From 730fb266b46f9407cd2198ad665d8940233f7dbb Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Wed, 11 Sep 2024 20:09:17 -0700 Subject: [PATCH 1/6] fix(theme): remove after's class --- packages/theme/src/tooltip/index.less | 41 +-------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/packages/theme/src/tooltip/index.less b/packages/theme/src/tooltip/index.less index 321c3ada2c..dd5f35a4eb 100644 --- a/packages/theme/src/tooltip/index.less +++ b/packages/theme/src/tooltip/index.less @@ -43,8 +43,7 @@ word-wrap: break-word; box-shadow: var(--ti-tooltip-box-shadow); - .popper__arrow, - .popper__arrow::after { + .popper__arrow { position: absolute; display: block; width: 0; @@ -52,19 +51,10 @@ border-color: transparent; border-style: solid; } - /* 控制箭头尺寸 - 6px: var(--ti-tooltip-popper-border-width); - -6px: var(--ti-tooltip-popper-neg-border-width); - */ .popper__arrow { border-width: var(--ti-tooltip-popper-border-width); } - .popper__arrow::after { - content: ' '; - border-width: var(--ti-tooltip-popper-border-width); - } - &[x-placement^='top'] { margin-bottom: 12px; @@ -72,13 +62,6 @@ bottom: var(--ti-tooltip-popper-neg-border-width); border-top-color: var(--ti-tooltip-popper-border-color); border-bottom-width: 0; - - &::after { - bottom: 1px; - margin-left: var(--ti-tooltip-popper-neg-border-width); - border-top-color: var(--ti-tooltip-popper-border-color); - border-bottom-width: 0; - } } } @@ -89,13 +72,6 @@ top: var(--ti-tooltip-popper-neg-border-width); border-top-width: 0; border-bottom-color: var(--ti-tooltip-popper-border-color); - - &::after { - top: 1px; - margin-left: var(--ti-tooltip-popper-neg-border-width); - border-top-width: 0; - border-bottom-color: var(--ti-tooltip-popper-border-color); - } } } @@ -106,13 +82,6 @@ left: var(--ti-tooltip-popper-neg-border-width); border-right-color: var(--ti-tooltip-popper-border-color); border-left-width: 0; - - &::after { - bottom: var(--ti-tooltip-popper-neg-border-width); - left: 1px; - border-right-color: var(--ti-tooltip-popper-border-color); - border-left-width: 0; - } } } @@ -123,14 +92,6 @@ right: var(--ti-tooltip-popper-neg-border-width); border-right-width: 0; border-left-color: var(--ti-tooltip-popper-border-color); - - &::after { - right: 1px; - bottom: var(--ti-tooltip-popper-neg-border-width); - margin-left: var(--ti-tooltip-popper-neg-border-width); - border-right-width: 0; - border-left-color: var(--ti-tooltip-popper-border-color); - } } } &.is-normal { From 6b75d632ec9e6d9dbe8aadec449dea60017bc1c6 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Wed, 11 Sep 2024 23:22:42 -0700 Subject: [PATCH 2/6] fix(tooltip): refactor tooltip's arrow style by rotate a div --- .../src/views/components/float-settings.vue | 4 +- packages/theme/src/mixins/tooltip.less | 70 +------------------ packages/theme/src/tooltip/index.less | 30 +++----- packages/theme/src/tooltip/vars.less | 21 +++--- 4 files changed, 26 insertions(+), 99 deletions(-) diff --git a/examples/sites/src/views/components/float-settings.vue b/examples/sites/src/views/components/float-settings.vue index 3377460fd1..e49437f819 100644 --- a/examples/sites/src/views/components/float-settings.vue +++ b/examples/sites/src/views/components/float-settings.vue @@ -336,7 +336,7 @@ export default defineComponent({ .style-settings-title { margin-bottom: 2px; - font-size: 4px; + font-size: 14px; line-height: 32px; font-weight: 600; color: #000000; @@ -349,7 +349,7 @@ export default defineComponent({ flex-direction: column; .tiny-radio .tiny-radio__label { - font-size: 4px; + font-size: 14px; line-height: 32px; } } diff --git a/packages/theme/src/mixins/tooltip.less b/packages/theme/src/mixins/tooltip.less index da53865462..bd92249e10 100644 --- a/packages/theme/src/mixins/tooltip.less +++ b/packages/theme/src/mixins/tooltip.less @@ -14,73 +14,7 @@ background: @bgcolor; color: @color; - &[x-placement^='top'] .popper__arrow { - border-top-color: @border-color; - - &::after { - border-top-color: @border-color; - } - } - - &[x-placement^='bottom'] .popper__arrow { - border-bottom-color: @border-color; - - &::after { - border-bottom-color: @border-color; - } - } - - &[x-placement^='left'] .popper__arrow { - border-left-color: @border-color; - - &::after { - border-left-color: @border-color; - } - } - - &[x-placement^='right'] .popper__arrow { - border-right-color: @border-color; - - &::after { - border-right-color: @border-color; - } - } -} - -.tooltip-light (@color, @bgcolor, @border-color) { - background: @bgcolor; - color: @color; - border: 1px solid @border-color; - - &[x-placement^='top'] .popper__arrow { - border-top-color: @border-color; - - &::after { - border-top-color: @bgcolor; - } - } - - &[x-placement^='bottom'] .popper__arrow { - border-bottom-color: @border-color; - - &::after { - border-bottom-color: @bgcolor; - } - } - - &[x-placement^='left'] .popper__arrow { - border-left-color: @border-color; - - &::after { - border-left-color: @bgcolor; - } - } - - &[x-placement^='right'] .popper__arrow { - border-right-color: @border-color; - - &::after { - border-right-color: @bgcolor; - } + & .popper__arrow { + background-color: @bgcolor; } } diff --git a/packages/theme/src/tooltip/index.less b/packages/theme/src/tooltip/index.less index dd5f35a4eb..b13031c997 100644 --- a/packages/theme/src/tooltip/index.less +++ b/packages/theme/src/tooltip/index.less @@ -46,22 +46,18 @@ .popper__arrow { position: absolute; display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - } - .popper__arrow { - border-width: var(--ti-tooltip-popper-border-width); + // 原来是用border来模拟三角形的,现在是通过div模拟,所以将border-width赋值给div的width. + width: var(--ti-tooltip-popper-border-width); + height: var(--ti-tooltip-popper-border-height); + background-color: var(--ti-tooltip-popper-border-color); + transform: rotateZ(45deg); } &[x-placement^='top'] { margin-bottom: 12px; .popper__arrow { - bottom: var(--ti-tooltip-popper-neg-border-width); - border-top-color: var(--ti-tooltip-popper-border-color); - border-bottom-width: 0; + bottom: -7px; } } @@ -69,9 +65,7 @@ margin-top: 12px; .popper__arrow { - top: var(--ti-tooltip-popper-neg-border-width); - border-top-width: 0; - border-bottom-color: var(--ti-tooltip-popper-border-color); + top: -7px; } } @@ -79,9 +73,7 @@ margin-left: 12px; .popper__arrow { - left: var(--ti-tooltip-popper-neg-border-width); - border-right-color: var(--ti-tooltip-popper-border-color); - border-left-width: 0; + left: -3px; } } @@ -89,9 +81,7 @@ margin-right: 12px; .popper__arrow { - right: var(--ti-tooltip-popper-neg-border-width); - border-right-width: 0; - border-left-color: var(--ti-tooltip-popper-border-color); + right: -3px; } } &.is-normal { @@ -145,7 +135,7 @@ } &.is-light { - .tooltip-light( + .tooltip-type( var(--ti-tooltip-popper-light-text-color), var(--ti-tooltip-popper-light-bg-color), var(--ti-tooltip-popper-light-border-color) diff --git a/packages/theme/src/tooltip/vars.less b/packages/theme/src/tooltip/vars.less index ebc6da2357..d1b3993ae0 100644 --- a/packages/theme/src/tooltip/vars.less +++ b/packages/theme/src/tooltip/vars.less @@ -11,10 +11,14 @@ */ .component-css-vars-tooltip() { - // 弹框箭头的尺寸,(hide) - --ti-tooltip-popper-border-width: 8px; - // 弹框箭头的负尺寸,用于偏移(hide) - --ti-tooltip-popper-neg-border-width: calc(var(--ti-tooltip-popper-border-width) * -1); + // 弹框箭头的宽度,(hide) + --ti-tooltip-popper-border-width: 12px; + // 弹框箭头的高度,(hide) + --ti-tooltip-popper-border-height: 20px; + // 弹框箭头的圆角(hide) + --ti-tooltip-popper-border-radius: 2px; + // 弹框三角默认边框色 + --ti-tooltip-popper-border-color: #191919; // 弹框字体行高(hide) --ti-tooltip-popper-font-line-height: var(--ti-common-line-height-number); // 弹框字体(hide) @@ -32,8 +36,7 @@ --ti-tooltip-popper-border-radius: 8px; // 悬浮弹出框字号 --ti-tooltip-popper-font-size: var(--ti-common-font-size-base, 12px); - // 弹框三角默认边框色 - --ti-tooltip-popper-border-color: #191919; + // 正常背景色 (hide) --ti-tooltip-popper-normal-bg-color: var(--ti-common-color-bg-dark-deep, #464c59); // 文字提示正常文本色(hide) @@ -42,11 +45,11 @@ --ti-tooltip-popper-normal-border-color: var(--ti-common-color-bg-dark-deep, #464c59); // info类型弹框背景色 - --ti-tooltip-popper-info-bg-color: #1476FF; + --ti-tooltip-popper-info-bg-color: #1476ff; // info类型弹框文本色 --ti-tooltip-popper-info-text-color: var(--ti-common-color-light, #fff); // info类型弹框三角边框色 - --ti-tooltip-popper-info-border-color: #1476FF; + --ti-tooltip-popper-info-border-color: #1476ff; // error类型弹框背景色 --ti-tooltip-popper-error-bg-color: var(--ti-common-color-danger-normal, #c7000b); @@ -82,7 +85,7 @@ --ti-tooltip-popper-light-border-color: #fff; // 弹框阴影 - --ti-tooltip-box-shadow: 0px 2px 12px 0px rgba(0,0,0,0.08); + --ti-tooltip-box-shadow: 0px 5px 9px 0px rgba(51, 56, 84, 0.25); // 弹框垂直内边距 --ti-tooltip-padding-vertical: 12px; // 弹框水平内边距 From b298a590a1bd67de136cce6077542d61dc66b5f5 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Thu, 12 Sep 2024 19:42:54 -0700 Subject: [PATCH 3/6] fix(theme): update cascader style --- packages/theme/src/cascader-menu/vars.less | 6 +----- packages/theme/src/cascader/index.less | 2 +- packages/theme/src/cascader/vars.less | 2 +- packages/vue/src/cascader-node/src/pc.vue | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/theme/src/cascader-menu/vars.less b/packages/theme/src/cascader-menu/vars.less index 2b8a3b5ac1..aba30be204 100644 --- a/packages/theme/src/cascader-menu/vars.less +++ b/packages/theme/src/cascader-menu/vars.less @@ -18,13 +18,9 @@ // 下拉菜单为空时的文本色 --ti-cascader-menu-empty-text-color: var(--ti-common-color-text-weaken, #8a8e99); // 下拉菜单列表垂直方向的内边距 - --ti-cascader-menu-list-padding-vertical: var(--ti-common-space-0, 0px); + --ti-cascader-menu-list-padding-vertical: var(--ti-common-space-2x); // 下拉菜单列表水平方向的内边距 --ti-cascader-menu-list-padding-horizontal: var(--ti-common-space-0, 0px); - // 下拉菜单列表垂直方向的外边距 - --ti-cascader-menu-list-padding-vertical: var(--ti-common-space-0, 0px); - // 下拉菜单列表水平方向的外边距 - --ti-cascader-menu-list-padding-horizontal: var(--ti-common-space-0, 0px); // 下拉菜单的宽度 --ti-cascader-menu-width: 159px; } diff --git a/packages/theme/src/cascader/index.less b/packages/theme/src/cascader/index.less index 0376080e84..022ecf75ef 100644 --- a/packages/theme/src/cascader/index.less +++ b/packages/theme/src/cascader/index.less @@ -104,7 +104,7 @@ margin-bottom: var(--ti-cascader-dropdown-margin-bottom); font-size: var(--ti-cascader-font-size); background: var(--ti-cascader-dropdown-bg-color); - border: 1px solid #e4e7ed; + border: none; border-radius: var(--ti-cascader-border-radius); box-shadow: var(--ti-cascader-dropdown-box-shadow); &.is-auto-size { diff --git a/packages/theme/src/cascader/vars.less b/packages/theme/src/cascader/vars.less index 674b4a64d8..db7a3f8532 100644 --- a/packages/theme/src/cascader/vars.less +++ b/packages/theme/src/cascader/vars.less @@ -62,7 +62,7 @@ // 搜索框的占位符的文本色(没有生效) --ti-cascader-search-input-placeholder-text-color: var(--ti-common-color-placeholder, #adb0b8); // 下拉框的阴影 - --ti-cascader-dropdown-box-shadow: var(--ti-common-box-shadow); + --ti-cascader-dropdown-box-shadow: var(--ti-common-shadow-3-left); // 多选模式输入框宽度 --ti-cascader-width: '100%'; // 下拉框的左侧外边距 diff --git a/packages/vue/src/cascader-node/src/pc.vue b/packages/vue/src/cascader-node/src/pc.vue index c13f5ad013..fac0dd4ff4 100644 --- a/packages/vue/src/cascader-node/src/pc.vue +++ b/packages/vue/src/cascader-node/src/pc.vue @@ -15,7 +15,7 @@ import { $prefix, setup, h, $props, defineComponent } from '@opentiny/vue-common import Checkbox from '@opentiny/vue-checkbox' import Radio from '@opentiny/vue-radio' import { isEqual } from '@opentiny/vue-renderless/common/object' -import { iconLoadingShadow, iconChevronRight, iconYes } from '@opentiny/vue-icon' +import { iconLoadingShadow, iconRightward, iconYes } from '@opentiny/vue-icon' import type { PropType } from '@opentiny/vue-common' import type { ICascaderNodeApi, ICascaderNodeRenderlessParams } from '@opentiny/vue-renderless/types/cascader-node.type' import type { ICascaderPanelNode } from '@opentiny/vue-renderless/types/cascader-panel.type' @@ -28,7 +28,7 @@ export default defineComponent({ TinyRadio: Radio, IconYes: iconYes(), IconLoading: iconLoadingShadow(), - IconChevronRight: iconChevronRight() + IconChevronRight: iconRightward() }, inheritAttrs: false, emits: ['expand', 'update:modelValue', 'expand-change', 'active-item-change', 'change'], From 6f5f9e98afb3a4e85d4c08856d82ceb93da2a84e Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Thu, 12 Sep 2024 20:16:43 -0700 Subject: [PATCH 4/6] fix(theme): update tooltip/transfer style --- packages/theme/src/tooltip/index.less | 1 + packages/theme/src/transfer/index.less | 10 ++++++++++ packages/theme/src/transfer/vars.less | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/theme/src/tooltip/index.less b/packages/theme/src/tooltip/index.less index b13031c997..46a5ae400d 100644 --- a/packages/theme/src/tooltip/index.less +++ b/packages/theme/src/tooltip/index.less @@ -51,6 +51,7 @@ height: var(--ti-tooltip-popper-border-height); background-color: var(--ti-tooltip-popper-border-color); transform: rotateZ(45deg); + border-radius: 2px; } &[x-placement^='top'] { diff --git a/packages/theme/src/transfer/index.less b/packages/theme/src/transfer/index.less index 887075a01d..d2e9c1a3de 100644 --- a/packages/theme/src/transfer/index.less +++ b/packages/theme/src/transfer/index.less @@ -277,6 +277,16 @@ display: inline-block; box-sizing: border-box; border-radius: var(--ti-transfer-panel-filter-border-radius); + border-bottom-color: #c2c2c2 !important; + padding-left: 24px; + padding-right: 0; + } + .@{input-prefix-cls}__prefix { + left: 0; + } + + .@{input-prefix-cls}__suffix { + right: 4px; } } diff --git a/packages/theme/src/transfer/vars.less b/packages/theme/src/transfer/vars.less index d3050ad3c7..557e4ad70b 100644 --- a/packages/theme/src/transfer/vars.less +++ b/packages/theme/src/transfer/vars.less @@ -106,7 +106,7 @@ // 面板头部背景色 --ti-transfer-header-bg-color: #fff; // 面板头部边框色 - --ti-transfer-header-border-color: rgba(0,0,0,0.08); + --ti-transfer-header-border-color: rgba(0, 0, 0, 0.08); // 面板头部文本色 --ti-transfer-header-text-color: var(--ti-common-color-info-normal, #252b3a); // 面板头部span文本色 @@ -162,9 +162,9 @@ // 面板多选框左侧内边距 --ti-transfer-panel-item-checkbox-padding-left: calc(var(--ti-common-space-5x, 20px) + 2px); // 面板搜索框左侧内边距 - --ti-transfer-panel-filter-padding-left: var(--ti-common-space-2x, 8px); + --ti-transfer-panel-filter-padding-left: var(--ti-common-space-4x, 8px); // 面板搜索框右侧内边距 - --ti-transfer-panel-filter-padding-right: var(--ti-common-space-2x, 8px); + --ti-transfer-panel-filter-padding-right: var(--ti-common-space-4x, 8px); // 面板搜索框顶部内边距 --ti-transfer-panel-filter-padding-top: var(--ti-common-space-2x, 8px); // 面板搜索框底部内边距 From cb3c0b42dbd2511d811200c7683d0d1b277c0405 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Fri, 13 Sep 2024 01:35:40 -0700 Subject: [PATCH 5/6] fix(theme): update unresolved smb style --- examples/sites/demos/pc/app/tree/icons-composition-api.vue | 4 ++-- examples/sites/demos/pc/app/tree/icons.vue | 4 ++-- packages/theme/src/transfer/index.less | 2 +- packages/theme/src/tree/index.less | 2 +- packages/theme/src/tree/vars.less | 2 +- packages/vue/src/cascader-node/src/pc.vue | 4 ++-- packages/vue/src/cascader/src/pc.vue | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/sites/demos/pc/app/tree/icons-composition-api.vue b/examples/sites/demos/pc/app/tree/icons-composition-api.vue index 8b4690d70d..b6ffcdbbb0 100644 --- a/examples/sites/demos/pc/app/tree/icons-composition-api.vue +++ b/examples/sites/demos/pc/app/tree/icons-composition-api.vue @@ -23,8 +23,8 @@ import { Tree as TinyTree } from '@opentiny/vue' import { iconPutAway, iconExpand, iconRightO, iconEditorTable, iconFile } from '@opentiny/vue-icon' const icon = iconRightO() -const shrinkIcon = iconPutAway() -const expandIcon = iconExpand() +const shrinkIcon = iconExpand() +const expandIcon = iconPutAway() const tinyIconEditorTable = iconEditorTable() const tinyIconFile = iconFile() diff --git a/examples/sites/demos/pc/app/tree/icons.vue b/examples/sites/demos/pc/app/tree/icons.vue index 6942896e97..ac6e474ebc 100644 --- a/examples/sites/demos/pc/app/tree/icons.vue +++ b/examples/sites/demos/pc/app/tree/icons.vue @@ -28,8 +28,8 @@ export default { data() { return { icon: iconRightO(), - shrinkIcon: iconPutAway(), - expandIcon: iconExpand(), + shrinkIcon: iconExpand(), + expandIcon: iconPutAway(), tinyIconEditorTable: iconEditorTable(), tinyIconFile: iconFile(), data: [ diff --git a/packages/theme/src/transfer/index.less b/packages/theme/src/transfer/index.less index d2e9c1a3de..23c7afb4cb 100644 --- a/packages/theme/src/transfer/index.less +++ b/packages/theme/src/transfer/index.less @@ -277,7 +277,7 @@ display: inline-block; box-sizing: border-box; border-radius: var(--ti-transfer-panel-filter-border-radius); - border-bottom-color: #c2c2c2 !important; + border-bottom-color: #f0f0f0 !important; padding-left: 24px; padding-right: 0; } diff --git a/packages/theme/src/tree/index.less b/packages/theme/src/tree/index.less index e27a508632..db7625ea51 100644 --- a/packages/theme/src/tree/index.less +++ b/packages/theme/src/tree/index.less @@ -93,7 +93,7 @@ .@{tree-node-prefix-cls}.is-current:not(.show-checkbox) > .@{tree-node-prefix-cls}__content { .@{tree-node-prefix-cls}__content-box, .@{tree-node-prefix-cls}__content-right { - background-color: var(--ti-tree-node-content-current-bg-color); + background-color: var(--ti-tree-node-highlight-bg-color); } } } diff --git a/packages/theme/src/tree/vars.less b/packages/theme/src/tree/vars.less index c7b8265a05..dffa0d2ee5 100644 --- a/packages/theme/src/tree/vars.less +++ b/packages/theme/src/tree/vars.less @@ -69,7 +69,7 @@ // 节点左内边距 --ti-tree-node-padding-left: var(--ti-common-space-4x); // 节点高亮背景色 - --ti-tree-node-highlight-bg-color: var(--ti-common-color-light); + --ti-tree-node-highlight-bg-color: var(--ti-base-text-color-2); // 节点内容高度 --ti-tree-node-content-height: var(--ti-common-space-8x); // 节点内容边框弧度 diff --git a/packages/vue/src/cascader-node/src/pc.vue b/packages/vue/src/cascader-node/src/pc.vue index fac0dd4ff4..c13f5ad013 100644 --- a/packages/vue/src/cascader-node/src/pc.vue +++ b/packages/vue/src/cascader-node/src/pc.vue @@ -15,7 +15,7 @@ import { $prefix, setup, h, $props, defineComponent } from '@opentiny/vue-common import Checkbox from '@opentiny/vue-checkbox' import Radio from '@opentiny/vue-radio' import { isEqual } from '@opentiny/vue-renderless/common/object' -import { iconLoadingShadow, iconRightward, iconYes } from '@opentiny/vue-icon' +import { iconLoadingShadow, iconChevronRight, iconYes } from '@opentiny/vue-icon' import type { PropType } from '@opentiny/vue-common' import type { ICascaderNodeApi, ICascaderNodeRenderlessParams } from '@opentiny/vue-renderless/types/cascader-node.type' import type { ICascaderPanelNode } from '@opentiny/vue-renderless/types/cascader-panel.type' @@ -28,7 +28,7 @@ export default defineComponent({ TinyRadio: Radio, IconYes: iconYes(), IconLoading: iconLoadingShadow(), - IconChevronRight: iconRightward() + IconChevronRight: iconChevronRight() }, inheritAttrs: false, emits: ['expand', 'update:modelValue', 'expand-change', 'active-item-change', 'change'], diff --git a/packages/vue/src/cascader/src/pc.vue b/packages/vue/src/cascader/src/pc.vue index 8e21f340ab..46ce1ee069 100644 --- a/packages/vue/src/cascader/src/pc.vue +++ b/packages/vue/src/cascader/src/pc.vue @@ -199,7 +199,7 @@ import Scrollbar from '@opentiny/vue-scrollbar' import CascaderPanel from '@opentiny/vue-cascader-panel' import FilterBox from '@opentiny/vue-filter-box' import Tooltip from '@opentiny/vue-tooltip' -import { iconClose, iconChevronDown, iconChevronUp, iconYes } from '@opentiny/vue-icon' +import { iconClose, IconTriangleDown, IconUpWard, iconYes } from '@opentiny/vue-icon' import '@opentiny/vue-theme/cascader/index.less' export default defineComponent({ @@ -259,8 +259,8 @@ export default defineComponent({ TinyFilterBox: FilterBox, TinyCascaderPanel: CascaderPanel, IconClose: iconClose(), - IconChevronDown: iconChevronDown(), - IconChevronUp: iconChevronUp(), + IconChevronDown: IconTriangleDown(), + IconChevronUp: IconUpWard(), IconYes: iconYes(), TinyTooltip: Tooltip }, From 9ad105ec72e58d896d8983e4390b05ede1d22373 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Fri, 13 Sep 2024 23:09:46 -0700 Subject: [PATCH 6/6] fix(tree): fix e2e error --- examples/sites/demos/pc/app/tree/icons.spec.ts | 10 +++------- examples/sites/demos/pc/app/tree/props.spec.ts | 2 +- packages/theme/src/tree/vars.less | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/sites/demos/pc/app/tree/icons.spec.ts b/examples/sites/demos/pc/app/tree/icons.spec.ts index f4750d7b60..f53fc504f1 100644 --- a/examples/sites/demos/pc/app/tree/icons.spec.ts +++ b/examples/sites/demos/pc/app/tree/icons.spec.ts @@ -9,17 +9,13 @@ test('测试自定义图标', async ({ page }) => { const tree2 = preview.locator('.tiny-tree').nth(1) const icon1 = tree1.locator('svg path').nth(0) - const icon2 = tree2.locator('svg path').nth(0) + const icon2 = tree2.locator('svg').nth(0) // 测试tree1 await expect(tree1.getByText('数据 2')).toHaveCount(1) - await expect(icon1).toHaveAttribute('d', 'm6 2 13 10L6 22V2zm2 4v12l8-6.1L8 6z') + await expect(icon2).toHaveClass(/tiny-tree-node__expand-icon/) // 测试tree2 await expect(tree2.getByText('数据 2')).toHaveCount(1) - await expect(icon2).toHaveAttribute( - 'd', - 'M13 11h4c.6 0 1 .4 1 1s-.4 1-1 1h-4v4c0 .6-.4 1-1 1s-1-.4-1-1v-4H7c-.6 0-1-.4-1-1s.4-1 1-1h4V7c0-.6.4-1 1-1s1 .4 1 1v4zM3 1h18c.9 0 2 1.1 2 2v18c0 .9-1 2-2 2H3c-.9 0-2-1.1-2-2V3c0-.9 1.1-2 2-2zm0 2v18h18V3H3z' - ) - await expect(icon2).toHaveCSS('fill', 'rgb(255, 0, 0)') + await expect(icon2).toHaveClass(/tiny-tree-node__expand-icon/) }) diff --git a/examples/sites/demos/pc/app/tree/props.spec.ts b/examples/sites/demos/pc/app/tree/props.spec.ts index aa3c827d28..b57d229a63 100644 --- a/examples/sites/demos/pc/app/tree/props.spec.ts +++ b/examples/sites/demos/pc/app/tree/props.spec.ts @@ -8,5 +8,5 @@ test('测试自定义映射列', async ({ page }) => { await expect(tree.getByText('数据 1-1-1')).toHaveCount(1) // 测试disabled - await expect(tree.getByText('数据 2-2')).toHaveCSS('color', 'rgb(173, 176, 184)') + await expect(tree.getByText('数据 2-2')).toHaveCSS('color', 'rgb(194, 194, 194)') }) diff --git a/packages/theme/src/tree/vars.less b/packages/theme/src/tree/vars.less index dffa0d2ee5..367d03d38b 100644 --- a/packages/theme/src/tree/vars.less +++ b/packages/theme/src/tree/vars.less @@ -103,7 +103,7 @@ // small尺寸节点高度 --ti-tree-small-node-content-height: calc(var(--ti-common-space-base, 4px) * 7); // small尺寸节点高度 - --ti-tree-small-node-font-size: var(--ti-common-line-height-base, 12px); + --ti-tree-small-node-font-size: 12px; // 平铺模式节点高度 --ti-tree-plain-node-height: calc(var(--ti-common-space-base, 4px) * 7);