@veltra/desktop 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/components/action/action-group.vue.d.ts +1 -1
  2. package/dist/components/action/action.vue.d.ts +1 -1
  3. package/dist/components/auto-complete/auto-complete.vue.d.ts +1 -1
  4. package/dist/components/batch-edit/batch-edit.vue.d.ts +1 -1
  5. package/dist/components/cascade/cascade.vue.d.ts +5 -5
  6. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  7. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
  8. package/dist/components/collapse/collapse-item.js +1 -2
  9. package/dist/components/collapse/collapse-item.js.map +1 -1
  10. package/dist/components/collapse/collapse.js +1 -11
  11. package/dist/components/collapse/collapse.js.map +1 -1
  12. package/dist/components/collapse/collapse.vue.d.ts +0 -1
  13. package/dist/components/collapse/di.js.map +1 -1
  14. package/dist/components/collapse/style2.css +29 -17
  15. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  16. package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
  17. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
  18. package/dist/components/drawer/drawer.vue.d.ts +2 -2
  19. package/dist/components/empty/empty.vue.d.ts +1 -1
  20. package/dist/components/file-viewer/file-viewer.vue.d.ts +1 -1
  21. package/dist/components/input/input.vue.d.ts +3 -3
  22. package/dist/components/input/style2.css +5 -2
  23. package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
  24. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +6 -6
  25. package/dist/components/notification/notification.vue.d.ts +1 -1
  26. package/dist/components/number/number.vue.d.ts +1 -1
  27. package/dist/components/number-input/number-input.vue.d.ts +3 -3
  28. package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
  29. package/dist/components/password-input/password-input.js +30 -13
  30. package/dist/components/password-input/password-input.js.map +1 -1
  31. package/dist/components/password-input/password-input.vue.d.ts +1 -1
  32. package/dist/components/password-input/style2.css +21 -0
  33. package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
  34. package/dist/components/progress-nodes/progress-nodes.vue.d.ts +2 -2
  35. package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
  36. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
  37. package/dist/components/select/select.vue.d.ts +3 -3
  38. package/dist/components/table/node/col.js +2 -2
  39. package/dist/components/table/node/col.js.map +1 -1
  40. package/dist/components/tabs/tabs-horizontal.vue.d.ts +3 -3
  41. package/dist/components/tabs/tabs-vertical.vue.d.ts +3 -3
  42. package/dist/components/tabs/tabs.vue.d.ts +3 -3
  43. package/dist/components/textarea/style2.css +7 -4
  44. package/dist/components/textarea/textarea.vue.d.ts +3 -3
  45. package/dist/components/tip/tip.vue.d.ts +1 -1
  46. package/dist/components/tree-select/tree-select.vue.d.ts +6 -6
  47. package/dist/components/watermark/watermark.vue.d.ts +1 -1
  48. package/dist/types/collapse.d.ts +0 -5
  49. package/package.json +23 -25
  50. package/src/components/collapse/collapse-item.vue +1 -2
  51. package/src/components/collapse/collapse.vue +2 -6
  52. package/src/components/collapse/di.ts +0 -1
  53. package/src/components/collapse/style.scss +57 -37
  54. package/src/components/input/style.scss +3 -6
  55. package/src/components/password-input/__test__/password-input.test.ts +90 -0
  56. package/src/components/password-input/password-input.vue +28 -13
  57. package/src/components/password-input/style.scss +22 -1
  58. package/src/components/table/node/col.ts +2 -2
  59. package/src/components/textarea/style.scss +3 -2
  60. package/src/types/collapse.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"password-input.js","names":[],"sources":["../../../src/components/password-input/password-input.vue"],"sourcesContent":["<template>\n <u-input\n :class=\"cls.b\"\n :model-value=\"passwordText\"\n v-bind=\"inputProps\"\n :size=\"size\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n @native:input=\"handleUpdatePwd\"\n @update:model-value=\"!$event && handleClear()\"\n @suffix:click=\"toggleVisible\"\n >\n <template #suffix>\n <Transition name=\"fade\">\n <UIcon :class=\"cls.e('visibility-toggle')\" :size=\"18\">\n <Hide v-if=\"pwdVisible\" />\n <View v-else />\n </UIcon>\n </Transition>\n </template>\n\n <template #prefix v-if=\"slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n </u-input>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { Hide, View } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, shallowRef } from 'vue'\n\nimport type { PasswordInputProps } from '../../types'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\n\ndefineOptions({\n name: 'PasswordInput'\n})\n\nconst props = withDefaults(defineProps<PasswordInputProps>(), {\n clearable: false,\n disabled: undefined,\n readonly: undefined\n})\n\nconst slots = defineSlots<{\n prefix?: () => any\n}>()\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst inputProps = computed(() => {\n return o(props).pick(['clearable', 'disabled', 'placeholder', 'size'])\n})\n\nconst cls = bem('password-input')\n\nconst model = defineModel<string>()\n\nconst passwordChar = '●'\n\nconst handleUpdatePwd = (e: Event): void => {\n const target = e.target as HTMLInputElement\n const val = target.value\n if (!val) {\n model.value = val\n return\n }\n\n // 字符从无到有\n if (!model.value) {\n model.value = val\n return\n }\n\n const pointIndex = target.selectionStart!\n let inputChar = pointIndex === 0 ? '' : val[pointIndex - 1]!\n if (inputChar === passwordChar) inputChar = ''\n\n // 光标右侧字符数量(当前字符长度减去光标位置)\n const rightLen = val.length - pointIndex\n // 光标左侧字符数量 (当光标前的字符是刚刚输入的,则为这个字符前的所有的字符,否则为光标前的所有赐福)\n const leftLen = inputChar === '' ? pointIndex : pointIndex - 1\n\n const leftVal = model.value.slice(0, leftLen)\n const rightVal = rightLen === 0 ? '' : model.value.slice(-rightLen)\n\n model.value = leftVal + inputChar + rightVal\n\n nextTick(() => {\n target.selectionStart = pointIndex\n target.selectionEnd = pointIndex\n })\n}\n\nconst handleClear = (): void => {\n model.value = ''\n}\n\nconst pwdVisible = shallowRef(false)\n\nconst passwordText = computed<string | undefined>(() => {\n if (pwdVisible.value) return model.value\n return model.value ? passwordChar.repeat(model.value.length) : ''\n})\n\nconst toggleVisible = () => {\n pwdVisible.value = !pwdVisible.value\n}\n</script>\n"],"mappings":";;;;;;;;AAqEA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA1BrB,MAAM,QAAQ;EAMd,MAAM,QAAQ,UAAA;EAId,MAAM,EAAE,cAAc,mBAAkB;EAExC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,EAAC,EAAG,MAAK,EAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;GACX,CAAA;EAED,MAAM,aAAa,eAAe;GAChC,OAAO,EAAE,MAAK,CAAE,KAAK;IAAC;IAAa;IAAY;IAAe;IAAO,CAAA;IACtE;EAED,MAAM,MAAM,IAAI,iBAAgB;EAEhC,MAAM,QAAQ,SAAmB,SAAA,aAAC;EAIlC,MAAM,mBAAmB,MAAmB;GAC1C,MAAM,SAAS,EAAE;GACjB,MAAM,MAAM,OAAO;GACnB,IAAI,CAAC,KAAK;IACR,MAAM,QAAQ;IACd;;GAIF,IAAI,CAAC,MAAM,OAAO;IAChB,MAAM,QAAQ;IACd;;GAGF,MAAM,aAAa,OAAO;GAC1B,IAAI,YAAY,eAAe,IAAI,KAAK,IAAI,aAAa;GACzD,IAAI,cAAc,cAAc,YAAY;GAG5C,MAAM,WAAW,IAAI,SAAS;GAE9B,MAAM,UAAU,cAAc,KAAK,aAAa,aAAa;GAE7D,MAAM,UAAU,MAAM,MAAM,MAAM,GAAG,QAAO;GAC5C,MAAM,WAAW,aAAa,IAAI,KAAK,MAAM,MAAM,MAAM,CAAC,SAAQ;GAElE,MAAM,QAAQ,UAAU,YAAY;GAEpC,eAAe;IACb,OAAO,iBAAiB;IACxB,OAAO,eAAe;KACvB;;EAGH,MAAM,oBAA0B;GAC9B,MAAM,QAAQ;;EAGhB,MAAM,aAAa,WAAW,MAAK;EAEnC,MAAM,eAAe,eAAmC;GACtD,IAAI,WAAW,OAAO,OAAO,MAAM;GACnC,OAAO,MAAM,QAAQ,aAAa,OAAO,MAAM,MAAM,OAAM,GAAI;IAChE;EAED,MAAM,sBAAsB;GAC1B,WAAW,QAAQ,CAAC,WAAW;;;uBApH/B,YAuBU,MAAA,cAAA,EAvBV,WAuBU;IAtBP,OAAO,MAAA,IAAA,CAAI;IACX,eAAa,aAAA;MACN,WAAA,OAAU;IACjB,MAAM,MAAA,KAAA;IACN,UAAU,MAAA,SAAA;IACV,UAAU,MAAA,SAAA;IACV,kBAAc;IACd,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAA,CAAG,UAAU,aAAW;IAC1C,kBAAc;;IAEJ,QAAM,cAMF,CALb,YAKa,YAAA,EALD,MAAK,QAAM,EAAA;4BAIb,CAHR,YAGQ,MAAA,YAAA,EAAA;MAHA,OAAK,eAAE,MAAA,IAAA,CAAI,EAAC,oBAAA,CAAA;MAAwB,MAAM;;6BACtB,CAAd,WAAA,SAAA,WAAA,EAAZ,YAA0B,MAAA,KAAA,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAC1B,YAAe,MAAA,KAAA,EAAA,EAAA,KAAA,GAAA,CAAA,EAAA,CAAA;;;;;;OAKG,MAAM,SAAA;UAAnB;sBACa,CAAtB,WAAsB,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"password-input.js","names":[],"sources":["../../../src/components/password-input/password-input.vue"],"sourcesContent":["<template>\n <u-input\n :class=\"cls.b\"\n :model-value=\"passwordText\"\n v-bind=\"inputProps\"\n :size=\"size\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n :clearable=\"false\"\n @native:input=\"handleUpdatePwd\"\n @update:model-value=\"!$event && handleClear()\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <template #suffix>\n <span :class=\"cls.e('suffix')\">\n <UIcon v-if=\"showClear\" :class=\"cls.e('clear')\" title=\"清除\" @click.stop=\"handleClear\">\n <Close />\n </UIcon>\n <UIcon :class=\"cls.e('visibility-toggle')\" :size=\"18\" @click.stop=\"toggleVisible\">\n <Hide v-if=\"pwdVisible\" />\n <View v-else />\n </UIcon>\n </span>\n </template>\n\n <template #prefix v-if=\"slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n </u-input>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { Close, Hide, View } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, ref, shallowRef } from 'vue'\n\nimport type { PasswordInputProps } from '../../types'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\n\ndefineOptions({ name: 'PasswordInput' })\n\nconst props = withDefaults(defineProps<PasswordInputProps>(), {\n clearable: false,\n disabled: undefined,\n readonly: undefined\n})\n\nconst slots = defineSlots<{ prefix?: () => any }>()\n\nconst { formProps } = injectFormContext()\n\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst inputProps = computed(() => {\n return o(props).pick(['disabled', 'placeholder', 'size'])\n})\n\nconst cls = bem('password-input')\n\nconst model = defineModel<string>()\n\nconst hovered = ref(false)\n\nconst handleMouseEnter = (): void => {\n hovered.value = true\n}\n\nconst handleMouseLeave = (): void => {\n hovered.value = false\n}\n\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && !!model.value && hovered.value\n})\n\nconst passwordChar = '●'\n\nconst handleUpdatePwd = (e: Event): void => {\n const target = e.target as HTMLInputElement\n const val = target.value\n if (!val) {\n model.value = val\n return\n }\n\n // 字符从无到有\n if (!model.value) {\n model.value = val\n return\n }\n\n const pointIndex = target.selectionStart!\n let inputChar = pointIndex === 0 ? '' : val[pointIndex - 1]!\n if (inputChar === passwordChar) inputChar = ''\n\n // 光标右侧字符数量(当前字符长度减去光标位置)\n const rightLen = val.length - pointIndex\n // 光标左侧字符数量 (当光标前的字符是刚刚输入的,则为这个字符前的所有的字符,否则为光标前的所有赐福)\n const leftLen = inputChar === '' ? pointIndex : pointIndex - 1\n\n const leftVal = model.value.slice(0, leftLen)\n const rightVal = rightLen === 0 ? '' : model.value.slice(-rightLen)\n\n model.value = leftVal + inputChar + rightVal\n\n nextTick(() => {\n target.selectionStart = pointIndex\n target.selectionEnd = pointIndex\n })\n}\n\nconst handleClear = (): void => {\n model.value = ''\n}\n\nconst pwdVisible = shallowRef(false)\n\nconst passwordText = computed<string | undefined>(() => {\n if (pwdVisible.value) return model.value\n return model.value ? passwordChar.repeat(model.value.length) : ''\n})\n\nconst toggleVisible = () => {\n pwdVisible.value = !pwdVisible.value\n}\n</script>\n"],"mappings":";;;;;;;;AAoFA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAtCrB,MAAM,QAAQ;EAMd,MAAM,QAAQ,UAAA;EAEd,MAAM,EAAE,cAAc,mBAAkB;EAExC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,EAAC,EAAG,MAAK,EAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;GACX,CAAA;EAED,MAAM,aAAa,eAAe;GAChC,OAAO,EAAE,MAAK,CAAE,KAAK;IAAC;IAAY;IAAe;IAAO,CAAA;IACzD;EAED,MAAM,MAAM,IAAI,iBAAgB;EAEhC,MAAM,QAAQ,SAAmB,SAAA,aAAC;EAElC,MAAM,UAAU,IAAI,MAAK;EAEzB,MAAM,yBAA+B;GACnC,QAAQ,QAAQ;;EAGlB,MAAM,yBAA+B;GACnC,QA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EF,QAAM,cASR,CARP,mBAQO,QAAA,EARA,OAAK,eAAE,MAAA,IAAA,CAAI,EAAC,SAAA,CAAA,EAAA,EAAA,CACJ,UAAA,SAAA,WAAA,EAAb,YAEQ,MAAA,YAAA,EAAA;;KAFiB,OAAK,eAAE,MAAA,IAAA,CAAI,EAAC,QAAA,CAAA;KAAW,OAAM;KAAM,SAAK,cAAO,aAAW,CAAA,OAAA,CAAA;;4BACxE,CAAT,YAAS,MAAA,MAAA,CAAA,CAAA,CAAA;;0DAEX,YAGQ,MAAA,YAAA,EAAA;KAHA,OAAK,eAAE,MAAA,IAAA,CAAI,EAAC,oBAAA,CAAA;KAAwB,MAAM;KAAK,SAAK,cAAO,eAAa,CAAA,OAAA,CAAA;;4BACpD,CAAd,WAAA,SAAA,WAAA,EAAZ,YAA0B,MAAA,KAAA,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAC1B,YAAe,MAAA,KAAA,EAAA,EAAA,KAAA,GAAA,CAAA,EAAA,CAAA;;;;OAKG,MAAM,SAAA;UAAnB;sBACa,CAAtB,WAAsB,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -16,8 +16,8 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
16
16
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
17
17
  }>, {
18
18
  disabled: boolean;
19
- readonly: boolean;
20
19
  clearable: boolean;
20
+ readonly: boolean;
21
21
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
22
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
23
  declare const _default: typeof __VLS_export;
@@ -15,3 +15,24 @@
15
15
  * --u-height-small: 24px;
16
16
  */
17
17
  /** 暗色:data-theme 与系统偏好,与 UITheme.injectBuiltInThemes 选择器策略一致 */
18
+ .u-password-input__suffix {
19
+ display: inline-flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ height: 100%;
23
+ gap: 2px;
24
+ }
25
+ .u-password-input__clear {
26
+ cursor: pointer;
27
+ flex-shrink: 0;
28
+ width: 20px;
29
+ border-radius: var(--u-radius-default);
30
+ transition: color 0.25s;
31
+ }
32
+ .u-password-input__clear:hover {
33
+ color: var(--u-color-primary);
34
+ }
35
+ .u-password-input__visibility-toggle {
36
+ cursor: pointer;
37
+ flex-shrink: 0;
38
+ }
@@ -15,8 +15,8 @@ declare const __VLS_base: _$vue.DefineComponent<PopConfirmProps, {}, {}, {}, {},
15
15
  onCancel?: (() => any) | undefined;
16
16
  }>, {
17
17
  trigger: "hover" | "click";
18
- icon: _$vue.Component;
19
18
  direction: TipDirection;
19
+ icon: _$vue.Component;
20
20
  iconColor: string;
21
21
  confirmText: string;
22
22
  cancelText: string;
@@ -16,11 +16,11 @@ type __VLS_Slots = {} & {
16
16
  default?: (props: typeof __VLS_3) => any;
17
17
  };
18
18
  declare const __VLS_base: _$vue.DefineComponent<ProgressNodesProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
19
- "update:modelValue": (value: string | number) => any;
20
19
  click: (node: Record<string, any>, index: number) => any;
20
+ "update:modelValue": (value: string | number) => any;
21
21
  }, string, _$vue.PublicProps, Readonly<ProgressNodesProps> & Readonly<{
22
- "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
23
22
  onClick?: ((node: Record<string, any>, index: number) => any) | undefined;
23
+ "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
24
24
  }>, {
25
25
  labelKey: string;
26
26
  valueKey: string;
@@ -17,9 +17,9 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
17
17
  onChange?: ((item: Record<string, any>) => any) | undefined;
18
18
  }>, {
19
19
  disabled: boolean;
20
- readonly: boolean;
21
20
  labelKey: string;
22
21
  valueKey: string;
22
+ readonly: boolean;
23
23
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
25
25
  //#endregion
@@ -13,8 +13,8 @@ declare const __VLS_export: _$vue.DefineComponent<RichTextEditorProps & {
13
13
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
14
14
  }>, {
15
15
  disabled: boolean;
16
- readonly: boolean;
17
16
  placeholder: string;
17
+ readonly: boolean;
18
18
  format: RichTextFormat;
19
19
  toolbar: ToolbarItem[];
20
20
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -27,11 +27,11 @@ declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {
27
27
  "onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
28
28
  }>, {
29
29
  disabled: boolean;
30
- readonly: boolean;
31
- placeholder: string;
32
- clearable: boolean;
33
30
  labelKey: string;
34
31
  valueKey: string;
32
+ placeholder: string;
33
+ clearable: boolean;
34
+ readonly: boolean;
35
35
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
36
36
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
37
  declare const _default: typeof __VLS_export;
@@ -1,4 +1,4 @@
1
- import { reactive, shallowReactive } from "vue";
1
+ import { isReactive, reactive, shallowReactive } from "vue";
2
2
  import { TreeNode } from "@cat-kit/core";
3
3
  //#region src/components/table/node/col.ts
4
4
  var ColumnNode = class extends TreeNode {
@@ -76,7 +76,7 @@ var ColumnNode = class extends TreeNode {
76
76
  }
77
77
  style = reactive({});
78
78
  constructor(val, index, depth, parent) {
79
- super(val ? shallowReactive(val) : val, index, depth, parent);
79
+ super(isReactive(val) ? val : shallowReactive(val), index, depth, parent);
80
80
  }
81
81
  };
82
82
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"col.js","names":[],"sources":["../../../../src/components/table/node/col.ts"],"sourcesContent":["import { TreeNode } from '@cat-kit/core'\nimport { reactive, shallowReactive } from 'vue'\n\nimport type { TableColumn, TableColumnAlign } from '../../../types'\n\nexport class ColumnNode extends TreeNode<TableColumn, ColumnNode> {\n declare children?: ColumnNode[] | undefined\n declare parent?: ColumnNode\n /** 叶子节点数量 */\n leafs?: number\n\n nextNode: ColumnNode | null = null\n\n /** 列key */\n get key(): string {\n return this.data.key\n }\n set key(val) {\n this.data.key = val\n }\n /** 列名 */\n get name(): string {\n return this.data.name\n }\n set name(val) {\n this.data.name = val\n }\n\n /**\n * 列对齐方式\n * @default 'left'\n */\n get align(): TableColumnAlign {\n return this.data.align ?? 'left'\n }\n set align(val) {\n this.data.align = val\n }\n\n get headerAlign(): TableColumnAlign {\n return this.data.headerAlign ?? this.align\n }\n set headerAlign(val) {\n this.data.headerAlign = val\n }\n\n /** 宽度 */\n get width(): number | undefined {\n const { width } = this.data\n if (!width || (this.minWidth && width && width < this.minWidth)) {\n return this.minWidth\n }\n return width\n }\n set width(val) {\n if (this.minWidth && val && val < this.minWidth) {\n val = this.minWidth\n }\n this.data.width = val\n }\n /** 最小宽度 */\n get minWidth(): number | undefined {\n const minWidth = this.data.minWidth\n if (!minWidth && this.isLeaf) {\n return 100\n }\n return minWidth\n }\n set minWidth(val) {\n this.data.minWidth = val\n }\n\n /** 列固定方向 */\n get fixed(): 'left' | 'right' | undefined {\n if (this.depth > 0) return\n return this.data.fixed\n }\n set fixed(val) {\n this.data.fixed = val\n }\n\n /** 是否是左侧的最后一个固定列 */\n get isLastFixed(): boolean {\n return this.data.isLastFixed ?? false\n }\n\n /** 是否是右侧的第一个固定列 */\n get isFirstFixed(): boolean {\n return this.data.isFirstFixed ?? false\n }\n\n /** 是否是可调整宽度的列 */\n get resizable(): boolean {\n return this.data.resizable ?? true\n }\n\n style: Record<string, number> = reactive({})\n\n constructor(val: TableColumn, index: number, depth: number, parent?: ColumnNode) {\n super(val ? shallowReactive(val) : val, index, depth, parent)\n }\n}\n"],"mappings":";;;AAKA,IAAa,aAAb,cAAgC,SAAkC;;CAIhE;CAEA,WAA8B;;CAG9B,IAAI,MAAc;EAChB,OAAO,KAAK,KAAK;;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/components/table/node/col.ts"],"sourcesContent":["import { TreeNode } from '@cat-kit/core'\nimport { isReactive, reactive, shallowReactive } from 'vue'\n\nimport type { TableColumn, TableColumnAlign } from '../../../types'\n\nexport class ColumnNode extends TreeNode<TableColumn, ColumnNode> {\n declare children?: ColumnNode[] | undefined\n declare parent?: ColumnNode\n /** 叶子节点数量 */\n leafs?: number\n\n nextNode: ColumnNode | null = null\n\n /** 列key */\n get key(): string {\n return this.data.key\n }\n set key(val) {\n this.data.key = val\n }\n /** 列名 */\n get name(): string {\n return this.data.name\n }\n set name(val) {\n this.data.name = val\n }\n\n /**\n * 列对齐方式\n * @default 'left'\n */\n get align(): TableColumnAlign {\n return this.data.align ?? 'left'\n }\n set align(val) {\n this.data.align = val\n }\n\n get headerAlign(): TableColumnAlign {\n return this.data.headerAlign ?? this.align\n }\n set headerAlign(val) {\n this.data.headerAlign = val\n }\n\n /** 宽度 */\n get width(): number | undefined {\n const { width } = this.data\n if (!width || (this.minWidth && width && width < this.minWidth)) {\n return this.minWidth\n }\n return width\n }\n set width(val) {\n if (this.minWidth && val && val < this.minWidth) {\n val = this.minWidth\n }\n this.data.width = val\n }\n /** 最小宽度 */\n get minWidth(): number | undefined {\n const minWidth = this.data.minWidth\n if (!minWidth && this.isLeaf) {\n return 100\n }\n return minWidth\n }\n set minWidth(val) {\n this.data.minWidth = val\n }\n\n /** 列固定方向 */\n get fixed(): 'left' | 'right' | undefined {\n if (this.depth > 0) return\n return this.data.fixed\n }\n set fixed(val) {\n this.data.fixed = val\n }\n\n /** 是否是左侧的最后一个固定列 */\n get isLastFixed(): boolean {\n return this.data.isLastFixed ?? false\n }\n\n /** 是否是右侧的第一个固定列 */\n get isFirstFixed(): boolean {\n return this.data.isFirstFixed ?? false\n }\n\n /** 是否是可调整宽度的列 */\n get resizable(): boolean {\n return this.data.resizable ?? true\n }\n\n style: Record<string, number> = reactive({})\n\n constructor(val: TableColumn, index: number, depth: number, parent?: ColumnNode) {\n super(isReactive(val) ? val : shallow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,YAAY,KAAkB,OAAe,OAAe,QAAqB;EAC/E,MAAM,WAAW,IAAI,GAAG,MAAM,gBAAgB,IAAI,EAAE,OAAO,OAAO,OAAO"}
@@ -15,18 +15,18 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
15
15
  declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
16
16
  "update:modelValue": (value: string | undefined) => any;
17
17
  } & {
18
- "update:modelValue": (value: string) => any;
19
18
  close: (item: TabItem, index: number) => any;
20
19
  click: (item: TabItem, index: number) => any;
20
+ "update:modelValue": (value: string) => any;
21
21
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
23
22
  onClose?: ((item: TabItem, index: number) => any) | undefined;
24
23
  onClick?: ((item: TabItem, index: number) => any) | undefined;
24
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
25
25
  }>, {
26
26
  closable: boolean;
27
+ rounded: boolean;
27
28
  position: "top" | "bottom";
28
29
  block: boolean;
29
- rounded: boolean;
30
30
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
31
31
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
32
  declare const _default: typeof __VLS_export;
@@ -14,17 +14,17 @@ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_2>]?: (props: typeof __
14
14
  declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
15
15
  "update:modelValue": (value: string | undefined) => any;
16
16
  } & {
17
- "update:modelValue": (value: string) => any;
18
17
  close: (item: TabItem, index: number) => any;
19
18
  click: (item: TabItem, index: number) => any;
19
+ "update:modelValue": (value: string) => any;
20
20
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
22
21
  onClose?: ((item: TabItem, index: number) => any) | undefined;
23
22
  onClick?: ((item: TabItem, index: number) => any) | undefined;
23
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
24
24
  }>, {
25
25
  closable: boolean;
26
- position: "left" | "right";
27
26
  rounded: boolean;
27
+ position: "left" | "right";
28
28
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
29
29
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
30
  declare const _default: typeof __VLS_export;
@@ -10,18 +10,18 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
10
  declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
11
11
  "update:modelValue": (value: string | undefined) => any;
12
12
  } & {
13
- "update:modelValue": (value: string) => any;
14
13
  close: (item: TabItem, index: number) => any;
15
14
  click: (item: TabItem, index: number) => any;
15
+ "update:modelValue": (value: string) => any;
16
16
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
18
17
  onClose?: ((item: TabItem, index: number) => any) | undefined;
19
18
  onClick?: ((item: TabItem, index: number) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
20
20
  }>, {
21
21
  closable: boolean;
22
+ rounded: boolean;
22
23
  position: "left" | "right" | "top" | "bottom";
23
24
  block: boolean;
24
- rounded: boolean;
25
25
  keepAlive: boolean;
26
26
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
@@ -29,6 +29,7 @@
29
29
  }
30
30
  .u-textarea--small {
31
31
  border-radius: var(--u-radius-small);
32
+ font-size: var(--u-font-size-main-small);
32
33
  }
33
34
  .u-textarea--small .u-textarea__native {
34
35
  padding: calc(var(--u-gap-small) / 2);
@@ -36,10 +37,11 @@
36
37
  padding-right: 20px;
37
38
  }
38
39
  .u-textarea--small .u-textarea__clear {
39
- font-size: var(--u-font-size-main-small);
40
+ font-size: inherit;
40
41
  }
41
42
  .u-textarea--default {
42
43
  border-radius: var(--u-radius-default);
44
+ font-size: var(--u-font-size-main-default);
43
45
  }
44
46
  .u-textarea--default .u-textarea__native {
45
47
  padding: calc(var(--u-gap-default) / 2);
@@ -47,10 +49,11 @@
47
49
  padding-right: 20px;
48
50
  }
49
51
  .u-textarea--default .u-textarea__clear {
50
- font-size: var(--u-font-size-main-default);
52
+ font-size: inherit;
51
53
  }
52
54
  .u-textarea--large {
53
55
  border-radius: var(--u-radius-large);
56
+ font-size: var(--u-font-size-main-large);
54
57
  }
55
58
  .u-textarea--large .u-textarea__native {
56
59
  padding: calc(var(--u-gap-large) / 2);
@@ -58,7 +61,7 @@
58
61
  padding-right: 20px;
59
62
  }
60
63
  .u-textarea--large .u-textarea__clear {
61
- font-size: var(--u-font-size-main-large);
64
+ font-size: inherit;
62
65
  }
63
66
  .u-textarea__native {
64
67
  color: var(--u-text-color-main);
@@ -66,7 +69,7 @@
66
69
  border: none;
67
70
  background-color: transparent;
68
71
  font-family: var(--u-font-family);
69
- font-size: 1em;
72
+ font-size: inherit;
70
73
  width: 100%;
71
74
  display: block;
72
75
  padding: 0;
@@ -11,21 +11,21 @@ declare const __VLS_export: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {},
11
11
  "update:modelValue": (value: string | undefined) => any;
12
12
  } & {
13
13
  "update:modelValue": (value: string) => any;
14
+ clear: () => any;
14
15
  change: (value: string) => any;
15
16
  focus: () => any;
16
- clear: () => any;
17
17
  blur: () => any;
18
18
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
19
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
20
+ onClear?: (() => any) | undefined;
20
21
  onChange?: ((value: string) => any) | undefined;
21
22
  onFocus?: (() => any) | undefined;
22
- onClear?: (() => any) | undefined;
23
23
  onBlur?: (() => any) | undefined;
24
24
  }>, {
25
25
  disabled: boolean;
26
- readonly: boolean;
27
26
  placeholder: string;
28
27
  clearable: boolean;
28
+ readonly: boolean;
29
29
  resize: boolean;
30
30
  autosize: boolean;
31
31
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
@@ -14,8 +14,8 @@ declare const __VLS_base: _$vue.DefineComponent<TipProps, {}, {}, {}, {}, _$vue.
14
14
  trigger: "hover" | "click";
15
15
  contentTag: string;
16
16
  visible: boolean;
17
- content: string;
18
17
  direction: TipDirection;
18
+ content: string;
19
19
  alignment: TipAlign;
20
20
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
21
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,24 +15,24 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
15
15
  declare const __VLS_base: _$vue.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
16
16
  "update:modelValue": (value: string | number | undefined) => any;
17
17
  } & {
18
- change: (value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any;
19
18
  clear: () => any;
19
+ change: (value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any;
20
20
  "update:text": (text?: string | undefined) => any;
21
21
  }, string, _$vue.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
22
  "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
23
- onChange?: ((value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any) | undefined;
24
23
  onClear?: (() => any) | undefined;
24
+ onChange?: ((value?: string | number | undefined, selectedData?: Record<string, any> | undefined) => any) | undefined;
25
25
  "onUpdate:text"?: ((text?: string | undefined) => any) | undefined;
26
26
  }>, {
27
+ minWidth: string;
27
28
  disabled: boolean;
28
- readonly: boolean;
29
- placeholder: string;
30
- clearable: boolean;
31
29
  expandAll: boolean;
32
30
  labelKey: string;
33
31
  valueKey: string;
34
- minWidth: string;
32
+ placeholder: string;
33
+ clearable: boolean;
35
34
  filterable: boolean;
35
+ readonly: boolean;
36
36
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
37
37
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
38
  declare const _default: typeof __VLS_export;
@@ -7,8 +7,8 @@ type __VLS_Slots = {} & {
7
7
  default?: (props: typeof __VLS_7) => any;
8
8
  };
9
9
  declare const __VLS_base: _$vue.DefineComponent<WatermarkProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<WatermarkProps> & Readonly<{}>, {
10
- fontSize: number;
11
10
  route: number;
11
+ fontSize: number;
12
12
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
13
13
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
14
  declare const _default: typeof __VLS_export;
@@ -20,11 +20,6 @@ interface CollapseProps extends ComponentProps {
20
20
  * @default false
21
21
  */
22
22
  defaultCollapseAll?: boolean;
23
- /**
24
- * 是否使用边框模式
25
- * @default false
26
- */
27
- bordered?: boolean;
28
23
  /**
29
24
  * 自定义展开图标组件,活动态会自动旋转 90°。
30
25
  * 接受任意 Vue 组件(SFC、Functional Component 等)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -37,9 +37,6 @@
37
37
  "scripts": {
38
38
  "build": "vp pack"
39
39
  },
40
- "devDependencies": {
41
- "@cat-kit/fe": "^1.1.3"
42
- },
43
40
  "dependencies": {
44
41
  "@codemirror/lang-java": "^6.0.2",
45
42
  "@codemirror/lang-javascript": "^6.2.5",
@@ -48,33 +45,34 @@
48
45
  "@codemirror/state": "^6.6.0",
49
46
  "@codemirror/theme-one-dark": "^6.1.3",
50
47
  "@codemirror/view": "^6.41.1",
51
- "@embedpdf/core": "^2.14.1",
52
- "@embedpdf/engines": "^2.14.1",
53
- "@embedpdf/plugin-document-manager": "^2.14.1",
54
- "@embedpdf/plugin-render": "^2.14.1",
55
- "@embedpdf/plugin-scroll": "^2.14.1",
56
- "@embedpdf/plugin-viewport": "^2.14.1",
48
+ "@embedpdf/core": "^2.14.3",
49
+ "@embedpdf/engines": "^2.14.3",
50
+ "@embedpdf/plugin-document-manager": "^2.14.3",
51
+ "@embedpdf/plugin-render": "^2.14.3",
52
+ "@embedpdf/plugin-scroll": "^2.14.3",
53
+ "@embedpdf/plugin-viewport": "^2.14.3",
57
54
  "@embedpdf/plugin-zoom": "^2.14.1",
58
- "@lexical/history": "^0.43.0",
59
- "@lexical/html": "^0.43.0",
60
- "@lexical/link": "^0.43.0",
61
- "@lexical/list": "^0.43.0",
62
- "@lexical/rich-text": "^0.43.0",
63
- "@lexical/selection": "^0.43.0",
64
- "@lexical/utils": "^0.43.0",
65
- "@visactor/vtable": "^1.26.0",
55
+ "@lexical/history": "^0.45.0",
56
+ "@lexical/html": "^0.45.0",
57
+ "@lexical/link": "^0.45.0",
58
+ "@lexical/list": "^0.45.0",
59
+ "@lexical/rich-text": "^0.45.0",
60
+ "@lexical/selection": "^0.45.0",
61
+ "@lexical/utils": "^0.45.0",
62
+ "@visactor/vtable": "^1.26.1",
66
63
  "codemirror": "^6.0.2",
67
64
  "docx-preview": "^0.3.7",
68
- "lexical": "^0.43.0"
65
+ "lexical": "^0.45.0"
69
66
  },
70
67
  "peerDependencies": {
71
- "@cat-kit/core": ">=1.1.0",
68
+ "@cat-kit/core": ">=1.1.5",
72
69
  "@cat-kit/excel": ">=1.0.0",
73
- "@veltra/compositions": "1.1.21",
74
- "@veltra/directives": "1.1.21",
75
- "@veltra/icons": "1.1.21",
76
- "@veltra/styles": "1.1.21",
77
- "@veltra/utils": "1.1.21",
70
+ "@cat-kit/fe": "^1.1.5",
71
+ "@veltra/compositions": "1.1.23",
72
+ "@veltra/directives": "1.1.23",
73
+ "@veltra/icons": "1.1.23",
74
+ "@veltra/styles": "1.1.23",
75
+ "@veltra/utils": "1.1.23",
78
76
  "vue": ">=3.5.0"
79
77
  }
80
78
  }
@@ -54,8 +54,7 @@ const iconComponent = computed(() => context?.expandIcon.value ?? ArrowRight)
54
54
  const classList = computed(() => [
55
55
  cls.e('item'),
56
56
  bem.is('active', isActive.value),
57
- bem.is('disabled', props.disabled),
58
- bem.is('bordered', context?.bordered.value)
57
+ bem.is('disabled', props.disabled)
59
58
  ])
60
59
 
61
60
  const headerClassList = computed(() => [
@@ -18,8 +18,7 @@ defineOptions({
18
18
 
19
19
  const props = withDefaults(defineProps<CollapseProps>(), {
20
20
  accordion: false,
21
- defaultCollapseAll: false,
22
- bordered: false
21
+ defaultCollapseAll: false
23
22
  })
24
23
  const emit = defineEmits<CollapseEmits>()
25
24
 
@@ -33,9 +32,7 @@ const { size } = useFormFallbackProps([props], { size: 'default' })
33
32
 
34
33
  const expandIcon = computed(() => props.expandIcon)
35
34
 
36
- const bordered = computed(() => props.bordered)
37
-
38
- const classList = computed(() => [cls.b, cls.m(size.value), bem.is('bordered', bordered.value)])
35
+ const classList = computed(() => [cls.b, cls.m(size.value)])
39
36
 
40
37
  const modelValue = useModel<CollapseProps, 'modelValue'>({
41
38
  props,
@@ -110,7 +107,6 @@ const unregister = (value: CollapseValue) => {
110
107
  provide(CollapseDIKey, {
111
108
  cls,
112
109
  size,
113
- bordered,
114
110
  expandIcon,
115
111
  activeValues,
116
112
  toggle,
@@ -6,7 +6,6 @@ import type { CollapseValue } from '../../types'
6
6
  export interface CollapseContext {
7
7
  cls: BEM<'collapse'>
8
8
  size: ComputedRef<ComponentSize>
9
- bordered: ComputedRef<boolean>
10
9
  expandIcon: ComputedRef<Component | undefined>
11
10
  activeValues: ComputedRef<CollapseValue[]>
12
11
  toggle: (value: CollapseValue) => void
@@ -1,6 +1,4 @@
1
- @use 'sass:map';
2
1
  @use 'pkg:@veltra/styles/mixins' as m;
3
- @use 'pkg:@veltra/styles/vars';
4
2
  @use 'pkg:@veltra/styles/functions' as fn;
5
3
 
6
4
  $root-name: collapse;
@@ -9,6 +7,32 @@ $root-name: collapse;
9
7
  $ease: cubic-bezier(0.4, 0, 0.2, 1);
10
8
  $transition-fast: 0.18s $ease;
11
9
  $transition-normal: 0.24s $ease;
10
+ $item-bg: fn.component-var(
11
+ collapse,
12
+ item-bg,
13
+ color-mix(in srgb, #{fn.use-var(bg-color, hover)} 72%, #{fn.use-var(bg-color, top)})
14
+ );
15
+ $item-hover-bg: fn.component-var(
16
+ collapse,
17
+ item-hover-bg,
18
+ color-mix(in srgb, #{fn.use-var(color, primary)} 4%, #{$item-bg})
19
+ );
20
+ $item-active-bg: fn.component-var(
21
+ collapse,
22
+ item-active-bg,
23
+ color-mix(in srgb, #{fn.use-var(color, primary)} 5%, #{$item-bg})
24
+ );
25
+ $header-active-bg: fn.component-var(
26
+ collapse,
27
+ header-active-bg,
28
+ color-mix(in srgb, #{fn.use-var(color, primary)} 8%, #{$item-bg})
29
+ );
30
+ $content-bg: fn.component-var(
31
+ collapse,
32
+ content-bg,
33
+ color-mix(in srgb, #{$item-active-bg} 42%, #{fn.use-var(bg-color, top)})
34
+ );
35
+ $active-title-color: fn.component-var(collapse, active-title-color, fn.use-var(color, primary));
12
36
 
13
37
  @include m.b($root-name) {
14
38
  width: 100%;
@@ -18,32 +42,42 @@ $transition-normal: 0.24s $ease;
18
42
 
19
43
  // ===== Item =====
20
44
  @include m.e(item) {
45
+ position: relative;
21
46
  border-radius: calc(fn.use-var(radius, default) + 2px);
22
- background-color: fn.use-var(bg-color, hover);
47
+ overflow: hidden;
48
+ background-color: $item-bg;
23
49
  transition: background-color $transition-fast;
24
50
 
51
+ &::before {
52
+ content: '';
53
+ position: absolute;
54
+ top: 0;
55
+ bottom: 0;
56
+ left: 0;
57
+ width: 3px;
58
+ background-color: fn.use-var(color, primary);
59
+ opacity: 0;
60
+ pointer-events: none;
61
+ transition: opacity $transition-fast;
62
+ z-index: 1;
63
+ }
64
+
25
65
  & + #{fn.bem($root-name, item)} {
26
66
  margin-top: fn.use-var(gap, default);
27
67
  }
28
68
 
29
69
  @include m.is-not(disabled) {
30
70
  &:hover {
31
- // hover 状态与展开状态保持一致的微加深背景(混入 6% 的正文文字色)
32
- background-color: color-mix(
33
- in srgb,
34
- #{fn.use-var(text-color, main)} 6%,
35
- #{fn.use-var(bg-color, hover)}
36
- );
71
+ background-color: $item-hover-bg;
37
72
  }
38
73
  }
39
74
 
40
75
  @include m.is(active) {
41
- // 展开/活动状态背景(混入 6% 的正文文字色)
42
- background-color: color-mix(
43
- in srgb,
44
- #{fn.use-var(text-color, main)} 6%,
45
- #{fn.use-var(bg-color, hover)}
46
- );
76
+ background-color: $item-active-bg;
77
+
78
+ &::before {
79
+ opacity: 1;
80
+ }
47
81
  }
48
82
 
49
83
  @include m.is(disabled) {
@@ -79,10 +113,14 @@ $transition-normal: 0.24s $ease;
79
113
 
80
114
  @include m.is(active) {
81
115
  font-weight: 600;
116
+ color: $active-title-color;
117
+ background-color: $header-active-bg;
118
+ border-bottom-right-radius: 0;
119
+ border-bottom-left-radius: 0;
82
120
 
83
121
  #{fn.bem($root-name, icon)} {
84
122
  transform: rotate(90deg);
85
- color: fn.use-var(text-color, second);
123
+ color: $active-title-color;
86
124
  }
87
125
  }
88
126
  }
@@ -111,6 +149,9 @@ $transition-normal: 0.24s $ease;
111
149
  @include m.e(content-wrapper) {
112
150
  overflow: hidden;
113
151
  height: 0;
152
+ border-bottom-right-radius: inherit;
153
+ border-bottom-left-radius: inherit;
154
+ background-color: $content-bg;
114
155
  transition: height $transition-normal;
115
156
  }
116
157
 
@@ -141,25 +182,4 @@ $transition-normal: 0.24s $ease;
141
182
  }
142
183
  }
143
184
  }
144
-
145
- // ===== Bordered =====
146
- @include m.is(bordered) {
147
- #{fn.bem($root-name, item)} {
148
- background-color: transparent;
149
- border: 1px solid vars.$border-color;
150
-
151
- &:hover,
152
- &.is-active {
153
- background-color: transparent;
154
- }
155
- }
156
-
157
- #{fn.bem($root-name, header)} {
158
- border-radius: 0;
159
-
160
- @include m.is(active) {
161
- border-bottom: 1px solid vars.$border-color;
162
- }
163
- }
164
- }
165
185
  }