@robot-admin/naive-ui-components 0.25.0 → 0.27.0

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 (177) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -9
  3. package/README_EN.md +6 -8
  4. package/dist/C_Form.base.css +31 -13
  5. package/dist/C_Form.css +31 -13
  6. package/dist/C_Form.d.cts +3 -2
  7. package/dist/C_Form.d.ts +3 -19
  8. package/dist/C_FormModal.d.cts +1 -1
  9. package/dist/C_FormModal.d.ts +2 -17
  10. package/dist/C_FormSearch.css +79 -79
  11. package/dist/C_FormSearch.d.cts +2 -1
  12. package/dist/C_FormSearch.d.ts +2 -2
  13. package/dist/C_FormulaEditor.d.cts +1 -1
  14. package/dist/C_FormulaEditor.d.ts +1 -1
  15. package/dist/C_Guide.d.cts +1 -1
  16. package/dist/C_Guide.d.ts +1 -1
  17. package/dist/C_Icon.d.cts +1 -1
  18. package/dist/C_Icon.d.ts +1 -1
  19. package/dist/C_Language.d.cts +1 -1
  20. package/dist/C_Language.d.ts +1 -1
  21. package/dist/C_Loading.d.cts +1 -1
  22. package/dist/C_Loading.d.ts +1 -1
  23. package/dist/C_Login.d.cts +1 -1
  24. package/dist/C_Login.d.ts +1 -1
  25. package/dist/C_Markdown.d.cts +1 -1
  26. package/dist/C_Markdown.d.ts +1 -1
  27. package/dist/C_Menu.d.ts +1 -1
  28. package/dist/C_OrgChart.d.cts +1 -1
  29. package/dist/C_OrgChart.d.ts +1 -1
  30. package/dist/C_Progress.d.cts +1 -1
  31. package/dist/C_Progress.d.ts +1 -1
  32. package/dist/C_SectionNav.d.cts +1 -1
  33. package/dist/C_SectionNav.d.ts +1 -1
  34. package/dist/C_Skeleton.d.cts +1 -1
  35. package/dist/C_Skeleton.d.ts +1 -1
  36. package/dist/C_Steps.d.cts +1 -1
  37. package/dist/C_Steps.d.ts +1 -1
  38. package/dist/C_Table.base.css +140 -135
  39. package/dist/C_Table.css +109 -122
  40. package/dist/C_Table.d.cts +1 -1
  41. package/dist/C_Table.d.ts +7 -5
  42. package/dist/C_Table2.cjs +3 -3
  43. package/dist/C_Table2.js +3 -3
  44. package/dist/C_TagsView.d.cts +1 -1
  45. package/dist/C_TagsView.d.ts +1 -1
  46. package/dist/C_Theme.d.cts +1 -1
  47. package/dist/C_Theme.d.ts +1 -1
  48. package/dist/C_Timeline.d.cts +1 -1
  49. package/dist/C_Timeline.d.ts +1 -1
  50. package/dist/C_Transfer.d.cts +1 -1
  51. package/dist/C_Transfer.d.ts +1 -1
  52. package/dist/C_Tree.d.cts +1 -1
  53. package/dist/C_Tree.d.ts +7 -5
  54. package/dist/C_Upload.d.cts +1 -1
  55. package/dist/C_Upload.d.ts +1 -1
  56. package/dist/config.cjs +1 -1
  57. package/dist/config.d.cts +1 -4
  58. package/dist/config.d.ts +1 -4
  59. package/dist/config.js +1 -1
  60. package/dist/constants.d.cts +1 -1
  61. package/dist/constants.d.ts +1 -1
  62. package/dist/constants2.d.cts +173 -402
  63. package/dist/constants2.d.ts +173 -402
  64. package/dist/constants3.d.cts +3 -3
  65. package/dist/constants3.d.ts +3 -3
  66. package/dist/constants4.d.cts +402 -173
  67. package/dist/constants4.d.ts +402 -173
  68. package/dist/constants5.d.cts +4 -4
  69. package/dist/constants5.d.ts +4 -4
  70. package/dist/data.cjs +1 -1
  71. package/dist/data.d.cts +1 -2
  72. package/dist/data.d.ts +1 -2
  73. package/dist/data.js +1 -1
  74. package/dist/data2.d.cts +10 -10
  75. package/dist/data2.d.ts +10 -10
  76. package/dist/dateRange.d.cts +3 -2
  77. package/dist/dateRange.d.ts +3 -2
  78. package/dist/helpers.cjs +1 -1
  79. package/dist/helpers.js +1 -1
  80. package/dist/index.cjs +1 -1
  81. package/dist/index.d.cts +34 -34
  82. package/dist/index.d.ts +41 -42
  83. package/dist/index.js +1 -1
  84. package/dist/index.vue.d.cts +4 -4
  85. package/dist/index.vue.d.ts +4 -4
  86. package/dist/index10.vue.d.cts +4 -4
  87. package/dist/index10.vue.d.ts +3 -3
  88. package/dist/index11.vue.d.cts +3 -3
  89. package/dist/index11.vue.d.ts +7 -6
  90. package/dist/index12.vue.d.cts +7 -6
  91. package/dist/index13.vue.d.ts +5 -5
  92. package/dist/index14.vue.d.cts +5 -5
  93. package/dist/index15.vue.d.ts +52 -54
  94. package/dist/index16.vue.d.cts +52 -54
  95. package/dist/index16.vue.d.ts +125 -13
  96. package/dist/index17.vue.d.cts +125 -13
  97. package/dist/index17.vue.d.ts +51 -123
  98. package/dist/index18.vue.d.cts +51 -123
  99. package/dist/index18.vue.d.ts +26 -47
  100. package/dist/index19.vue.d.cts +26 -47
  101. package/dist/index19.vue.d.ts +13 -38
  102. package/dist/index20.vue.d.cts +13 -38
  103. package/dist/index20.vue.d.ts +128 -11
  104. package/dist/index21.vue.d.cts +128 -11
  105. package/dist/index21.vue.d.ts +75 -25
  106. package/dist/index22.vue.d.cts +75 -25
  107. package/dist/index22.vue.d.ts +72 -78
  108. package/dist/index23.vue.d.cts +97 -75
  109. package/dist/index23.vue.d.ts +96 -68
  110. package/dist/index24.vue.d.cts +47 -89
  111. package/dist/index24.vue.d.ts +47 -89
  112. package/dist/index25.vue.d.cts +19 -127
  113. package/dist/index25.vue.d.ts +19 -127
  114. package/dist/index26.vue.d.cts +87 -94
  115. package/dist/index26.vue.d.ts +87 -94
  116. package/dist/index27.vue.d.cts +36 -66
  117. package/dist/index27.vue.d.ts +36 -66
  118. package/dist/index28.vue.d.cts +12 -96
  119. package/dist/index28.vue.d.ts +12 -96
  120. package/dist/index29.vue.d.cts +85 -94
  121. package/dist/index29.vue.d.ts +85 -94
  122. package/dist/index3.vue.d.cts +3 -3
  123. package/dist/index3.vue.d.ts +3 -3
  124. package/dist/index30.vue.d.cts +103 -21
  125. package/dist/index30.vue.d.ts +103 -21
  126. package/dist/index31.vue.d.cts +75 -0
  127. package/dist/index31.vue.d.ts +75 -0
  128. package/dist/index5.vue.d.cts +3 -3
  129. package/dist/index7.vue.d.ts +1 -1
  130. package/dist/index8.vue.d.cts +1 -1
  131. package/dist/index9.vue.d.ts +4 -4
  132. package/dist/mapUtils.d.cts +4 -4
  133. package/dist/mapUtils.d.ts +4 -4
  134. package/dist/options.cjs +1 -0
  135. package/dist/options.d.cts +9 -0
  136. package/dist/options.js +1 -0
  137. package/dist/serializeSearch.cjs +1 -1
  138. package/dist/serializeSearch.js +1 -1
  139. package/dist/style.css +219 -214
  140. package/dist/useCollapsePanel.d.cts +4 -4
  141. package/dist/useCollapsePanel.d.ts +4 -4
  142. package/dist/useComponentLocale.cjs +1 -1
  143. package/dist/useComponentLocale.js +1 -1
  144. package/dist/useCropperCore.d.cts +6 -6
  145. package/dist/useCropperCore.d.ts +6 -6
  146. package/dist/useDynamicFormState.d.cts +12 -970
  147. package/dist/useDynamicFormState.d.ts +12 -960
  148. package/dist/useEdgeInteraction.d.cts +1 -1
  149. package/dist/useEdgeInteraction.d.ts +1 -1
  150. package/dist/useFormConfig.d.cts +5 -5
  151. package/dist/useFormConfig.d.ts +13 -6
  152. package/dist/useFullscreen.d.cts +2 -2
  153. package/dist/useFullscreen.d.ts +2 -2
  154. package/dist/useInfiniteScroll.d.cts +1 -1
  155. package/dist/useInfiniteScroll.d.ts +1 -1
  156. package/dist/useQRCode.d.cts +4 -4
  157. package/dist/useQRCode.d.ts +4 -4
  158. package/dist/useSignatureHistory.d.cts +4 -4
  159. package/dist/useSignatureHistory.d.ts +4 -4
  160. package/dist/useSplitResize.d.cts +7 -7
  161. package/dist/useSplitResize.d.ts +7 -7
  162. package/dist/useTableQuery.d.cts +899 -0
  163. package/dist/useTableQuery.d.ts +889 -0
  164. package/dist/useWorkflowValidation.d.cts +4 -4
  165. package/dist/useWorkflowValidation.d.ts +4 -4
  166. package/dist/verification.d.cts +2 -2
  167. package/dist/verification.d.ts +2 -2
  168. package/docs/guides/data-workflows.md +8 -38
  169. package/docs/guides/search-workflows.md +3 -5
  170. package/docs/guides/table-density.md +9 -1
  171. package/package.json +1 -1
  172. package/dist/dictionary.cjs +0 -1
  173. package/dist/dictionary.d.cts +0 -47
  174. package/dist/dictionary.d.ts +0 -47
  175. package/dist/dictionary.js +0 -1
  176. package/dist/useDictionary.cjs +0 -1
  177. package/dist/useDictionary.js +0 -1
@@ -1,103 +1,19 @@
1
1
  import * as vue from "vue";
2
2
 
3
- //#region src/components/C_Skeleton/types.d.ts
4
- /** 骨架屏预设模式 */
5
- type SkeletonPreset = 'text' | 'avatar' | 'card' | 'table' | 'form' | 'list' | 'detail' | 'image';
6
- /** 骨架屏动画类型 */
7
- type SkeletonAnimation = 'pulse' | 'wave' | false;
8
- /** 表格骨架配置 */
9
- interface SkeletonTableConfig {
10
- /** 行数 */
11
- rows?: number;
12
- /** 列数 */
13
- cols?: number;
14
- /** 是否显示表头 */
15
- showHeader?: boolean;
16
- /** 是否显示操作列 */
17
- showActions?: boolean;
18
- }
19
- /** 表单骨架配置 */
20
- interface SkeletonFormConfig {
21
- /** 字段数 */
22
- fields?: number;
23
- /** 每行列数 */
24
- cols?: number;
25
- /** 是否显示标签 */
26
- showLabel?: boolean;
27
- /** 是否显示操作按钮 */
28
- showActions?: boolean;
29
- }
30
- /** 列表骨架配置 */
31
- interface SkeletonListConfig {
32
- /** 列表项数 */
33
- items?: number;
34
- /** 是否显示头像 */
35
- showAvatar?: boolean;
36
- /** 描述行数 */
37
- descLines?: number;
38
- }
39
- /** 卡片骨架配置 */
40
- interface SkeletonCardConfig {
41
- /** 是否显示封面图 */
42
- showCover?: boolean;
43
- /** 标题行数 */
44
- titleLines?: number;
45
- /** 描述行数 */
46
- descLines?: number;
47
- /** 是否显示底部操作 */
48
- showFooter?: boolean;
49
- }
50
- /** 详情骨架配置 */
51
- interface SkeletonDetailConfig {
52
- /** 字段数 */
53
- fields?: number;
54
- /** 每个字段的值行数 */
55
- valueLines?: number;
56
- /** 是否显示头像 */
57
- showAvatar?: boolean;
58
- }
59
- /** C_Skeleton Props */
60
- interface SkeletonProps {
61
- /** 预设模式 */
62
- preset?: SkeletonPreset;
63
- /** 是否正在加载(true 显示骨架屏,false 显示插槽内容) */
64
- loading?: boolean;
65
- /** 动画类型 */
66
- animation?: SkeletonAnimation;
67
- /** 重复次数(用于 text/card/list 模式) */
68
- repeat?: number;
69
- /** 圆角大小 */
70
- borderRadius?: string;
71
- /** 表格配置 */
72
- table?: SkeletonTableConfig;
73
- /** 表单配置 */
74
- form?: SkeletonFormConfig;
75
- /** 列表配置 */
76
- list?: SkeletonListConfig;
77
- /** 卡片配置 */
78
- card?: SkeletonCardConfig;
79
- /** 详情配置 */
80
- detail?: SkeletonDetailConfig;
81
- }
3
+ //#region src/components/C_Theme/types.d.ts
4
+ type ThemeMode = 'system' | 'light' | 'dark';
82
5
  //#endregion
83
- //#region src/components/C_Skeleton/index.vue.d.ts
84
- declare var __VLS_1: {};
85
- type __VLS_Slots = {} & {
86
- default?: (props: typeof __VLS_1) => any;
6
+ //#region src/components/C_Theme/index.vue.d.ts
7
+ type __VLS_Props = {
8
+ modelValue?: ThemeMode;
87
9
  };
88
- declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
- loading: boolean;
90
- repeat: number;
91
- borderRadius: string;
92
- animation: SkeletonAnimation;
93
- preset: SkeletonPreset;
10
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
11
+ "update:modelValue": (mode: ThemeMode) => any;
12
+ }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((mode: ThemeMode) => any) | undefined;
14
+ }>, {
15
+ modelValue: ThemeMode;
94
16
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
96
17
  declare const _default: typeof __VLS_export;
97
- type __VLS_WithSlots<T, S> = T & {
98
- new (): {
99
- $slots: S;
100
- };
101
- };
102
18
  //#endregion
103
- export { SkeletonFormConfig as a, SkeletonProps as c, SkeletonDetailConfig as i, SkeletonTableConfig as l, SkeletonAnimation as n, SkeletonListConfig as o, SkeletonCardConfig as r, SkeletonPreset as s, _default as t };
19
+ export { ThemeMode as n, _default as t };
@@ -1,103 +1,19 @@
1
1
  import * as vue from "vue";
2
2
 
3
- //#region src/components/C_Skeleton/types.d.ts
4
- /** 骨架屏预设模式 */
5
- type SkeletonPreset = 'text' | 'avatar' | 'card' | 'table' | 'form' | 'list' | 'detail' | 'image';
6
- /** 骨架屏动画类型 */
7
- type SkeletonAnimation = 'pulse' | 'wave' | false;
8
- /** 表格骨架配置 */
9
- interface SkeletonTableConfig {
10
- /** 行数 */
11
- rows?: number;
12
- /** 列数 */
13
- cols?: number;
14
- /** 是否显示表头 */
15
- showHeader?: boolean;
16
- /** 是否显示操作列 */
17
- showActions?: boolean;
18
- }
19
- /** 表单骨架配置 */
20
- interface SkeletonFormConfig {
21
- /** 字段数 */
22
- fields?: number;
23
- /** 每行列数 */
24
- cols?: number;
25
- /** 是否显示标签 */
26
- showLabel?: boolean;
27
- /** 是否显示操作按钮 */
28
- showActions?: boolean;
29
- }
30
- /** 列表骨架配置 */
31
- interface SkeletonListConfig {
32
- /** 列表项数 */
33
- items?: number;
34
- /** 是否显示头像 */
35
- showAvatar?: boolean;
36
- /** 描述行数 */
37
- descLines?: number;
38
- }
39
- /** 卡片骨架配置 */
40
- interface SkeletonCardConfig {
41
- /** 是否显示封面图 */
42
- showCover?: boolean;
43
- /** 标题行数 */
44
- titleLines?: number;
45
- /** 描述行数 */
46
- descLines?: number;
47
- /** 是否显示底部操作 */
48
- showFooter?: boolean;
49
- }
50
- /** 详情骨架配置 */
51
- interface SkeletonDetailConfig {
52
- /** 字段数 */
53
- fields?: number;
54
- /** 每个字段的值行数 */
55
- valueLines?: number;
56
- /** 是否显示头像 */
57
- showAvatar?: boolean;
58
- }
59
- /** C_Skeleton Props */
60
- interface SkeletonProps {
61
- /** 预设模式 */
62
- preset?: SkeletonPreset;
63
- /** 是否正在加载(true 显示骨架屏,false 显示插槽内容) */
64
- loading?: boolean;
65
- /** 动画类型 */
66
- animation?: SkeletonAnimation;
67
- /** 重复次数(用于 text/card/list 模式) */
68
- repeat?: number;
69
- /** 圆角大小 */
70
- borderRadius?: string;
71
- /** 表格配置 */
72
- table?: SkeletonTableConfig;
73
- /** 表单配置 */
74
- form?: SkeletonFormConfig;
75
- /** 列表配置 */
76
- list?: SkeletonListConfig;
77
- /** 卡片配置 */
78
- card?: SkeletonCardConfig;
79
- /** 详情配置 */
80
- detail?: SkeletonDetailConfig;
81
- }
3
+ //#region src/components/C_Theme/types.d.ts
4
+ type ThemeMode = 'system' | 'light' | 'dark';
82
5
  //#endregion
83
- //#region src/components/C_Skeleton/index.vue.d.ts
84
- declare var __VLS_1: {};
85
- type __VLS_Slots = {} & {
86
- default?: (props: typeof __VLS_1) => any;
6
+ //#region src/components/C_Theme/index.vue.d.ts
7
+ type __VLS_Props = {
8
+ modelValue?: ThemeMode;
87
9
  };
88
- declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
- loading: boolean;
90
- repeat: number;
91
- borderRadius: string;
92
- animation: SkeletonAnimation;
93
- preset: SkeletonPreset;
10
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
11
+ "update:modelValue": (mode: ThemeMode) => any;
12
+ }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((mode: ThemeMode) => any) | undefined;
14
+ }>, {
15
+ modelValue: ThemeMode;
94
16
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
96
17
  declare const _default: typeof __VLS_export;
97
- type __VLS_WithSlots<T, S> = T & {
98
- new (): {
99
- $slots: S;
100
- };
101
- };
102
18
  //#endregion
103
- export { SkeletonFormConfig as a, SkeletonProps as c, SkeletonDetailConfig as i, SkeletonTableConfig as l, SkeletonAnimation as n, SkeletonListConfig as o, SkeletonCardConfig as r, SkeletonPreset as s, _default as t };
19
+ export { ThemeMode as n, _default as t };
@@ -1,105 +1,96 @@
1
+ import { i as TagItem } from "./types2.cjs";
1
2
  import * as vue from "vue";
3
+ import { Ref } from "vue";
2
4
 
3
- //#region src/components/C_OrgChart/types.d.ts
4
- /** 节点数据 */
5
- interface OrgChartNode {
6
- /** 唯一标识 */
7
- id: string | number;
8
- /** 节点标题(姓名/部门名) */
9
- label: string;
10
- /** 副标题(职位/描述) */
11
- subtitle?: string;
12
- /** 头像 URL */
13
- avatar?: string;
14
- /** 子节点 */
15
- children?: OrgChartNode[];
16
- /** 自定义 CSS 类 */
17
- className?: string;
18
- /** 节点是否默认折叠 */
19
- collapsed?: boolean;
20
- /** 节点额外数据(透传给插槽/事件) */
21
- data?: Record<string, unknown>;
5
+ //#region src/components/C_TagsView/useTagsView.d.ts
6
+ interface UseTagsViewOptions {
7
+ /** localStorage 持久化 key,传空字符串则不持久化 */
8
+ persistKey?: string;
9
+ /** 首页路径,用于 removeAll 后的回退 */
10
+ homePath?: string;
22
11
  }
23
- /** 布局方向 */
24
- type OrgChartDirection = 'vertical' | 'horizontal';
25
- /** 连线样式 */
26
- type OrgChartLineStyle = 'straight' | 'rounded' | 'stepped';
27
- /** C_OrgChart Props */
28
- interface OrgChartProps {
29
- /** 树形数据 */
30
- data: OrgChartNode;
31
- /** 布局方向 */
32
- direction?: OrgChartDirection;
33
- /** 连线样式 */
34
- lineStyle?: OrgChartLineStyle;
35
- /** 连线颜色 */
36
- lineColor?: string;
37
- /** 连线宽度(px) */
38
- lineWidth?: number;
39
- /** 节点间距(px) */
40
- nodeSpacing?: number;
41
- /** 层级间距(px) */
42
- levelSpacing?: number;
43
- /** 是否支持缩放 */
44
- zoomable?: boolean;
45
- /** 是否支持平移 */
46
- pannable?: boolean;
47
- /** 初始缩放比例 */
48
- initialZoom?: number;
49
- /** 首次渲染与数据、布局变化时适配完整树形范围。 */
50
- fitOnInit?: boolean;
51
- /** 最小缩放 */
52
- minZoom?: number;
53
- /** 最大缩放 */
54
- maxZoom?: number;
55
- /** 是否可折叠 */
56
- collapsible?: boolean;
12
+ /**
13
+ * 标签页管理 composable
14
+ *
15
+ * 独立于组件使用 — 可在任何地方管理标签状态
16
+ *
17
+ * @example 独立使用
18
+ * ```ts
19
+ * const tags = useTagsView({ persistKey: 'my-tags' })
20
+ * tags.addTag({ path: '/home', title: '首页', meta: { affix: true } })
21
+ * ```
22
+ */
23
+ declare function useTagsView(options?: UseTagsViewOptions): {
24
+ tagsViewList: Ref<TagItem[], TagItem[]>;
25
+ activeTag: Ref<string, string>;
26
+ homePath: string;
27
+ initTags: (tags?: TagItem[]) => void;
28
+ setActiveTag: (path: string) => void;
29
+ addTag: (tag: TagItem) => void;
30
+ removeTag: (index: number) => string | null;
31
+ removeOtherTags: (index: number) => void;
32
+ removeLeftTags: (index: number) => void;
33
+ removeRightTags: (index: number) => void;
34
+ removeAllTags: () => void;
35
+ };
36
+ //#endregion
37
+ //#region src/components/C_TagsView/types.d.ts
38
+ interface ContextMenuLabels {
39
+ close?: string;
40
+ closeOthers?: string;
41
+ closeLeft?: string;
42
+ closeRight?: string;
43
+ closeAll?: string;
57
44
  }
58
45
  //#endregion
59
- //#region src/components/C_OrgChart/index.vue.d.ts
60
- declare var __VLS_12: {
61
- node: OrgChartNode;
62
- isLeaf: boolean;
63
- isExpanded: boolean;
64
- };
65
- type __VLS_Slots = {} & {
66
- node?: (props: typeof __VLS_12) => any;
46
+ //#region src/components/C_TagsView/index.vue.d.ts
47
+ interface LegacyContextMenuLabels extends ContextMenuLabels {
48
+ close?: string;
49
+ closeOthers?: string;
50
+ closeLeft?: string;
51
+ closeRight?: string;
52
+ closeAll?: string;
53
+ }
54
+ type __VLS_Props = {
55
+ /**
56
+ * 标签文本格式化函数(用于 i18n)
57
+ */
58
+ labelFormatter?: (label: string) => string; /** 首页路径 */
59
+ homePath?: string; /** 首页标题(原始文本) */
60
+ homeTitle?: string; /** 首页图标 */
61
+ homeIcon?: string; /** 持久化 localStorage key,传空字符串禁用 */
62
+ persistKey?: string; /** 右键菜单文案(国际化适配) */
63
+ contextMenuLabels?: LegacyContextMenuLabels; /** useTagsView 配置项(优先级最高) */
64
+ tagsViewOptions?: UseTagsViewOptions;
67
65
  };
68
- declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
69
- zoomIn: () => void;
70
- zoomOut: () => void;
71
- resetView: () => void;
72
- fitView: () => Promise<void>;
73
- zoom: vue.Ref<number, number>;
66
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {
67
+ /** useTagsView composable 实例 */tags: {
68
+ tagsViewList: vue.Ref<TagItem[], TagItem[]>;
69
+ activeTag: vue.Ref<string, string>;
70
+ homePath: string;
71
+ initTags: (tags?: TagItem[]) => void;
72
+ setActiveTag: (path: string) => void;
73
+ addTag: (tag: TagItem) => void;
74
+ removeTag: (index: number) => string | null;
75
+ removeOtherTags: (index: number) => void;
76
+ removeLeftTags: (index: number) => void;
77
+ removeRightTags: (index: number) => void;
78
+ removeAllTags: () => void;
79
+ }; /** 滚动到指定标签 */
80
+ scrollToTag: (path: string) => void;
74
81
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
75
- "node-click": (node: OrgChartNode) => any;
76
- "node-expand": (node: OrgChartNode) => any;
77
- "node-collapse": (node: OrgChartNode) => any;
78
- }, string, vue.PublicProps, Readonly<OrgChartProps> & Readonly<{
79
- "onNode-click"?: ((node: OrgChartNode) => any) | undefined;
80
- "onNode-expand"?: ((node: OrgChartNode) => any) | undefined;
81
- "onNode-collapse"?: ((node: OrgChartNode) => any) | undefined;
82
+ close: (fallbackPath: string) => any;
83
+ closeAll: () => any;
84
+ }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
85
+ onClose?: ((fallbackPath: string) => any) | undefined;
86
+ onCloseAll?: (() => any) | undefined;
82
87
  }>, {
83
- direction: OrgChartDirection;
84
- lineColor: string;
85
- lineStyle: OrgChartLineStyle;
86
- lineWidth: number;
87
- nodeSpacing: number;
88
- levelSpacing: number;
89
- zoomable: boolean;
90
- pannable: boolean;
91
- initialZoom: number;
92
- fitOnInit: boolean;
93
- minZoom: number;
94
- maxZoom: number;
95
- collapsible: boolean;
88
+ homePath: string;
89
+ homeTitle: string;
90
+ homeIcon: string;
91
+ persistKey: string;
92
+ contextMenuLabels: LegacyContextMenuLabels;
96
93
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
97
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
98
94
  declare const _default: typeof __VLS_export;
99
- type __VLS_WithSlots<T, S> = T & {
100
- new (): {
101
- $slots: S;
102
- };
103
- };
104
95
  //#endregion
105
- export { OrgChartProps as a, OrgChartNode as i, OrgChartDirection as n, OrgChartLineStyle as r, _default as t };
96
+ export { useTagsView as i, ContextMenuLabels as n, UseTagsViewOptions as r, _default as t };
@@ -1,105 +1,96 @@
1
+ import { s as TagItem } from "./public.js";
1
2
  import * as vue from "vue";
3
+ import { Ref } from "vue";
2
4
 
3
- //#region src/components/C_OrgChart/types.d.ts
4
- /** 节点数据 */
5
- interface OrgChartNode {
6
- /** 唯一标识 */
7
- id: string | number;
8
- /** 节点标题(姓名/部门名) */
9
- label: string;
10
- /** 副标题(职位/描述) */
11
- subtitle?: string;
12
- /** 头像 URL */
13
- avatar?: string;
14
- /** 子节点 */
15
- children?: OrgChartNode[];
16
- /** 自定义 CSS 类 */
17
- className?: string;
18
- /** 节点是否默认折叠 */
19
- collapsed?: boolean;
20
- /** 节点额外数据(透传给插槽/事件) */
21
- data?: Record<string, unknown>;
5
+ //#region src/components/C_TagsView/useTagsView.d.ts
6
+ interface UseTagsViewOptions {
7
+ /** localStorage 持久化 key,传空字符串则不持久化 */
8
+ persistKey?: string;
9
+ /** 首页路径,用于 removeAll 后的回退 */
10
+ homePath?: string;
22
11
  }
23
- /** 布局方向 */
24
- type OrgChartDirection = 'vertical' | 'horizontal';
25
- /** 连线样式 */
26
- type OrgChartLineStyle = 'straight' | 'rounded' | 'stepped';
27
- /** C_OrgChart Props */
28
- interface OrgChartProps {
29
- /** 树形数据 */
30
- data: OrgChartNode;
31
- /** 布局方向 */
32
- direction?: OrgChartDirection;
33
- /** 连线样式 */
34
- lineStyle?: OrgChartLineStyle;
35
- /** 连线颜色 */
36
- lineColor?: string;
37
- /** 连线宽度(px) */
38
- lineWidth?: number;
39
- /** 节点间距(px) */
40
- nodeSpacing?: number;
41
- /** 层级间距(px) */
42
- levelSpacing?: number;
43
- /** 是否支持缩放 */
44
- zoomable?: boolean;
45
- /** 是否支持平移 */
46
- pannable?: boolean;
47
- /** 初始缩放比例 */
48
- initialZoom?: number;
49
- /** 首次渲染与数据、布局变化时适配完整树形范围。 */
50
- fitOnInit?: boolean;
51
- /** 最小缩放 */
52
- minZoom?: number;
53
- /** 最大缩放 */
54
- maxZoom?: number;
55
- /** 是否可折叠 */
56
- collapsible?: boolean;
12
+ /**
13
+ * 标签页管理 composable
14
+ *
15
+ * 独立于组件使用 — 可在任何地方管理标签状态
16
+ *
17
+ * @example 独立使用
18
+ * ```ts
19
+ * const tags = useTagsView({ persistKey: 'my-tags' })
20
+ * tags.addTag({ path: '/home', title: '首页', meta: { affix: true } })
21
+ * ```
22
+ */
23
+ declare function useTagsView(options?: UseTagsViewOptions): {
24
+ tagsViewList: Ref<TagItem[], TagItem[]>;
25
+ activeTag: Ref<string, string>;
26
+ homePath: string;
27
+ initTags: (tags?: TagItem[]) => void;
28
+ setActiveTag: (path: string) => void;
29
+ addTag: (tag: TagItem) => void;
30
+ removeTag: (index: number) => string | null;
31
+ removeOtherTags: (index: number) => void;
32
+ removeLeftTags: (index: number) => void;
33
+ removeRightTags: (index: number) => void;
34
+ removeAllTags: () => void;
35
+ };
36
+ //#endregion
37
+ //#region src/components/C_TagsView/types.d.ts
38
+ interface ContextMenuLabels {
39
+ close?: string;
40
+ closeOthers?: string;
41
+ closeLeft?: string;
42
+ closeRight?: string;
43
+ closeAll?: string;
57
44
  }
58
45
  //#endregion
59
- //#region src/components/C_OrgChart/index.vue.d.ts
60
- declare var __VLS_12: {
61
- node: OrgChartNode;
62
- isLeaf: boolean;
63
- isExpanded: boolean;
64
- };
65
- type __VLS_Slots = {} & {
66
- node?: (props: typeof __VLS_12) => any;
46
+ //#region src/components/C_TagsView/index.vue.d.ts
47
+ interface LegacyContextMenuLabels extends ContextMenuLabels {
48
+ close?: string;
49
+ closeOthers?: string;
50
+ closeLeft?: string;
51
+ closeRight?: string;
52
+ closeAll?: string;
53
+ }
54
+ type __VLS_Props = {
55
+ /**
56
+ * 标签文本格式化函数(用于 i18n)
57
+ */
58
+ labelFormatter?: (label: string) => string; /** 首页路径 */
59
+ homePath?: string; /** 首页标题(原始文本) */
60
+ homeTitle?: string; /** 首页图标 */
61
+ homeIcon?: string; /** 持久化 localStorage key,传空字符串禁用 */
62
+ persistKey?: string; /** 右键菜单文案(国际化适配) */
63
+ contextMenuLabels?: LegacyContextMenuLabels; /** useTagsView 配置项(优先级最高) */
64
+ tagsViewOptions?: UseTagsViewOptions;
67
65
  };
68
- declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
69
- zoomIn: () => void;
70
- zoomOut: () => void;
71
- resetView: () => void;
72
- fitView: () => Promise<void>;
73
- zoom: vue.Ref<number, number>;
66
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {
67
+ /** useTagsView composable 实例 */tags: {
68
+ tagsViewList: vue.Ref<TagItem[], TagItem[]>;
69
+ activeTag: vue.Ref<string, string>;
70
+ homePath: string;
71
+ initTags: (tags?: TagItem[]) => void;
72
+ setActiveTag: (path: string) => void;
73
+ addTag: (tag: TagItem) => void;
74
+ removeTag: (index: number) => string | null;
75
+ removeOtherTags: (index: number) => void;
76
+ removeLeftTags: (index: number) => void;
77
+ removeRightTags: (index: number) => void;
78
+ removeAllTags: () => void;
79
+ }; /** 滚动到指定标签 */
80
+ scrollToTag: (path: string) => void;
74
81
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
75
- "node-click": (node: OrgChartNode) => any;
76
- "node-expand": (node: OrgChartNode) => any;
77
- "node-collapse": (node: OrgChartNode) => any;
78
- }, string, vue.PublicProps, Readonly<OrgChartProps> & Readonly<{
79
- "onNode-click"?: ((node: OrgChartNode) => any) | undefined;
80
- "onNode-expand"?: ((node: OrgChartNode) => any) | undefined;
81
- "onNode-collapse"?: ((node: OrgChartNode) => any) | undefined;
82
+ close: (fallbackPath: string) => any;
83
+ closeAll: () => any;
84
+ }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
85
+ onClose?: ((fallbackPath: string) => any) | undefined;
86
+ onCloseAll?: (() => any) | undefined;
82
87
  }>, {
83
- direction: OrgChartDirection;
84
- lineColor: string;
85
- lineStyle: OrgChartLineStyle;
86
- lineWidth: number;
87
- nodeSpacing: number;
88
- levelSpacing: number;
89
- zoomable: boolean;
90
- pannable: boolean;
91
- initialZoom: number;
92
- fitOnInit: boolean;
93
- minZoom: number;
94
- maxZoom: number;
95
- collapsible: boolean;
88
+ homePath: string;
89
+ homeTitle: string;
90
+ homeIcon: string;
91
+ persistKey: string;
92
+ contextMenuLabels: LegacyContextMenuLabels;
96
93
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
97
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
98
94
  declare const _default: typeof __VLS_export;
99
- type __VLS_WithSlots<T, S> = T & {
100
- new (): {
101
- $slots: S;
102
- };
103
- };
104
95
  //#endregion
105
- export { OrgChartProps as a, OrgChartNode as i, OrgChartDirection as n, OrgChartLineStyle as r, _default as t };
96
+ export { useTagsView as i, ContextMenuLabels as n, UseTagsViewOptions as r, _default as t };
@@ -20,16 +20,16 @@ declare const __VLS_export: vue.DefineComponent<Props, {}, {}, {}, {}, vue.Compo
20
20
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
21
21
  onError?: ((error: Error) => any) | undefined;
22
22
  }>, {
23
- fontSize: number;
24
- label: string;
25
- height: number;
26
23
  width: number;
24
+ height: number;
27
25
  format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
28
26
  showText: boolean;
27
+ fontSize: number;
29
28
  textPosition: "bottom" | "top";
30
29
  lineColor: string;
31
30
  background: string;
32
31
  showBorder: boolean;
32
+ label: string;
33
33
  showLabel: boolean;
34
34
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
@@ -20,16 +20,16 @@ declare const __VLS_export: vue.DefineComponent<Props, {}, {}, {}, {}, vue.Compo
20
20
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
21
21
  onError?: ((error: Error) => any) | undefined;
22
22
  }>, {
23
- fontSize: number;
24
- label: string;
25
- height: number;
26
23
  width: number;
24
+ height: number;
27
25
  format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
28
26
  showText: boolean;
27
+ fontSize: number;
29
28
  textPosition: "bottom" | "top";
30
29
  lineColor: string;
31
30
  background: string;
32
31
  showBorder: boolean;
32
+ label: string;
33
33
  showLabel: boolean;
34
34
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;