@veltra/desktop 1.2.22 → 1.2.24

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 (30) hide show
  1. package/dist/components/action/action-group.vue.d.ts +1 -1
  2. package/dist/components/action/style2.css +0 -12
  3. package/dist/components/batch-edit/style2.css +2 -2
  4. package/dist/components/cascade/cascade.vue.d.ts +1 -1
  5. package/dist/components/collapse/style2.css +5 -5
  6. package/dist/components/file-viewer/style2.css +24 -9
  7. package/dist/components/kbd/style2.css +1 -1
  8. package/dist/components/loading/style2.css +3 -3
  9. package/dist/components/multi-select/multi-select.vue.d.ts +1 -1
  10. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +1 -1
  11. package/dist/components/nav/nav-sub.js +1 -1
  12. package/dist/components/nav/nav-sub.js.map +1 -1
  13. package/dist/components/nav/style2.css +3 -5
  14. package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
  15. package/dist/components/select/select.js +2 -0
  16. package/dist/components/select/select.js.map +1 -1
  17. package/dist/components/steps/steps.vue.d.ts +2 -2
  18. package/dist/components/tip/tip.vue.d.ts +1 -1
  19. package/dist/components/tree-select/tree-select.vue.d.ts +1 -1
  20. package/dist/components/watermark/watermark.vue.d.ts +1 -1
  21. package/package.json +6 -6
  22. package/src/components/action/style.scss +0 -11
  23. package/src/components/batch-edit/style.scss +3 -7
  24. package/src/components/collapse/style.scss +5 -25
  25. package/src/components/file-viewer/style.scss +24 -9
  26. package/src/components/kbd/style.scss +3 -4
  27. package/src/components/loading/style.scss +3 -3
  28. package/src/components/nav/nav-sub.vue +1 -1
  29. package/src/components/nav/style.scss +3 -5
  30. package/src/components/select/select.vue +2 -0
@@ -9,8 +9,8 @@ declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _Actio
9
9
  size: "small" | "default" | "large";
10
10
  type: import("@veltra/utils").ColorType;
11
11
  text: boolean;
12
- circle: boolean;
13
12
  max: number;
13
+ circle: boolean;
14
14
  loading: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,18 +15,6 @@
15
15
  * --u-height-small: 24px;
16
16
  */
17
17
  /** 暗色:data-theme 与系统偏好,与 UITheme.injectBuiltInThemes 选择器策略一致 */
18
- .u-action-group {
19
- display: inline-flex;
20
- align-items: center;
21
- vertical-align: middle;
22
- gap: 2px;
23
- padding: 2px 4px;
24
- border-radius: 999px;
25
- background-color: color-mix(in srgb, var(--u-bg-color-top) 70%, transparent);
26
- backdrop-filter: var(--u-bg-filter);
27
- -webkit-backdrop-filter: var(--u-bg-filter);
28
- box-shadow: 0 1px 4px color-mix(in srgb, var(--u-shadow-color) 35%, transparent);
29
- }
30
18
  .u-action-group__more {
31
19
  flex-shrink: 0;
32
20
  }
@@ -51,7 +51,7 @@
51
51
  flex-direction: column;
52
52
  background-color: var(--u-bg-color-top);
53
53
  border-radius: var(--u-batch-edit-form-radius);
54
- box-shadow: 0 1px 2px color-mix(in srgb, var(--u-shadow-color) 40%, transparent), 0 12px 32px -16px color-mix(in srgb, var(--u-shadow-color) 50%, transparent);
54
+ box-shadow: 0 1px 2px var(--u-shadow-color-a-40), 0 12px 32px -16px var(--u-shadow-color-a-50);
55
55
  overflow: hidden;
56
56
  isolation: isolate;
57
57
  min-height: 0;
@@ -62,7 +62,7 @@
62
62
  gap: 12px;
63
63
  padding: 10px 14px;
64
64
  border-bottom: 1px solid var(--u-border-color);
65
- background-color: color-mix(in srgb, var(--u-bg-color-top) 96%, var(--u-bg-color-hover));
65
+ background-color: var(--u-batch-edit-form-header-bg);
66
66
  flex-shrink: 0;
67
67
  }
68
68
  .u-batch-edit__form-icon {
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
20
20
  placeholder: string;
21
21
  clearable: boolean;
22
22
  filterable: boolean;
23
- visibilityLimit: number;
24
23
  separator: string;
24
+ visibilityLimit: number;
25
25
  showFullPath: boolean;
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
@@ -25,7 +25,7 @@
25
25
  position: relative;
26
26
  border-radius: calc(var(--u-radius-default) + 2px);
27
27
  overflow: hidden;
28
- background-color: var(--u-collapse-item-bg, color-mix(in srgb, var(--u-bg-color-hover) 72%, var(--u-bg-color-top)));
28
+ background-color: var(--u-collapse-item-bg);
29
29
  transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
30
30
  }
31
31
  .u-collapse__item::before {
@@ -45,10 +45,10 @@
45
45
  margin-top: var(--u-gap-default);
46
46
  }
47
47
  .u-collapse__item:not(.is-disabled):hover {
48
- background-color: var(--u-collapse-item-hover-bg, color-mix(in srgb, var(--u-color-primary) 4%, var(--u-collapse-item-bg, color-mix(in srgb, var(--u-bg-color-hover) 72%, var(--u-bg-color-top)))));
48
+ background-color: var(--u-collapse-item-hover-bg);
49
49
  }
50
50
  .u-collapse__item.is-active {
51
- background-color: var(--u-collapse-item-active-bg, color-mix(in srgb, var(--u-color-primary) 5%, var(--u-collapse-item-bg, color-mix(in srgb, var(--u-bg-color-hover) 72%, var(--u-bg-color-top)))));
51
+ background-color: var(--u-collapse-item-active-bg);
52
52
  }
53
53
  .u-collapse__item.is-active::before {
54
54
  opacity: 1;
@@ -80,7 +80,7 @@
80
80
  .u-collapse__header.is-active {
81
81
  font-weight: 600;
82
82
  color: var(--u-collapse-active-title-color, var(--u-color-primary));
83
- background-color: var(--u-collapse-header-active-bg, color-mix(in srgb, var(--u-color-primary) 8%, var(--u-collapse-item-bg, color-mix(in srgb, var(--u-bg-color-hover) 72%, var(--u-bg-color-top)))));
83
+ background-color: var(--u-collapse-header-active-bg);
84
84
  border-bottom-right-radius: 0;
85
85
  border-bottom-left-radius: 0;
86
86
  }
@@ -107,7 +107,7 @@
107
107
  height: 0;
108
108
  border-bottom-right-radius: inherit;
109
109
  border-bottom-left-radius: inherit;
110
- background-color: var(--u-collapse-content-bg, color-mix(in srgb, var(--u-collapse-item-active-bg, color-mix(in srgb, var(--u-color-primary) 5%, var(--u-collapse-item-bg, color-mix(in srgb, var(--u-bg-color-hover) 72%, var(--u-bg-color-top))))) 42%, var(--u-bg-color-top)));
110
+ background-color: var(--u-collapse-content-bg);
111
111
  transition: height 0.24s cubic-bezier(0.4, 0, 0.2, 1);
112
112
  }
113
113
  .u-collapse__content {
@@ -18,6 +18,7 @@
18
18
  .u-file-viewer {
19
19
  --u-file-viewer-canvas: #101114;
20
20
  --u-file-viewer-canvas-soft: #17191f;
21
+ --u-file-viewer-canvas-overlay: rgba(16, 17, 20, 0.74);
21
22
  --u-file-viewer-page-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
22
23
  position: relative;
23
24
  display: flex;
@@ -150,7 +151,7 @@
150
151
  background: var(--u-bg-color-hover);
151
152
  }
152
153
  .u-file-viewer__item.is-active {
153
- background: color-mix(in srgb, var(--u-color-primary) 8%, transparent);
154
+ background: var(--u-color-primary-a-8);
154
155
  }
155
156
  .u-file-viewer__item.is-active::before {
156
157
  opacity: 1;
@@ -210,37 +211,51 @@
210
211
  }
211
212
  .u-file-viewer__badge {
212
213
  --u-file-viewer-kind: var(--u-text-color-second);
214
+ --u-file-viewer-kind-border: fn.color-a(text-color, 28, second);
215
+ --u-file-viewer-kind-bg: fn.color-a(text-color, 10, second);
213
216
  display: inline-flex;
214
217
  align-items: center;
215
218
  justify-content: center;
216
219
  flex-shrink: 0;
217
220
  width: 40px;
218
221
  height: 26px;
219
- border: 1px solid color-mix(in srgb, var(--u-file-viewer-kind) 28%, transparent);
222
+ border: 1px solid var(--u-file-viewer-kind-border);
220
223
  border-radius: 7px;
221
224
  color: var(--u-file-viewer-kind);
222
- background: color-mix(in srgb, var(--u-file-viewer-kind) 10%, transparent);
225
+ background: var(--u-file-viewer-kind-bg);
223
226
  font-size: 10px;
224
227
  font-weight: 760;
225
228
  line-height: 1;
226
229
  }
227
230
  .u-file-viewer__badge--image {
228
231
  --u-file-viewer-kind: #0891b2;
232
+ --u-file-viewer-kind-border: rgba(8, 145, 178, 0.28);
233
+ --u-file-viewer-kind-bg: rgba(8, 145, 178, 0.1);
229
234
  }
230
235
  .u-file-viewer__badge--video {
231
236
  --u-file-viewer-kind: #db2777;
237
+ --u-file-viewer-kind-border: rgba(219, 39, 119, 0.28);
238
+ --u-file-viewer-kind-bg: rgba(219, 39, 119, 0.1);
232
239
  }
233
240
  .u-file-viewer__badge--pdf {
234
241
  --u-file-viewer-kind: #dc2626;
242
+ --u-file-viewer-kind-border: rgba(220, 38, 38, 0.28);
243
+ --u-file-viewer-kind-bg: rgba(220, 38, 38, 0.1);
235
244
  }
236
245
  .u-file-viewer__badge--sheet {
237
246
  --u-file-viewer-kind: #15803d;
247
+ --u-file-viewer-kind-border: rgba(21, 128, 61, 0.28);
248
+ --u-file-viewer-kind-bg: rgba(21, 128, 61, 0.1);
238
249
  }
239
250
  .u-file-viewer__badge--docx {
240
251
  --u-file-viewer-kind: #2563eb;
252
+ --u-file-viewer-kind-border: rgba(37, 99, 235, 0.28);
253
+ --u-file-viewer-kind-bg: rgba(37, 99, 235, 0.1);
241
254
  }
242
255
  .u-file-viewer__badge--text {
243
256
  --u-file-viewer-kind: #64748b;
257
+ --u-file-viewer-kind-border: rgba(100, 116, 139, 0.28);
258
+ --u-file-viewer-kind-bg: rgba(100, 116, 139, 0.1);
244
259
  }
245
260
  .u-file-viewer__stage {
246
261
  display: flex;
@@ -341,7 +356,7 @@
341
356
  gap: 2px;
342
357
  height: 34px;
343
358
  padding: 2px;
344
- border: 1px solid color-mix(in srgb, var(--u-border-color) 86%, transparent);
359
+ border: 1px solid var(--u-border-color-a-86);
345
360
  border-radius: 8px;
346
361
  background: var(--u-bg-color-middle);
347
362
  }
@@ -367,7 +382,7 @@
367
382
  }
368
383
  .u-file-viewer__action:not(:disabled):hover {
369
384
  color: var(--u-color-primary);
370
- background: color-mix(in srgb, var(--u-color-primary) 10%, transparent);
385
+ background: var(--u-color-primary-a-10);
371
386
  }
372
387
  .u-file-viewer__action:not(:disabled):active {
373
388
  transform: translateY(1px);
@@ -394,7 +409,7 @@
394
409
  }
395
410
  .u-file-viewer__action--primary:not(:disabled):hover {
396
411
  color: #fff;
397
- background: color-mix(in srgb, var(--u-color-primary) 88%, #fff);
412
+ background: var(--u-color-primary-light-1);
398
413
  }
399
414
  .u-file-viewer.is-modal .u-file-viewer__action--primary {
400
415
  color: #06111d;
@@ -623,8 +638,8 @@
623
638
  }
624
639
  .u-file-viewer__sheet-tab.is-active {
625
640
  color: var(--u-color-primary);
626
- background: color-mix(in srgb, var(--u-color-primary) 11%, transparent);
627
- border-color: color-mix(in srgb, var(--u-color-primary) 22%, transparent);
641
+ background: var(--u-color-primary-a-11);
642
+ border-color: var(--u-color-primary-a-22);
628
643
  }
629
644
  .u-file-viewer.is-modal .u-file-viewer__sheet-tab {
630
645
  color: rgba(255, 255, 255, 0.58);
@@ -650,7 +665,7 @@
650
665
  align-items: center;
651
666
  justify-content: center;
652
667
  color: rgba(255, 255, 255, 0.72);
653
- background: color-mix(in srgb, var(--u-file-viewer-canvas) 74%, transparent);
668
+ background: var(--u-file-viewer-canvas-overlay);
654
669
  font-size: 13px;
655
670
  pointer-events: none;
656
671
  }
@@ -39,5 +39,5 @@
39
39
  * Adapted from Radix UI Themes Kbd.
40
40
  * Multi-layer box-shadow simulates a 3D keycap appearance.
41
41
  */
42
- box-shadow: inset 0 0.05em color-mix(in srgb, var(--u-bg-color-top) 75%, var(--u-bg-color-black)), 0 0 0 0.05em color-mix(in srgb, var(--u-border-color) 50%, transparent), 0 0.08em 0.17em color-mix(in srgb, var(--u-shadow-color) 60%, transparent);
42
+ box-shadow: inset 0 0.05em var(--u-kbd-inset-shadow), 0 0 0 0.05em var(--u-kbd-border-shadow), 0 0.08em 0.17em var(--u-kbd-drop-shadow);
43
43
  }
@@ -33,7 +33,7 @@
33
33
  width: 36px;
34
34
  aspect-ratio: 1;
35
35
  border-radius: 50%;
36
- border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
36
+ border: 3px solid var(--u-color-primary-a-22);
37
37
  border-top-color: currentColor;
38
38
  position: relative;
39
39
  animation: loading-spin 0.8s linear infinite;
@@ -43,7 +43,7 @@
43
43
  position: absolute;
44
44
  inset: 5px;
45
45
  border-radius: 50%;
46
- border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
46
+ border: 2px solid var(--u-color-primary-a-22);
47
47
  border-bottom-color: currentColor;
48
48
  animation: loading-spin 1.2s linear infinite reverse;
49
49
  }
@@ -78,7 +78,7 @@
78
78
  width: 36px;
79
79
  aspect-ratio: 1;
80
80
  border-radius: 50%;
81
- border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
81
+ border: 3px solid var(--u-color-primary-a-22);
82
82
  border-top-color: currentColor;
83
83
  animation: loading-spin 0.9s linear infinite;
84
84
  }
@@ -28,11 +28,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
28
28
  }>, {
29
29
  disabled: boolean;
30
30
  readonly: boolean;
31
- minWidth: string;
32
31
  labelKey: string;
33
32
  valueKey: string;
34
33
  placeholder: string;
35
34
  clearable: boolean;
35
+ minWidth: string;
36
36
  visibilityLimit: number;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -23,13 +23,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
23
23
  }>, {
24
24
  disabled: boolean;
25
25
  readonly: boolean;
26
- minWidth: string;
27
26
  expandAll: boolean;
28
27
  labelKey: string;
29
28
  valueKey: string;
30
29
  placeholder: string;
31
30
  clearable: boolean;
32
31
  filterable: boolean;
32
+ minWidth: string;
33
33
  visibilityLimit: number;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -65,7 +65,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
65
65
  onAfterLeave: _cache[4] || (_cache[4] = (el) => unref(expandTransition).afterLeave(el)),
66
66
  persisted: ""
67
67
  }, {
68
- default: withCtx(() => [withDirectives(createElementVNode("ul", { class: normalizeClass(unref(cls).e("sub-list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.children, (child, index) => {
68
+ default: withCtx(() => [withDirectives(createElementVNode("ul", { class: normalizeClass([unref(cls).e("sub-list"), unref(bem).is("has-active", branchActive.value)]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.item.children, (child, index) => {
69
69
  return openBlock(), createElementBlock(Fragment, { key: unref(getKey)(index, __props.parentKey) }, [!child.children?.length ? (openBlock(), createBlock(_sfc_main$3, {
70
70
  key: 0,
71
71
  item: child,
@@ -1 +1 @@
1
- {"version":3,"file":"nav-sub.js","names":[],"sources":["../../../src/components/nav/nav-sub.vue"],"sourcesContent":["<template>\n <li :class=\"cls.e('sub')\">\n <div\n :class=\"[\n cls.e('sub-content'),\n bem.is('first-level', depth === 0),\n bem.is('expanded', expanded),\n bem.is('branch-active', branchActive)\n ]\"\n @click=\"handleToggleExpand\"\n >\n <UNavIcon v-if=\"item.icon\" :icon=\"item.icon\" :class=\"cls.e('icon')\" />\n\n <!-- 文本 -->\n <span :class=\"cls.e('sub-title')\">\n {{ item.title }}\n </span>\n\n <!-- 展开图标 -->\n <u-icon :class=\"[cls.e('sub-expand'), bem.is('expanded', expanded)]\">\n <ArrowRight />\n </u-icon>\n </div>\n\n <!-- @vue-ignore -->\n <transition\n @enter=\"(el: Element) => expandTransition.enter(el as HTMLElement)\"\n @after-enter=\"(el: Element) => expandTransition.afterEnter(el as HTMLElement)\"\n @before-leave=\"(el: Element) => expandTransition.beforeLeave(el as HTMLElement)\"\n @leave=\"(el: Element) => expandTransition.leave(el as HTMLElement)\"\n @after-leave=\"(el: Element) => expandTransition.afterLeave(el as HTMLElement)\"\n >\n <ul :class=\"cls.e('sub-list')\" v-show=\"expanded\">\n <template v-for=\"(child, index) of item.children!\" :key=\"getKey(index, parentKey)\">\n <UNavItem v-if=\"!child.children?.length\" :item=\"child\" :depth=\"depth + 1\" />\n <NavSub v-else :item=\"child\" :parent-key=\"getKey(index, parentKey)\" :depth=\"depth + 1\" />\n </template>\n </ul>\n </transition>\n </li>\n</template>\n\n<script setup lang=\"ts\">\nimport { ArrowRight } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject } from 'vue'\n\nimport type { NavItem } from '../../types'\nimport { UIcon } from '../icon'\nimport { NavDIKey } from './di'\nimport { getKey } from './helper'\nimport UNavIcon from './nav-icon.vue'\nimport UNavItem from './nav-item.vue'\n\ndefineOptions({ name: 'UNavSub' })\n\nconst props = defineProps<{ item: NavItem; parentKey: string; depth: number }>()\n\nconst { cls, expandedPath, navProps, expandTransition } = inject(NavDIKey)!\n\nconst expanded = computed(() => expandedPath.has(props.item.path))\n\nconst branchActive = computed(() => {\n const currentPath = navProps.currentPath\n if (!currentPath) return false\n\n const check = (items?: NavItem[]) => {\n return items?.some((item) => item.path === currentPath || check(item.children)) ?? false\n }\n\n return check(props.item.children)\n})\n\nfunction handleToggleExpand() {\n const { item } = props\n expandedPath.has(item.path) ? expandedPath.delete(item.path) : expandedPath.add(item.path)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAwDA,MAAM,QAAQ;EAEd,MAAM,EAAE,KAAK,cAAc,UAAU,qBAAqB,OAAO,QAAQ;EAEzE,MAAM,WAAW,eAAe,aAAa,IAAI,MAAM,KAAK,IAAI,CAAC;EAEjE,MAAM,eAAe,eAAe;GAClC,MAAM,cAAc,SAAS;GAC7B,IAAI,CAAC,aAAa,OAAO;GAEzB,MAAM,SAAS,UAAsB;IACnC,OAAO,OAAO,MAAM,SAAS,KAAK,SAAS,eAAe,MAAM,KAAK,QAAQ,CAAC,KAAK;GACrF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OAAA,MAAG,OAAgB,MAAA,gBAAA,CAAgB,CAAC,WAAW,EAAE;KAC5D,eAAY,OAAA,OAAA,OAAA,MAAG,OAAgB,MAAA,gBAAA,CAAgB,CAAC,YAAY,EAAE;KAC9D,SAAK,OAAA,OAAA,OAAA,MAAG,OAAgB,MAAA,gBAAA,CAAgB,CAAC,MAAM,EAAE;KACjD,cAAW,OAAA,OAAA,OAAA,MAAG,OAAgB,MAAA,gBAAA,CAAgB,CAAC,WAAW,EAAE;KAL/D,WAAA;;4BAYO,CAAA,eALL,mBAKK,MAAA,EALA,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,UAAA,CAAA,EAAA,GAAA,EAAA,UAAA,IAAA,GACf,mBAGW,UAAA,MAAA,WAHwB,QAAA,KAAK,WAAtB,OAAO,UAAK;8DAA2B,MAAA,MAAA,CAAM,CAAC,OAAO,QAAA,SAAS,EAAA,GAAA,CAAA,CAC7D,MAAM,UAAU,UAAA,UAAA,GAAjC,YAA4E,aAAA;;OAAlC,MAAM;OAAQ,OAAO,QAAA,QAAK;sDACpE,YAAyF,mBAAA;;OAAzE,MAAM;OAAQ,cAAY,MAAA,MAAA,CAAM,CAAC,OAAO,QAAA,SAAS;OAAI,OAAO,QAAA,QAAK;;;;;;8BAH9C,SAAA,KAAQ,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"nav-sub.js","names":[],"sources":["../../../src/components/nav/nav-sub.vue"],"sourcesContent":["<template>\n <li :class=\"cls.e('sub')\">\n <div\n :class=\"[\n cls.e('sub-content'),\n bem.is('first-level', depth === 0),\n bem.is('expanded', expanded),\n bem.is('branch-active', branchActive)\n ]\"\n @click=\"handleToggleExpand\"\n >\n <UNavIcon v-if=\"item.icon\" :icon=\"item.icon\" :class=\"cls.e('icon')\" />\n\n <!-- 文本 -->\n <span :class=\"cls.e('sub-title')\">\n {{ item.title }}\n </span>\n\n <!-- 展开图标 -->\n <u-icon :class=\"[cls.e('sub-expand'), bem.is('expanded', expanded)]\">\n <ArrowRight />\n </u-icon>\n </div>\n\n <!-- @vue-ignore -->\n <transition\n @enter=\"(el: Element) => expandTransition.enter(el as HTMLElement)\"\n @after-enter=\"(el: Element) => expandTransition.afterEnter(el as HTMLElement)\"\n @before-leave=\"(el: Element) => expandTransition.beforeLeave(el as HTMLElement)\"\n @leave=\"(el: Element) => expandTransition.leave(el as HTMLElement)\"\n @after-leave=\"(el: Element) => expandTransition.afterLeave(el as HTMLElement)\"\n >\n <ul :class=\"[cls.e('sub-list'), bem.is('has-active', branchActive)]\" v-show=\"expanded\">\n <template v-for=\"(child, index) of item.children!\" :key=\"getKey(index, parentKey)\">\n <UNavItem v-if=\"!child.children?.length\" :item=\"child\" :depth=\"depth + 1\" />\n <NavSub v-else :item=\"child\" :parent-key=\"getKey(index, parentKey)\" :depth=\"depth + 1\" />\n </template>\n </ul>\n </transition>\n </li>\n</template>\n\n<script setup lang=\"ts\">\nimport { ArrowRight } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, inject } from 'vue'\n\nimport type { NavItem } from '../../types'\nimport { UIcon } from '../icon'\nimport { NavDIKey } from './di'\nimport { getKey } from './helper'\nimport UNavIcon from './nav-icon.vue'\nimport UNavItem from './nav-item.vue'\n\ndefineOptions({ name: 'UNavSub' })\n\nconst props = defineProps<{ item: NavItem; parentKey: string; depth: number }>()\n\nconst { cls, expandedPath, navProps, expandTransition } = inject(NavDIKey)!\n\nconst expanded = computed(() => expandedPath.has(props.item.path))\n\nconst branchActive = computed(() => {\n const currentPath = navProps.currentPath\n if (!currentPath) return false\n\n const check = (items?: NavItem[]) => {\n return items?.some((item) => item.path === currentPath || check(item.children)) ?? false\n }\n\n return check(props.item.children)\n})\n\nfunction handleToggleExpand() {\n const { item } = props\n expandedPath.has(item.path) ? expandedPath.delete(item.path) : expandedPath.add(item.path)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAwDA,MAAM,QAAQ;EAEd,MAAM,EAAE,KAAK,cA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px 0 0 12px;
293
293
  padding: 2px 0 2px 8px;
294
- border-left: 1px solid color-mix(in srgb, var(--u-border-color) 52%, transparent);
294
+ border-left: 1px solid var(--u-border-color-a-52);
295
295
  }
296
- @supports selector(:has(*)) {
297
- .u-nav__sub-list:has(.u-nav__item.is-active) {
298
- border-left-color: var(--u-color-primary);
299
- }
296
+ .u-nav__sub-list.is-has-active {
297
+ border-left-color: var(--u-color-primary);
300
298
  }
301
299
  .u-nav__sub-expand {
302
300
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), color 0.18s ease;
@@ -12,8 +12,8 @@ declare const __VLS_base: import("vue").DefineComponent<PopConfirmProps, {}, {},
12
12
  onConfirm?: (() => any) | undefined;
13
13
  onCancel?: (() => any) | undefined;
14
14
  }>, {
15
- trigger: "hover" | "click";
16
15
  direction: TipDirection;
16
+ trigger: "hover" | "click";
17
17
  icon: import("vue").Component;
18
18
  iconColor: string;
19
19
  confirmText: string;
@@ -171,6 +171,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
171
171
  const handleClear = () => {
172
172
  lock();
173
173
  selected.value = void 0;
174
+ currentIndex.value = -1;
175
+ label.value = void 0;
174
176
  clearCreatedOptions();
175
177
  emit("update:modelValue", void 0);
176
178
  emit("change", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["$attrs","$slots"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, bem.is('disabled', disabled)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size), contentClass]\"\n :content-style=\"contentStyle\"\n :disabled=\"disabled\"\n :min-width=\"minWidth\"\n :width=\"width\"\n @keydown=\"handleKeydown\"\n @update:visible=\"handleDropdownVisible\"\n >\n <!-- 触发 -->\n <template #trigger>\n <u-input\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n :model-value=\"displayedValue\"\n @clear=\"handleClear\"\n @keydown=\"handleKeydown\"\n native-readonly\n >\n <template #prefix v-if=\"$slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n\n <template #suffix>\n <u-icon :class=\"cls.e('arrow')\">\n <ArrowDown />\n </u-icon>\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <!-- 过滤器 -->\n <div v-if=\"filterable\" :class=\"cls.e('content-filter')\">\n <u-input placeholder=\"输入关键字进行搜索\" tabindex=\"0\" v-focus v-model=\"queryString\">\n <template #suffix>\n <u-icon>\n <Search />\n </u-icon>\n </template>\n </u-input>\n </div>\n\n <!--\n 单选列表。虚拟化启用时,内容容器 height 由 useVirtualizer 命令式写入;\n 此处 content-style 仅承担 grid 相关样式,避免 height 变化触发模板重渲染。\n -->\n <u-scroll\n v-if=\"options.length\"\n tag=\"ul\"\n :class=\"cls.e('options')\"\n ref=\"scrollRef\"\n :content-class=\"[\n cls.e('options-wrap'),\n bem.is('virtual', virtualEnabled),\n bem.is('grid', !!grid)\n ]\"\n :content-style=\"{\n gridTemplateColumns: grid ? `repeat(${grid.cols}, minmax(0px, 1fr))` : undefined,\n gridGap: grid ? withUnit(grid.gap, 'px') : undefined\n }\"\n >\n <template v-if=\"virtualEnabled\">\n <!-- @vue-ignore -->\n <li\n v-for=\"{ option, index, val, label, key, offset } of virtualOptions\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :key=\"key\"\n :style=\"{ transform: `translateY(${offset}px)` }\"\n :data-index=\"index\"\n :ref=\"(el) => measureElement(index, el as Element | null)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ label }}\n </slot>\n </li>\n </template>\n\n <template v-else>\n <li\n v-for=\"(option, index) of options\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :data-index=\"index\"\n :title=\"o(option).get(labelKey)\"\n :key=\"o(option).get(valueKey)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ o(option).get(labelKey) }}\n </slot>\n </li>\n </template>\n </u-scroll>\n\n <div v-else :class=\"cls.e('empty')\">\n <UEmpty />\n </div>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ displayedValue || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps, useVirtualizer } from '@veltra/compositions'\nimport { vFocus } from '@veltra/directives'\nimport { ArrowDown, Search } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT, scrollIntoContainerView, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, shallowRef, watch } from 'vue'\n\nimport type {\n SelectEmits,\n SelectProps,\n _SelectExposed,\n DropdownExposed,\n ScrollExposed\n} from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UEmpty } from '../empty'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useOptions } from './use-options'\n\ndefineOptions({ name: 'USelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n labelKey: 'label',\n valueKey: 'value',\n placeholder: '请选择',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<SelectEmits>()\n\ndefineSlots<{\n /** 前缀插槽 */\n prefix?: () => any\n /** 默认插槽 */\n default?: (scope: { option: Record<string, any>; index: number }) => any\n}>()\n\nconst cls = bem('select')\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst currentIndex = shallowRef(-1)\nconst label = defineModel('text')\nconst selected = shallowRef<Record<string, any>>()\n\nconst displayedValue = computed(() => {\n if (label.value) return label.value\n\n return selected.value ? o(selected.value).get(props.labelKey) : String(props.modelValue ?? '')\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst scrollRef = shallowRef<ScrollExposed>()\n\nconst filterable = computed(() => {\n return props.filterable || typeof props.options === 'function'\n})\n\nconst { queryString, options, temOptionsToCreatedOptions, clearCreatedOptions } = useOptions({\n props\n})\n\n// TODO: 优化\nlet userSelecting = false\nfunction lock() {\n userSelecting = true\n}\n\nfunction unlock() {\n nextTick(() => {\n userSelecting = false\n })\n}\n\n// 回显\nwatch(\n [() => props.modelValue, options],\n ([modelValue, options]) => {\n if (userSelecting) return\n\n if (!options?.length) return\n\n const { valueKey, labelKey } = props\n\n if (modelValue !== undefined && modelValue !== null && modelValue !== '') {\n currentIndex.value = options.findIndex((option) => o(option).get(valueKey) === modelValue)\n selected.value = currentIndex.value >= 0 ? options[currentIndex.value] : undefined\n label.value = selected.value ? o(selected.value).get(labelKey) : undefined\n } else {\n currentIndex.value = -1\n selected.value = undefined\n label.value = undefined\n }\n },\n { immediate: true }\n)\n\nconst baseVirtualEnabled = computed(() => options.value.length > 80)\nconst virtualEnabled = computed(() => baseVirtualEnabled.value && !props.grid)\n\nconst { virtualizer, items } = useVirtualizer({\n count: computed(() => options.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n contentEl: () => (virtualEnabled.value ? (scrollRef.value?.contentRef ?? null) : null),\n gap: 4,\n estimateSize: () => 40\n})\n\nconst virtualOptions = computed(() => {\n const _options = options.value\n const { labelKey, valueKey } = props\n return items.value.map((item) => {\n const option = _options[item.index]!\n return {\n option,\n index: item.index,\n label: o(option).get(labelKey),\n val: o(option).get(valueKey),\n key: item.index,\n offset: item.start\n }\n })\n})\n\nconst measureElement: (index: number, el: Element | null) => void = (index, el) =>\n virtualizer.measureElement(index, el)\n\nfunction scrollTo(index: number): void {\n virtualizer.scrollToIndex(index, { align: 'center' })\n}\n\nwatch([scrollRef, virtualEnabled], ([scroll, virtualEnabled]) => {\n if (!scroll || !props.modelValue) return\n\n if (virtualEnabled) {\n const index = options.value.findIndex((option) => option === selected.value)\n index !== -1 && dropdownVisible.value && nextTick(() => scrollTo(index))\n } else {\n const selectedEl = scroll?.contentRef?.getElementsByClassName('is-selected')[0]\n if (selectedEl) {\n scrollIntoContainerView(selectedEl as HTMLElement, scroll.containerRef ?? null)\n }\n }\n})\n\nconst dropdownVisible = shallowRef(false)\n\nwatch(dropdownVisible, (v) => {\n if (!v) {\n queryString.value = ''\n }\n})\n\nconst handleDropdownVisible = (visible: boolean) => {\n if (!visible) {\n queryString.value = ''\n }\n}\n\n/** 单选 */\nconst handleSelect = (option: Record<string, any>, index: number) => {\n lock()\n selected.value = option\n\n emit('update:modelValue', option?.[props.valueKey])\n label.value = option?.[props.labelKey]\n emit('change', option)\n if (option.__isTemp) {\n temOptionsToCreatedOptions()\n }\n currentIndex.value = index\n dropdownRef.value?.close()\n\n unlock()\n}\n\n/** 清除选项 */\nconst handleClear = () => {\n lock()\n selected.value = undefined\n clearCreatedOptions()\n emit('update:modelValue', undefined)\n emit('change', undefined)\n unlock()\n}\n\nfunction getCurrentEl() {\n return scrollRef.value?.contentRef?.querySelector('li.is-selected') as HTMLElement | undefined\n}\n\nconst { handleKeydown } = useKeyboard({\n options,\n currentIndex,\n selectOption: handleSelect,\n getCurrentEl\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IA,MAAM,QAAQ;EASd,MAAM,OAAO;EASb,MAAM,MAAM,IAAI,QAAQ;EAExB,MAAM,cAAc,IAAI,EAAE,QAAQ;EAElC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;EACZ,CAAC;EAED,MAAM,eAAe,WAAW,EAAE;EAClC,MAAM,QAAQ,SAAW,S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;;;yBAMjC,mBAEM,OAAA;;MAFO,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,OAAA,CAAA;SACvB,YAAU,MAAA,WAAA,CAAA,CAAA,GAAA,CAAA;;;;;;;;;;;;uBAKhB,mBAEW,UAAA,EAAA,KAAA,EAAA,GAAA,CAAA,gBAAA,gBADN,eAAA,SAAkB,MAAA,kBAAA,CAAkB,GAAA,CAAA,CAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"select.js","names":["$attrs","$slots"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, bem.is('disabled', disabled)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size), contentClass]\"\n :content-style=\"contentStyle\"\n :disabled=\"disabled\"\n :min-width=\"minWidth\"\n :width=\"width\"\n @keydown=\"handleKeydown\"\n @update:visible=\"handleDropdownVisible\"\n >\n <!-- 触发 -->\n <template #trigger>\n <u-input\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n :model-value=\"displayedValue\"\n @clear=\"handleClear\"\n @keydown=\"handleKeydown\"\n native-readonly\n >\n <template #prefix v-if=\"$slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n\n <template #suffix>\n <u-icon :class=\"cls.e('arrow')\">\n <ArrowDown />\n </u-icon>\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <!-- 过滤器 -->\n <div v-if=\"filterable\" :class=\"cls.e('content-filter')\">\n <u-input placeholder=\"输入关键字进行搜索\" tabindex=\"0\" v-focus v-model=\"queryString\">\n <template #suffix>\n <u-icon>\n <Search />\n </u-icon>\n </template>\n </u-input>\n </div>\n\n <!--\n 单选列表。虚拟化启用时,内容容器 height 由 useVirtualizer 命令式写入;\n 此处 content-style 仅承担 grid 相关样式,避免 height 变化触发模板重渲染。\n -->\n <u-scroll\n v-if=\"options.length\"\n tag=\"ul\"\n :class=\"cls.e('options')\"\n ref=\"scrollRef\"\n :content-class=\"[\n cls.e('options-wrap'),\n bem.is('virtual', virtualEnabled),\n bem.is('grid', !!grid)\n ]\"\n :content-style=\"{\n gridTemplateColumns: grid ? `repeat(${grid.cols}, minmax(0px, 1fr))` : undefined,\n gridGap: grid ? withUnit(grid.gap, 'px') : undefined\n }\"\n >\n <template v-if=\"virtualEnabled\">\n <!-- @vue-ignore -->\n <li\n v-for=\"{ option, index, val, label, key, offset } of virtualOptions\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :key=\"key\"\n :style=\"{ transform: `translateY(${offset}px)` }\"\n :data-index=\"index\"\n :ref=\"(el) => measureElement(index, el as Element | null)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ label }}\n </slot>\n </li>\n </template>\n\n <template v-else>\n <li\n v-for=\"(option, index) of options\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :data-index=\"index\"\n :title=\"o(option).get(labelKey)\"\n :key=\"o(option).get(valueKey)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ o(option).get(labelKey) }}\n </slot>\n </li>\n </template>\n </u-scroll>\n\n <div v-else :class=\"cls.e('empty')\">\n <UEmpty />\n </div>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ displayedValue || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps, useVirtualizer } from '@veltra/compositions'\nimport { vFocus } from '@veltra/directives'\nimport { ArrowDown, Search } from '@veltra/icons/normal'\nimport { bem, FORM_EMPTY_CONTENT, scrollIntoContainerView, withUnit } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, shallowRef, watch } from 'vue'\n\nimport type {\n SelectEmits,\n SelectProps,\n _SelectExposed,\n DropdownExposed,\n ScrollExposed\n} from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UEmpty } from '../empty'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useOptions } from './use-options'\n\ndefineOptions({ name: 'USelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n labelKey: 'label',\n valueKey: 'value',\n placeholder: '请选择',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<SelectEmits>()\n\ndefineSlots<{\n /** 前缀插槽 */\n prefix?: () => any\n /** 默认插槽 */\n default?: (scope: { option: Record<string, any>; index: number }) => any\n}>()\n\nconst cls = bem('select')\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst currentIndex = shallowRef(-1)\nconst label = defineModel('text')\nconst selected = shallowRef<Record<string, any>>()\n\nconst displayedValue = computed(() => {\n if (label.value) return label.value\n\n return selected.value ? o(selected.value).get(props.labelKey) : String(props.modelValue ?? '')\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst scrollRef = shallowRef<ScrollExposed>()\n\nconst filterable = computed(() => {\n return props.filterable || typeof props.options === 'function'\n})\n\nconst { queryString, options, temOptionsToCreatedOptions, clearCreatedOptions } = useOptions({\n props\n})\n\n// TODO: 优化\nlet userSelecting = false\nfunction lock() {\n userSelecting = true\n}\n\nfunction unlock() {\n nextTick(() => {\n userSelecting = false\n })\n}\n\n// 回显\nwatch(\n [() => props.modelValue, options],\n ([modelValue, options]) => {\n if (userSelecting) return\n\n if (!options?.length) return\n\n const { valueKey, labelKey } = props\n\n if (modelValue !== undefined && modelValue !== null && modelValue !== '') {\n currentIndex.value = options.findIndex((option) => o(option).get(valueKey) === modelValue)\n selected.value = currentIndex.value >= 0 ? options[currentIndex.value] : undefined\n label.value = selected.value ? o(selected.value).get(labelKey) : undefined\n } else {\n currentIndex.value = -1\n selected.value = undefined\n label.value = undefined\n }\n },\n { immediate: true }\n)\n\nconst baseVirtualEnabled = computed(() => options.value.length > 80)\nconst virtualEnabled = computed(() => baseVirtualEnabled.value && !props.grid)\n\nconst { virtualizer, items } = useVirtualizer({\n count: computed(() => options.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n contentEl: () => (virtualEnabled.value ? (scrollRef.value?.contentRef ?? null) : null),\n gap: 4,\n estimateSize: () => 40\n})\n\nconst virtualOptions = computed(() => {\n const _options = options.value\n const { labelKey, valueKey } = props\n return items.value.map((item) => {\n const option = _options[item.index]!\n return {\n option,\n index: item.index,\n label: o(option).get(labelKey),\n val: o(option).get(valueKey),\n key: item.index,\n offset: item.start\n }\n })\n})\n\nconst measureElement: (index: number, el: Element | null) => void = (index, el) =>\n virtualizer.measureElement(index, el)\n\nfunction scrollTo(index: number): void {\n virtualizer.scrollToIndex(index, { align: 'center' })\n}\n\nwatch([scrollRef, virtualEnabled], ([scroll, virtualEnabled]) => {\n if (!scroll || !props.modelValue) return\n\n if (virtualEnabled) {\n const index = options.value.findIndex((option) => option === selected.value)\n index !== -1 && dropdownVisible.value && nextTick(() => scrollTo(index))\n } else {\n const selectedEl = scroll?.contentRef?.getElementsByClassName('is-selected')[0]\n if (selectedEl) {\n scrollIntoContainerView(selectedEl as HTMLElement, scroll.containerRef ?? null)\n }\n }\n})\n\nconst dropdownVisible = shallowRef(false)\n\nwatch(dropdownVisible, (v) => {\n if (!v) {\n queryString.value = ''\n }\n})\n\nconst handleDropdownVisible = (visible: boolean) => {\n if (!visible) {\n queryString.value = ''\n }\n}\n\n/** 单选 */\nconst handleSelect = (option: Record<string, any>, index: number) => {\n lock()\n selected.value = option\n\n emit('update:modelValue', option?.[props.valueKey])\n label.value = option?.[props.labelKey]\n emit('change', option)\n if (option.__isTemp) {\n temOptionsToCreatedOptions()\n }\n currentIndex.value = index\n dropdownRef.value?.close()\n\n unlock()\n}\n\n/** 清除选项 */\nconst handleClear = () => {\n lock()\n selected.value = undefined\n currentIndex.value = -1\n label.value = undefined\n clearCreatedOptions()\n emit('update:modelValue', undefined)\n emit('change', undefined)\n unlock()\n}\n\nfunction getCurrentEl() {\n return scrollRef.value?.contentRef?.querySelector('li.is-selected') as HTMLElement | undefined\n}\n\nconst { handleKeydown } = useKeyboard({\n options,\n currentIndex,\n selectOption: handleSelect,\n getCurrentEl\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IA,MAAM,QAAQ;EASd,MAAM,OAAO;EASb,MAAM,MAAM,IAAI,QAAQ;EAExB,MAAM,cAAc,IAAI,EAAE,QAAQ;EAElC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;EACZ,CAAC;EAED,MAAM,eAAe,WAAW,EAAE;EAClC,MAAM,QAAQ,SAAW,SAAC,MAAM;EAChC,MAAM,WAAW,WAAgC;EAEjD,MAAM,iBAAiB,eAAe;GACpC,IAAI,MAAM,OAAO,OAAO,MAAM;GAE9B,OAAO,SAAS,QAAQ,EAAE,SAAS,KAAK,CAAC,CAAC,IAAI,MAAM,QAAQ,IAAI,OAAO,MAAM,cAAc,EAAE;EAC/F,CAAC;EAED,MAAM,cAAc,WAA4B;EAChD,MAAM,YAAY,WAA0B;EAE5C,MAAM,aAAa,eAAe;GAChC,OAAO,MAAM,cAAc,OAAO,MAAM,YAAY;EACtD,CAAC;EAED,MAAM,EAAE,aAAa,SAAS,4BAA4B,wBAAwB,WAAW,EAC3F,MACF,CAAC;EAGD,IAAI,gBAAgB;EACpB,SAAS,OAAO;GACd,gBAAgB;EAClB;EAEA,SAAS,SAAS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P,WAEO,EAAA,SAAA,KAAA,GAAA;QAFS;QAAQ;OAAK,CAAA,SAEtB,CAAA,gBAAA,gBADF,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,IAAA,UAAA;2CAMZ,mBAWK,UAAA,EAAA,KAAA,EAAA,GAAA,WAVuB,MAAA,OAAA,IAAlB,QAAQ,UAAK;2BADvB,mBAWK,MAAA;QATF,OAAK,eAAA,CAAG,MAAA,WAAA,GAAa,MAAA,GAAA,CAAG,CAAC,GAAE,YAAa,UAAU,aAAA,KAAY,CAAA,CAAA;QAC9D,UAAK,WAAE,aAAa,QAAQ,KAAK;QACjC,cAAY;QACZ,OAAO,MAAA,CAAA,CAAC,CAAC,MAAM,CAAA,CAAE,IAAI,QAAA,QAAQ;QAC7B,KAAK,MAAA,CAAA,CAAC,CAAC,MAAM,CAAA,CAAE,IAAI,QAAA,QAAQ;WAE5B,WAEO,KAAA,QAAA,WAFP,WAEO,EAAA,SAAA,KAAA,GAAA;QAFS;QAAQ;OAAK,CAAA,SAEtB,CAAA,gBAAA,gBADF,MAAA,CAAA,CAAC,CAAC,MAAM,CAAA,CAAE,IAAI,QAAA,QAAQ,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,IAAA,UAAA;;;;;;;yBAMjC,mBAEM,OAAA;;MAFO,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,OAAA,CAAA;SACvB,YAAU,MAAA,WAAA,CAAA,CAAA,GAAA,CAAA;;;;;;;;;;;;uBAKhB,mBAEW,UAAA,EAAA,KAAA,EAAA,GAAA,CAAA,gBAAA,gBADN,eAAA,SAAkB,MAAA,kBAAA,CAAkB,GAAA,CAAA,CAAA,GAAA,EAAA"}
@@ -6,11 +6,11 @@ type __VLS_Slots = {
6
6
  tip?: (scope: StepsSlotScope) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- "update:current": (value?: string | number | undefined) => any;
10
9
  "item-click": (item: Record<string, any>, index: number) => any;
10
+ "update:current": (value?: string | number | undefined) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<StepsProps> & Readonly<{
12
- "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
13
12
  "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
13
+ "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
14
14
  }>, {
15
15
  labelKey: string;
16
16
  direction: "horizontal" | "vertical";
@@ -9,10 +9,10 @@ declare const __VLS_base: import("vue").DefineComponent<TipProps, {}, {}, {}, {}
9
9
  }, string, import("vue").PublicProps, Readonly<TipProps> & Readonly<{
10
10
  "onUpdate:visible"?: ((value: boolean) => any) | undefined;
11
11
  }>, {
12
+ direction: TipDirection;
12
13
  trigger: "hover" | "click";
13
14
  contentTag: string;
14
15
  visible: boolean;
15
- direction: TipDirection;
16
16
  content: string;
17
17
  alignment: TipAlign;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
26
26
  }>, {
27
27
  disabled: boolean;
28
28
  readonly: boolean;
29
- minWidth: string;
30
29
  expandAll: boolean;
31
30
  labelKey: string;
32
31
  valueKey: string;
33
32
  placeholder: string;
34
33
  clearable: boolean;
35
34
  filterable: boolean;
35
+ minWidth: string;
36
36
  }, {}, {}, {}, string, import("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;
@@ -5,8 +5,8 @@ type __VLS_Slots = {} & {
5
5
  default?: (props: typeof __VLS_7) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<WatermarkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WatermarkProps> & Readonly<{}>, {
8
- route: number;
9
8
  fontSize: number;
9
+ route: number;
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
12
  declare const _default: typeof __VLS_export;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -57,11 +57,11 @@
57
57
  "@cat-kit/core": ">=1.1.8",
58
58
  "@cat-kit/excel": ">=1.0.0",
59
59
  "@cat-kit/fe": "^1.1.8",
60
- "@veltra/compositions": "1.2.22",
61
- "@veltra/directives": "1.2.22",
62
- "@veltra/icons": "1.2.22",
63
- "@veltra/styles": "1.2.22",
64
- "@veltra/utils": "1.2.22",
60
+ "@veltra/compositions": "1.2.24",
61
+ "@veltra/directives": "1.2.24",
62
+ "@veltra/icons": "1.2.24",
63
+ "@veltra/styles": "1.2.24",
64
+ "@veltra/utils": "1.2.24",
65
65
  "vue": ">=3.5.39"
66
66
  },
67
67
  "devDependencies": {
@@ -5,17 +5,6 @@ $root-name: action;
5
5
  $group-name: action-group;
6
6
 
7
7
  @include m.b($group-name) {
8
- display: inline-flex;
9
- align-items: center;
10
- vertical-align: middle;
11
- gap: 2px;
12
- padding: 2px 4px;
13
- border-radius: 999px;
14
- background-color: color-mix(in srgb, #{fn.use-var(bg-color, top)} 70%, transparent);
15
- backdrop-filter: fn.use-var(bg-filter);
16
- -webkit-backdrop-filter: fn.use-var(bg-filter);
17
- box-shadow: 0 1px 4px color-mix(in srgb, #{fn.use-var(shadow, color)} 35%, transparent);
18
-
19
8
  @include m.e(more) {
20
9
  flex-shrink: 0;
21
10
  }
@@ -52,8 +52,8 @@ $root-name: batch-edit;
52
52
  background-color: fn.use-var(bg-color, top);
53
53
  border-radius: var(--u-batch-edit-form-radius);
54
54
  box-shadow:
55
- 0 1px 2px color-mix(in srgb, #{fn.use-var(shadow, color)} 40%, transparent),
56
- 0 12px 32px -16px color-mix(in srgb, #{fn.use-var(shadow, color)} 50%, transparent);
55
+ 0 1px 2px fn.color-a(shadow, 40, color),
56
+ 0 12px 32px -16px fn.color-a(shadow, 50, color);
57
57
  overflow: hidden;
58
58
  isolation: isolate;
59
59
  min-height: 0;
@@ -65,11 +65,7 @@ $root-name: batch-edit;
65
65
  gap: 12px;
66
66
  padding: 10px 14px;
67
67
  border-bottom: 1px solid fn.use-var(border-color);
68
- background-color: color-mix(
69
- in srgb,
70
- #{fn.use-var(bg-color, top)} 96%,
71
- #{fn.use-var(bg-color, hover)}
72
- );
68
+ background-color: fn.component-var(batch-edit, form-header-bg);
73
69
  flex-shrink: 0;
74
70
  }
75
71
 
@@ -7,31 +7,11 @@ $root-name: collapse;
7
7
  $ease: cubic-bezier(0.4, 0, 0.2, 1);
8
8
  $transition-fast: 0.18s $ease;
9
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
- );
10
+ $item-bg: fn.component-var(collapse, item-bg);
11
+ $item-hover-bg: fn.component-var(collapse, item-hover-bg);
12
+ $item-active-bg: fn.component-var(collapse, item-active-bg);
13
+ $header-active-bg: fn.component-var(collapse, header-active-bg);
14
+ $content-bg: fn.component-var(collapse, content-bg);
35
15
  $active-title-color: fn.component-var(collapse, active-title-color, fn.use-var(color, primary));
36
16
 
37
17
  @include m.b($root-name) {
@@ -4,6 +4,7 @@
4
4
  @include m.b(file-viewer) {
5
5
  --u-file-viewer-canvas: #101114;
6
6
  --u-file-viewer-canvas-soft: #17191f;
7
+ --u-file-viewer-canvas-overlay: rgba(16, 17, 20, 0.74);
7
8
  --u-file-viewer-page-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
8
9
 
9
10
  position: relative;
@@ -174,7 +175,7 @@
174
175
  }
175
176
 
176
177
  @include m.is(active) {
177
- background: color-mix(in srgb, #{fn.use-var(color, primary)} 8%, transparent);
178
+ background: fn.color-a(color, 8, primary);
178
179
 
179
180
  &::before {
180
181
  opacity: 1;
@@ -247,6 +248,8 @@
247
248
 
248
249
  @include m.e(badge) {
249
250
  --u-file-viewer-kind: #{fn.use-var(text-color, second)};
251
+ --u-file-viewer-kind-border: fn.color-a(text-color, 28, second);
252
+ --u-file-viewer-kind-bg: fn.color-a(text-color, 10, second);
250
253
 
251
254
  display: inline-flex;
252
255
  align-items: center;
@@ -254,10 +257,10 @@
254
257
  flex-shrink: 0;
255
258
  width: 40px;
256
259
  height: 26px;
257
- border: 1px solid color-mix(in srgb, var(--u-file-viewer-kind) 28%, transparent);
260
+ border: 1px solid var(--u-file-viewer-kind-border);
258
261
  border-radius: 7px;
259
262
  color: var(--u-file-viewer-kind);
260
- background: color-mix(in srgb, var(--u-file-viewer-kind) 10%, transparent);
263
+ background: var(--u-file-viewer-kind-bg);
261
264
  font-size: 10px;
262
265
  font-weight: 760;
263
266
  line-height: 1;
@@ -265,26 +268,38 @@
265
268
 
266
269
  @include m.em(badge, image) {
267
270
  --u-file-viewer-kind: #0891b2;
271
+ --u-file-viewer-kind-border: rgba(8, 145, 178, 0.28);
272
+ --u-file-viewer-kind-bg: rgba(8, 145, 178, 0.1);
268
273
  }
269
274
 
270
275
  @include m.em(badge, video) {
271
276
  --u-file-viewer-kind: #db2777;
277
+ --u-file-viewer-kind-border: rgba(219, 39, 119, 0.28);
278
+ --u-file-viewer-kind-bg: rgba(219, 39, 119, 0.1);
272
279
  }
273
280
 
274
281
  @include m.em(badge, pdf) {
275
282
  --u-file-viewer-kind: #dc2626;
283
+ --u-file-viewer-kind-border: rgba(220, 38, 38, 0.28);
284
+ --u-file-viewer-kind-bg: rgba(220, 38, 38, 0.1);
276
285
  }
277
286
 
278
287
  @include m.em(badge, sheet) {
279
288
  --u-file-viewer-kind: #15803d;
289
+ --u-file-viewer-kind-border: rgba(21, 128, 61, 0.28);
290
+ --u-file-viewer-kind-bg: rgba(21, 128, 61, 0.1);
280
291
  }
281
292
 
282
293
  @include m.em(badge, docx) {
283
294
  --u-file-viewer-kind: #2563eb;
295
+ --u-file-viewer-kind-border: rgba(37, 99, 235, 0.28);
296
+ --u-file-viewer-kind-bg: rgba(37, 99, 235, 0.1);
284
297
  }
285
298
 
286
299
  @include m.em(badge, text) {
287
300
  --u-file-viewer-kind: #64748b;
301
+ --u-file-viewer-kind-border: rgba(100, 116, 139, 0.28);
302
+ --u-file-viewer-kind-bg: rgba(100, 116, 139, 0.1);
288
303
  }
289
304
 
290
305
  @include m.e(stage) {
@@ -404,7 +419,7 @@
404
419
  gap: 2px;
405
420
  height: 34px;
406
421
  padding: 2px;
407
- border: 1px solid color-mix(in srgb, #{fn.use-var(border, color)} 86%, transparent);
422
+ border: 1px solid fn.color-a(border, 86, color);
408
423
  border-radius: 8px;
409
424
  background: fn.use-var(bg-color, middle);
410
425
  }
@@ -436,7 +451,7 @@
436
451
 
437
452
  &:not(:disabled):hover {
438
453
  color: fn.use-var(color, primary);
439
- background: color-mix(in srgb, #{fn.use-var(color, primary)} 10%, transparent);
454
+ background: fn.color-a(color, 10, primary);
440
455
  }
441
456
 
442
457
  &:not(:disabled):active {
@@ -470,7 +485,7 @@
470
485
 
471
486
  &:not(:disabled):hover {
472
487
  color: #fff;
473
- background: color-mix(in srgb, #{fn.use-var(color, primary)} 88%, #fff);
488
+ background: fn.use-var(color, primary, light, 1);
474
489
  }
475
490
  }
476
491
 
@@ -760,8 +775,8 @@
760
775
 
761
776
  @include m.is(active) {
762
777
  color: fn.use-var(color, primary);
763
- background: color-mix(in srgb, #{fn.use-var(color, primary)} 11%, transparent);
764
- border-color: color-mix(in srgb, #{fn.use-var(color, primary)} 22%, transparent);
778
+ background: fn.color-a(color, 11, primary);
779
+ border-color: fn.color-a(color, 22, primary);
765
780
  }
766
781
  }
767
782
 
@@ -793,7 +808,7 @@
793
808
  align-items: center;
794
809
  justify-content: center;
795
810
  color: rgba(255, 255, 255, 0.72);
796
- background: color-mix(in srgb, var(--u-file-viewer-canvas) 74%, transparent);
811
+ background: var(--u-file-viewer-canvas-overlay);
797
812
  font-size: 13px;
798
813
  pointer-events: none;
799
814
  }
@@ -30,8 +30,7 @@
30
30
  * Multi-layer box-shadow simulates a 3D keycap appearance.
31
31
  */
32
32
  box-shadow:
33
- inset 0 0.05em
34
- color-mix(in srgb, #{fn.use-var(bg-color, top)} 75%, #{fn.use-var(bg-color, black)}),
35
- 0 0 0 0.05em color-mix(in srgb, #{fn.use-var(border, color)} 50%, transparent),
36
- 0 0.08em 0.17em color-mix(in srgb, #{fn.use-var(shadow, color)} 60%, transparent);
33
+ inset 0 0.05em fn.component-var(kbd, inset-shadow),
34
+ 0 0 0 0.05em fn.component-var(kbd, border-shadow),
35
+ 0 0.08em 0.17em fn.component-var(kbd, drop-shadow);
37
36
  }
@@ -25,7 +25,7 @@ $root-name: loading;
25
25
  width: 36px;
26
26
  aspect-ratio: 1;
27
27
  border-radius: 50%;
28
- border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
28
+ border: 3px solid fn.color-a(color, 22, primary);
29
29
  border-top-color: currentColor;
30
30
  position: relative;
31
31
  animation: loading-spin 0.8s linear infinite;
@@ -35,7 +35,7 @@ $root-name: loading;
35
35
  position: absolute;
36
36
  inset: 5px;
37
37
  border-radius: 50%;
38
- border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
38
+ border: 2px solid fn.color-a(color, 22, primary);
39
39
  border-bottom-color: currentColor;
40
40
  animation: loading-spin 1.2s linear infinite reverse;
41
41
  }
@@ -88,7 +88,7 @@ $root-name: loading;
88
88
  width: 36px;
89
89
  aspect-ratio: 1;
90
90
  border-radius: 50%;
91
- border: 3px solid color-mix(in srgb, currentColor 22%, transparent);
91
+ border: 3px solid fn.color-a(color, 22, primary);
92
92
  border-top-color: currentColor;
93
93
  animation: loading-spin 0.9s linear infinite;
94
94
  }
@@ -30,7 +30,7 @@
30
30
  @leave="(el: Element) => expandTransition.leave(el as HTMLElement)"
31
31
  @after-leave="(el: Element) => expandTransition.afterLeave(el as HTMLElement)"
32
32
  >
33
- <ul :class="cls.e('sub-list')" v-show="expanded">
33
+ <ul :class="[cls.e('sub-list'), bem.is('has-active', branchActive)]" v-show="expanded">
34
34
  <template v-for="(child, index) of item.children!" :key="getKey(index, parentKey)">
35
35
  <UNavItem v-if="!child.children?.length" :item="child" :depth="depth + 1" />
36
36
  <NavSub v-else :item="child" :parent-key="getKey(index, parentKey)" :depth="depth + 1" />
@@ -148,12 +148,10 @@ $collapsed-nav: collapsed-nav;
148
148
  overflow: hidden;
149
149
  margin: 2px 0 0 12px;
150
150
  padding: 2px 0 2px 8px;
151
- border-left: 1px solid color-mix(in srgb, #{fn.use-var(border, color)} 52%, transparent);
151
+ border-left: 1px solid fn.color-a(border, 52, color);
152
152
 
153
- @supports selector(:has(*)) {
154
- &:has(#{fn.bem($root-name, item)}.is-active) {
155
- border-left-color: fn.use-var(color, primary);
156
- }
153
+ @include m.is(has-active) {
154
+ border-left-color: fn.use-var(color, primary);
157
155
  }
158
156
  }
159
157
 
@@ -308,6 +308,8 @@ const handleSelect = (option: Record<string, any>, index: number) => {
308
308
  const handleClear = () => {
309
309
  lock()
310
310
  selected.value = undefined
311
+ currentIndex.value = -1
312
+ label.value = undefined
311
313
  clearCreatedOptions()
312
314
  emit('update:modelValue', undefined)
313
315
  emit('change', undefined)