@robot-admin/naive-ui-components 0.20.0 → 0.21.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 (178) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -5
  3. package/README_EN.md +5 -5
  4. package/SECURITY.md +39 -0
  5. package/dist/C_AntV.css +31 -31
  6. package/dist/C_AntV2.cjs +1 -1
  7. package/dist/C_AntV2.js +1 -1
  8. package/dist/C_Chat.css +90 -90
  9. package/dist/C_Chat2.cjs +1 -1
  10. package/dist/C_Chat2.js +1 -1
  11. package/dist/C_CollapsePanel2.cjs +1 -1
  12. package/dist/C_CollapsePanel2.js +1 -1
  13. package/dist/C_Draggable.css +53 -53
  14. package/dist/C_Draggable2.cjs +1 -1
  15. package/dist/C_Draggable2.js +1 -1
  16. package/dist/C_FilePreview.css +98 -98
  17. package/dist/C_FilePreview.d.cts +2 -2
  18. package/dist/C_FilePreview.d.ts +2 -2
  19. package/dist/C_FilePreview2.cjs +1 -1
  20. package/dist/C_FilePreview2.js +1 -1
  21. package/dist/C_Form.base.css +9 -9
  22. package/dist/C_Form.css +9 -9
  23. package/dist/C_FormSearch.css +52 -52
  24. package/dist/C_FormSearch2.cjs +1 -1
  25. package/dist/C_FormSearch2.js +1 -1
  26. package/dist/C_Language.css +2 -2
  27. package/dist/C_Language2.cjs +1 -1
  28. package/dist/C_Language2.js +1 -1
  29. package/dist/C_Login.css +79 -79
  30. package/dist/C_Login2.cjs +1 -1
  31. package/dist/C_Login2.js +1 -1
  32. package/dist/C_Menu.css +1 -1
  33. package/dist/C_Menu.d.cts +2 -2
  34. package/dist/C_Menu.d.ts +2 -2
  35. package/dist/C_Menu2.cjs +1 -1
  36. package/dist/C_Menu2.js +1 -1
  37. package/dist/C_NotificationCenter.css +124 -124
  38. package/dist/C_NotificationCenter.d.cts +2 -2
  39. package/dist/C_NotificationCenter.d.ts +2 -2
  40. package/dist/C_NotificationCenter2.cjs +1 -1
  41. package/dist/C_NotificationCenter2.js +1 -1
  42. package/dist/C_Skeleton.css +2 -2
  43. package/dist/C_Skeleton2.cjs +1 -1
  44. package/dist/C_Skeleton2.js +1 -1
  45. package/dist/C_SplitPane.css +66 -66
  46. package/dist/C_SplitPane2.cjs +1 -1
  47. package/dist/C_SplitPane2.js +1 -1
  48. package/dist/C_Table.base.css +9 -9
  49. package/dist/C_Table.css +9 -9
  50. package/dist/C_Table.d.ts +1 -0
  51. package/dist/C_Theme2.cjs +1 -1
  52. package/dist/C_Theme2.js +1 -1
  53. package/dist/C_Timeline.css +46 -46
  54. package/dist/C_Timeline2.cjs +1 -1
  55. package/dist/C_Timeline2.js +1 -1
  56. package/dist/C_Transfer.css +26 -26
  57. package/dist/C_Transfer2.cjs +1 -1
  58. package/dist/C_Transfer2.js +1 -1
  59. package/dist/C_Tree.css +23 -23
  60. package/dist/C_Tree.d.ts +1 -0
  61. package/dist/C_Tree2.cjs +1 -1
  62. package/dist/C_Tree2.js +1 -1
  63. package/dist/C_Upload2.cjs +1 -1
  64. package/dist/C_Upload2.js +1 -1
  65. package/dist/C_VideoPlayer.d.cts +2 -2
  66. package/dist/C_VideoPlayer.d.ts +2 -2
  67. package/dist/C_VideoPlayer2.cjs +2 -2
  68. package/dist/C_VideoPlayer2.js +2 -2
  69. package/dist/C_WaterFall.css +31 -29
  70. package/dist/C_WaterFall2.cjs +1 -1
  71. package/dist/C_WaterFall2.js +1 -1
  72. package/dist/C_WorkFlow.css +111 -111
  73. package/dist/C_WorkFlow2.cjs +1 -1
  74. package/dist/C_WorkFlow2.js +1 -1
  75. package/dist/config.cjs +1 -0
  76. package/dist/config.d.cts +8 -0
  77. package/dist/config.d.ts +8 -0
  78. package/dist/config.js +1 -0
  79. package/dist/constants3.d.cts +34 -11
  80. package/dist/constants3.d.ts +34 -11
  81. package/dist/constants4.d.cts +20 -9
  82. package/dist/constants4.d.ts +20 -9
  83. package/dist/constants5.d.cts +22 -18
  84. package/dist/constants5.d.ts +22 -18
  85. package/dist/data.d.cts +8 -8
  86. package/dist/data.d.ts +8 -8
  87. package/dist/dateRange.d.cts +2 -0
  88. package/dist/dateRange.d.ts +2 -0
  89. package/dist/feedback.cjs +1 -1
  90. package/dist/feedback.js +1 -1
  91. package/dist/helpers.cjs +1 -1
  92. package/dist/helpers.js +1 -1
  93. package/dist/index.cjs +1 -1
  94. package/dist/index.d.cts +7 -6
  95. package/dist/index.d.ts +8 -6
  96. package/dist/index.js +1 -1
  97. package/dist/index.vue.d.cts +6 -6
  98. package/dist/index.vue.d.ts +6 -6
  99. package/dist/index10.vue.d.cts +3 -3
  100. package/dist/index10.vue.d.ts +5 -5
  101. package/dist/index11.vue.d.cts +5 -5
  102. package/dist/index11.vue.d.ts +2 -2
  103. package/dist/index12.vue.d.cts +2 -2
  104. package/dist/index12.vue.d.ts +5 -5
  105. package/dist/index13.vue.d.cts +5 -5
  106. package/dist/index13.vue.d.ts +6 -6
  107. package/dist/index14.vue.d.cts +6 -6
  108. package/dist/index14.vue.d.ts +0 -1
  109. package/dist/index15.vue.d.cts +0 -1
  110. package/dist/index15.vue.d.ts +1 -1
  111. package/dist/index16.vue.d.cts +1 -1
  112. package/dist/index17.vue.d.ts +2 -2
  113. package/dist/index18.vue.d.cts +2 -2
  114. package/dist/index18.vue.d.ts +44 -40
  115. package/dist/index19.vue.d.cts +1 -1
  116. package/dist/index19.vue.d.ts +1 -1
  117. package/dist/index2.vue.d.cts +3 -3
  118. package/dist/index2.vue.d.ts +3 -3
  119. package/dist/index20.vue.d.cts +1 -1
  120. package/dist/index20.vue.d.ts +1 -1
  121. package/dist/index21.vue.d.cts +1 -1
  122. package/dist/index21.vue.d.ts +1 -1
  123. package/dist/index22.vue.d.cts +2 -2
  124. package/dist/index22.vue.d.ts +2 -2
  125. package/dist/index25.vue.d.cts +5 -6
  126. package/dist/index25.vue.d.ts +5 -6
  127. package/dist/index26.vue.d.cts +3 -3
  128. package/dist/index26.vue.d.ts +3 -3
  129. package/dist/index3.vue.d.cts +5 -5
  130. package/dist/index3.vue.d.ts +5 -5
  131. package/dist/index4.vue.d.cts +44 -40
  132. package/dist/index6.vue.d.ts +2 -4
  133. package/dist/index7.vue.d.cts +2 -4
  134. package/dist/index9.vue.d.ts +3 -3
  135. package/dist/mapUtils.d.cts +1 -1
  136. package/dist/mapUtils.d.ts +1 -1
  137. package/dist/style.css +846 -844
  138. package/dist/useCalendarEvents.d.cts +1 -1
  139. package/dist/useCalendarEvents.d.ts +1 -1
  140. package/dist/useCollapsePanel.d.cts +1 -1
  141. package/dist/useCollapsePanel.d.ts +1 -1
  142. package/dist/useComponentLocale.cjs +1 -1
  143. package/dist/useComponentLocale.js +1 -1
  144. package/dist/useCropperCore.d.cts +8 -8
  145. package/dist/useCropperCore.d.ts +8 -8
  146. package/dist/useDraggableLayout.d.cts +1 -0
  147. package/dist/useDraggableLayout.d.ts +1 -0
  148. package/dist/useDynamicFormState.d.cts +2 -2
  149. package/dist/useDynamicFormState.d.ts +2 -2
  150. package/dist/useEdgeInteraction.d.cts +1 -1
  151. package/dist/useEdgeInteraction.d.ts +1 -1
  152. package/dist/useFullscreen.d.cts +41 -23
  153. package/dist/useFullscreen.d.ts +41 -23
  154. package/dist/useGlobalSearch.d.cts +1 -1
  155. package/dist/useGlobalSearch.d.ts +1 -1
  156. package/dist/useInfiniteScroll.d.cts +7 -5
  157. package/dist/useInfiniteScroll.d.ts +7 -5
  158. package/dist/useQRCode.d.cts +3 -3
  159. package/dist/useQRCode.d.ts +3 -3
  160. package/dist/useSignatureHistory.d.cts +5 -5
  161. package/dist/useSignatureHistory.d.ts +5 -5
  162. package/dist/useSplitResize.d.cts +10 -11
  163. package/dist/useSplitResize.d.ts +10 -11
  164. package/dist/useTableQuery.cjs +1 -1
  165. package/dist/useTableQuery.d.cts +12 -16
  166. package/dist/useTableQuery.d.ts +12 -16
  167. package/dist/useTableQuery.js +1 -1
  168. package/dist/useWorkflowValidation.d.cts +91 -83
  169. package/dist/useWorkflowValidation.d.ts +91 -83
  170. package/dist/verification.d.cts +4 -4
  171. package/dist/verification.d.ts +4 -4
  172. package/docs/architecture.en.md +3 -1
  173. package/docs/architecture.md +3 -1
  174. package/docs/guides/usage.en.md +16 -0
  175. package/docs/guides/usage.md +56 -0
  176. package/package.json +27 -10
  177. package/dist/context.cjs +0 -1
  178. package/dist/context.js +0 -1
@@ -1,21 +1,30 @@
1
1
  import { a as RouteItem, t as MenuAdapterConfig } from "./public.js";
2
2
  import * as vue from "vue";
3
3
  import { Ref } from "vue";
4
- import * as naive_ui0 from "naive-ui";
5
4
  import { DropdownProps, MenuInst, MenuOption } from "naive-ui";
6
5
 
7
6
  //#region src/components/C_Menu/types.d.ts
8
- type MenuValue = string | null;
9
- interface MenuProps {
10
- options?: MenuOption[];
7
+ type MenuKey = string | number;
8
+ type MenuValue = MenuKey | null;
9
+ type OwnMenuKey<Option> = Option extends {
10
+ key?: infer Key;
11
+ } ? Extract<Key, MenuKey> : never;
12
+ /** 已遇到的递归业务类型或原生完整键类型均停止展开,内联配置包含子节点。 */
13
+ type MenuOptionKeys<Option, Seen = never> = Option extends Seen ? OwnMenuKey<Option> : MenuKey extends OwnMenuKey<Option> ? MenuKey : OwnMenuKey<Option> | (Option extends {
14
+ children?: infer Children;
15
+ } ? Children extends readonly unknown[] ? MenuOptionKeys<Children[number], Seen | Option> : never : never);
16
+ type WidenMenuKey<Key> = Key extends string ? string : Key extends number ? number : never;
17
+ type MenuSelectionKey<O extends MenuOption[] | undefined> = O extends MenuOption[] ? [MenuOptionKeys<O[number]>] extends [never] ? MenuKey : WidenMenuKey<MenuOptionKeys<O[number]>> : string;
18
+ interface MenuProps<O extends MenuOption[] | undefined = MenuOption[] | undefined> {
19
+ options?: O;
11
20
  routes?: RouteItem[];
12
21
  adapterConfig?: MenuAdapterConfig;
13
22
  labelFormatter?: (label: string) => string;
14
23
  /** @deprecated Use modelValue. */
15
24
  value?: MenuValue;
16
25
  modelValue?: MenuValue;
17
- expandedKeys?: string[];
18
- defaultExpandedKeys?: string[];
26
+ expandedKeys?: MenuKey[];
27
+ defaultExpandedKeys?: MenuKey[];
19
28
  mode?: 'vertical' | 'horizontal';
20
29
  collapsed?: boolean;
21
30
  collapsedWidth?: number;
@@ -26,48 +35,43 @@ interface MenuProps {
26
35
  rootIndent?: number;
27
36
  dropdownProps?: DropdownProps;
28
37
  }
29
- interface MenuEmits {
30
- select: [key: string];
38
+ interface MenuEmits<O extends MenuOption[] | undefined = MenuOption[] | undefined> {
39
+ select: [key: MenuSelectionKey<O>];
31
40
  /** 鼠标或键盘聚焦叶子项时触发,可用于无副作用的路由预取。 */
32
- intent: [key: string];
33
- 'update:modelValue': [key: MenuValue];
41
+ intent: [key: MenuSelectionKey<O>];
42
+ 'update:modelValue': [key: MenuSelectionKey<O> | null];
34
43
  /** @deprecated Use update:modelValue. */
35
- 'update:value': [key: MenuValue];
36
- 'update:expandedKeys': [keys: string[]];
44
+ 'update:value': [key: MenuSelectionKey<O> | null];
45
+ 'update:expandedKeys': [keys: MenuSelectionKey<O>[]];
37
46
  }
38
47
  interface MenuExpose {
39
- showOption: (key: string) => void;
48
+ showOption: (key: MenuKey) => void;
40
49
  /** Vue 公开实例会解包顶层 Ref。 */
41
50
  menuRef: MenuInst | null;
42
51
  }
43
52
  //#endregion
44
53
  //#region src/components/C_Menu/index.vue.d.ts
45
- declare const __VLS_export: vue.DefineComponent<MenuProps, {
46
- showOption: (key: string) => void | undefined;
47
- menuRef: Ref<MenuInst | null, MenuInst | null>;
48
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
49
- select: (key: string) => any;
50
- "update:modelValue": (key: MenuValue) => any;
51
- "update:expandedKeys": (keys: string[]) => any;
52
- intent: (key: string) => any;
53
- "update:value": (key: MenuValue) => any;
54
- }, string, vue.PublicProps, Readonly<MenuProps> & Readonly<{
55
- onSelect?: ((key: string) => any) | undefined;
56
- "onUpdate:modelValue"?: ((key: MenuValue) => any) | undefined;
57
- "onUpdate:expandedKeys"?: ((keys: string[]) => any) | undefined;
58
- onIntent?: ((key: string) => any) | undefined;
59
- "onUpdate:value"?: ((key: MenuValue) => any) | undefined;
60
- }>, {
61
- mode: "vertical" | "horizontal";
62
- defaultExpandedKeys: string[];
63
- indent: number;
64
- collapsed: boolean;
65
- collapsedWidth: number;
66
- collapsedIconSize: number;
67
- inverted: boolean;
68
- rootIndent: number;
69
- dropdownProps: naive_ui0.DropdownProps;
70
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
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
+ props: vue.PublicProps & __VLS_PrettifyLocal<MenuProps<Options> & {
56
+ "onUpdate:modelValue"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
57
+ onSelect?: ((key: MenuSelectionKey<Options>) => any) | undefined;
58
+ onIntent?: ((key: MenuSelectionKey<Options>) => any) | undefined;
59
+ "onUpdate:value"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
60
+ "onUpdate:expandedKeys"?: ((keys: MenuSelectionKey<Options>[]) => any) | undefined;
61
+ }> & (typeof globalThis extends {
62
+ __VLS_PROPS_FALLBACK: infer P;
63
+ } ? P : {});
64
+ expose: (exposed: vue.ShallowUnwrapRef<{
65
+ showOption: (key: MenuKey) => void | undefined;
66
+ menuRef: Ref<MenuInst | null, MenuInst | null>;
67
+ }>) => void;
68
+ attrs: any;
69
+ slots: {};
70
+ emit: ((evt: "update:modelValue", key: MenuSelectionKey<Options> | null) => void) & ((evt: "select", key: MenuSelectionKey<Options>) => void) & ((evt: "intent", key: MenuSelectionKey<Options>) => void) & ((evt: "update:value", key: MenuSelectionKey<Options> | null) => void) & ((evt: "update:expandedKeys", keys: MenuSelectionKey<Options>[]) => void);
71
+ }>) => vue.VNode & {
72
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
73
+ };
71
74
  declare const _default: typeof __VLS_export;
75
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
72
76
  //#endregion
73
- export { MenuValue as a, MenuProps as i, MenuEmits as n, MenuExpose as r, _default as t };
77
+ export { MenuProps as a, MenuKey as i, MenuEmits as n, MenuValue as o, MenuExpose as r, _default as t };
@@ -80,10 +80,10 @@ declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
80
80
  "onNode-expand"?: ((node: OrgChartNode) => any) | undefined;
81
81
  "onNode-collapse"?: ((node: OrgChartNode) => any) | undefined;
82
82
  }>, {
83
- lineColor: string;
84
83
  direction: OrgChartDirection;
85
84
  collapsible: boolean;
86
85
  lineStyle: OrgChartLineStyle;
86
+ lineColor: string;
87
87
  lineWidth: number;
88
88
  nodeSpacing: number;
89
89
  levelSpacing: number;
@@ -80,10 +80,10 @@ declare const __VLS_base: vue.DefineComponent<OrgChartProps, {
80
80
  "onNode-expand"?: ((node: OrgChartNode) => any) | undefined;
81
81
  "onNode-collapse"?: ((node: OrgChartNode) => any) | undefined;
82
82
  }>, {
83
- lineColor: string;
84
83
  direction: OrgChartDirection;
85
84
  collapsible: boolean;
86
85
  lineStyle: OrgChartLineStyle;
86
+ lineColor: string;
87
87
  lineWidth: number;
88
88
  nodeSpacing: number;
89
89
  levelSpacing: number;
@@ -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
- max: number;
76
75
  size: number;
76
+ max: number;
77
+ direction: "ltr" | "rtl";
78
+ clickable: boolean;
77
79
  overlap: number;
78
80
  shape: "circle" | "square";
79
81
  showStatus: boolean;
80
82
  showTooltip: boolean;
81
- 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
- max: number;
76
75
  size: number;
76
+ max: number;
77
+ direction: "ltr" | "rtl";
78
+ clickable: boolean;
77
79
  overlap: number;
78
80
  shape: "circle" | "square";
79
81
  showStatus: boolean;
80
82
  showTooltip: boolean;
81
- 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
@@ -34,9 +34,9 @@ type __VLS_Slots = {} & {
34
34
  indicator?: (props: typeof __VLS_9) => any;
35
35
  };
36
36
  declare const __VLS_base: vue.DefineComponent<Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<Props> & Readonly<{}>, {
37
+ status: "default" | "success" | "error" | "warning" | "info";
37
38
  strokeWidth: number;
38
39
  time: number;
39
- status: "default" | "success" | "error" | "warning" | "info";
40
40
  percentage: number | number[];
41
41
  isAnimation: boolean;
42
42
  indicatorPlacement: "inside" | "outside";
@@ -34,9 +34,9 @@ type __VLS_Slots = {} & {
34
34
  indicator?: (props: typeof __VLS_9) => any;
35
35
  };
36
36
  declare const __VLS_base: vue.DefineComponent<Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<Props> & Readonly<{}>, {
37
+ status: "default" | "success" | "error" | "warning" | "info";
37
38
  strokeWidth: number;
38
39
  time: number;
39
- status: "default" | "success" | "error" | "warning" | "info";
40
40
  percentage: number | number[];
41
41
  isAnimation: boolean;
42
42
  indicatorPlacement: "inside" | "outside";
@@ -86,10 +86,10 @@ type __VLS_Slots = {} & {
86
86
  default?: (props: typeof __VLS_1) => any;
87
87
  };
88
88
  declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
- animation: SkeletonAnimation;
90
89
  repeat: number;
91
90
  loading: boolean;
92
91
  preset: SkeletonPreset;
92
+ animation: SkeletonAnimation;
93
93
  borderRadius: string;
94
94
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
95
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -86,10 +86,10 @@ type __VLS_Slots = {} & {
86
86
  default?: (props: typeof __VLS_1) => any;
87
87
  };
88
88
  declare const __VLS_base: vue.DefineComponent<SkeletonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
89
- animation: SkeletonAnimation;
90
89
  repeat: number;
91
90
  loading: boolean;
92
91
  preset: SkeletonPreset;
92
+ animation: SkeletonAnimation;
93
93
  borderRadius: string;
94
94
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
95
95
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -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;
41
39
  current: number;
40
+ clickable: boolean;
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;
41
39
  current: number;
40
+ clickable: boolean;
41
+ connected: boolean;
42
42
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
43
43
  declare const _default: typeof __VLS_export;
44
44
  //#endregion
@@ -84,19 +84,18 @@ 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
- reverse: boolean;
94
93
  items: TimelineItem[];
95
94
  size: "small" | "medium" | "large";
96
- labelPlacement: "left" | "right" | "alternate";
97
- mode: "vertical" | "horizontal";
95
+ reverse: boolean;
98
96
  pending: boolean;
99
- pendingText: string;
97
+ mode: "vertical" | "horizontal";
98
+ labelPlacement: "left" | "right" | "alternate";
100
99
  lineType: "solid" | "dashed" | "dotted";
101
100
  showTime: boolean;
102
101
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -84,19 +84,18 @@ 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
- reverse: boolean;
94
93
  items: TimelineItem[];
95
94
  size: "small" | "medium" | "large";
96
- labelPlacement: "left" | "right" | "alternate";
97
- mode: "vertical" | "horizontal";
95
+ reverse: boolean;
98
96
  pending: boolean;
99
- pendingText: string;
97
+ mode: "vertical" | "horizontal";
98
+ labelPlacement: "left" | "right" | "alternate";
100
99
  lineType: "solid" | "dashed" | "dotted";
101
100
  showTime: boolean;
102
101
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -28,7 +28,7 @@ interface TransferProps<T extends TransferItem = TransferItem> {
28
28
  /** 右侧已选 key 列表 (v-model) */
29
29
  modelValue: readonly NoInfer<T['key']>[];
30
30
  /** 左右栏标题 */
31
- titles?: [string, string];
31
+ titles?: readonly [string, string];
32
32
  /** 是否可搜索 */
33
33
  filterable?: boolean;
34
34
  /** 搜索占位符 */
@@ -58,14 +58,14 @@ declare const DEFAULT_TRANSFER_PROPS: Partial<TransferProps>;
58
58
  declare const __VLS_export: <T extends TransferItem = TransferItem>(__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<{
59
59
  props: vue.PublicProps & __VLS_PrettifyLocal<TransferProps<T> & {
60
60
  "onUpdate:modelValue"?: ((value: T["key"][]) => any) | undefined;
61
- onChange?: ((targetKeys: T["key"][], direction: "left" | "right", moveKeys: T["key"][]) => any) | undefined;
61
+ onChange?: ((targetKeys: T["key"][], direction: "right" | "left", moveKeys: T["key"][]) => any) | undefined;
62
62
  }> & (typeof globalThis extends {
63
63
  __VLS_PROPS_FALLBACK: infer P;
64
64
  } ? P : {});
65
65
  expose: (exposed: {}) => void;
66
66
  attrs: any;
67
67
  slots: {};
68
- emit: ((evt: "update:modelValue", value: T["key"][]) => void) & ((evt: "change", targetKeys: T["key"][], direction: "left" | "right", moveKeys: T["key"][]) => void);
68
+ emit: ((evt: "update:modelValue", value: T["key"][]) => void) & ((evt: "change", targetKeys: T["key"][], direction: "right" | "left", moveKeys: T["key"][]) => void);
69
69
  }>) => vue.VNode & {
70
70
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
71
71
  };
@@ -28,7 +28,7 @@ interface TransferProps<T extends TransferItem = TransferItem> {
28
28
  /** 右侧已选 key 列表 (v-model) */
29
29
  modelValue: readonly NoInfer<T['key']>[];
30
30
  /** 左右栏标题 */
31
- titles?: [string, string];
31
+ titles?: readonly [string, string];
32
32
  /** 是否可搜索 */
33
33
  filterable?: boolean;
34
34
  /** 搜索占位符 */
@@ -58,14 +58,14 @@ declare const DEFAULT_TRANSFER_PROPS: Partial<TransferProps>;
58
58
  declare const __VLS_export: <T extends TransferItem = TransferItem>(__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<{
59
59
  props: vue.PublicProps & __VLS_PrettifyLocal<TransferProps<T> & {
60
60
  "onUpdate:modelValue"?: ((value: T["key"][]) => any) | undefined;
61
- onChange?: ((targetKeys: T["key"][], direction: "left" | "right", moveKeys: T["key"][]) => any) | undefined;
61
+ onChange?: ((targetKeys: T["key"][], direction: "right" | "left", moveKeys: T["key"][]) => any) | undefined;
62
62
  }> & (typeof globalThis extends {
63
63
  __VLS_PROPS_FALLBACK: infer P;
64
64
  } ? P : {});
65
65
  expose: (exposed: {}) => void;
66
66
  attrs: any;
67
67
  slots: {};
68
- emit: ((evt: "update:modelValue", value: T["key"][]) => void) & ((evt: "change", targetKeys: T["key"][], direction: "left" | "right", moveKeys: T["key"][]) => void);
68
+ emit: ((evt: "update:modelValue", value: T["key"][]) => void) & ((evt: "change", targetKeys: T["key"][], direction: "right" | "left", moveKeys: T["key"][]) => void);
69
69
  }>) => vue.VNode & {
70
70
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
71
71
  };
@@ -20,17 +20,17 @@ 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;
23
24
  label: string;
24
- format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
25
25
  width: number;
26
26
  height: number;
27
+ showBorder: boolean;
28
+ lineColor: string;
29
+ format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
30
+ showLabel: boolean;
27
31
  showText: boolean;
28
- fontSize: number;
29
32
  textPosition: "bottom" | "top";
30
- lineColor: string;
31
33
  background: string;
32
- showBorder: boolean;
33
- showLabel: boolean;
34
34
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
36
36
  //#endregion
@@ -20,17 +20,17 @@ 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;
23
24
  label: string;
24
- format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
25
25
  width: number;
26
26
  height: number;
27
+ showBorder: boolean;
28
+ lineColor: string;
29
+ format: "CODE128" | "CODE39" | "EAN13" | "EAN8" | "UPC" | "ITF14" | "MSI" | "pharmacode";
30
+ showLabel: boolean;
27
31
  showText: boolean;
28
- fontSize: number;
29
32
  textPosition: "bottom" | "top";
30
- lineColor: string;
31
33
  background: string;
32
- showBorder: boolean;
33
- showLabel: boolean;
34
34
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
35
35
  declare const _default: typeof __VLS_export;
36
36
  //#endregion
@@ -1,7 +1,6 @@
1
1
  import { n as RouteItem } from "./types.cjs";
2
2
  import * as vue from "vue";
3
3
  import { Ref, VNode } from "vue";
4
- import * as naive_ui0 from "naive-ui";
5
4
  import { DropdownProps, MenuInst, MenuOption } from "naive-ui";
6
5
 
7
6
  //#region src/components/_shared/menuAdapter.d.ts
@@ -63,17 +62,27 @@ declare function createMenuOptions(routes: RouteItem[], config?: MenuAdapterConf
63
62
  declare function flattenRoutes(routes: RouteItem[], filter?: (route: RouteItem) => boolean): RouteItem[];
64
63
  //#endregion
65
64
  //#region src/components/C_Menu/types.d.ts
66
- type MenuValue = string | null;
67
- interface MenuProps {
68
- options?: MenuOption[];
65
+ type MenuKey = string | number;
66
+ type MenuValue = MenuKey | null;
67
+ type OwnMenuKey<Option> = Option extends {
68
+ key?: infer Key;
69
+ } ? Extract<Key, MenuKey> : never;
70
+ /** 已遇到的递归业务类型或原生完整键类型均停止展开,内联配置包含子节点。 */
71
+ type MenuOptionKeys<Option, Seen = never> = Option extends Seen ? OwnMenuKey<Option> : MenuKey extends OwnMenuKey<Option> ? MenuKey : OwnMenuKey<Option> | (Option extends {
72
+ children?: infer Children;
73
+ } ? Children extends readonly unknown[] ? MenuOptionKeys<Children[number], Seen | Option> : never : never);
74
+ type WidenMenuKey<Key> = Key extends string ? string : Key extends number ? number : never;
75
+ type MenuSelectionKey<O extends MenuOption[] | undefined> = O extends MenuOption[] ? [MenuOptionKeys<O[number]>] extends [never] ? MenuKey : WidenMenuKey<MenuOptionKeys<O[number]>> : string;
76
+ interface MenuProps<O extends MenuOption[] | undefined = MenuOption[] | undefined> {
77
+ options?: O;
69
78
  routes?: RouteItem[];
70
79
  adapterConfig?: MenuAdapterConfig;
71
80
  labelFormatter?: (label: string) => string;
72
81
  /** @deprecated Use modelValue. */
73
82
  value?: MenuValue;
74
83
  modelValue?: MenuValue;
75
- expandedKeys?: string[];
76
- defaultExpandedKeys?: string[];
84
+ expandedKeys?: MenuKey[];
85
+ defaultExpandedKeys?: MenuKey[];
77
86
  mode?: 'vertical' | 'horizontal';
78
87
  collapsed?: boolean;
79
88
  collapsedWidth?: number;
@@ -84,48 +93,43 @@ interface MenuProps {
84
93
  rootIndent?: number;
85
94
  dropdownProps?: DropdownProps;
86
95
  }
87
- interface MenuEmits {
88
- select: [key: string];
96
+ interface MenuEmits<O extends MenuOption[] | undefined = MenuOption[] | undefined> {
97
+ select: [key: MenuSelectionKey<O>];
89
98
  /** 鼠标或键盘聚焦叶子项时触发,可用于无副作用的路由预取。 */
90
- intent: [key: string];
91
- 'update:modelValue': [key: MenuValue];
99
+ intent: [key: MenuSelectionKey<O>];
100
+ 'update:modelValue': [key: MenuSelectionKey<O> | null];
92
101
  /** @deprecated Use update:modelValue. */
93
- 'update:value': [key: MenuValue];
94
- 'update:expandedKeys': [keys: string[]];
102
+ 'update:value': [key: MenuSelectionKey<O> | null];
103
+ 'update:expandedKeys': [keys: MenuSelectionKey<O>[]];
95
104
  }
96
105
  interface MenuExpose {
97
- showOption: (key: string) => void;
106
+ showOption: (key: MenuKey) => void;
98
107
  /** Vue 公开实例会解包顶层 Ref。 */
99
108
  menuRef: MenuInst | null;
100
109
  }
101
110
  //#endregion
102
111
  //#region src/components/C_Menu/index.vue.d.ts
103
- declare const __VLS_export: vue.DefineComponent<MenuProps, {
104
- showOption: (key: string) => void | undefined;
105
- menuRef: Ref<MenuInst | null, MenuInst | null>;
106
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
107
- select: (key: string) => any;
108
- "update:modelValue": (key: MenuValue) => any;
109
- "update:expandedKeys": (keys: string[]) => any;
110
- intent: (key: string) => any;
111
- "update:value": (key: MenuValue) => any;
112
- }, string, vue.PublicProps, Readonly<MenuProps> & Readonly<{
113
- onSelect?: ((key: string) => any) | undefined;
114
- "onUpdate:modelValue"?: ((key: MenuValue) => any) | undefined;
115
- "onUpdate:expandedKeys"?: ((keys: string[]) => any) | undefined;
116
- onIntent?: ((key: string) => any) | undefined;
117
- "onUpdate:value"?: ((key: MenuValue) => any) | undefined;
118
- }>, {
119
- mode: "vertical" | "horizontal";
120
- defaultExpandedKeys: string[];
121
- indent: number;
122
- collapsed: boolean;
123
- collapsedWidth: number;
124
- collapsedIconSize: number;
125
- inverted: boolean;
126
- rootIndent: number;
127
- dropdownProps: naive_ui0.DropdownProps;
128
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
112
+ 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<{
113
+ props: vue.PublicProps & __VLS_PrettifyLocal<MenuProps<Options> & {
114
+ "onUpdate:modelValue"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
115
+ onSelect?: ((key: MenuSelectionKey<Options>) => any) | undefined;
116
+ onIntent?: ((key: MenuSelectionKey<Options>) => any) | undefined;
117
+ "onUpdate:value"?: ((key: MenuSelectionKey<Options> | null) => any) | undefined;
118
+ "onUpdate:expandedKeys"?: ((keys: MenuSelectionKey<Options>[]) => any) | undefined;
119
+ }> & (typeof globalThis extends {
120
+ __VLS_PROPS_FALLBACK: infer P;
121
+ } ? P : {});
122
+ expose: (exposed: vue.ShallowUnwrapRef<{
123
+ showOption: (key: MenuKey) => void | undefined;
124
+ menuRef: Ref<MenuInst | null, MenuInst | null>;
125
+ }>) => void;
126
+ attrs: any;
127
+ slots: {};
128
+ emit: ((evt: "update:modelValue", key: MenuSelectionKey<Options> | null) => void) & ((evt: "select", key: MenuSelectionKey<Options>) => void) & ((evt: "intent", key: MenuSelectionKey<Options>) => void) & ((evt: "update:value", key: MenuSelectionKey<Options> | null) => void) & ((evt: "update:expandedKeys", keys: MenuSelectionKey<Options>[]) => void);
129
+ }>) => vue.VNode & {
130
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
131
+ };
129
132
  declare const _default: typeof __VLS_export;
133
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
130
134
  //#endregion
131
- export { MenuValue as a, flattenRoutes as c, MenuProps as i, MenuEmits as n, MenuAdapterConfig as o, MenuExpose as r, createMenuOptions as s, _default as t };
135
+ export { MenuProps as a, createMenuOptions as c, MenuKey as i, flattenRoutes as l, MenuEmits as n, MenuValue as o, MenuExpose as r, MenuAdapterConfig as s, _default as t };
@@ -88,26 +88,24 @@ type __VLS_Slots = {} & {
88
88
  declare const __VLS_base: vue.DefineComponent<ChatProps, {
89
89
  scrollToBottom: () => void;
90
90
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
91
+ "load-more": () => any;
91
92
  send: (content: string) => any;
92
93
  "select-contact": (id: string) => any;
93
- "load-more": () => any;
94
94
  "image-preview": (url: string) => any;
95
95
  "file-click": (msg: ChatMessage) => any;
96
96
  "file-upload": () => any;
97
97
  "emoji-click": () => any;
98
98
  resend: (msg: ChatMessage) => any;
99
99
  }, string, vue.PublicProps, Readonly<ChatProps> & Readonly<{
100
+ "onLoad-more"?: (() => any) | undefined;
100
101
  onSend?: ((content: string) => any) | undefined;
101
102
  "onSelect-contact"?: ((id: string) => any) | undefined;
102
- "onLoad-more"?: (() => any) | undefined;
103
103
  "onImage-preview"?: ((url: string) => any) | undefined;
104
104
  "onFile-click"?: ((msg: ChatMessage) => any) | undefined;
105
105
  "onFile-upload"?: (() => any) | undefined;
106
106
  "onEmoji-click"?: (() => any) | undefined;
107
107
  onResend?: ((msg: ChatMessage) => any) | undefined;
108
108
  }>, {
109
- placeholder: string;
110
- title: string;
111
109
  virtualScroll: boolean;
112
110
  showContacts: boolean;
113
111
  showTimestamp: boolean;
@@ -88,26 +88,24 @@ type __VLS_Slots = {} & {
88
88
  declare const __VLS_base: vue.DefineComponent<ChatProps, {
89
89
  scrollToBottom: () => void;
90
90
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
91
+ "load-more": () => any;
91
92
  send: (content: string) => any;
92
93
  "select-contact": (id: string) => any;
93
- "load-more": () => any;
94
94
  "image-preview": (url: string) => any;
95
95
  "file-click": (msg: ChatMessage) => any;
96
96
  "file-upload": () => any;
97
97
  "emoji-click": () => any;
98
98
  resend: (msg: ChatMessage) => any;
99
99
  }, string, vue.PublicProps, Readonly<ChatProps> & Readonly<{
100
+ "onLoad-more"?: (() => any) | undefined;
100
101
  onSend?: ((content: string) => any) | undefined;
101
102
  "onSelect-contact"?: ((id: string) => any) | undefined;
102
- "onLoad-more"?: (() => any) | undefined;
103
103
  "onImage-preview"?: ((url: string) => any) | undefined;
104
104
  "onFile-click"?: ((msg: ChatMessage) => any) | undefined;
105
105
  "onFile-upload"?: (() => any) | undefined;
106
106
  "onEmoji-click"?: (() => any) | undefined;
107
107
  onResend?: ((msg: ChatMessage) => any) | undefined;
108
108
  }>, {
109
- placeholder: string;
110
- title: string;
111
109
  virtualScroll: boolean;
112
110
  showContacts: boolean;
113
111
  showTimestamp: boolean;
@@ -61,27 +61,27 @@ declare const __VLS_export: vue.DefineComponent<ContextMenuProps, {
61
61
  close: () => void; /** 当前是否可见 */
62
62
  visible: vue.ComputedRef<boolean>;
63
63
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
64
- select: (item: ContextMenuItem) => any;
65
64
  close: () => any;
66
65
  open: (position: {
67
66
  x: number;
68
67
  y: number;
69
68
  }) => any;
69
+ select: (item: ContextMenuItem) => any;
70
70
  }, string, vue.PublicProps, Readonly<ContextMenuProps> & Readonly<{
71
- onSelect?: ((item: ContextMenuItem) => any) | undefined;
72
71
  onClose?: (() => any) | undefined;
73
72
  onOpen?: ((position: {
74
73
  x: number;
75
74
  y: number;
76
75
  }) => any) | undefined;
76
+ onSelect?: ((item: ContextMenuItem) => any) | undefined;
77
77
  }>, {
78
78
  items: ContextMenuItem[];
79
79
  disabled: boolean;
80
- zIndex: number;
81
80
  minWidth: number;
82
81
  maxWidth: number;
83
82
  subMenuPlacement: "right" | "left";
84
83
  autoClose: boolean;
84
+ zIndex: number;
85
85
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
86
86
  declare const _default: typeof __VLS_export;
87
87
  //#endregion
@@ -91,8 +91,8 @@ declare const __VLS_export: vue.DefineComponent<MapProps, MapExpose, {}, {}, {},
91
91
  onReady?: ((map: MapInstance) => any) | undefined;
92
92
  onMarkerClick?: ((marker: MapMarker, event: MapMarkerEvent) => any) | undefined;
93
93
  }>, {
94
- height: string;
95
94
  center: MapCoordinate;
95
+ height: string;
96
96
  ariaLabel: string;
97
97
  zoom: number;
98
98
  mapType: MapType;