@sunny-base-web/ui 0.8.29 → 0.8.31

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 (188) hide show
  1. package/dist/basic/icon/icon.d.ts +4 -0
  2. package/dist/basic/icon/icon.d.ts.map +1 -0
  3. package/dist/basic/icon/index.d.ts +3 -0
  4. package/dist/basic/icon/index.d.ts.map +1 -0
  5. package/dist/basic/icon/types.d.ts +16 -0
  6. package/dist/basic/icon/types.d.ts.map +1 -0
  7. package/dist/basic/scrollbar/components/ScrollArea.d.ts +29 -0
  8. package/dist/basic/scrollbar/components/ScrollArea.d.ts.map +1 -0
  9. package/dist/basic/scrollbar/components/ScrollBar.d.ts +12 -0
  10. package/dist/basic/scrollbar/components/ScrollBar.d.ts.map +1 -0
  11. package/dist/basic/scrollbar/components/index.d.ts +3 -0
  12. package/dist/basic/scrollbar/components/index.d.ts.map +1 -0
  13. package/dist/basic/scrollbar/index.d.ts +2 -0
  14. package/dist/basic/scrollbar/index.d.ts.map +1 -0
  15. package/dist/basic/scrollbar/scrollbar.d.ts +63 -0
  16. package/dist/basic/scrollbar/scrollbar.d.ts.map +1 -0
  17. package/dist/composite/business-search/SunnyBusinessSearch.d.ts +29 -0
  18. package/dist/composite/business-search/SunnyBusinessSearch.d.ts.map +1 -0
  19. package/dist/composite/business-search/configs/index.d.ts +13 -0
  20. package/dist/composite/business-search/configs/index.d.ts.map +1 -0
  21. package/dist/composite/business-search/index.d.ts +6 -0
  22. package/dist/composite/business-search/index.d.ts.map +1 -0
  23. package/dist/composite/business-search/types.d.ts +115 -0
  24. package/dist/composite/business-search/types.d.ts.map +1 -0
  25. package/dist/composite/business-search/use-sunny-business-search.d.ts +18 -0
  26. package/dist/composite/business-search/use-sunny-business-search.d.ts.map +1 -0
  27. package/dist/composite/customize-select/CustomizeSelect.d.ts +43 -0
  28. package/dist/composite/customize-select/CustomizeSelect.d.ts.map +1 -0
  29. package/dist/composite/customize-select/index.d.ts +4 -0
  30. package/dist/composite/customize-select/index.d.ts.map +1 -0
  31. package/dist/composite/index.d.ts +3 -0
  32. package/dist/composite/index.d.ts.map +1 -0
  33. package/dist/composite/search-plan/SunnySearchPlan.d.ts +67 -0
  34. package/dist/composite/search-plan/SunnySearchPlan.d.ts.map +1 -0
  35. package/dist/composite/search-plan/api.d.ts +34 -0
  36. package/dist/composite/search-plan/api.d.ts.map +1 -0
  37. package/dist/composite/search-plan/index.d.ts +6 -0
  38. package/dist/composite/search-plan/index.d.ts.map +1 -0
  39. package/dist/composite/search-plan/types.d.ts +95 -0
  40. package/dist/composite/search-plan/types.d.ts.map +1 -0
  41. package/dist/composite/search-plan/use-sunny-search-plan.d.ts +21 -0
  42. package/dist/composite/search-plan/use-sunny-search-plan.d.ts.map +1 -0
  43. package/dist/data/edit-grid/api.d.ts +63 -0
  44. package/dist/data/edit-grid/api.d.ts.map +1 -0
  45. package/dist/data/edit-grid/edit-render.d.ts +188 -0
  46. package/dist/data/edit-grid/edit-render.d.ts.map +1 -0
  47. package/dist/data/edit-grid/index.d.ts +4 -0
  48. package/dist/data/edit-grid/index.d.ts.map +1 -0
  49. package/dist/data/edit-grid/use-vxe-grid.d.ts +29 -0
  50. package/dist/data/edit-grid/use-vxe-grid.d.ts.map +1 -0
  51. package/dist/data/edit-grid/validators.d.ts +48 -0
  52. package/dist/data/edit-grid/validators.d.ts.map +1 -0
  53. package/dist/data/query-grid/api.d.ts +43 -0
  54. package/dist/data/query-grid/api.d.ts.map +1 -0
  55. package/dist/data/query-grid/index.d.ts +2 -0
  56. package/dist/data/query-grid/index.d.ts.map +1 -0
  57. package/dist/data/query-grid/renderer/FilterComplex.d.ts +11 -0
  58. package/dist/data/query-grid/renderer/FilterComplex.d.ts.map +1 -0
  59. package/dist/data/query-grid/renderer/index.d.ts +2 -0
  60. package/dist/data/query-grid/renderer/index.d.ts.map +1 -0
  61. package/dist/data/query-grid/sticky.d.ts +4 -0
  62. package/dist/data/query-grid/sticky.d.ts.map +1 -0
  63. package/dist/data/query-grid/use-query-grid.d.ts +34 -0
  64. package/dist/data/query-grid/use-query-grid.d.ts.map +1 -0
  65. package/dist/data/resource-tree/SunnyResourceTree.d.ts +42 -0
  66. package/dist/data/resource-tree/SunnyResourceTree.d.ts.map +1 -0
  67. package/dist/data/resource-tree/index.d.ts +6 -0
  68. package/dist/data/resource-tree/index.d.ts.map +1 -0
  69. package/dist/data/resource-tree/types.d.ts +42 -0
  70. package/dist/data/resource-tree/types.d.ts.map +1 -0
  71. package/dist/data/resource-tree/use-sunny-resource-tree.d.ts +16 -0
  72. package/dist/data/resource-tree/use-sunny-resource-tree.d.ts.map +1 -0
  73. package/dist/data/simple-upload/index.d.ts +103 -0
  74. package/dist/data/simple-upload/index.d.ts.map +1 -0
  75. package/dist/data/upload/index.d.ts +51 -0
  76. package/dist/data/upload/index.d.ts.map +1 -0
  77. package/dist/entry/form/SunnyForm.d.ts +33 -0
  78. package/dist/entry/form/SunnyForm.d.ts.map +1 -0
  79. package/dist/entry/form/SunnyUseForm.d.ts +29 -0
  80. package/dist/entry/form/SunnyUseForm.d.ts.map +1 -0
  81. package/dist/entry/form/components/form-actions.d.ts +101 -0
  82. package/dist/entry/form/components/form-actions.d.ts.map +1 -0
  83. package/dist/entry/form/config.d.ts +17 -0
  84. package/dist/entry/form/config.d.ts.map +1 -0
  85. package/dist/entry/form/form-api.d.ts +221 -0
  86. package/dist/entry/form/form-api.d.ts.map +1 -0
  87. package/dist/entry/form/form-render/Form.d.ts +59 -0
  88. package/dist/entry/form/form-render/Form.d.ts.map +1 -0
  89. package/dist/entry/form/form-render/FormField.d.ts +7 -0
  90. package/dist/entry/form/form-render/FormField.d.ts.map +1 -0
  91. package/dist/entry/form/form-render/context.d.ts +56 -0
  92. package/dist/entry/form/form-render/context.d.ts.map +1 -0
  93. package/dist/entry/form/form-render/dependencies.d.ts +19 -0
  94. package/dist/entry/form/form-render/dependencies.d.ts.map +1 -0
  95. package/dist/entry/form/form-render/expandable.d.ts +10 -0
  96. package/dist/entry/form/form-render/expandable.d.ts.map +1 -0
  97. package/dist/entry/form/form-render/helper.d.ts +33 -0
  98. package/dist/entry/form/form-render/helper.d.ts.map +1 -0
  99. package/dist/entry/form/index.d.ts +8 -0
  100. package/dist/entry/form/index.d.ts.map +1 -0
  101. package/dist/entry/form/store.d.ts +46 -0
  102. package/dist/entry/form/store.d.ts.map +1 -0
  103. package/dist/entry/form/types.d.ts +836 -0
  104. package/dist/entry/form/types.d.ts.map +1 -0
  105. package/dist/entry/form/use-form-context.d.ts +29 -0
  106. package/dist/entry/form/use-form-context.d.ts.map +1 -0
  107. package/dist/entry/form/use-sunny-form.d.ts +6 -0
  108. package/dist/entry/form/use-sunny-form.d.ts.map +1 -0
  109. package/dist/entry/index.d.ts +4 -0
  110. package/dist/entry/index.d.ts.map +1 -0
  111. package/dist/entry/qrcode-reader/SunnyQrcodeReader.d.ts +36 -0
  112. package/dist/entry/qrcode-reader/SunnyQrcodeReader.d.ts.map +1 -0
  113. package/dist/entry/qrcode-reader/index.d.ts +5 -0
  114. package/dist/entry/qrcode-reader/index.d.ts.map +1 -0
  115. package/dist/entry/qrcode-reader/types.d.ts +52 -0
  116. package/dist/entry/qrcode-reader/types.d.ts.map +1 -0
  117. package/dist/entry/search-input-tag/SearchInputTag.d.ts +36 -0
  118. package/dist/entry/search-input-tag/SearchInputTag.d.ts.map +1 -0
  119. package/dist/entry/search-input-tag/index.d.ts +5 -0
  120. package/dist/entry/search-input-tag/index.d.ts.map +1 -0
  121. package/dist/entry/search-input-tag/types.d.ts +12 -0
  122. package/dist/entry/search-input-tag/types.d.ts.map +1 -0
  123. package/dist/entry/select/BatchSelect.d.ts +28 -0
  124. package/dist/entry/select/BatchSelect.d.ts.map +1 -0
  125. package/dist/entry/select/Select.d.ts +37 -0
  126. package/dist/entry/select/Select.d.ts.map +1 -0
  127. package/dist/entry/select/index.d.ts +6 -0
  128. package/dist/entry/select/index.d.ts.map +1 -0
  129. package/dist/entry/select/types.d.ts +66 -0
  130. package/dist/entry/select/types.d.ts.map +1 -0
  131. package/dist/feedback/error-boundary/ErrorBoundary.d.ts +31 -0
  132. package/dist/feedback/error-boundary/ErrorBoundary.d.ts.map +1 -0
  133. package/dist/feedback/error-boundary/index.d.ts +5 -0
  134. package/dist/feedback/error-boundary/index.d.ts.map +1 -0
  135. package/dist/feedback/error-boundary/types.d.ts +56 -0
  136. package/dist/feedback/error-boundary/types.d.ts.map +1 -0
  137. package/dist/feedback/export-modal/SunnyExportModal.d.ts +22 -0
  138. package/dist/feedback/export-modal/SunnyExportModal.d.ts.map +1 -0
  139. package/dist/feedback/export-modal/index.d.ts +6 -0
  140. package/dist/feedback/export-modal/index.d.ts.map +1 -0
  141. package/dist/feedback/export-modal/types.d.ts +33 -0
  142. package/dist/feedback/export-modal/types.d.ts.map +1 -0
  143. package/dist/feedback/export-modal/use-export-modal.d.ts +8 -0
  144. package/dist/feedback/export-modal/use-export-modal.d.ts.map +1 -0
  145. package/dist/feedback/import-modal/SunnyImportModal.d.ts +37 -0
  146. package/dist/feedback/import-modal/SunnyImportModal.d.ts.map +1 -0
  147. package/dist/feedback/import-modal/index.d.ts +6 -0
  148. package/dist/feedback/import-modal/index.d.ts.map +1 -0
  149. package/dist/feedback/import-modal/types.d.ts +13 -0
  150. package/dist/feedback/import-modal/types.d.ts.map +1 -0
  151. package/dist/feedback/import-modal/use-import-modal.d.ts +8 -0
  152. package/dist/feedback/import-modal/use-import-modal.d.ts.map +1 -0
  153. package/dist/feedback/modal/Modal.d.ts +45 -0
  154. package/dist/feedback/modal/Modal.d.ts.map +1 -0
  155. package/dist/feedback/modal/index.d.ts +7 -0
  156. package/dist/feedback/modal/index.d.ts.map +1 -0
  157. package/dist/feedback/modal/modal-api.d.ts +10 -0
  158. package/dist/feedback/modal/modal-api.d.ts.map +1 -0
  159. package/dist/feedback/modal/types.d.ts +62 -0
  160. package/dist/feedback/modal/types.d.ts.map +1 -0
  161. package/dist/feedback/modal/use-sunny-modal.d.ts +3 -0
  162. package/dist/feedback/modal/use-sunny-modal.d.ts.map +1 -0
  163. package/dist/feedback/search-modal/SunnySearchModal.d.ts +39 -0
  164. package/dist/feedback/search-modal/SunnySearchModal.d.ts.map +1 -0
  165. package/dist/feedback/search-modal/index.d.ts +6 -0
  166. package/dist/feedback/search-modal/index.d.ts.map +1 -0
  167. package/dist/feedback/search-modal/types.d.ts +153 -0
  168. package/dist/feedback/search-modal/types.d.ts.map +1 -0
  169. package/dist/feedback/search-modal/use-sunny-search-modal.d.ts +40 -0
  170. package/dist/feedback/search-modal/use-sunny-search-modal.d.ts.map +1 -0
  171. package/dist/feedback/spinner/SunnyLoading.d.ts +24 -0
  172. package/dist/feedback/spinner/SunnyLoading.d.ts.map +1 -0
  173. package/dist/feedback/spinner/SunnySpinner.d.ts +7 -0
  174. package/dist/feedback/spinner/SunnySpinner.d.ts.map +1 -0
  175. package/dist/feedback/spinner/index.d.ts +5 -0
  176. package/dist/feedback/spinner/index.d.ts.map +1 -0
  177. package/dist/feedback/spinner/types.d.ts +49 -0
  178. package/dist/feedback/spinner/types.d.ts.map +1 -0
  179. package/dist/feedback/spinner/use-loading-state.d.ts +34 -0
  180. package/dist/feedback/spinner/use-loading-state.d.ts.map +1 -0
  181. package/dist/index.d.ts +37 -0
  182. package/dist/index.d.ts.map +1 -0
  183. package/dist/index.js +3 -3
  184. package/dist/index.mjs +1711 -1642
  185. package/dist/navigation/nprogress/index.d.ts +2 -0
  186. package/dist/navigation/nprogress/index.d.ts.map +1 -0
  187. package/dist/ui.css +1 -1
  188. package/package.json +6 -6
@@ -0,0 +1,836 @@
1
+ import { FormContext, GenericObject } from 'vee-validate';
2
+ import { ZodTypeAny } from 'zod';
3
+ import { Component } from 'vue';
4
+ export type FormLayout = 'horizontal' | 'inline' | 'vertical';
5
+ export type BaseFormComponentType = 'SunnyInput' | 'SunnySelect' | 'SunnyCheckbox' | 'SunnyRadio' | 'SunnySwitch' | 'SunnyDatePicker' | 'SunnyTimePicker' | 'SunnyUpload' | 'Input' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'DatePicker' | 'TimePicker' | 'Upload' | (Record<never, never> & string);
6
+ export interface FormShape {
7
+ default?: any;
8
+ fieldName: string;
9
+ required?: boolean;
10
+ rules?: ZodTypeAny;
11
+ }
12
+ export type MaybeComponentProps = Record<string, any>;
13
+ export type FormActions = FormContext<GenericObject>;
14
+ export type FormSchemaRuleType = 'required' | null | ZodTypeAny;
15
+ export interface FormItemDependencies {
16
+ /**
17
+ * 动态组件属性
18
+ * Dynamic component props
19
+ */
20
+ componentProps?: (value: Partial<Record<string, any>>, actions: FormActions) => MaybeComponentProps | PromiseLike<MaybeComponentProps>;
21
+ /**
22
+ * 是否渲染 (v-if)
23
+ * Whether to render
24
+ */
25
+ if?: (value: Partial<Record<string, any>>, actions: FormActions) => boolean | PromiseLike<boolean>;
26
+ /**
27
+ * 是否显示 (v-show)
28
+ * Whether to show
29
+ */
30
+ show?: (value: Partial<Record<string, any>>, actions: FormActions) => boolean | PromiseLike<boolean>;
31
+ /**
32
+ * 触发依赖更新的字段
33
+ * Trigger fields for dependency updates
34
+ * @deprecated 已废弃,Vue 会自动追踪依赖,无需手动指定
35
+ * @deprecated Deprecated, Vue automatically tracks dependencies, no need to specify manually
36
+ */
37
+ triggerFields?: string[];
38
+ disabled?: (value: Partial<Record<string, any>>, actions: FormActions) => boolean | PromiseLike<boolean>;
39
+ required?: (value: Partial<Record<string, any>>, actions: FormActions) => boolean | PromiseLike<boolean>;
40
+ rules?: (value: Partial<Record<string, any>>, actions: FormActions) => FormSchemaRuleType | PromiseLike<FormSchemaRuleType>;
41
+ trigger?: (value: Partial<Record<string, any>>, actions: FormActions) => void | PromiseLike<void>;
42
+ }
43
+ export interface ColProps {
44
+ span?: number;
45
+ offset?: number;
46
+ push?: number;
47
+ pull?: number;
48
+ order?: number;
49
+ xs?: number | {
50
+ [key: string]: any;
51
+ };
52
+ sm?: number | {
53
+ [key: string]: any;
54
+ };
55
+ md?: number | {
56
+ [key: string]: any;
57
+ };
58
+ lg?: number | {
59
+ [key: string]: any;
60
+ };
61
+ xl?: number | {
62
+ [key: string]: any;
63
+ };
64
+ xxl?: number | {
65
+ [key: string]: any;
66
+ };
67
+ [key: string]: any;
68
+ }
69
+ export type FieldMappingTime = [
70
+ string,
71
+ [
72
+ string,
73
+ string
74
+ ],
75
+ (((value: any, fieldName: string) => any) | [string, string] | null | string)?
76
+ ][];
77
+ export type ArrayToStringFields = Array<[string[], string?] | string | string[]>;
78
+ export interface FormSchema {
79
+ /**
80
+ * 组件属性
81
+ * Component props
82
+ */
83
+ componentProps?: MaybeComponentProps;
84
+ /**
85
+ * 组件类型
86
+ * Component type
87
+ */
88
+ component?: BaseFormComponentType | Component;
89
+ /**
90
+ * 默认值
91
+ * Default value
92
+ */
93
+ defaultValue?: any;
94
+ /**
95
+ * 依赖项配置
96
+ * Dependencies configuration
97
+ */
98
+ dependencies?: FormItemDependencies;
99
+ /**
100
+ * 字段名
101
+ * Field name
102
+ */
103
+ fieldName?: string;
104
+ /**
105
+ * 标签
106
+ * Label
107
+ */
108
+ label?: string;
109
+ /**
110
+ * 验证规则
111
+ * Validation rules
112
+ */
113
+ rules?: FormSchemaRuleType;
114
+ /**
115
+ * 帮助信息
116
+ * Help message
117
+ */
118
+ help?: string;
119
+ /**
120
+ * 标签宽度
121
+ * Label width
122
+ */
123
+ labelWidth?: number | string;
124
+ /**
125
+ * 栅格列配置 (传递给 a-col)
126
+ * Col props (passed to a-col)
127
+ */
128
+ colProps?: ColProps;
129
+ /**
130
+ * 栅格跨度 (1-24)
131
+ * Col span (1-24)
132
+ */
133
+ colSpan?: number;
134
+ /**
135
+ * 通用组件属性
136
+ * Common component props
137
+ */
138
+ commonComponentProps?: Record<string, any>;
139
+ /**
140
+ * 表单字段属性 (传递给 FormField/FormItem)
141
+ * Form field props
142
+ */
143
+ formFieldProps?: Record<string, any>;
144
+ /**
145
+ * 是否禁用
146
+ */
147
+ disabled?: boolean;
148
+ /**
149
+ * 是否隐藏字段(静态隐藏,不参与联动)
150
+ * Whether to hide the field (static hiding, not involved in dependencies)
151
+ */
152
+ hidden?: boolean;
153
+ /**
154
+ * Select 选项声明配置(声明式加载字典选项)
155
+ * Select options declaration config (declarative loading of dictionary options)
156
+ * @description 在 FormSchema 中声明式配置字典选项,useList 会自动收集并批量加载
157
+ * @description Declarative configuration of dictionary options in FormSchema, useList will auto-collect and batch load
158
+ * @example
159
+ * ```typescript
160
+ * {
161
+ * fieldName: 'nZt',
162
+ * component: 'Select',
163
+ * selectOptions: {
164
+ * dictCode: 'SFQY',
165
+ * fieldMapping: { label: 'cName', value: 'cXuhao' }
166
+ * }
167
+ * }
168
+ * ```
169
+ */
170
+ selectOptions?: SelectOptionsDeclaration;
171
+ /**
172
+ * 权限选项声明配置(声明式加载权限选项)
173
+ * Permission options declaration config (declarative loading of permission options)
174
+ * @description 在 FormSchema 中声明式配置权限选项,useForm 会自动收集并批量加载
175
+ * @description Declarative configuration of permission options in FormSchema, useForm will auto-collect and batch load
176
+ * @example
177
+ * ```typescript
178
+ * {
179
+ * fieldName: 'cOrg',
180
+ * component: 'Select',
181
+ * permissionOptions: {
182
+ * code: 'FACTORY',
183
+ * fieldMapping: { label: 'cName', value: 'cXuhao' }
184
+ * }
185
+ * }
186
+ * ```
187
+ */
188
+ permissionOptions?: PermissionOptionsDeclaration;
189
+ }
190
+ export interface SunnyFormProps {
191
+ /**
192
+ * 表单唯一标识
193
+ * Form unique identifier
194
+ */
195
+ id?: string;
196
+ /**
197
+ * 表单布局
198
+ * Form layout
199
+ */
200
+ layout?: FormLayout;
201
+ /**
202
+ * 表单尺寸
203
+ * Form size
204
+ * @default 'small'
205
+ */
206
+ size?: 'mini' | 'small' | 'medium' | 'large';
207
+ /**
208
+ * 表单 Schema 配置
209
+ * Form schema configuration
210
+ */
211
+ schema?: FormSchema[];
212
+ /**
213
+ * 标签宽度
214
+ * Label width
215
+ */
216
+ labelWidth?: number | string;
217
+ /**
218
+ * 外层容器类名
219
+ * Wrapper class
220
+ */
221
+ wrapperClass?: string;
222
+ /**
223
+ * 栅格容器配置 (传递给 a-grid 组件,如 cols, xGap, yGap)
224
+ * Grid container props (passed to a-grid)
225
+ */
226
+ gridProps?: Record<string, any>;
227
+ /**
228
+ * 操作栏外层类名
229
+ * Action wrapper class
230
+ */
231
+ actionWrapperClass?: string;
232
+ /**
233
+ * 表单项通用配置 (如 colProps, labelWidth, componentProps)
234
+ * Common config for form items
235
+ */
236
+ commonConfig?: Record<string, any>;
237
+ /**
238
+ * 其他配置
239
+ * Other configuration
240
+ */
241
+ config?: Record<string, any>;
242
+ /**
243
+ * 是否显示默认操作按钮 (提交/重置)
244
+ * Show default actions (submit/reset)
245
+ */
246
+ showDefaultActions?: boolean;
247
+ /**
248
+ * 提交按钮配置
249
+ * Submit button options
250
+ */
251
+ submitButtonOptions?: Record<string, any>;
252
+ /**
253
+ * 重置按钮配置
254
+ * Reset button options
255
+ */
256
+ resetButtonOptions?: Record<string, any>;
257
+ /**
258
+ * 是否回车提交
259
+ * Submit on enter
260
+ */
261
+ submitOnEnter?: boolean;
262
+ /**
263
+ * 是否在值变化时自动提交
264
+ * Submit on change
265
+ */
266
+ submitOnChange?: boolean;
267
+ /**
268
+ * 值变化时的回调
269
+ * Handle values change
270
+ */
271
+ handleValuesChange?: (values: Record<string, any>, changedFields: string[]) => void;
272
+ /**
273
+ * 折叠状态变化时的回调
274
+ * Handle collapsed change
275
+ */
276
+ handleCollapsedChange?: (collapsed: boolean) => void;
277
+ /**
278
+ * 提交回调
279
+ * Handle submit
280
+ */
281
+ handleSubmit?: (values: Record<string, any>) => Promise<void> | void;
282
+ /**
283
+ * 滚动到第一个错误字段
284
+ * Scroll to first error field
285
+ */
286
+ scrollToFirstError?: boolean;
287
+ /**
288
+ * 重置回调
289
+ * Handle reset
290
+ */
291
+ handleReset?: (values: Record<string, any>) => Promise<void> | void;
292
+ /**
293
+ * 是否折叠
294
+ * Collapsed state
295
+ */
296
+ collapsed?: boolean;
297
+ /**
298
+ * 是否显示折叠按钮
299
+ * Show collapse button
300
+ */
301
+ showCollapseButton?: boolean;
302
+ /**
303
+ * 折叠行数
304
+ * Collapsed rows
305
+ */
306
+ collapsedRows?: number;
307
+ /**
308
+ * 折叠是否触发布局调整
309
+ * Collapse trigger resize
310
+ */
311
+ collapseTriggerResize?: boolean;
312
+ /**
313
+ * 紧凑模式
314
+ * Compact mode
315
+ */
316
+ compact?: boolean;
317
+ /**
318
+ * 操作按钮布局
319
+ * Action buttons layout
320
+ */
321
+ actionLayout?: 'inline' | 'newLine' | 'rowEnd';
322
+ /**
323
+ * 操作按钮位置
324
+ * Action buttons position
325
+ */
326
+ actionPosition?: 'left' | 'right' | 'center';
327
+ /**
328
+ * 操作栏栅格配置 (传递给 a-grid-item)
329
+ * Action column props
330
+ */
331
+ actionColProps?: ColProps;
332
+ /**
333
+ * 表单值
334
+ * Form values
335
+ */
336
+ values?: Record<string, any>;
337
+ /**
338
+ * 表单字段映射到时间格式
339
+ * Field mapping time
340
+ */
341
+ fieldMappingTime?: FieldMappingTime;
342
+ /**
343
+ * 表单字段数组映射字符串配置 默认使用","
344
+ * Array to string fields
345
+ */
346
+ arrayToStringFields?: ArrayToStringFields;
347
+ /**
348
+ * 对象数组转值字符串配置
349
+ * Object array to value string fields
350
+ * 会自动从组件配置的 fieldNames 中读取 value 字段进行提取
351
+ */
352
+ objectToValueFields?: string[];
353
+ /**
354
+ * 查询方案配置
355
+ * Search plan configuration
356
+ */
357
+ searchPlanConfig?: {
358
+ /**
359
+ * 是否启用查询方案
360
+ */
361
+ enable?: boolean;
362
+ /**
363
+ * 表单配置
364
+ */
365
+ formConfig?: any[];
366
+ /**
367
+ * 当前选中的查询方案
368
+ */
369
+ currentSearchPlan?: any;
370
+ /**
371
+ * 查询方案列表
372
+ */
373
+ searchPlanList?: any[];
374
+ /**
375
+ * 资源ID
376
+ */
377
+ resourceId?: string;
378
+ /**
379
+ * 资源编号
380
+ */
381
+ nResourceid?: number;
382
+ /**
383
+ * 查询方案API
384
+ */
385
+ api?: any;
386
+ /**
387
+ * 搜索回调
388
+ */
389
+ onSearch?: (values: any) => void;
390
+ /**
391
+ * 默认查询方案加载完成回调
392
+ */
393
+ onDefaultPlanLoaded?: (values: any) => void;
394
+ /**
395
+ * 更新当前查询方案回调
396
+ */
397
+ onUpdateCurrentSearchPlan?: (value: any) => void;
398
+ /**
399
+ * 更新查询方案列表回调
400
+ */
401
+ onUpdateSearchPlanList?: (value: any[]) => void;
402
+ };
403
+ }
404
+ export interface FormApiOptions extends SunnyFormProps {
405
+ /**
406
+ * 表单实例
407
+ * Form instance
408
+ */
409
+ form?: any;
410
+ }
411
+ /**
412
+ * BusinessSearch 加载配置返回格式
413
+ * BusinessSearch load config return format
414
+ */
415
+ export interface BusinessSearchConfig {
416
+ /**
417
+ * 弹窗标题
418
+ */
419
+ title?: string;
420
+ /**
421
+ * 弹窗宽度
422
+ */
423
+ width?: string | number;
424
+ /**
425
+ * 内容高度
426
+ */
427
+ contentHeight?: string | number;
428
+ /**
429
+ * 是否多选
430
+ */
431
+ multiple?: boolean;
432
+ /**
433
+ * 搜索表单配置 (FormSchema 格式)
434
+ */
435
+ formSchema?: any[];
436
+ /**
437
+ * 表格列配置 (VxeTable 格式)
438
+ */
439
+ tableColumns?: any[];
440
+ /**
441
+ * 字段名映射
442
+ */
443
+ fieldNames?: {
444
+ label: string;
445
+ value: string;
446
+ desc?: string;
447
+ };
448
+ /**
449
+ * 搜索 API 函数
450
+ */
451
+ searchApi?: (params: any) => Promise<{
452
+ records: any[];
453
+ total: number;
454
+ }>;
455
+ }
456
+ /**
457
+ * BusinessSearch 搜索参数格式
458
+ * BusinessSearch search params format
459
+ */
460
+ export interface BusinessSearchParams {
461
+ /**
462
+ * 配置编码
463
+ */
464
+ cNum: string;
465
+ /**
466
+ * 分页:当前页 (别名)
467
+ */
468
+ page?: number;
469
+ /**
470
+ * 分页:当前页
471
+ */
472
+ pageNo?: number;
473
+ /**
474
+ * 分页:每页条数
475
+ */
476
+ pageSize?: number;
477
+ /**
478
+ * 搜索字段
479
+ */
480
+ [key: string]: any;
481
+ }
482
+ /**
483
+ * BusinessSearch 搜索结果格式
484
+ * BusinessSearch search result format
485
+ */
486
+ export interface BusinessSearchResult {
487
+ /**
488
+ * 数据列表
489
+ */
490
+ records: any[];
491
+ /**
492
+ * 总数
493
+ */
494
+ total: number;
495
+ }
496
+ /**
497
+ * BusinessSearch API 适配器接口
498
+ * BusinessSearch API adapter interface
499
+ *
500
+ * 组件不关心数据如何获取和转换,全部由 adapter 负责
501
+ * The component doesn't care about how data is fetched and transformed, all handled by adapter
502
+ */
503
+ export interface BusinessSearchAdapter {
504
+ /**
505
+ * 加载动态配置
506
+ * Load dynamic configuration
507
+ *
508
+ * 职责:
509
+ * 1. 调用后端接口获取原始配置
510
+ * 2. 转换成 BusinessSearchConfig 格式
511
+ *
512
+ * @param cNum 配置编码
513
+ * @returns 已转换好的配置数据 (BusinessSearchConfig)
514
+ */
515
+ loadConfig?: (cNum: string) => Promise<BusinessSearchConfig>;
516
+ /**
517
+ * 搜索数据
518
+ * Search data
519
+ *
520
+ * 职责:
521
+ * 1. 接收前端组件传入的搜索参数
522
+ * 2. 转换成后端需要的格式
523
+ * 3. 调用后端接口
524
+ * 4. 转换返回结果成 BusinessSearchResult 格式
525
+ *
526
+ * @param params 搜索参数 (已包含分页信息)
527
+ * @returns 搜索结果 (BusinessSearchResult)
528
+ */
529
+ search?: (params: BusinessSearchParams) => Promise<BusinessSearchResult>;
530
+ }
531
+ export interface CustomizeSelectConfig {
532
+ nType?: number;
533
+ cLabelslotcol?: string;
534
+ nSearchinterval?: number;
535
+ }
536
+ export interface CustomizeSelectOption {
537
+ cKeynumb: string | number;
538
+ cKeyname: string;
539
+ cSlot?: string;
540
+ }
541
+ export interface CustomizeSelectQueryParams {
542
+ cNum: string | number;
543
+ attrParam?: Record<string, any>;
544
+ cVal?: string;
545
+ searchCondition?: string;
546
+ }
547
+ export interface CustomizeSelectQueryResult {
548
+ options: CustomizeSelectOption[];
549
+ config?: CustomizeSelectConfig;
550
+ }
551
+ export interface CustomizeSelectAdapter {
552
+ query: (params: CustomizeSelectQueryParams) => Promise<CustomizeSelectQueryResult>;
553
+ }
554
+ /**
555
+ * Select 选项数据格式
556
+ * Select option data format
557
+ */
558
+ export interface SelectOption {
559
+ /**
560
+ * 显示文本
561
+ * Display text
562
+ */
563
+ label: string;
564
+ /**
565
+ * 选项值
566
+ * Option value
567
+ */
568
+ value: string | number;
569
+ /**
570
+ * 是否禁用
571
+ * Whether disabled
572
+ */
573
+ disabled?: boolean;
574
+ /**
575
+ * 保留原始字段
576
+ * Preserve original fields
577
+ */
578
+ [key: string]: any;
579
+ }
580
+ /**
581
+ * Select 字段映射配置
582
+ * Select field mapping configuration
583
+ */
584
+ export interface SelectFieldMapping {
585
+ /**
586
+ * label 字段名
587
+ * Label field name
588
+ * @default 'cName'
589
+ */
590
+ label?: string;
591
+ /**
592
+ * value 字段名
593
+ * Value field name
594
+ * @default 'cXuhao'
595
+ */
596
+ value?: string;
597
+ }
598
+ /**
599
+ * 权限选项字段映射配置
600
+ * Permission options field mapping configuration
601
+ * @description 支持更灵活的 label 配置
602
+ */
603
+ export interface PermissionFieldMapping {
604
+ /**
605
+ * label 字段配置
606
+ * Label field configuration
607
+ * @description 支持多种格式:
608
+ * - string: 单个字段名,如 'cName'
609
+ * - string[]: 多个字段自动用 '-' 拼接,如 ['cExresnum', 'cExresname']
610
+ * - function: 自定义函数,如 (item) => `${item.cExresnum}-${item.cExresname}`
611
+ * @default 'cExresname'
612
+ */
613
+ label?: string | string[] | ((item: any) => string);
614
+ /**
615
+ * value 字段名
616
+ * Value field name
617
+ * @default 'cXuhao'
618
+ */
619
+ value?: string;
620
+ }
621
+ /**
622
+ * Select 选项声明配置(Schema 声明式)
623
+ * Select options declaration config (Schema declarative)
624
+ * @description 用于在 FormSchema 中声明式配置字典选项,useList 会自动收集并批量加载
625
+ * @description Used for declarative configuration of dictionary options in FormSchema, useList will auto-collect and batch load
626
+ */
627
+ export interface SelectOptionsDeclaration {
628
+ /**
629
+ * 字典编码
630
+ * Dictionary code
631
+ */
632
+ dictCode: string | number;
633
+ /**
634
+ * 字段映射配置
635
+ * Field mapping configuration
636
+ */
637
+ fieldMapping?: SelectFieldMapping;
638
+ /**
639
+ * 是否强制刷新
640
+ * Whether to force reload
641
+ * @default false
642
+ */
643
+ forceReload?: boolean;
644
+ }
645
+ /**
646
+ * 权限选项声明配置
647
+ * Permission options declaration config
648
+ * @description 用于声明式加载权限选项
649
+ * @description Used for declarative loading of permission options
650
+ */
651
+ export interface PermissionOptionsDeclaration {
652
+ /**
653
+ * 权限编码
654
+ * Permission code
655
+ */
656
+ code: string | number;
657
+ /**
658
+ * 字段映射配置
659
+ * Field mapping configuration
660
+ */
661
+ fieldMapping?: PermissionFieldMapping;
662
+ }
663
+ /**
664
+ * Select 选项加载适配器
665
+ * Select options loader adapter
666
+ */
667
+ export interface SelectOptionsAdapter {
668
+ /**
669
+ * 批量加载多个字典选项
670
+ * Batch load multiple dictionary options
671
+ * @param numbList - 字典编码列表
672
+ * @param fieldMapping - 字段映射配置
673
+ * @returns 选项映射表 { dictCode: options }
674
+ */
675
+ loadOptions: (numbList: (string | number)[], fieldMapping?: SelectFieldMapping) => Promise<Record<string, SelectOption[]>>;
676
+ }
677
+ /**
678
+ * 权限选项加载适配器
679
+ * Permission options loader adapter
680
+ */
681
+ export interface PermissionOptionsAdapter {
682
+ /**
683
+ * 批量加载多个权限选项
684
+ * Batch load multiple permission options
685
+ * @param numbList - 权限编码列表
686
+ * @param fieldMapping - 字段映射配置
687
+ * @returns 选项映射表 { code: options }
688
+ */
689
+ loadOptions: (numbList: (string | number)[], fieldMapping?: PermissionFieldMapping) => Promise<Record<string, SelectOption[]>>;
690
+ }
691
+ /**
692
+ * 表单通用配置
693
+ * Form common configuration
694
+ */
695
+ export interface FormCommonConfig {
696
+ /**
697
+ * 全局禁用状态
698
+ * Global disabled state
699
+ * @description 应用级别的表单禁用控制,作为所有表单的默认禁用状态
700
+ * @default false
701
+ */
702
+ disabled?: boolean;
703
+ /**
704
+ * 是否禁用 change 事件监听
705
+ * Whether to disable change listener
706
+ */
707
+ disabledOnChangeListener?: boolean;
708
+ /**
709
+ * 是否禁用 input 事件监听
710
+ * Whether to disable input listener
711
+ */
712
+ disabledOnInputListener?: boolean;
713
+ /**
714
+ * 空状态值
715
+ * Empty state value
716
+ */
717
+ emptyStateValue?: any;
718
+ /**
719
+ * BusinessSearch API 适配器
720
+ * BusinessSearch API adapter
721
+ * 用于适配业务系统的后端接口格式
722
+ * Used to adapt business system backend API formats
723
+ */
724
+ businessSearchAdapter?: BusinessSearchAdapter;
725
+ /**
726
+ * CustomizeSelect API 适配器
727
+ */
728
+ customizeSelectAdapter?: CustomizeSelectAdapter;
729
+ /**
730
+ * Select 选项加载适配器
731
+ * Select options loader adapter
732
+ * 用于批量加载字典选项
733
+ * Used for batch loading dictionary options
734
+ */
735
+ selectOptionsAdapter?: SelectOptionsAdapter;
736
+ /**
737
+ * 权限选项加载适配器
738
+ * Permission options loader adapter
739
+ * 用于批量加载权限选项
740
+ * Used for batch loading permission options
741
+ */
742
+ permissionOptionsAdapter?: PermissionOptionsAdapter;
743
+ /**
744
+ * API 前缀
745
+ */
746
+ apiPrefix?: string;
747
+ /**
748
+ * Upload 上传配置
749
+ * Upload configuration
750
+ * @description 用于配置全局默认的上传和删除接口地址,支持组件级别覆盖
751
+ * @description Used to configure global default upload and delete API endpoints, supports component-level override
752
+ */
753
+ uploadConfig?: {
754
+ /**
755
+ * 默认上传接口地址
756
+ * Default upload API endpoint
757
+ * @example '/api/upload/file'
758
+ */
759
+ action?: string;
760
+ /**
761
+ * 默认删除接口地址
762
+ * Default delete API endpoint
763
+ * @example '/api/upload/delete'
764
+ */
765
+ delAction?: string;
766
+ /**
767
+ * 默认文件存储类型
768
+ * Default file storage type
769
+ * @default 'amazon'
770
+ */
771
+ storeType?: string;
772
+ /**
773
+ * 默认是否加密文件
774
+ * Default whether to encrypt files
775
+ * @default false
776
+ */
777
+ encryptFile?: boolean;
778
+ /**
779
+ * 默认 S3 文件目录
780
+ * Default S3 file directory
781
+ */
782
+ s3FileDir?: string;
783
+ /**
784
+ * 默认是否需要生成签名 URL
785
+ * Default whether to generate pre-signed URL
786
+ * @default false
787
+ */
788
+ preSigned?: boolean;
789
+ /**
790
+ * 默认签名 URL 过期时间(天)
791
+ * Default pre-signed URL expiration time (days)
792
+ * @default 7
793
+ */
794
+ preSignedExpire?: number;
795
+ /**
796
+ * 默认最大文件大小 (MB)
797
+ * Default max file size (MB)
798
+ */
799
+ maxSize?: number;
800
+ /**
801
+ * 默认上传文件数量限制
802
+ * Default upload file count limit
803
+ */
804
+ limit?: number;
805
+ /**
806
+ * 默认接受的文件类型
807
+ * Default accepted file types
808
+ * @example '.jpg,.jpeg,.png,.pdf,.doc,.docx'
809
+ */
810
+ accept?: string;
811
+ };
812
+ }
813
+ /**
814
+ * 表单适配器选项
815
+ * Form adapter options
816
+ */
817
+ export interface SunnyFormAdapterOptions {
818
+ /**
819
+ * 配置
820
+ * Configuration
821
+ */
822
+ config?: FormCommonConfig;
823
+ /**
824
+ * 定义验证规则
825
+ * Define validation rules
826
+ */
827
+ defineRules?: Record<string, any>;
828
+ }
829
+ /**
830
+ * 表单渲染属性
831
+ * Form render properties
832
+ */
833
+ export interface FormRenderProps extends SunnyFormProps {
834
+ form?: any;
835
+ }
836
+ //# sourceMappingURL=types.d.ts.map