@veltra/desktop 1.2.32 → 1.2.33

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 (49) hide show
  1. package/dist/components/batch-edit/batch-edit.vue.d.ts +8 -8
  2. package/dist/components/cascade/cascade.vue.d.ts +1 -1
  3. package/dist/components/dual-nav/dual-nav-app.js +17 -4
  4. package/dist/components/dual-nav/dual-nav-app.js.map +1 -1
  5. package/dist/components/dual-nav/dual-nav.js +5 -2
  6. package/dist/components/dual-nav/dual-nav.js.map +1 -1
  7. package/dist/components/dual-nav/dual-nav.vue.d.ts +4 -3
  8. package/dist/components/dual-nav/style2.css +22 -0
  9. package/dist/components/group-nav/group-nav-item.js +40 -0
  10. package/dist/components/group-nav/group-nav-item.js.map +1 -0
  11. package/dist/components/group-nav/group-nav.js +47 -0
  12. package/dist/components/group-nav/group-nav.js.map +1 -0
  13. package/dist/components/group-nav/group-nav.vue.d.ts +13 -0
  14. package/dist/components/group-nav/index.d.ts +1 -0
  15. package/dist/components/group-nav/style.d.ts +1 -0
  16. package/dist/components/group-nav/style.js +3 -0
  17. package/dist/components/group-nav/style2.css +119 -0
  18. package/dist/components/index.d.ts +20 -19
  19. package/dist/components/index.js +22 -20
  20. package/dist/components/index.js.map +1 -1
  21. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +1 -1
  22. package/dist/components/progress-nodes/progress-nodes.vue.d.ts +1 -1
  23. package/dist/components/steps/steps.vue.d.ts +2 -2
  24. package/dist/components/tabs/tabs-horizontal.vue.d.ts +2 -2
  25. package/dist/components/tabs/tabs-vertical.vue.d.ts +2 -2
  26. package/dist/components/tabs/tabs.vue.d.ts +2 -2
  27. package/dist/components/textarea/textarea.vue.d.ts +1 -1
  28. package/dist/components/tree/tree.vue.d.ts +1 -1
  29. package/dist/components/tree-select/tree-select.vue.d.ts +1 -1
  30. package/dist/index.d.ts +50 -48
  31. package/dist/index.js +46 -45
  32. package/dist/style.js +1 -0
  33. package/dist/types/dual-nav.d.ts +9 -1
  34. package/dist/types/group-nav.d.ts +22 -0
  35. package/dist/types/index.d.ts +3 -2
  36. package/package.json +6 -6
  37. package/src/components/dual-nav/dual-nav-app.vue +22 -3
  38. package/src/components/dual-nav/dual-nav.vue +3 -2
  39. package/src/components/dual-nav/style.scss +30 -1
  40. package/src/components/group-nav/group-nav-item.vue +32 -0
  41. package/src/components/group-nav/group-nav.vue +36 -0
  42. package/src/components/group-nav/index.ts +1 -0
  43. package/src/components/group-nav/style.scss +121 -0
  44. package/src/components/group-nav/style.ts +3 -0
  45. package/src/components/index.ts +2 -0
  46. package/src/style.ts +1 -0
  47. package/src/types/dual-nav.ts +9 -0
  48. package/src/types/group-nav.ts +20 -0
  49. package/src/types/index.ts +1 -0
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import _sfc_main$40 from "./components/icon/icon.js";
1
+ import _sfc_main$41 from "./components/icon/icon.js";
2
2
  import _sfc_main$30 from "./components/empty/empty.js";
3
- import _sfc_main$66 from "./components/scroll/scroll.js";
3
+ import _sfc_main$67 from "./components/scroll/scroll.js";
4
4
  import NodeRender from "./components/node-render/node-render.js";
5
- import _sfc_main$80 from "./components/tip/tip.js";
5
+ import _sfc_main$81 from "./components/tip/tip.js";
6
6
  import { createEmptyGroup, createEmptyLeaf, evaluate } from "./components/condition-editor/core/evaluator.js";
7
7
  import _sfc_main$28 from "./components/dropdown/dropdown.js";
8
8
  import input_default from "./components/input/input.js";
9
- import _sfc_main$67 from "./components/select/select.js";
9
+ import _sfc_main$68 from "./components/select/select.js";
10
10
  import _sfc_main$21 from "./components/condition-editor/condition-editor.js";
11
- import _sfc_main$74 from "./components/tabs/tabs-horizontal.js";
12
- import _sfc_main$75 from "./components/tabs/tabs-vertical.js";
13
- import _sfc_main$73 from "./components/tabs/tabs.js";
11
+ import _sfc_main$75 from "./components/tabs/tabs-horizontal.js";
12
+ import _sfc_main$76 from "./components/tabs/tabs-vertical.js";
13
+ import _sfc_main$74 from "./components/tabs/tabs.js";
14
14
  import _sfc_main$15 from "./components/checkbox/checkbox.js";
15
- import _sfc_main$81 from "./components/tree/tree.js";
16
- import _sfc_main$82 from "./components/tree-select/tree-select.js";
15
+ import _sfc_main$82 from "./components/tree/tree.js";
16
+ import _sfc_main$83 from "./components/tree-select/tree-select.js";
17
17
  import _sfc_main$18 from "./components/code-editor/code-editor.js";
18
18
  import _sfc_main$27 from "./components/drawer/drawer.js";
19
19
  import _sfc_main$36 from "./components/grid/grid.js";
@@ -22,10 +22,10 @@ import form_item_default from "./components/form-item/form-item.js";
22
22
  import form_default from "./components/form/form.js";
23
23
  import _sfc_main$5 from "./components/button/button.js";
24
24
  import _sfc_main$6 from "./components/button/button-group.js";
25
- import _sfc_main$47 from "./components/message-confirm/message-confirm.js";
25
+ import _sfc_main$48 from "./components/message-confirm/message-confirm.js";
26
26
  import MessageConfirm from "./components/message-confirm/message-confirm2.js";
27
27
  import _sfc_main$7 from "./components/calendar/calendar.js";
28
- import _sfc_main$63 from "./components/radio/radio.js";
28
+ import _sfc_main$64 from "./components/radio/radio.js";
29
29
  import _sfc_main$8 from "./components/card/card.js";
30
30
  import _sfc_main$12 from "./components/card/card-header.js";
31
31
  import _sfc_main$11 from "./components/card/card-cover.js";
@@ -33,66 +33,67 @@ import _sfc_main$10 from "./components/card/card-content.js";
33
33
  import _sfc_main$9 from "./components/card/card-action.js";
34
34
  import _sfc_main$23 from "./components/date-panel/date-panel.js";
35
35
  import _sfc_main$25 from "./components/date-range-picker/date-range-picker.js";
36
- import _sfc_main$45 from "./components/loading/loading.js";
36
+ import _sfc_main$46 from "./components/loading/loading.js";
37
37
  import { vLoading } from "./components/loading/directive.js";
38
- import _sfc_main$62 from "./components/progress-nodes/progress-nodes.js";
38
+ import _sfc_main$63 from "./components/progress-nodes/progress-nodes.js";
39
39
  import _sfc_main$1 from "./components/auto-complete/auto-complete.js";
40
- import _sfc_main$61 from "./components/progress/progress.js";
41
- import _sfc_main$53 from "./components/notification/notification.js";
40
+ import _sfc_main$62 from "./components/progress/progress.js";
41
+ import _sfc_main$54 from "./components/notification/notification.js";
42
42
  import { Notification } from "./components/notification/index.js";
43
- import _sfc_main$42 from "./components/layout/layout.js";
44
- import _sfc_main$76 from "./components/tag/tag.js";
43
+ import _sfc_main$43 from "./components/layout/layout.js";
44
+ import _sfc_main$77 from "./components/tag/tag.js";
45
45
  import _sfc_main$16 from "./components/checkbox/checkbox-button.js";
46
- import _sfc_main$48 from "./components/multi-select/multi-select.js";
47
- import _sfc_main$68 from "./components/slider/slider.js";
46
+ import _sfc_main$49 from "./components/multi-select/multi-select.js";
47
+ import _sfc_main$69 from "./components/slider/slider.js";
48
48
  import _sfc_main$35 from "./components/gantt-chart/gantt-chart.js";
49
- import _sfc_main$46 from "./components/message/message.js";
49
+ import _sfc_main$47 from "./components/message/message.js";
50
50
  import { message } from "./components/message/message2.js";
51
51
  import _sfc_main$32 from "./components/file-picker/file-picker.js";
52
- import _sfc_main$55 from "./components/number-input/number-input.js";
53
- import _sfc_main$56 from "./components/number-range-input/number-range-input.js";
52
+ import _sfc_main$56 from "./components/number-input/number-input.js";
53
+ import _sfc_main$57 from "./components/number-range-input/number-range-input.js";
54
54
  import _sfc_main$19 from "./components/collapse/collapse.js";
55
55
  import _sfc_main$20 from "./components/collapse/collapse-item.js";
56
56
  import { defineTableColumns } from "./components/table/use-columns.js";
57
- import _sfc_main$71 from "./components/table/table.js";
58
- import _sfc_main$72 from "./components/table-editor/table-editor.js";
57
+ import _sfc_main$72 from "./components/table/table.js";
58
+ import _sfc_main$73 from "./components/table-editor/table-editor.js";
59
59
  import _sfc_main$14 from "./components/check-tag/check-tag.js";
60
60
  import _sfc_main$22 from "./components/contextmenu/contextmenu.js";
61
61
  import { contextmenu } from "./components/contextmenu/api.js";
62
- import _sfc_main$59 from "./components/password-input/password-input.js";
63
- import _sfc_main$54 from "./components/number/number.js";
62
+ import _sfc_main$60 from "./components/password-input/password-input.js";
63
+ import _sfc_main$55 from "./components/number/number.js";
64
64
  import _sfc_main$26 from "./components/dialog/dialog.js";
65
65
  import _sfc_main$31 from "./components/expression-editor/expression-editor.js";
66
- import _sfc_main$83 from "./components/watermark/watermark.js";
67
- import _sfc_main$41 from "./components/kbd/kbd.js";
68
- import _sfc_main$60 from "./components/pop-confirm/pop-confirm.js";
66
+ import _sfc_main$84 from "./components/watermark/watermark.js";
67
+ import _sfc_main$42 from "./components/kbd/kbd.js";
68
+ import _sfc_main$61 from "./components/pop-confirm/pop-confirm.js";
69
69
  import _sfc_main from "./components/action/action.js";
70
70
  import action_group_default from "./components/action/action-group.js";
71
71
  import _sfc_main$3 from "./components/batch-edit/batch-edit.js";
72
72
  import { defineBatchEditColumns } from "./components/batch-edit/helper.js";
73
- import _sfc_main$78 from "./components/textarea/textarea.js";
73
+ import _sfc_main$79 from "./components/textarea/textarea.js";
74
74
  import _sfc_main$13 from "./components/cascade/cascade.js";
75
- import _sfc_main$69 from "./components/steps/steps.js";
75
+ import _sfc_main$70 from "./components/steps/steps.js";
76
76
  import _sfc_main$24 from "./components/date-picker/date-picker.js";
77
- import _sfc_main$58 from "./components/palette/palette.js";
78
- import _sfc_main$79 from "./components/theme/theme.js";
79
- import _sfc_main$49 from "./components/multi-tree-select/multi-tree-select.js";
77
+ import _sfc_main$59 from "./components/palette/palette.js";
78
+ import _sfc_main$80 from "./components/theme/theme.js";
79
+ import _sfc_main$50 from "./components/multi-tree-select/multi-tree-select.js";
80
80
  import _sfc_main$39 from "./components/group-input/group-input.js";
81
- import _sfc_main$43 from "./components/list/list.js";
82
- import _sfc_main$44 from "./components/list/list-item.js";
83
- import _sfc_main$65 from "./components/rich-text-editor/rich-text-editor.js";
84
- import _sfc_main$51 from "./components/nav/nav-item.js";
85
- import _sfc_main$52 from "./components/nav/nav-sub.js";
86
- import _sfc_main$50 from "./components/nav/nav.js";
81
+ import _sfc_main$44 from "./components/list/list.js";
82
+ import _sfc_main$45 from "./components/list/list-item.js";
83
+ import _sfc_main$66 from "./components/rich-text-editor/rich-text-editor.js";
84
+ import _sfc_main$52 from "./components/nav/nav-item.js";
85
+ import _sfc_main$53 from "./components/nav/nav-sub.js";
86
+ import _sfc_main$51 from "./components/nav/nav.js";
87
87
  import _sfc_main$29 from "./components/dual-nav/dual-nav.js";
88
+ import _sfc_main$40 from "./components/group-nav/group-nav.js";
88
89
  import _sfc_main$37 from "./components/grid-input/grid-input.js";
89
- import _sfc_main$70 from "./components/switch/switch.js";
90
- import _sfc_main$64 from "./components/radio-group/radio-group.js";
90
+ import _sfc_main$71 from "./components/switch/switch.js";
91
+ import _sfc_main$65 from "./components/radio-group/radio-group.js";
91
92
  import _sfc_main$17 from "./components/checkbox-group/checkbox-group.js";
92
93
  import _sfc_main$33 from "./components/file-viewer/file-viewer.js";
93
- import _sfc_main$77 from "./components/text/text.js";
94
+ import _sfc_main$78 from "./components/text/text.js";
94
95
  import _sfc_main$4 from "./components/breadcrumb/breadcrumb.js";
95
- import _sfc_main$57 from "./components/paginator/paginator.js";
96
+ import _sfc_main$58 from "./components/paginator/paginator.js";
96
97
  import _sfc_main$34 from "./components/float-button/float-button.js";
97
98
  import _sfc_main$2 from "./components/badge/badge.js";
98
- export { MessageConfirm, Notification, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UIcon, input_default as UInput, _sfc_main$41 as UKbd, _sfc_main$42 as ULayout, _sfc_main$43 as UList, _sfc_main$44 as UListItem, _sfc_main$45 as ULoading, _sfc_main$46 as UMessage, _sfc_main$47 as UMessageConfirm, _sfc_main$48 as UMultiSelect, _sfc_main$49 as UMultiTreeSelect, _sfc_main$50 as UNav, _sfc_main$51 as UNavItem, _sfc_main$52 as UNavSub, NodeRender as UNodeRender, _sfc_main$53 as UNotification, _sfc_main$54 as UNumber, _sfc_main$55 as UNumberInput, _sfc_main$56 as UNumberRangeInput, _sfc_main$57 as UPaginator, _sfc_main$58 as UPalette, _sfc_main$59 as UPasswordInput, _sfc_main$60 as UPopConfirm, _sfc_main$61 as UProgress, _sfc_main$62 as UProgressNodes, _sfc_main$63 as URadio, _sfc_main$64 as URadioGroup, _sfc_main$65 as URichTextEditor, _sfc_main$66 as UScroll, _sfc_main$67 as USelect, _sfc_main$68 as USlider, _sfc_main$69 as USteps, _sfc_main$70 as USwitch, _sfc_main$71 as UTable, _sfc_main$72 as UTableEditor, _sfc_main$73 as UTabs, _sfc_main$74 as UTabsHorizontal, _sfc_main$75 as UTabsVertical, _sfc_main$76 as UTag, _sfc_main$77 as UText, _sfc_main$78 as UTextarea, _sfc_main$79 as UTheme, _sfc_main$80 as UTip, _sfc_main$81 as UTree, _sfc_main$82 as UTreeSelect, _sfc_main$83 as UWatermark, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, vLoading };
99
+ export { MessageConfirm, Notification, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, input_default as UInput, _sfc_main$42 as UKbd, _sfc_main$43 as ULayout, _sfc_main$44 as UList, _sfc_main$45 as UListItem, _sfc_main$46 as ULoading, _sfc_main$47 as UMessage, _sfc_main$48 as UMessageConfirm, _sfc_main$49 as UMultiSelect, _sfc_main$50 as UMultiTreeSelect, _sfc_main$51 as UNav, _sfc_main$52 as UNavItem, _sfc_main$53 as UNavSub, NodeRender as UNodeRender, _sfc_main$54 as UNotification, _sfc_main$55 as UNumber, _sfc_main$56 as UNumberInput, _sfc_main$57 as UNumberRangeInput, _sfc_main$58 as UPaginator, _sfc_main$59 as UPalette, _sfc_main$60 as UPasswordInput, _sfc_main$61 as UPopConfirm, _sfc_main$62 as UProgress, _sfc_main$63 as UProgressNodes, _sfc_main$64 as URadio, _sfc_main$65 as URadioGroup, _sfc_main$66 as URichTextEditor, _sfc_main$67 as UScroll, _sfc_main$68 as USelect, _sfc_main$69 as USlider, _sfc_main$70 as USteps, _sfc_main$71 as USwitch, _sfc_main$72 as UTable, _sfc_main$73 as UTableEditor, _sfc_main$74 as UTabs, _sfc_main$75 as UTabsHorizontal, _sfc_main$76 as UTabsVertical, _sfc_main$77 as UTag, _sfc_main$78 as UText, _sfc_main$79 as UTextarea, _sfc_main$80 as UTheme, _sfc_main$81 as UTip, _sfc_main$82 as UTree, _sfc_main$83 as UTreeSelect, _sfc_main$84 as UWatermark, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, vLoading };
package/dist/style.js CHANGED
@@ -46,6 +46,7 @@ import "./components/list/style.js";
46
46
  import "./components/loading/style.js";
47
47
  import "./components/nav/style.js";
48
48
  import "./components/dual-nav/style.js";
49
+ import "./components/group-nav/style.js";
49
50
  import "./components/message-confirm/style.js";
50
51
  import "./components/message/style.js";
51
52
  import "./components/multi-select/style.js";
@@ -2,6 +2,8 @@ import { NavItem } from "./nav.js";
2
2
  import { DeconstructValue } from "@veltra/utils";
3
3
 
4
4
  //#region src/types/dual-nav.d.ts
5
+ /** 双栏导航左轨变体 */
6
+ type DualNavRailVariant = 'icon' | 'labeled';
5
7
  /** 双栏导航根级应用项;`description` 在左轨 tooltip 与右栏顶部展示 */
6
8
  interface DualNavRootItem extends NavItem {
7
9
  /** 子导航 */
@@ -13,6 +15,12 @@ interface DualNavProps {
13
15
  currentPath?: string;
14
16
  /** 根级应用导航列表 */
15
17
  menus?: DualNavRootItem[];
18
+ /**
19
+ * 左轨变体
20
+ * - `icon`:仅图标(默认)
21
+ * - `labeled`:加宽左轨,图标下方显示菜单名称(最多 4 个字)
22
+ */
23
+ railVariant?: DualNavRailVariant;
16
24
  }
17
25
  /** 双栏导航组件定义的事件 */
18
26
  interface DualNavEmits {
@@ -23,5 +31,5 @@ interface _DualNavExposed {}
23
31
  /** 双栏导航组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
24
32
  type DualNavExposed = DeconstructValue<_DualNavExposed>;
25
33
  //#endregion
26
- export { DualNavEmits, DualNavExposed, DualNavProps, DualNavRootItem, _DualNavExposed };
34
+ export { DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, _DualNavExposed };
27
35
  //# sourceMappingURL=dual-nav.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { NavItem } from "./nav.js";
2
+
3
+ //#region src/types/group-nav.d.ts
4
+ /** 分组:标题 + 叶子菜单 */
5
+ interface GroupNavGroup {
6
+ title: string;
7
+ children: NavItem[];
8
+ }
9
+ /** 分组导航组件属性 */
10
+ interface GroupNavProps {
11
+ /** 当前路径 */
12
+ currentPath?: string;
13
+ /** 分组列表(每组仅渲染一层叶子,更深嵌套舍弃) */
14
+ groups?: GroupNavGroup[];
15
+ }
16
+ /** 分组导航组件定义的事件 */
17
+ interface GroupNavEmits {
18
+ (e: 'item-click', item: NavItem): void;
19
+ }
20
+ //#endregion
21
+ export { GroupNavEmits, GroupNavGroup, GroupNavProps };
22
+ //# sourceMappingURL=group-nav.d.ts.map
@@ -47,7 +47,8 @@ import { TextEmits, TextExposed, TextProps, _TextExposed } from "./text.js";
47
47
  import { CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps } from "./checkbox-group.js";
48
48
  import { TableEditorEmits, TableEditorExposed, TableEditorProps, _TableEditorExposed } from "./table-editor.js";
49
49
  import { NavEmits, NavExposed, NavItem, NavProps, _NavExposed } from "./nav.js";
50
- import { DualNavEmits, DualNavExposed, DualNavProps, DualNavRootItem, _DualNavExposed } from "./dual-nav.js";
50
+ import { DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, _DualNavExposed } from "./dual-nav.js";
51
+ import { GroupNavEmits, GroupNavGroup, GroupNavProps } from "./group-nav.js";
51
52
  import { PasswordInputEmits, PasswordInputExposed, PasswordInputProps, _PasswordInputExposed } from "./password-input.js";
52
53
  import { DatePickerEmits, DatePickerExposed, DatePickerProps, _DatePickerExposed } from "./date-picker.js";
53
54
  import { DropdownEmits, DropdownExposed, DropdownProps, _DropdownExposed } from "./dropdown.js";
@@ -82,7 +83,7 @@ export type * from "@veltra/utils";
82
83
 
83
84
  //#region src/types/index.d.ts
84
85
  declare namespace index_d_exports {
85
- export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditFormStatus, BatchEditProps, BatchEditSlots, BatchEditStates, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormEmits, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, IconEmits, IconExposed, IconProps, InputEmits, InputExposed, InputProps, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, NotificationEmits, NotificationExposed, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SelectEmits, SelectExposed, SelectProps, SliderEmits, SliderExposed, SliderProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, ToolbarItem, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AnimationExposed, _AutoCompleteExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _InputExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RichTextEditorExposed, _ScrollExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TipExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
86
+ export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditFormStatus, BatchEditProps, BatchEditSlots, BatchEditStates, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormEmits, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, GroupNavEmits, GroupNavGroup, GroupNavProps, IconEmits, IconExposed, IconProps, InputEmits, InputExposed, InputProps, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, NotificationEmits, NotificationExposed, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SelectEmits, SelectExposed, SelectProps, SliderEmits, SliderExposed, SliderProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, ToolbarItem, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AnimationExposed, _AutoCompleteExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _InputExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RichTextEditorExposed, _ScrollExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TipExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
86
87
  }
87
88
  import * as import__veltra_utils from "@veltra/utils";
88
89
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.2.32",
3
+ "version": "1.2.33",
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.32",
61
- "@veltra/directives": "1.2.32",
62
- "@veltra/icons": "1.2.32",
63
- "@veltra/styles": "1.2.32",
64
- "@veltra/utils": "1.2.32",
60
+ "@veltra/compositions": "1.2.33",
61
+ "@veltra/directives": "1.2.33",
62
+ "@veltra/icons": "1.2.33",
63
+ "@veltra/styles": "1.2.33",
64
+ "@veltra/utils": "1.2.33",
65
65
  "vue": ">=3.5.39"
66
66
  },
67
67
  "devDependencies": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <u-tip v-model:visible="tipVisible" direction="right" hide-arrow :disabled="tipSuppressed">
2
+ <u-tip v-model:visible="tipVisible" direction="right" hide-arrow :disabled="tipDisabled">
3
3
  <button
4
4
  type="button"
5
5
  v-ripple="!app.disabled"
@@ -15,6 +15,7 @@
15
15
  >
16
16
  <UNavIcon v-if="app.icon" :icon="app.icon" :class="cls.e('app-icon')" />
17
17
  <span v-else :class="cls.e('app-fallback')">{{ app.title[0] }}</span>
18
+ <span v-if="labeled" :class="cls.e('app-label')">{{ displayTitle }}</span>
18
19
  </button>
19
20
 
20
21
  <template #content>
@@ -31,7 +32,7 @@
31
32
  <script setup lang="ts">
32
33
  import { vRipple } from '@veltra/directives'
33
34
  import { bem } from '@veltra/utils'
34
- import { shallowRef } from 'vue'
35
+ import { computed, shallowRef } from 'vue'
35
36
 
36
37
  import type { DualNavRootItem } from '../../types'
37
38
  import UNavIcon from '../nav/nav-icon.vue'
@@ -41,7 +42,16 @@ defineOptions({ name: 'UDualNavApp' })
41
42
 
42
43
  const cls = bem('dual-nav')
43
44
 
44
- defineProps<{ app: DualNavRootItem; active: boolean; selected: boolean }>()
45
+ /** 左轨菜单名称最多展示字数 */
46
+ const LABEL_MAX_LENGTH = 4
47
+
48
+ const props = defineProps<{
49
+ app: DualNavRootItem
50
+ active: boolean
51
+ selected: boolean
52
+ /** 是否在图标下方显示菜单名称 */
53
+ labeled?: boolean
54
+ }>()
45
55
 
46
56
  const emit = defineEmits<{ click: [] }>()
47
57
 
@@ -49,6 +59,15 @@ const tipVisible = shallowRef(false)
49
59
  /** 点击后暂时禁用 hover 弹出,移出触发区后恢复 */
50
60
  const tipSuppressed = shallowRef(false)
51
61
 
62
+ const displayTitle = computed(() => props.app.title.slice(0, LABEL_MAX_LENGTH))
63
+
64
+ /** labeled 且标题未截断、无描述时,tooltip 无额外信息 */
65
+ const tipUnnecessary = computed(() => {
66
+ return !!props.labeled && props.app.title.length <= LABEL_MAX_LENGTH && !props.app.description
67
+ })
68
+
69
+ const tipDisabled = computed(() => tipSuppressed.value || tipUnnecessary.value)
70
+
52
71
  function handleClick() {
53
72
  tipSuppressed.value = true
54
73
  tipVisible.value = false
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="cls.b">
2
+ <div :class="[cls.b, railVariant === 'labeled' && cls.m('labeled')]">
3
3
  <div :class="cls.e('rail')">
4
4
  <DualNavApp
5
5
  v-for="app in menus"
@@ -7,6 +7,7 @@
7
7
  :app="app"
8
8
  :active="isAppActive(app)"
9
9
  :selected="isAppSelected(app)"
10
+ :labeled="railVariant === 'labeled'"
10
11
  @click="handleAppClick(app)"
11
12
  />
12
13
  </div>
@@ -72,7 +73,7 @@ import { findFirstLeaf, findRootApp } from './helper'
72
73
 
73
74
  defineOptions({ name: 'UDualNav' })
74
75
 
75
- const props = defineProps<DualNavProps>()
76
+ const props = withDefaults(defineProps<DualNavProps>(), { railVariant: 'icon' })
76
77
  const emit = defineEmits<DualNavEmits>()
77
78
 
78
79
  const cls = bem('dual-nav')
@@ -2,7 +2,9 @@
2
2
  @use 'pkg:@veltra/styles/functions' as fn;
3
3
  @use 'pkg:@veltra/styles/vars';
4
4
 
5
- @include m.b(dual-nav) {
5
+ $root-name: dual-nav;
6
+
7
+ @include m.b($root-name) {
6
8
  display: flex;
7
9
  height: 100%;
8
10
  min-height: 0;
@@ -21,6 +23,23 @@
21
23
  background-color: fn.use-var(bg-color, middle);
22
24
  }
23
25
 
26
+ @include m.m(labeled) {
27
+ @include m.bem($root-name, rail) {
28
+ width: var(--u-nav-rail-labeled-width);
29
+ padding: 8px 4px;
30
+ gap: 2px;
31
+ }
32
+
33
+ @include m.bem($root-name, app) {
34
+ aspect-ratio: auto;
35
+ max-width: none;
36
+ flex-direction: column;
37
+ gap: 2px;
38
+ padding: 6px 2px;
39
+ min-height: 0;
40
+ }
41
+ }
42
+
24
43
  @include m.e(divider) {
25
44
  flex-shrink: 0;
26
45
  width: 1px;
@@ -164,6 +183,16 @@
164
183
  line-height: 1;
165
184
  }
166
185
 
186
+ @include m.e(app-label) {
187
+ max-width: 100%;
188
+ overflow: hidden;
189
+ text-overflow: ellipsis;
190
+ white-space: nowrap;
191
+ font-size: fn.use-var(font-size-assist, default);
192
+ line-height: 1.2;
193
+ text-align: center;
194
+ }
195
+
167
196
  @include m.e(app-tip) {
168
197
  display: flex;
169
198
  flex-direction: column;
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <li
3
+ :class="[cls.e('item'), bem.is('active', active), bem.is('disabled', item.disabled ?? false)]"
4
+ @click="handleClick"
5
+ >
6
+ <NavIcon v-if="item.icon" :icon="item.icon" :class="cls.e('icon')" />
7
+
8
+ <span :class="cls.e('item-title')">
9
+ {{ item.title }}
10
+ </span>
11
+ </li>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { bem } from '@veltra/utils'
16
+
17
+ import type { NavItem } from '../../types/nav'
18
+ import NavIcon from '../nav/nav-icon.vue'
19
+
20
+ defineOptions({ name: 'UGroupNavItem' })
21
+
22
+ const props = defineProps<{ item: NavItem; active: boolean }>()
23
+
24
+ const emit = defineEmits<{ (e: 'click', item: NavItem): void }>()
25
+
26
+ const cls = bem('group-nav')
27
+
28
+ function handleClick() {
29
+ if (props.item.disabled) return
30
+ emit('click', props.item)
31
+ }
32
+ </script>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <u-scroll tag="ul" :class="cls.b" :container-class="cls.e('container')">
3
+ <li v-for="(group, index) of groups" :key="group.title || index" :class="cls.e('group')">
4
+ <div :class="cls.e('group-label')">{{ group.title }}</div>
5
+ <ul :class="cls.e('group-list')">
6
+ <GroupNavItem
7
+ v-for="(child, childIndex) of group.children"
8
+ :key="child.path || childIndex"
9
+ :item="child"
10
+ :active="currentPath === child.path"
11
+ @click="handleItemClick"
12
+ />
13
+ </ul>
14
+ </li>
15
+ </u-scroll>
16
+ </template>
17
+
18
+ <script lang="ts" setup>
19
+ import { bem } from '@veltra/utils'
20
+
21
+ import type { GroupNavEmits, GroupNavProps } from '../../types/group-nav'
22
+ import type { NavItem } from '../../types/nav'
23
+ import { UScroll } from '../scroll'
24
+ import GroupNavItem from './group-nav-item.vue'
25
+
26
+ defineOptions({ name: 'UGroupNav' })
27
+
28
+ defineProps<GroupNavProps>()
29
+ const emit = defineEmits<GroupNavEmits>()
30
+
31
+ const cls = bem('group-nav')
32
+
33
+ function handleItemClick(item: NavItem) {
34
+ emit('item-click', item)
35
+ }
36
+ </script>
@@ -0,0 +1 @@
1
+ export { default as UGroupNav } from './group-nav.vue'
@@ -0,0 +1,121 @@
1
+ @use 'pkg:@veltra/styles/mixins' as m;
2
+ @use 'pkg:@veltra/styles/functions' as fn;
3
+ @use 'pkg:@veltra/styles/vars';
4
+
5
+ @include m.b(group-nav) {
6
+ margin: 0;
7
+ padding: 0;
8
+ user-select: none;
9
+ color: var(--u-nav-color);
10
+ background-color: var(--u-nav-bg-color);
11
+ backdrop-filter: fn.use-var(bg-filter);
12
+ -webkit-backdrop-filter: fn.use-var(bg-filter);
13
+ background-image: var(--u-nav-bg-image);
14
+ background-size: cover;
15
+ background-repeat: no-repeat;
16
+ border: 1px solid fn.use-var(border, color);
17
+ border-radius: calc(fn.use-var(radius, large) + 6px);
18
+ box-shadow:
19
+ 0 1px 2px rgba(15, 23, 42, 0.05),
20
+ 0 12px 28px rgba(15, 23, 42, 0.08);
21
+
22
+ @include m.e(container) {
23
+ padding: 8px;
24
+ }
25
+
26
+ @include m.e(group, group-list, item) {
27
+ list-style: none;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ // 组与组之间统一间距(仅 groups,无独立叶子)
33
+ @include m.e(group) {
34
+ & + & {
35
+ margin-top: 16px;
36
+ }
37
+ }
38
+
39
+ @include m.e(group-label) {
40
+ padding: 0 8px 6px;
41
+ font-size: fn.use-var(font-size-assist, default);
42
+ font-weight: 500;
43
+ line-height: 1.4;
44
+ letter-spacing: 0.02em;
45
+ color: fn.use-var(text-color, second);
46
+ }
47
+
48
+ @include m.e(group-list) {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 3px;
52
+ }
53
+
54
+ @include m.e(item) {
55
+ width: 100%;
56
+ min-height: var(--u-nav-height-default);
57
+ margin: 0;
58
+ padding: 0 8px;
59
+ gap: 8px;
60
+ cursor: pointer;
61
+ color: inherit;
62
+ border-radius: calc(fn.use-var(radius, default) + 4px);
63
+ transition:
64
+ background-color 0.15s ease,
65
+ color 0.15s ease;
66
+
67
+ @include m.flex;
68
+
69
+ &:hover {
70
+ background-color: var(--u-nav-hover-bg);
71
+ color: var(--u-nav-hover-color);
72
+ }
73
+
74
+ @include m.is(active) {
75
+ position: relative;
76
+ background-color: var(--u-nav-active-bg);
77
+ color: var(--u-nav-active-color);
78
+
79
+ &::before {
80
+ content: '';
81
+ position: absolute;
82
+ left: 0;
83
+ top: 50%;
84
+ width: 3px;
85
+ height: 56%;
86
+ min-height: 10px;
87
+ border-radius: 9999px;
88
+ background-color: fn.use-var(color, primary);
89
+ transform: translateY(-50%);
90
+ pointer-events: none;
91
+ }
92
+ }
93
+
94
+ @include m.is(disabled) {
95
+ opacity: 0.55;
96
+ cursor: not-allowed;
97
+ }
98
+ }
99
+
100
+ @include m.e(icon) {
101
+ width: 16px;
102
+ height: 16px;
103
+ font-size: 16px;
104
+ flex-shrink: 0;
105
+ display: inline-flex;
106
+ justify-content: center;
107
+ align-items: center;
108
+ border-radius: calc(fn.use-var(radius, small) + 2px);
109
+ color: inherit;
110
+ object-fit: contain;
111
+ }
112
+
113
+ @include m.e(item-title) {
114
+ flex: 1;
115
+ min-width: 0;
116
+ font-size: fn.use-var(font-size-main, default);
117
+ font-weight: 500;
118
+ letter-spacing: 0.01em;
119
+ @include m.ellipsis;
120
+ }
121
+ }
@@ -0,0 +1,3 @@
1
+ import '../nav/style'
2
+ import '../scroll/style'
3
+ import './style.scss'
@@ -112,6 +112,8 @@ export * from './nav'
112
112
 
113
113
  export * from './dual-nav'
114
114
 
115
+ export * from './group-nav'
116
+
115
117
  export * from './grid-input'
116
118
 
117
119
  export * from './switch'
package/src/style.ts CHANGED
@@ -38,6 +38,7 @@ import './components/layout/style'
38
38
  import './components/list/style'
39
39
  import './components/loading/style'
40
40
  import './components/dual-nav/style'
41
+ import './components/group-nav/style'
41
42
  import './components/nav/style'
42
43
  import './components/message-confirm/style'
43
44
  import './components/message/style'