@robot-admin/naive-ui-components 0.32.0 → 0.34.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 (163) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +5 -1
  3. package/README_EN.md +5 -1
  4. package/dist/C_DataPicker.css +60 -23
  5. package/dist/C_Form.base.css +1 -1
  6. package/dist/C_Form.css +1 -1
  7. package/dist/C_FormSearch.css +93 -72
  8. package/dist/C_FormSearch.d.cts +2 -2
  9. package/dist/C_FormSearch.d.ts +2 -2
  10. package/dist/C_GlobalSearch2.cjs +1 -1
  11. package/dist/C_GlobalSearch2.js +1 -1
  12. package/dist/C_OrgChart.cjs +1 -1
  13. package/dist/C_OrgChart.css +67 -158
  14. package/dist/C_OrgChart.d.cts +22 -2
  15. package/dist/C_OrgChart.d.ts +22 -2
  16. package/dist/C_OrgChart.js +1 -1
  17. package/dist/C_OrgChart2.cjs +1 -1
  18. package/dist/C_OrgChart2.js +1 -1
  19. package/dist/C_Select.css +1 -1
  20. package/dist/C_Select.d.cts +2 -2
  21. package/dist/C_Select.d.ts +2 -2
  22. package/dist/C_Select2.cjs +1 -1
  23. package/dist/C_Select2.js +1 -1
  24. package/dist/C_Table.base.css +147 -147
  25. package/dist/C_Table.cjs +1 -1
  26. package/dist/C_Table.css +146 -146
  27. package/dist/C_Table.d.cts +3 -3
  28. package/dist/C_Table.d.ts +3 -3
  29. package/dist/C_Table.js +1 -1
  30. package/dist/C_Table2.cjs +4 -3
  31. package/dist/C_Table2.js +4 -3
  32. package/dist/C_TagsView.css +51 -51
  33. package/dist/C_TagsView2.cjs +1 -1
  34. package/dist/C_TagsView2.js +1 -1
  35. package/dist/C_Tree.css +60 -23
  36. package/dist/C_Tree.d.cts +2 -2
  37. package/dist/C_Tree.d.ts +2 -2
  38. package/dist/C_Tree2.cjs +1 -1
  39. package/dist/C_Tree2.js +1 -1
  40. package/dist/SearchFieldSettings.cjs +1 -0
  41. package/dist/SearchFieldSettings.js +1 -0
  42. package/dist/constants.d.cts +1 -1
  43. package/dist/constants.d.ts +1 -1
  44. package/dist/constants4.d.cts +6 -6
  45. package/dist/constants4.d.ts +6 -6
  46. package/dist/constants5.d.cts +2 -2
  47. package/dist/constants5.d.ts +2 -2
  48. package/dist/data2.d.cts +10 -10
  49. package/dist/data2.d.ts +10 -10
  50. package/dist/dateRange.d.cts +44 -4
  51. package/dist/dateRange.d.ts +44 -4
  52. package/dist/editors.cjs +1 -0
  53. package/dist/{useTableQuery.d.cts → editors.d.cts} +150 -24
  54. package/dist/{useTableQuery.d.ts → editors.d.ts} +150 -24
  55. package/dist/editors.js +1 -0
  56. package/dist/fieldRenderers.cjs +1 -1
  57. package/dist/fieldRenderers.js +1 -1
  58. package/dist/formField.cjs +1 -1
  59. package/dist/formField.d.cts +35 -12
  60. package/dist/formField.d.ts +35 -12
  61. package/dist/formField.js +1 -1
  62. package/dist/helpers.cjs +1 -1
  63. package/dist/helpers.js +1 -1
  64. package/dist/index.cjs +1 -1
  65. package/dist/index.d.cts +26 -25
  66. package/dist/index.d.ts +26 -25
  67. package/dist/index.js +1 -1
  68. package/dist/index.vue.d.cts +1 -1
  69. package/dist/index.vue.d.ts +1 -1
  70. package/dist/index10.vue.d.ts +3 -3
  71. package/dist/index11.vue.d.cts +3 -3
  72. package/dist/index11.vue.d.ts +4 -4
  73. package/dist/index12.vue.d.cts +4 -4
  74. package/dist/index13.vue.d.ts +4 -4
  75. package/dist/index14.vue.d.cts +4 -4
  76. package/dist/index16.vue.d.ts +4 -4
  77. package/dist/index17.vue.d.cts +4 -4
  78. package/dist/index17.vue.d.ts +7 -7
  79. package/dist/index18.vue.d.cts +7 -7
  80. package/dist/index2.vue.d.cts +2 -2
  81. package/dist/index2.vue.d.ts +2 -2
  82. package/dist/index20.vue.d.ts +1 -1
  83. package/dist/index21.vue.d.cts +1 -1
  84. package/dist/index21.vue.d.ts +3 -3
  85. package/dist/index22.vue.d.cts +3 -3
  86. package/dist/index22.vue.d.ts +3 -3
  87. package/dist/index23.vue.d.cts +76 -43
  88. package/dist/index23.vue.d.ts +76 -43
  89. package/dist/index24.vue.d.cts +1 -1
  90. package/dist/index24.vue.d.ts +1 -1
  91. package/dist/index25.vue.d.cts +2 -2
  92. package/dist/index25.vue.d.ts +2 -2
  93. package/dist/index26.vue.d.cts +3 -3
  94. package/dist/index26.vue.d.ts +3 -3
  95. package/dist/index27.vue.d.cts +1 -1
  96. package/dist/index27.vue.d.ts +1 -1
  97. package/dist/index28.vue.d.cts +2 -2
  98. package/dist/index28.vue.d.ts +2 -2
  99. package/dist/index3.vue.d.cts +2 -2
  100. package/dist/index3.vue.d.ts +2 -2
  101. package/dist/index31.vue.d.cts +3 -3
  102. package/dist/index31.vue.d.ts +3 -3
  103. package/dist/index32.vue.d.cts +2 -2
  104. package/dist/index32.vue.d.ts +2 -2
  105. package/dist/index4.vue.d.cts +4 -4
  106. package/dist/index4.vue.d.ts +4 -4
  107. package/dist/index6.vue.d.cts +3 -3
  108. package/dist/mapUtils.d.cts +2 -2
  109. package/dist/mapUtils.d.ts +2 -2
  110. package/dist/presets.d.cts +1 -1
  111. package/dist/presets.d.ts +1 -1
  112. package/dist/public.d.ts +2 -0
  113. package/dist/selectPresentation.cjs +1 -1
  114. package/dist/selectPresentation.js +1 -1
  115. package/dist/serializeSearch.cjs +1 -1
  116. package/dist/serializeSearch.js +1 -1
  117. package/dist/sourceControls.cjs +1 -0
  118. package/dist/sourceControls.js +1 -0
  119. package/dist/style.css +418 -451
  120. package/dist/types3.d.cts +2 -0
  121. package/dist/types4.d.ts +10 -2
  122. package/dist/types5.d.cts +10 -2
  123. package/dist/useCollapsePanel.d.cts +2 -2
  124. package/dist/useCollapsePanel.d.ts +2 -2
  125. package/dist/useComponentLocale.cjs +1 -1
  126. package/dist/useComponentLocale.js +1 -1
  127. package/dist/useCropperCore.d.cts +10 -10
  128. package/dist/useCropperCore.d.ts +10 -10
  129. package/dist/useDynamicFormState.d.cts +1 -1
  130. package/dist/useDynamicFormState.d.ts +1 -1
  131. package/dist/useEdgeInteraction.d.cts +2 -2
  132. package/dist/useEdgeInteraction.d.ts +2 -2
  133. package/dist/useFullscreen.d.cts +1 -1
  134. package/dist/useFullscreen.d.ts +1 -1
  135. package/dist/useGlobalSearch.d.cts +8 -0
  136. package/dist/useGlobalSearch.d.ts +8 -0
  137. package/dist/useGridWidth.cjs +1 -1
  138. package/dist/useGridWidth.js +1 -1
  139. package/dist/useInfiniteScroll.d.cts +2 -2
  140. package/dist/useInfiniteScroll.d.ts +2 -2
  141. package/dist/useQRCode.d.cts +3 -3
  142. package/dist/useQRCode.d.ts +3 -3
  143. package/dist/useSignatureHistory.d.cts +3 -3
  144. package/dist/useSignatureHistory.d.ts +3 -3
  145. package/dist/useSplitResize.d.cts +7 -7
  146. package/dist/useSplitResize.d.ts +7 -7
  147. package/dist/useWorkflowValidation.d.cts +32 -32
  148. package/dist/useWorkflowValidation.d.ts +32 -32
  149. package/dist/verification.d.cts +4 -4
  150. package/dist/verification.d.ts +4 -4
  151. package/docs/guides/component-contracts.md +72 -0
  152. package/docs/guides/org-chart.md +133 -0
  153. package/docs/guides/remote-options.md +24 -0
  154. package/docs/guides/search-workflows.md +63 -0
  155. package/docs/guides/table-editing.md +79 -0
  156. package/docs/guides/tree-org-examples.md +145 -0
  157. package/docs/guides/tree.en.md +91 -0
  158. package/docs/guides/tree.md +133 -2
  159. package/package.json +1 -1
  160. package/dist/temporalField.cjs +0 -1
  161. package/dist/temporalField.js +0 -1
  162. package/dist/useTableQuery.cjs +0 -1
  163. package/dist/useTableQuery.js +0 -1
@@ -4,8 +4,8 @@ import * as vue from "vue";
4
4
  //#region src/components/C_AutoComplete/index.vue.d.ts
5
5
  declare const __VLS_export: <R extends object = AutoCompleteOptionItem, F extends object = Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
6
  props: vue.PublicProps & __VLS_PrettifyLocal<AutoCompleteProps<R, F> & {
7
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
8
7
  onSelect?: ((row: R) => any) | undefined;
8
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
9
  }> & (typeof globalThis extends {
10
10
  __VLS_PROPS_FALLBACK: infer P;
11
11
  } ? P : {});
@@ -21,7 +21,7 @@ declare const __VLS_export: <R extends object = AutoCompleteOptionItem, F extend
21
21
  } & {
22
22
  empty?: (props: {}) => any;
23
23
  };
24
- emit: ((evt: "update:modelValue", value: string) => void) & ((evt: "select", row: R) => void);
24
+ emit: ((evt: "select", row: R) => void) & ((evt: "update:modelValue", value: string) => void);
25
25
  }>) => vue.VNode & {
26
26
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
27
27
  };
@@ -116,8 +116,8 @@ declare const __VLS_base: vue.DefineComponent<LoginProps, {
116
116
  "onCaptcha-visible-change"?: ((visible: boolean) => any) | undefined;
117
117
  "onUsername-change"?: ((username: string) => any) | undefined;
118
118
  }>, {
119
- title: string;
120
119
  loading: boolean;
120
+ title: string;
121
121
  storageKey: string;
122
122
  defaultUsername: string;
123
123
  defaultPassword: string;
@@ -116,8 +116,8 @@ declare const __VLS_base: vue.DefineComponent<LoginProps, {
116
116
  "onCaptcha-visible-change"?: ((visible: boolean) => any) | undefined;
117
117
  "onUsername-change"?: ((username: string) => any) | undefined;
118
118
  }>, {
119
- title: string;
120
119
  loading: boolean;
120
+ title: string;
121
121
  storageKey: string;
122
122
  defaultUsername: string;
123
123
  defaultPassword: string;
@@ -61,14 +61,14 @@ declare const __VLS_export: vue.DefineComponent<Props, {
61
61
  "onAuto-save"?: ((text: string) => any) | undefined;
62
62
  "onMax-length-exceeded"?: ((currentLength: number, maxLength: number) => any) | undefined;
63
63
  }>, {
64
+ height: string | number;
65
+ placeholder: string;
64
66
  modelValue: string;
65
67
  disabled: boolean;
66
- placeholder: string;
67
- height: string | number;
68
68
  mode: "edit" | "editable" | "preview";
69
+ autofocus: boolean;
69
70
  tocNavPosition: "left" | "right";
70
71
  defaultFullscreen: boolean;
71
- autofocus: boolean;
72
72
  includeLevel: number[];
73
73
  leftToolbar: string;
74
74
  rightToolbar: string;
@@ -61,14 +61,14 @@ declare const __VLS_export: vue.DefineComponent<Props, {
61
61
  "onAuto-save"?: ((text: string) => any) | undefined;
62
62
  "onMax-length-exceeded"?: ((currentLength: number, maxLength: number) => any) | undefined;
63
63
  }>, {
64
+ height: string | number;
65
+ placeholder: string;
64
66
  modelValue: string;
65
67
  disabled: boolean;
66
- placeholder: string;
67
- height: string | number;
68
68
  mode: "edit" | "editable" | "preview";
69
+ autofocus: boolean;
69
70
  tocNavPosition: "left" | "right";
70
71
  defaultFullscreen: boolean;
71
- autofocus: boolean;
72
72
  includeLevel: number[];
73
73
  leftToolbar: string;
74
74
  rightToolbar: string;
@@ -53,9 +53,9 @@ interface MenuExpose {
53
53
  //#region src/components/C_Menu/index.vue.d.ts
54
54
  declare const __VLS_export: <Options extends MenuOption[] | undefined = undefined>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
55
55
  props: vue.PublicProps & __VLS_PrettifyLocal<MenuProps<Options> & {
56
- "onUpdate:modelValue"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
57
- onSelect?: ((key: MenuSelectionKey<Options>) => any) | undefined;
58
56
  "onUpdate:expandedKeys"?: ((keys: MenuSelectionKey<Options>[]) => any) | undefined;
57
+ onSelect?: ((key: MenuSelectionKey<Options>) => any) | undefined;
58
+ "onUpdate:modelValue"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
59
59
  onIntent?: ((key: MenuSelectionKey<Options>) => any) | undefined;
60
60
  "onUpdate:value"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
61
61
  }> & (typeof globalThis extends {
@@ -67,7 +67,7 @@ declare const __VLS_export: <Options extends MenuOption[] | undefined = undefine
67
67
  }>) => void;
68
68
  attrs: any;
69
69
  slots: {};
70
- emit: ((evt: "update:modelValue", key: MenuSelectionKey<Options> | null) => void) & ((evt: "select", key: MenuSelectionKey<Options>) => void) & ((evt: "update:expandedKeys", keys: MenuSelectionKey<Options>[]) => void) & ((evt: "intent", key: MenuSelectionKey<Options>) => void) & ((evt: "update:value", key: MenuSelectionKey<Options> | null) => void);
70
+ emit: ((evt: "update:expandedKeys", keys: MenuSelectionKey<Options>[]) => void) & ((evt: "select", key: MenuSelectionKey<Options>) => void) & ((evt: "update:modelValue", key: MenuSelectionKey<Options> | null) => void) & ((evt: "intent", key: MenuSelectionKey<Options>) => void) & ((evt: "update:value", key: MenuSelectionKey<Options> | null) => void);
71
71
  }>) => vue.VNode & {
72
72
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
73
73
  };
@@ -1,7 +1,9 @@
1
1
  import * as vue from "vue";
2
+ import { VNodeChild } from "vue";
2
3
 
3
4
  //#region src/components/C_OrgChart/types.d.ts
4
- /** 节点数据 */
5
+ type OrgChartKey = string | number;
6
+ /** 默认节点格式;业务节点可直接通过 data 推导,不必继承此接口。 */
5
7
  interface OrgChartNode {
6
8
  /** 唯一标识 */
7
9
  id: string | number;
@@ -25,9 +27,25 @@ type OrgChartDirection = 'vertical' | 'horizontal';
25
27
  /** 连线样式 */
26
28
  type OrgChartLineStyle = 'straight' | 'rounded' | 'stepped';
27
29
  /** C_OrgChart Props */
28
- interface OrgChartProps {
30
+ interface OrgChartProps<T extends object = OrgChartNode> {
29
31
  /** 树形数据 */
30
- data: OrgChartNode;
32
+ data: T;
33
+ /** 默认 id。各节点的键必须唯一,数字 0 是有效键。 */
34
+ keyField?: keyof T & string;
35
+ /** 默认 label。 */
36
+ labelField?: keyof T & string;
37
+ /** 默认 children;各级子项使用同一业务节点格式。 */
38
+ childrenField?: keyof T & string;
39
+ /** 默认 subtitle。 */
40
+ subtitleField?: keyof T & string;
41
+ /** 默认 avatar。 */
42
+ avatarField?: keyof T & string;
43
+ /** 受控选择;null 表示清空。未配置选择属性时保留旧版纯点击行为。 */
44
+ selectedKey?: OrgChartKey | null;
45
+ defaultSelectedKey?: OrgChartKey | null;
46
+ /** 受控展开。未传时由默认值或节点 collapsed 管理,不修改原节点。 */
47
+ expandedKeys?: readonly OrgChartKey[];
48
+ defaultExpandedKeys?: readonly OrgChartKey[];
31
49
  /** 布局方向 */
32
50
  direction?: OrgChartDirection;
33
51
  /** 连线样式 */
@@ -55,51 +73,66 @@ interface OrgChartProps {
55
73
  /** 是否可折叠 */
56
74
  collapsible?: boolean;
57
75
  }
58
- //#endregion
59
- //#region src/components/C_OrgChart/index.vue.d.ts
60
- declare var __VLS_12: {
61
- node: OrgChartNode;
76
+ interface OrgChartNodeSlotProps<T extends object = OrgChartNode> {
77
+ /** 未包装的原始业务节点。 */
78
+ node: T;
79
+ key: OrgChartKey;
62
80
  isLeaf: boolean;
63
81
  isExpanded: boolean;
64
- };
65
- type __VLS_Slots = {} & {
66
- node?: (props: typeof __VLS_12) => any;
67
- };
68
- declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
82
+ isSelected: boolean;
83
+ /** 自定义卡片可给原生按钮绑定此回调,保留键盘与内嵌操作的边界。 */
84
+ select: () => void;
85
+ toggle: () => void;
86
+ }
87
+ interface OrgChartSlots<T extends object = OrgChartNode> {
88
+ node?: (props: OrgChartNodeSlotProps<T>) => VNodeChild;
89
+ }
90
+ interface OrgChartEmits<T extends object = OrgChartNode> {
91
+ 'node-click': [node: T];
92
+ 'node-expand': [node: T];
93
+ 'node-collapse': [node: T];
94
+ 'update:selectedKey': [key: OrgChartKey | null, node: T];
95
+ 'update:expandedKeys': [keys: OrgChartKey[], node: T];
96
+ }
97
+ /** 模板 ref 的公开接口;zoom 在组件实例上自动解包为数字。 */
98
+ interface OrgChartExpose<T extends object = OrgChartNode> {
99
+ zoom: number;
69
100
  zoomIn: () => void;
70
101
  zoomOut: () => void;
71
102
  resetView: () => void;
72
103
  fitView: () => Promise<void>;
73
- zoom: vue.Ref<number, number>;
74
- }, {}, {}, {}, 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
- }>, {
83
- direction: OrgChartDirection;
84
- collapsible: boolean;
85
- lineColor: string;
86
- lineWidth: number;
87
- lineStyle: OrgChartLineStyle;
88
- nodeSpacing: number;
89
- levelSpacing: number;
90
- zoomable: boolean;
91
- pannable: boolean;
92
- initialZoom: number;
93
- fitOnInit: boolean;
94
- minZoom: number;
95
- maxZoom: number;
96
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
97
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
98
- declare const _default: typeof __VLS_export;
99
- type __VLS_WithSlots<T, S> = T & {
100
- new (): {
101
- $slots: S;
102
- };
104
+ getNode: (key: OrgChartKey) => T | null;
105
+ /** 展开祖先、建议选中并居中;受控父端未接受展开时返回 false。 */
106
+ locate: (key: OrgChartKey) => Promise<boolean>;
107
+ }
108
+ //#endregion
109
+ //#region src/components/C_OrgChart/index.vue.d.ts
110
+ declare const __VLS_export: <T extends object = OrgChartNode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
111
+ props: vue.PublicProps & __VLS_PrettifyLocal<OrgChartProps<T> & {
112
+ "onNode-click"?: ((node: T) => any) | undefined;
113
+ "onNode-expand"?: ((node: T) => any) | undefined;
114
+ "onNode-collapse"?: ((node: T) => any) | undefined;
115
+ "onUpdate:selectedKey"?: ((key: OrgChartKey | null, node: T) => any) | undefined;
116
+ "onUpdate:expandedKeys"?: ((keys: OrgChartKey[], node: T) => any) | undefined;
117
+ }> & (typeof globalThis extends {
118
+ __VLS_PROPS_FALLBACK: infer P;
119
+ } ? P : {});
120
+ expose: (exposed: vue.ShallowUnwrapRef<{
121
+ zoom: vue.Ref<number, number>;
122
+ zoomIn: () => void;
123
+ zoomOut: () => void;
124
+ resetView: () => void;
125
+ fitView: () => Promise<void>;
126
+ getNode: (key: OrgChartKey) => T | null;
127
+ locate: (key: OrgChartKey) => Promise<boolean>;
128
+ }>) => void;
129
+ attrs: any;
130
+ slots: OrgChartSlots<T>;
131
+ emit: ((evt: "node-click", node: T) => void) & ((evt: "node-expand", node: T) => void) & ((evt: "node-collapse", node: T) => void) & ((evt: "update:selectedKey", key: OrgChartKey | null, node: T) => void) & ((evt: "update:expandedKeys", keys: OrgChartKey[], node: T) => void);
132
+ }>) => vue.VNode & {
133
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
103
134
  };
135
+ declare const _default: typeof __VLS_export;
136
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
104
137
  //#endregion
105
- export { OrgChartProps as a, OrgChartNode as i, OrgChartDirection as n, OrgChartLineStyle as r, _default as t };
138
+ export { OrgChartKey as a, OrgChartNodeSlotProps as c, OrgChartExpose as i, OrgChartProps as l, OrgChartDirection as n, OrgChartLineStyle as o, OrgChartEmits as r, OrgChartNode as s, _default as t, OrgChartSlots as u };
@@ -1,7 +1,9 @@
1
1
  import * as vue from "vue";
2
+ import { VNodeChild } from "vue";
2
3
 
3
4
  //#region src/components/C_OrgChart/types.d.ts
4
- /** 节点数据 */
5
+ type OrgChartKey = string | number;
6
+ /** 默认节点格式;业务节点可直接通过 data 推导,不必继承此接口。 */
5
7
  interface OrgChartNode {
6
8
  /** 唯一标识 */
7
9
  id: string | number;
@@ -25,9 +27,25 @@ type OrgChartDirection = 'vertical' | 'horizontal';
25
27
  /** 连线样式 */
26
28
  type OrgChartLineStyle = 'straight' | 'rounded' | 'stepped';
27
29
  /** C_OrgChart Props */
28
- interface OrgChartProps {
30
+ interface OrgChartProps<T extends object = OrgChartNode> {
29
31
  /** 树形数据 */
30
- data: OrgChartNode;
32
+ data: T;
33
+ /** 默认 id。各节点的键必须唯一,数字 0 是有效键。 */
34
+ keyField?: keyof T & string;
35
+ /** 默认 label。 */
36
+ labelField?: keyof T & string;
37
+ /** 默认 children;各级子项使用同一业务节点格式。 */
38
+ childrenField?: keyof T & string;
39
+ /** 默认 subtitle。 */
40
+ subtitleField?: keyof T & string;
41
+ /** 默认 avatar。 */
42
+ avatarField?: keyof T & string;
43
+ /** 受控选择;null 表示清空。未配置选择属性时保留旧版纯点击行为。 */
44
+ selectedKey?: OrgChartKey | null;
45
+ defaultSelectedKey?: OrgChartKey | null;
46
+ /** 受控展开。未传时由默认值或节点 collapsed 管理,不修改原节点。 */
47
+ expandedKeys?: readonly OrgChartKey[];
48
+ defaultExpandedKeys?: readonly OrgChartKey[];
31
49
  /** 布局方向 */
32
50
  direction?: OrgChartDirection;
33
51
  /** 连线样式 */
@@ -55,51 +73,66 @@ interface OrgChartProps {
55
73
  /** 是否可折叠 */
56
74
  collapsible?: boolean;
57
75
  }
58
- //#endregion
59
- //#region src/components/C_OrgChart/index.vue.d.ts
60
- declare var __VLS_12: {
61
- node: OrgChartNode;
76
+ interface OrgChartNodeSlotProps<T extends object = OrgChartNode> {
77
+ /** 未包装的原始业务节点。 */
78
+ node: T;
79
+ key: OrgChartKey;
62
80
  isLeaf: boolean;
63
81
  isExpanded: boolean;
64
- };
65
- type __VLS_Slots = {} & {
66
- node?: (props: typeof __VLS_12) => any;
67
- };
68
- declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
82
+ isSelected: boolean;
83
+ /** 自定义卡片可给原生按钮绑定此回调,保留键盘与内嵌操作的边界。 */
84
+ select: () => void;
85
+ toggle: () => void;
86
+ }
87
+ interface OrgChartSlots<T extends object = OrgChartNode> {
88
+ node?: (props: OrgChartNodeSlotProps<T>) => VNodeChild;
89
+ }
90
+ interface OrgChartEmits<T extends object = OrgChartNode> {
91
+ 'node-click': [node: T];
92
+ 'node-expand': [node: T];
93
+ 'node-collapse': [node: T];
94
+ 'update:selectedKey': [key: OrgChartKey | null, node: T];
95
+ 'update:expandedKeys': [keys: OrgChartKey[], node: T];
96
+ }
97
+ /** 模板 ref 的公开接口;zoom 在组件实例上自动解包为数字。 */
98
+ interface OrgChartExpose<T extends object = OrgChartNode> {
99
+ zoom: number;
69
100
  zoomIn: () => void;
70
101
  zoomOut: () => void;
71
102
  resetView: () => void;
72
103
  fitView: () => Promise<void>;
73
- zoom: vue.Ref<number, number>;
74
- }, {}, {}, {}, 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
- }>, {
83
- direction: OrgChartDirection;
84
- collapsible: boolean;
85
- lineColor: string;
86
- lineWidth: number;
87
- lineStyle: OrgChartLineStyle;
88
- nodeSpacing: number;
89
- levelSpacing: number;
90
- zoomable: boolean;
91
- pannable: boolean;
92
- initialZoom: number;
93
- fitOnInit: boolean;
94
- minZoom: number;
95
- maxZoom: number;
96
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
97
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
98
- declare const _default: typeof __VLS_export;
99
- type __VLS_WithSlots<T, S> = T & {
100
- new (): {
101
- $slots: S;
102
- };
104
+ getNode: (key: OrgChartKey) => T | null;
105
+ /** 展开祖先、建议选中并居中;受控父端未接受展开时返回 false。 */
106
+ locate: (key: OrgChartKey) => Promise<boolean>;
107
+ }
108
+ //#endregion
109
+ //#region src/components/C_OrgChart/index.vue.d.ts
110
+ declare const __VLS_export: <T extends object = OrgChartNode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
111
+ props: vue.PublicProps & __VLS_PrettifyLocal<OrgChartProps<T> & {
112
+ "onNode-click"?: ((node: T) => any) | undefined;
113
+ "onNode-expand"?: ((node: T) => any) | undefined;
114
+ "onNode-collapse"?: ((node: T) => any) | undefined;
115
+ "onUpdate:selectedKey"?: ((key: OrgChartKey | null, node: T) => any) | undefined;
116
+ "onUpdate:expandedKeys"?: ((keys: OrgChartKey[], node: T) => any) | undefined;
117
+ }> & (typeof globalThis extends {
118
+ __VLS_PROPS_FALLBACK: infer P;
119
+ } ? P : {});
120
+ expose: (exposed: vue.ShallowUnwrapRef<{
121
+ zoom: vue.Ref<number, number>;
122
+ zoomIn: () => void;
123
+ zoomOut: () => void;
124
+ resetView: () => void;
125
+ fitView: () => Promise<void>;
126
+ getNode: (key: OrgChartKey) => T | null;
127
+ locate: (key: OrgChartKey) => Promise<boolean>;
128
+ }>) => void;
129
+ attrs: any;
130
+ slots: OrgChartSlots<T>;
131
+ emit: ((evt: "node-click", node: T) => void) & ((evt: "node-expand", node: T) => void) & ((evt: "node-collapse", node: T) => void) & ((evt: "update:selectedKey", key: OrgChartKey | null, node: T) => void) & ((evt: "update:expandedKeys", keys: OrgChartKey[], node: T) => void);
132
+ }>) => vue.VNode & {
133
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
103
134
  };
135
+ declare const _default: typeof __VLS_export;
136
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
104
137
  //#endregion
105
- export { OrgChartProps as a, OrgChartNode as i, OrgChartDirection as n, OrgChartLineStyle as r, _default as t };
138
+ export { OrgChartKey as a, OrgChartNodeSlotProps as c, OrgChartExpose as i, OrgChartProps as l, OrgChartDirection as n, OrgChartLineStyle as o, OrgChartEmits as r, OrgChartNode as s, _default as t, OrgChartSlots as u };
@@ -36,9 +36,9 @@ type __VLS_Slots = {} & {
36
36
  declare const __VLS_base: vue.DefineComponent<Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<Props> & Readonly<{}>, {
37
37
  status: "default" | "success" | "error" | "warning" | "info";
38
38
  strokeWidth: number;
39
- time: number;
40
39
  percentage: number | number[];
41
40
  isAnimation: boolean;
41
+ time: number;
42
42
  indicatorPlacement: "inside" | "outside";
43
43
  showIndicator: boolean;
44
44
  unit: string;
@@ -36,9 +36,9 @@ type __VLS_Slots = {} & {
36
36
  declare const __VLS_base: vue.DefineComponent<Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<Props> & Readonly<{}>, {
37
37
  status: "default" | "success" | "error" | "warning" | "info";
38
38
  strokeWidth: number;
39
- time: number;
40
39
  percentage: number | number[];
41
40
  isAnimation: boolean;
41
+ time: number;
42
42
  indicatorPlacement: "inside" | "outside";
43
43
  showIndicator: boolean;
44
44
  unit: string;
@@ -17,11 +17,11 @@ interface SectionNavProps {
17
17
  //#endregion
18
18
  //#region src/components/C_SectionNav/index.vue.d.ts
19
19
  declare const __VLS_export: vue.DefineComponent<SectionNavProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
20
- "update:modelValue": (key: string) => any;
21
20
  select: (key: string) => any;
21
+ "update:modelValue": (key: string) => any;
22
22
  }, string, vue.PublicProps, Readonly<SectionNavProps> & Readonly<{
23
- "onUpdate:modelValue"?: ((key: string) => any) | undefined;
24
23
  onSelect?: ((key: string) => any) | undefined;
24
+ "onUpdate:modelValue"?: ((key: string) => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
27
27
  //#endregion
@@ -17,11 +17,11 @@ interface SectionNavProps {
17
17
  //#endregion
18
18
  //#region src/components/C_SectionNav/index.vue.d.ts
19
19
  declare const __VLS_export: vue.DefineComponent<SectionNavProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
20
- "update:modelValue": (key: string) => any;
21
20
  select: (key: string) => any;
21
+ "update:modelValue": (key: string) => any;
22
22
  }, string, vue.PublicProps, Readonly<SectionNavProps> & Readonly<{
23
- "onUpdate:modelValue"?: ((key: string) => any) | undefined;
24
23
  onSelect?: ((key: string) => any) | undefined;
24
+ "onUpdate:modelValue"?: ((key: string) => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
26
26
  declare const _default: typeof __VLS_export;
27
27
  //#endregion
@@ -1,11 +1,11 @@
1
- import { a as SelectValue, i as SelectSelection, n as SelectOptionItem, r as SelectProps, t as SelectModelValue } from "./types5.cjs";
1
+ import { a as SelectProps, o as SelectSelection, r as SelectOptionItem, s as SelectValue, t as SelectModelValue } from "./types5.cjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/C_Select/index.vue.d.ts
5
5
  declare const __VLS_export: <V extends SelectValue = SelectValue, M extends boolean = false, T extends boolean = false, R extends object = SelectOptionItem<V>, F extends object = Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
6
  props: vue.PublicProps & __VLS_PrettifyLocal<SelectProps<V, M, T, R, F> & {
7
- "onUpdate:modelValue"?: ((value: SelectModelValue<V, M, T>) => any) | undefined;
8
7
  onSelect?: ((selection: SelectSelection<R, M>) => any) | undefined;
8
+ "onUpdate:modelValue"?: ((value: SelectModelValue<V, M, T>) => any) | undefined;
9
9
  "onUpdate:show"?: ((show: boolean) => any) | undefined;
10
10
  }> & (typeof globalThis extends {
11
11
  __VLS_PROPS_FALLBACK: infer P;
@@ -20,7 +20,7 @@ declare const __VLS_export: <V extends SelectValue = SelectValue, M extends bool
20
20
  } & {
21
21
  action?: (props: {}) => any;
22
22
  };
23
- emit: ((evt: "update:modelValue", value: SelectModelValue<V, M, T>) => void) & ((evt: "select", selection: SelectSelection<R, M>) => void) & ((evt: "update:show", show: boolean) => void);
23
+ emit: ((evt: "select", selection: SelectSelection<R, M>) => void) & ((evt: "update:modelValue", value: SelectModelValue<V, M, T>) => void) & ((evt: "update:show", show: boolean) => void);
24
24
  }>) => vue.VNode & {
25
25
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
@@ -1,11 +1,11 @@
1
- import { a as SelectValue, i as SelectSelection, n as SelectOptionItem, r as SelectProps, t as SelectModelValue } from "./types4.js";
1
+ import { a as SelectProps, o as SelectSelection, r as SelectOptionItem, s as SelectValue, t as SelectModelValue } from "./types4.js";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/C_Select/index.vue.d.ts
5
5
  declare const __VLS_export: <V extends SelectValue = SelectValue, M extends boolean = false, T extends boolean = false, R extends object = SelectOptionItem<V>, F extends object = Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
6
  props: vue.PublicProps & __VLS_PrettifyLocal<SelectProps<V, M, T, R, F> & {
7
- "onUpdate:modelValue"?: ((value: SelectModelValue<V, M, T>) => any) | undefined;
8
7
  onSelect?: ((selection: SelectSelection<R, M>) => any) | undefined;
8
+ "onUpdate:modelValue"?: ((value: SelectModelValue<V, M, T>) => any) | undefined;
9
9
  "onUpdate:show"?: ((show: boolean) => any) | undefined;
10
10
  }> & (typeof globalThis extends {
11
11
  __VLS_PROPS_FALLBACK: infer P;
@@ -20,7 +20,7 @@ declare const __VLS_export: <V extends SelectValue = SelectValue, M extends bool
20
20
  } & {
21
21
  action?: (props: {}) => any;
22
22
  };
23
- emit: ((evt: "update:modelValue", value: SelectModelValue<V, M, T>) => void) & ((evt: "select", selection: SelectSelection<R, M>) => void) & ((evt: "update:show", show: boolean) => void);
23
+ emit: ((evt: "select", selection: SelectSelection<R, M>) => void) & ((evt: "update:modelValue", value: SelectModelValue<V, M, T>) => void) & ((evt: "update:show", show: boolean) => void);
24
24
  }>) => vue.VNode & {
25
25
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
26
  };
@@ -88,9 +88,9 @@ type __VLS_Slots = {} & {
88
88
  declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
89
  repeat: number;
90
90
  loading: boolean;
91
- animation: SkeletonAnimation;
92
91
  borderRadius: string;
93
92
  preset: SkeletonPreset;
93
+ animation: SkeletonAnimation;
94
94
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
95
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
96
96
  declare const _default: typeof __VLS_export;
@@ -88,9 +88,9 @@ type __VLS_Slots = {} & {
88
88
  declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
89
  repeat: number;
90
90
  loading: boolean;
91
- animation: SkeletonAnimation;
92
91
  borderRadius: string;
93
92
  preset: SkeletonPreset;
93
+ animation: SkeletonAnimation;
94
94
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
95
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
96
96
  declare const _default: typeof __VLS_export;
@@ -35,10 +35,10 @@ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue
35
35
  onChange?: ((args_0: number) => any) | undefined;
36
36
  "onUpdate:current"?: ((args_0: number) => any) | undefined;
37
37
  }>, {
38
- clickable: boolean;
39
38
  direction: "horizontal" | "vertical";
40
- connected: boolean;
39
+ clickable: boolean;
41
40
  current: number;
41
+ connected: boolean;
42
42
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
43
43
  declare const _default: typeof __VLS_export;
44
44
  //#endregion
@@ -35,10 +35,10 @@ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue
35
35
  onChange?: ((args_0: number) => any) | undefined;
36
36
  "onUpdate:current"?: ((args_0: number) => any) | undefined;
37
37
  }>, {
38
- clickable: boolean;
39
38
  direction: "horizontal" | "vertical";
40
- connected: boolean;
39
+ clickable: boolean;
41
40
  current: number;
41
+ connected: boolean;
42
42
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
43
43
  declare const _default: typeof __VLS_export;
44
44
  //#endregion
@@ -72,15 +72,15 @@ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue
72
72
  onItemClick?: ((item: AvatarItem) => any) | undefined;
73
73
  onOverflowClick?: ((hiddenItems: AvatarItem[]) => any) | undefined;
74
74
  }>, {
75
+ direction: "ltr" | "rtl";
76
+ overlap: number;
75
77
  size: number;
76
78
  max: number;
77
- overlap: number;
78
79
  shape: "circle" | "square";
79
80
  showStatus: boolean;
80
81
  showTooltip: boolean;
81
82
  clickable: boolean;
82
83
  overflowClickable: boolean;
83
- direction: "ltr" | "rtl";
84
84
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
85
85
  declare const _default: typeof __VLS_export;
86
86
  //#endregion
@@ -72,15 +72,15 @@ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue
72
72
  onItemClick?: ((item: AvatarItem) => any) | undefined;
73
73
  onOverflowClick?: ((hiddenItems: AvatarItem[]) => any) | undefined;
74
74
  }>, {
75
+ direction: "ltr" | "rtl";
76
+ overlap: number;
75
77
  size: number;
76
78
  max: number;
77
- overlap: number;
78
79
  shape: "circle" | "square";
79
80
  showStatus: boolean;
80
81
  showTooltip: boolean;
81
82
  clickable: boolean;
82
83
  overflowClickable: boolean;
83
- direction: "ltr" | "rtl";
84
84
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
85
85
  declare const _default: typeof __VLS_export;
86
86
  //#endregion
@@ -84,14 +84,14 @@ declare const __VLS_base: vue.DefineComponent<TimelineProps, {
84
84
  /** 展开全部 */expandAll: () => void; /** 折叠全部 */
85
85
  collapseAll: () => void;
86
86
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
87
- expand: (item: TimelineItem, expanded: boolean) => any;
88
87
  "item-click": (item: TimelineItem, index: number) => any;
88
+ expand: (item: TimelineItem, expanded: boolean) => any;
89
89
  }, string, vue.PublicProps, Readonly<TimelineProps> & Readonly<{
90
- onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
91
90
  "onItem-click"?: ((item: TimelineItem, index: number) => any) | undefined;
91
+ onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
92
92
  }>, {
93
- size: "small" | "medium" | "large";
94
93
  reverse: boolean;
94
+ size: "small" | "medium" | "large";
95
95
  items: TimelineItem[];
96
96
  mode: "vertical" | "horizontal";
97
97
  labelPlacement: "left" | "right" | "alternate";
@@ -84,14 +84,14 @@ declare const __VLS_base: vue.DefineComponent<TimelineProps, {
84
84
  /** 展开全部 */expandAll: () => void; /** 折叠全部 */
85
85
  collapseAll: () => void;
86
86
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
87
- expand: (item: TimelineItem, expanded: boolean) => any;
88
87
  "item-click": (item: TimelineItem, index: number) => any;
88
+ expand: (item: TimelineItem, expanded: boolean) => any;
89
89
  }, string, vue.PublicProps, Readonly<TimelineProps> & Readonly<{
90
- onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
91
90
  "onItem-click"?: ((item: TimelineItem, index: number) => any) | undefined;
91
+ onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
92
92
  }>, {
93
- size: "small" | "medium" | "large";
94
93
  reverse: boolean;
94
+ size: "small" | "medium" | "large";
95
95
  items: TimelineItem[];
96
96
  mode: "vertical" | "horizontal";
97
97
  labelPlacement: "left" | "right" | "alternate";