@robot-admin/naive-ui-components 0.26.0 → 0.28.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 (182) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +9 -11
  3. package/README_EN.md +8 -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 +176 -171
  39. package/dist/C_Table.css +145 -158
  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 +2 -2
  61. package/dist/constants.d.ts +2 -2
  62. package/dist/constants2.d.cts +173 -402
  63. package/dist/constants2.d.ts +173 -402
  64. package/dist/constants3.d.cts +2 -2
  65. package/dist/constants3.d.ts +2 -2
  66. package/dist/constants4.d.cts +402 -173
  67. package/dist/constants4.d.ts +402 -173
  68. package/dist/data.cjs +1 -1
  69. package/dist/data.d.cts +1 -2
  70. package/dist/data.d.ts +1 -2
  71. package/dist/data.js +1 -1
  72. package/dist/data2.d.cts +5 -5
  73. package/dist/data2.d.ts +5 -5
  74. package/dist/dateRange.d.cts +3 -2
  75. package/dist/dateRange.d.ts +3 -2
  76. package/dist/helpers.cjs +1 -1
  77. package/dist/helpers.js +1 -1
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.d.cts +34 -34
  80. package/dist/index.d.ts +41 -42
  81. package/dist/index.js +1 -1
  82. package/dist/index.vue.d.cts +4 -4
  83. package/dist/index.vue.d.ts +4 -4
  84. package/dist/index10.vue.d.cts +1 -1
  85. package/dist/index10.vue.d.ts +1 -1
  86. package/dist/index11.vue.d.cts +1 -1
  87. package/dist/index11.vue.d.ts +7 -4
  88. package/dist/index12.vue.d.cts +7 -4
  89. package/dist/index13.vue.d.ts +4 -4
  90. package/dist/index14.vue.d.cts +4 -4
  91. package/dist/index15.vue.d.ts +52 -54
  92. package/dist/index16.vue.d.cts +52 -54
  93. package/dist/index16.vue.d.ts +125 -13
  94. package/dist/index17.vue.d.cts +125 -13
  95. package/dist/index17.vue.d.ts +51 -123
  96. package/dist/index18.vue.d.cts +51 -123
  97. package/dist/index18.vue.d.ts +26 -47
  98. package/dist/index19.vue.d.cts +26 -47
  99. package/dist/index19.vue.d.ts +13 -38
  100. package/dist/index2.vue.d.cts +1 -1
  101. package/dist/index2.vue.d.ts +1 -1
  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 +4 -4
  123. package/dist/index3.vue.d.ts +4 -4
  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/index6.vue.d.ts +2 -2
  129. package/dist/index7.vue.d.cts +2 -2
  130. package/dist/index7.vue.d.ts +2 -2
  131. package/dist/index8.vue.d.cts +2 -2
  132. package/dist/index8.vue.d.ts +2 -2
  133. package/dist/index9.vue.d.cts +2 -2
  134. package/dist/index9.vue.d.ts +1 -1
  135. package/dist/mapUtils.d.cts +1 -1
  136. package/dist/mapUtils.d.ts +1 -1
  137. package/dist/options.cjs +1 -0
  138. package/dist/options.d.cts +9 -0
  139. package/dist/options.js +1 -0
  140. package/dist/serializeSearch.cjs +1 -1
  141. package/dist/serializeSearch.js +1 -1
  142. package/dist/style.css +256 -251
  143. package/dist/useCalendarEvents.d.cts +1 -1
  144. package/dist/useCalendarEvents.d.ts +1 -1
  145. package/dist/useCollapsePanel.d.cts +5 -5
  146. package/dist/useCollapsePanel.d.ts +5 -5
  147. package/dist/useComponentLocale.cjs +1 -1
  148. package/dist/useComponentLocale.js +1 -1
  149. package/dist/useCropperCore.d.cts +5 -5
  150. package/dist/useCropperCore.d.ts +5 -5
  151. package/dist/useDynamicFormState.d.cts +11 -969
  152. package/dist/useDynamicFormState.d.ts +11 -959
  153. package/dist/useEdgeInteraction.d.cts +3 -3
  154. package/dist/useEdgeInteraction.d.ts +3 -3
  155. package/dist/useFormConfig.d.cts +5 -5
  156. package/dist/useFormConfig.d.ts +13 -6
  157. package/dist/useFullscreen.d.cts +3 -3
  158. package/dist/useFullscreen.d.ts +3 -3
  159. package/dist/useInfiniteScroll.d.cts +4 -4
  160. package/dist/useInfiniteScroll.d.ts +4 -4
  161. package/dist/useQRCode.d.cts +2 -2
  162. package/dist/useQRCode.d.ts +2 -2
  163. package/dist/useSignatureHistory.d.cts +6 -6
  164. package/dist/useSignatureHistory.d.ts +6 -6
  165. package/dist/useSplitResize.d.cts +6 -6
  166. package/dist/useSplitResize.d.ts +6 -6
  167. package/dist/useTableQuery.d.cts +905 -0
  168. package/dist/useTableQuery.d.ts +895 -0
  169. package/dist/useWorkflowValidation.d.cts +4 -4
  170. package/dist/useWorkflowValidation.d.ts +4 -4
  171. package/docs/guides/data-workflows.md +8 -48
  172. package/docs/guides/search-workflows.md +3 -5
  173. package/docs/guides/table-density.md +9 -1
  174. package/docs/guides/usage.en.md +4 -0
  175. package/docs/guides/usage.md +41 -0
  176. package/package.json +1 -1
  177. package/dist/dictionary.cjs +0 -1
  178. package/dist/dictionary.d.cts +0 -47
  179. package/dist/dictionary.d.ts +0 -47
  180. package/dist/dictionary.js +0 -1
  181. package/dist/useDictionary.cjs +0 -1
  182. package/dist/useDictionary.js +0 -1
@@ -75,9 +75,9 @@ declare const __VLS_export: vue.DefineComponent<ContextMenuProps, {
75
75
  y: number;
76
76
  }) => any) | undefined;
77
77
  }>, {
78
+ items: ContextMenuItem[];
78
79
  disabled: boolean;
79
80
  minWidth: number;
80
- items: ContextMenuItem[];
81
81
  maxWidth: number;
82
82
  subMenuPlacement: "right" | "left";
83
83
  autoClose: boolean;
@@ -1,9 +1,9 @@
1
1
  import { o as ActionItem, t as ActionBarConfig } from "./types.js";
2
2
  import { n as ComponentLocale, t as ComponentFeedback } from "./contracts.js";
3
- import { t as DictionaryBinding } from "./dictionary.js";
4
3
  import { t as ComponentDensity } from "./density.js";
5
4
  import * as vue from "vue";
6
5
  import { ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Ref, VNodeChild } from "vue";
6
+ import * as naive_ui0 from "naive-ui";
7
7
  import { DataTableBaseColumn, DataTableRowKey, FormItemRule, PaginationProps } from "naive-ui";
8
8
 
9
9
  //#region src/components/C_Table/columnPresentation.d.ts
@@ -767,7 +767,9 @@ interface BaseConfig<T extends object = DataRecord> {
767
767
  enabled?: boolean;
768
768
  rowCheckable?: (row: T) => boolean;
769
769
  }
770
- type SelectOption = BaseOption;
770
+ type SelectOption = Omit<BaseOption, 'value'> & {
771
+ value: string | number | boolean;
772
+ };
771
773
  interface EditProps {
772
774
  min?: number;
773
775
  max?: number;
@@ -777,6 +779,7 @@ interface EditProps {
777
779
  rows?: number;
778
780
  placeholder?: string;
779
781
  options?: SelectOption[];
782
+ fallbackOption?: naive_ui0.SelectProps['fallbackOption'];
780
783
  rules?: FormItemRule[];
781
784
  format?: string;
782
785
  valueFormat?: string;
@@ -810,8 +813,6 @@ interface BaseTableColumn<T extends object = DataRecord> extends Omit<DataTableB
810
813
  status?: ColumnStatus;
811
814
  /** 未声明 width 时默认按内容测宽;false 使用 display.columnWidth。 */
812
815
  autoWidth?: boolean;
813
- /** 字典显示低于 render/formatter;编辑时显式 editProps.options 优先。 */
814
- dictionary?: DictionaryBinding;
815
816
  fixed?: 'left' | 'right';
816
817
  resizable?: boolean;
817
818
  minWidth?: number;
@@ -875,6 +876,8 @@ interface TableRuntimeProps<T extends object = DataRecord, C = unknown> {
875
876
  data?: MaybeRefLike<T[]>;
876
877
  loading?: MaybeRefLike<boolean>;
877
878
  rowKey?: TableRowKey<T>;
879
+ /** 默认生成序号列;false 关闭自动列,显式声明的 index 列按列配置展示。 */
880
+ rowNumber?: boolean;
878
881
  /** 功能配置的统一入口。 */
879
882
  config?: TableConfig<T, C>;
880
883
  /** CRUD 模式自动提供 columns / data / loading,可省略对应属性。 */
@@ -1,9 +1,9 @@
1
1
  import { o as ActionItem, t as ActionBarConfig } from "./types.cjs";
2
2
  import { n as ComponentLocale, t as ComponentFeedback } from "./contracts.cjs";
3
- import { t as DictionaryBinding } from "./dictionary.cjs";
4
3
  import { t as ComponentDensity } from "./density.cjs";
5
4
  import * as vue from "vue";
6
5
  import { ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Ref, VNodeChild } from "vue";
6
+ import * as naive_ui0 from "naive-ui";
7
7
  import { DataTableBaseColumn, DataTableRowKey, FormItemRule, PaginationProps } from "naive-ui";
8
8
 
9
9
  //#region src/components/C_Table/columnPresentation.d.ts
@@ -767,7 +767,9 @@ interface BaseConfig<T extends object = DataRecord> {
767
767
  enabled?: boolean;
768
768
  rowCheckable?: (row: T) => boolean;
769
769
  }
770
- type SelectOption = BaseOption;
770
+ type SelectOption = Omit<BaseOption, 'value'> & {
771
+ value: string | number | boolean;
772
+ };
771
773
  interface EditProps {
772
774
  min?: number;
773
775
  max?: number;
@@ -777,6 +779,7 @@ interface EditProps {
777
779
  rows?: number;
778
780
  placeholder?: string;
779
781
  options?: SelectOption[];
782
+ fallbackOption?: naive_ui0.SelectProps['fallbackOption'];
780
783
  rules?: FormItemRule[];
781
784
  format?: string;
782
785
  valueFormat?: string;
@@ -810,8 +813,6 @@ interface BaseTableColumn<T extends object = DataRecord> extends Omit<DataTableB
810
813
  status?: ColumnStatus;
811
814
  /** 未声明 width 时默认按内容测宽;false 使用 display.columnWidth。 */
812
815
  autoWidth?: boolean;
813
- /** 字典显示低于 render/formatter;编辑时显式 editProps.options 优先。 */
814
- dictionary?: DictionaryBinding;
815
816
  fixed?: 'left' | 'right';
816
817
  resizable?: boolean;
817
818
  minWidth?: number;
@@ -875,6 +876,8 @@ interface TableRuntimeProps<T extends object = DataRecord, C = unknown> {
875
876
  data?: MaybeRefLike<T[]>;
876
877
  loading?: MaybeRefLike<boolean>;
877
878
  rowKey?: TableRowKey<T>;
879
+ /** 默认生成序号列;false 关闭自动列,显式声明的 index 列按列配置展示。 */
880
+ rowNumber?: boolean;
878
881
  /** 功能配置的统一入口。 */
879
882
  config?: TableConfig<T, C>;
880
883
  /** CRUD 模式自动提供 columns / data / loading,可省略对应属性。 */
@@ -43,21 +43,21 @@ declare const __VLS_export: vue.DefineComponent<Props, {
43
43
  isInitialized: Readonly<vue.Ref<boolean, boolean>>;
44
44
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
45
45
  "update:modelValue": (value: string) => any;
46
- error: (error: Error) => any;
47
46
  "editor-mounted": (editor: EditorInstance) => any;
48
47
  "editor-change": (html: string) => any;
48
+ error: (error: Error) => any;
49
49
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
50
50
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
51
- onError?: ((error: Error) => any) | undefined;
52
51
  "onEditor-mounted"?: ((editor: EditorInstance) => any) | undefined;
53
52
  "onEditor-change"?: ((html: string) => any) | undefined;
53
+ onError?: ((error: Error) => any) | undefined;
54
54
  }>, {
55
55
  modelValue: string;
56
- height: number;
56
+ placeholder: string;
57
57
  disabled: boolean;
58
58
  readonly: boolean;
59
+ height: number;
59
60
  theme: "light" | "dark";
60
- placeholder: string;
61
61
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
62
62
  declare const _default: typeof __VLS_export;
63
63
  //#endregion
@@ -43,21 +43,21 @@ declare const __VLS_export: vue.DefineComponent<Props, {
43
43
  isInitialized: Readonly<vue.Ref<boolean, boolean>>;
44
44
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
45
45
  "update:modelValue": (value: string) => any;
46
- error: (error: Error) => any;
47
46
  "editor-mounted": (editor: EditorInstance) => any;
48
47
  "editor-change": (html: string) => any;
48
+ error: (error: Error) => any;
49
49
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
50
50
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
51
- onError?: ((error: Error) => any) | undefined;
52
51
  "onEditor-mounted"?: ((editor: EditorInstance) => any) | undefined;
53
52
  "onEditor-change"?: ((html: string) => any) | undefined;
53
+ onError?: ((error: Error) => any) | undefined;
54
54
  }>, {
55
55
  modelValue: string;
56
- height: number;
56
+ placeholder: string;
57
57
  disabled: boolean;
58
58
  readonly: boolean;
59
+ height: number;
59
60
  theme: "light" | "dark";
60
- placeholder: string;
61
61
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
62
62
  declare const _default: typeof __VLS_export;
63
63
  //#endregion
@@ -1,60 +1,58 @@
1
+ import { E as FormRecord, T as FormOption, n as FormConfig, z as SubmitEventPayload } from "./useFormConfig.js";
1
2
  import * as vue from "vue";
2
- import { Component } from "vue";
3
+ import { ComputedRef, Ref } from "vue";
3
4
 
4
- //#region src/components/C_Icon/types.d.ts
5
- interface IconProps {
6
- name?: string | Component;
7
- type?: 'iconify' | 'unocss' | 'component' | 'svg' | 'image';
8
- color?: string;
9
- size?: number | string;
10
- svgPath?: string;
11
- viewBox?: string;
12
- alt?: string;
13
- clickable?: boolean;
14
- loading?: boolean;
15
- fallbackIcon?: string;
16
- /** 图标 API 请求超时(毫秒);超时后显示离线占位或配置的回退图标。 */
17
- loadTimeout?: number;
18
- title?: string;
19
- ariaLabel?: string;
20
- customClass?: string;
21
- rotate?: number;
22
- flip?: 'horizontal' | 'vertical' | 'both';
23
- componentProps?: Record<string, unknown>;
5
+ //#region src/components/C_FormModal/types.d.ts
6
+ type FormModalMode = 'create' | 'edit';
7
+ /**
8
+ * Structural editor contract. It intentionally does not depend on request-core,
9
+ * so any headless CRUD implementation can drive the modal.
10
+ */
11
+ interface FormModalEditor<T extends object = FormRecord> {
12
+ visible: Ref<boolean>;
13
+ mode: Ref<FormModalMode>;
14
+ model: Ref<T | null>;
15
+ title: Ref<string>;
16
+ loading: Ref<boolean> | ComputedRef<boolean>;
17
+ setModel(model: T): void;
18
+ close(): void;
19
+ submit(model?: T): Promise<boolean>;
20
+ }
21
+ interface FormModalProps<T extends object = FormRecord> {
22
+ editor: FormModalEditor<T>;
23
+ options: FormOption<T>[];
24
+ config?: FormConfig<T>;
25
+ width?: number | string;
26
+ createText?: string;
27
+ saveText?: string;
28
+ cancelText?: string;
29
+ closable?: boolean;
30
+ maskClosable?: boolean;
31
+ closeOnEsc?: boolean;
32
+ }
33
+ interface FormModalEmits<T extends object = FormRecord> {
34
+ submit: [payload: SubmitEventPayload<T>, saved: boolean];
35
+ close: [];
24
36
  }
25
37
  //#endregion
26
- //#region src/components/C_Icon/index.vue.d.ts
27
- declare const __VLS_export: vue.DefineComponent<IconProps, {
28
- validate: () => void;
29
- hasError: Readonly<vue.Ref<boolean, boolean>>;
30
- errorMessage: Readonly<vue.Ref<string, string>>;
31
- el: vue.Ref<HTMLElement | undefined, HTMLElement | undefined>;
32
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
33
- error: (type: string, error?: unknown) => any;
34
- click: (event: MouseEvent | KeyboardEvent) => any;
35
- load: () => any;
36
- }, string, vue.PublicProps, Readonly<IconProps> & Readonly<{
37
- onError?: ((type: string, error?: unknown) => any) | undefined;
38
- onClick?: ((event: MouseEvent | KeyboardEvent) => any) | undefined;
39
- onLoad?: (() => any) | undefined;
40
- }>, {
41
- color: string;
42
- size: number | string;
43
- title: string;
44
- loading: boolean;
45
- type: "iconify" | "unocss" | "component" | "svg" | "image";
46
- ariaLabel: string;
47
- svgPath: string;
48
- viewBox: string;
49
- alt: string;
50
- clickable: boolean;
51
- fallbackIcon: string;
52
- loadTimeout: number;
53
- customClass: string;
54
- rotate: number;
55
- flip: "horizontal" | "vertical" | "both";
56
- componentProps: Record<string, unknown>;
57
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
38
+ //#region src/components/C_FormModal/index.vue.d.ts
39
+ declare const __VLS_export: <T extends object = FormRecord>(__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<{
40
+ props: vue.PublicProps & __VLS_PrettifyLocal<FormModalProps<T> & {
41
+ onClose?: (() => any) | undefined;
42
+ onSubmit?: ((payload: SubmitEventPayload<T>, saved: boolean) => any) | undefined;
43
+ }> & (typeof globalThis extends {
44
+ __VLS_PROPS_FALLBACK: infer P;
45
+ } ? P : {});
46
+ expose: (exposed: {}) => void;
47
+ attrs: any;
48
+ slots: {
49
+ [x: string]: ((props: any) => any) | undefined;
50
+ };
51
+ emit: ((evt: "close") => void) & ((evt: "submit", payload: SubmitEventPayload<T>, saved: boolean) => void);
52
+ }>) => vue.VNode & {
53
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
54
+ };
58
55
  declare const _default: typeof __VLS_export;
56
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
59
57
  //#endregion
60
- export { IconProps as n, _default as t };
58
+ export { FormModalProps as a, FormModalMode as i, FormModalEditor as n, FormModalEmits as r, _default as t };
@@ -1,60 +1,58 @@
1
+ import { E as FormRecord, T as FormOption, n as FormConfig, z as SubmitEventPayload } from "./useFormConfig.cjs";
1
2
  import * as vue from "vue";
2
- import { Component } from "vue";
3
+ import { ComputedRef, Ref } from "vue";
3
4
 
4
- //#region src/components/C_Icon/types.d.ts
5
- interface IconProps {
6
- name?: string | Component;
7
- type?: 'iconify' | 'unocss' | 'component' | 'svg' | 'image';
8
- color?: string;
9
- size?: number | string;
10
- svgPath?: string;
11
- viewBox?: string;
12
- alt?: string;
13
- clickable?: boolean;
14
- loading?: boolean;
15
- fallbackIcon?: string;
16
- /** 图标 API 请求超时(毫秒);超时后显示离线占位或配置的回退图标。 */
17
- loadTimeout?: number;
18
- title?: string;
19
- ariaLabel?: string;
20
- customClass?: string;
21
- rotate?: number;
22
- flip?: 'horizontal' | 'vertical' | 'both';
23
- componentProps?: Record<string, unknown>;
5
+ //#region src/components/C_FormModal/types.d.ts
6
+ type FormModalMode = 'create' | 'edit';
7
+ /**
8
+ * Structural editor contract. It intentionally does not depend on request-core,
9
+ * so any headless CRUD implementation can drive the modal.
10
+ */
11
+ interface FormModalEditor<T extends object = FormRecord> {
12
+ visible: Ref<boolean>;
13
+ mode: Ref<FormModalMode>;
14
+ model: Ref<T | null>;
15
+ title: Ref<string>;
16
+ loading: Ref<boolean> | ComputedRef<boolean>;
17
+ setModel(model: T): void;
18
+ close(): void;
19
+ submit(model?: T): Promise<boolean>;
20
+ }
21
+ interface FormModalProps<T extends object = FormRecord> {
22
+ editor: FormModalEditor<T>;
23
+ options: FormOption<T>[];
24
+ config?: FormConfig<T>;
25
+ width?: number | string;
26
+ createText?: string;
27
+ saveText?: string;
28
+ cancelText?: string;
29
+ closable?: boolean;
30
+ maskClosable?: boolean;
31
+ closeOnEsc?: boolean;
32
+ }
33
+ interface FormModalEmits<T extends object = FormRecord> {
34
+ submit: [payload: SubmitEventPayload<T>, saved: boolean];
35
+ close: [];
24
36
  }
25
37
  //#endregion
26
- //#region src/components/C_Icon/index.vue.d.ts
27
- declare const __VLS_export: vue.DefineComponent<IconProps, {
28
- validate: () => void;
29
- hasError: Readonly<vue.Ref<boolean, boolean>>;
30
- errorMessage: Readonly<vue.Ref<string, string>>;
31
- el: vue.Ref<HTMLElement | undefined, HTMLElement | undefined>;
32
- }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
33
- error: (type: string, error?: unknown) => any;
34
- click: (event: MouseEvent | KeyboardEvent) => any;
35
- load: () => any;
36
- }, string, vue.PublicProps, Readonly<IconProps> & Readonly<{
37
- onError?: ((type: string, error?: unknown) => any) | undefined;
38
- onClick?: ((event: MouseEvent | KeyboardEvent) => any) | undefined;
39
- onLoad?: (() => any) | undefined;
40
- }>, {
41
- color: string;
42
- size: number | string;
43
- title: string;
44
- loading: boolean;
45
- type: "iconify" | "unocss" | "component" | "svg" | "image";
46
- ariaLabel: string;
47
- svgPath: string;
48
- viewBox: string;
49
- alt: string;
50
- clickable: boolean;
51
- fallbackIcon: string;
52
- loadTimeout: number;
53
- customClass: string;
54
- rotate: number;
55
- flip: "horizontal" | "vertical" | "both";
56
- componentProps: Record<string, unknown>;
57
- }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
38
+ //#region src/components/C_FormModal/index.vue.d.ts
39
+ declare const __VLS_export: <T extends object = FormRecord>(__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<{
40
+ props: vue.PublicProps & __VLS_PrettifyLocal<FormModalProps<T> & {
41
+ onClose?: (() => any) | undefined;
42
+ onSubmit?: ((payload: SubmitEventPayload<T>, saved: boolean) => any) | undefined;
43
+ }> & (typeof globalThis extends {
44
+ __VLS_PROPS_FALLBACK: infer P;
45
+ } ? P : {});
46
+ expose: (exposed: {}) => void;
47
+ attrs: any;
48
+ slots: {
49
+ [x: string]: ((props: any) => any) | undefined;
50
+ };
51
+ emit: ((evt: "close") => void) & ((evt: "submit", payload: SubmitEventPayload<T>, saved: boolean) => void);
52
+ }>) => vue.VNode & {
53
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
54
+ };
58
55
  declare const _default: typeof __VLS_export;
56
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
59
57
  //#endregion
60
- export { IconProps as n, _default as t };
58
+ export { FormModalProps as a, FormModalMode as i, FormModalEditor as n, FormModalEmits as r, _default as t };
@@ -1,20 +1,132 @@
1
1
  import * as vue from "vue";
2
2
 
3
- //#region src/components/C_Loading/types.d.ts
4
- interface LoadingProps {
5
- /** SVG 尺寸,单位 px,默认 48。 */
6
- size?: number;
7
- /** 可选可见提示;不传时仍提供可访问的加载说明。 */
8
- label?: string;
9
- /** 默认使用 Naive UI 主题主色。 */
10
- color?: string;
3
+ //#region src/components/C_Guide/types.d.ts
4
+ /** 通用功能示意图,不包含宿主业务数据。 */
5
+ type GuideIllustration = 'navigation' | 'search' | 'tabs' | 'account' | 'overview' | 'notification' | 'fullscreen' | 'language' | 'theme' | 'settings';
6
+ /** 可使用选择器、真实元素或动态解析函数定位目标。 */
7
+ type GuideTarget = string | Element | (() => Element | null | undefined);
8
+ /** 引导实例公开方法,用于宿主在路由变化时主动停止等场景。 */
9
+ interface GuideExpose {
10
+ startGuide: (force?: boolean) => Promise<void>;
11
+ stopGuide: () => void;
12
+ resetCompleted: () => void;
13
+ isCompleted: () => boolean;
14
+ }
15
+ /** 引导步骤定义 */
16
+ interface GuideStep {
17
+ /** 目标元素;不传时可展示居中的欢迎步骤。 */
18
+ element?: GuideTarget;
19
+ /** 弹出层配置 */
20
+ popover: {
21
+ title: string;
22
+ description: string;
23
+ side?: 'top' | 'right' | 'bottom' | 'left'; /** 可选的轻量示意图,使用组件主题色。 */
24
+ illustration?: GuideIllustration;
25
+ };
26
+ /** 步骤所属分组(用于步骤分组展示) */
27
+ group?: string;
28
+ /** 进入此步骤前的回调 */
29
+ onHighlightStarted?: (element: Element | undefined, step: GuideStep) => void;
30
+ /** 离开此步骤后的回调 */
31
+ onDeselected?: (element: Element | undefined, step: GuideStep) => void;
32
+ /** 是否跳过此步骤的条件 */
33
+ skipIf?: () => boolean;
34
+ }
35
+ /** 引导主题配置 */
36
+ interface GuideTheme {
37
+ /** 弹层背景色 */
38
+ popoverBgColor?: string;
39
+ /** 弹层文字色 */
40
+ popoverTextColor?: string;
41
+ /** 按钮主色 */
42
+ primaryColor?: string;
43
+ /** 遮罩层透明度 */
44
+ overlayOpacity?: number;
45
+ /** 弹层圆角 */
46
+ borderRadius?: string;
47
+ }
48
+ /** 引导持久化配置 */
49
+ interface GuidePersistence {
50
+ /** 是否启用持久化(记住已完成的引导) */
51
+ enabled?: boolean;
52
+ /** 持久化 key 前缀 */
53
+ keyPrefix?: string;
54
+ }
55
+ /** C_Guide Props */
56
+ interface GuideProps {
57
+ /** 引导步骤 */
58
+ steps?: GuideStep[];
59
+ /** 完成按钮文字 */
60
+ doneBtnText?: string;
61
+ /** 下一步按钮文字 */
62
+ nextBtnText?: string;
63
+ /** 上一步按钮文字 */
64
+ prevBtnText?: string;
65
+ /** 是否显示跳过按钮;allowClose 为 false 时不显示,默认 true。 */
66
+ showSkipButton?: boolean;
67
+ /** 跳过按钮文字,默认“跳过引导”。 */
68
+ skipBtnText?: string;
69
+ /** 是否显示进度条 */
70
+ showProgress?: boolean;
71
+ /** 是否启用键盘导航(← → Esc) */
72
+ keyboard?: boolean;
73
+ /** 是否启用动画 */
74
+ animate?: boolean;
75
+ /** 是否允许点击遮罩关闭 */
76
+ allowClose?: boolean;
77
+ /** 自动跳过不存在或不可见的目标,默认 true。 */
78
+ skipMissingElements?: boolean;
79
+ /** 主题配置 */
80
+ theme?: GuideTheme;
81
+ /** 持久化配置 */
82
+ persistence?: GuidePersistence;
83
+ /** 弹层自定义 CSS 类 */
84
+ popoverClass?: string;
85
+ /** 是否显示触发按钮(设为 false 则仅通过 expose 的 startGuide 触发) */
86
+ showTrigger?: boolean;
87
+ /** 触发按钮的 tooltip 文字 */
88
+ triggerTooltip?: string;
89
+ /** 触发按钮图标 */
90
+ triggerIcon?: string;
11
91
  }
12
92
  //#endregion
13
- //#region src/components/C_Loading/index.vue.d.ts
14
- declare const __VLS_export: vue.DefineComponent<LoadingProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<LoadingProps> & Readonly<{}>, {
15
- size: number;
16
- label: string;
93
+ //#region src/components/C_Guide/index.vue.d.ts
94
+ declare const __VLS_export: vue.DefineComponent<GuideProps, {
95
+ startGuide: (force?: boolean) => Promise<void>;
96
+ stopGuide: () => void;
97
+ resetCompleted: () => void;
98
+ isCompleted: () => boolean;
99
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
100
+ error: (error: unknown) => any;
101
+ start: () => any;
102
+ close: (currentStep: number) => any;
103
+ complete: () => any;
104
+ skip: (currentStep: number) => any;
105
+ "step-change": (stepIndex: number, step: GuideStep) => any;
106
+ }, string, vue.PublicProps, Readonly<GuideProps> & Readonly<{
107
+ onError?: ((error: unknown) => any) | undefined;
108
+ onStart?: (() => any) | undefined;
109
+ onClose?: ((currentStep: number) => any) | undefined;
110
+ onComplete?: (() => any) | undefined;
111
+ onSkip?: ((currentStep: number) => any) | undefined;
112
+ "onStep-change"?: ((stepIndex: number, step: GuideStep) => any) | undefined;
113
+ }>, {
114
+ steps: GuideStep[];
115
+ keyboard: boolean;
116
+ doneBtnText: string;
117
+ nextBtnText: string;
118
+ prevBtnText: string;
119
+ showSkipButton: boolean;
120
+ skipBtnText: string;
121
+ showProgress: boolean;
122
+ animate: boolean;
123
+ allowClose: boolean;
124
+ skipMissingElements: boolean;
125
+ popoverClass: string;
126
+ showTrigger: boolean;
127
+ triggerTooltip: string;
128
+ triggerIcon: string;
17
129
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
18
130
  declare const _default: typeof __VLS_export;
19
131
  //#endregion
20
- export { LoadingProps as n, _default as t };
132
+ export { GuideProps as a, GuideTheme as c, GuidePersistence as i, GuideExpose as n, GuideStep as o, GuideIllustration as r, GuideTarget as s, _default as t };