@tmagic/form 1.8.0-manmanyu.9 → 1.8.1

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 (149) hide show
  1. package/dist/es/Form.vue_vue_type_script_setup_true_lang.js +88 -107
  2. package/dist/es/FormBox.vue_vue_type_script_setup_true_lang.js +21 -5
  3. package/dist/es/FormDialog.vue_vue_type_script_setup_true_lang.js +21 -5
  4. package/dist/es/FormDrawer.vue_vue_type_script_setup_true_lang.js +46 -12
  5. package/dist/es/containers/Col.vue_vue_type_script_setup_true_lang.js +6 -2
  6. package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +44 -47
  7. package/dist/es/containers/Fieldset.vue_vue_type_script_setup_true_lang.js +7 -1
  8. package/dist/es/containers/FlexLayout.vue_vue_type_script_setup_true_lang.js +5 -2
  9. package/dist/es/containers/FormLabel.vue_vue_type_script_setup_true_lang.js +1 -1
  10. package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +59 -22
  11. package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +118 -100
  12. package/dist/es/containers/Panel.vue_vue_type_script_setup_true_lang.js +8 -3
  13. package/dist/es/containers/Row.vue_vue_type_script_setup_true_lang.js +4 -1
  14. package/dist/es/containers/Step.vue_vue_type_script_setup_true_lang.js +5 -2
  15. package/dist/es/containers/Tabs.vue_vue_type_script_setup_true_lang.js +8 -1
  16. package/dist/es/containers/table/ActionsColumn.vue_vue_type_script_setup_true_lang.js +1 -1
  17. package/dist/es/containers/table/SortColumn.vue_vue_type_script_setup_true_lang.js +1 -1
  18. package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +14 -10
  19. package/dist/es/containers/table/useTableColumns.js +10 -15
  20. package/dist/es/containers/table-group-list/TableGroupList.vue_vue_type_script_setup_true_lang.js +72 -79
  21. package/dist/es/containers/table-group-list/useAdd.js +26 -16
  22. package/dist/es/containers/table-group-list/useScrollLastItemIntoView.js +72 -0
  23. package/dist/es/fields/Cascader.vue_vue_type_script_setup_true_lang.js +2 -2
  24. package/dist/es/fields/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  25. package/dist/es/fields/CheckboxGroup/Index.js +5 -0
  26. package/dist/es/fields/{CheckboxGroup.vue_vue_type_script_setup_true_lang.js → CheckboxGroup/Index.vue_vue_type_script_setup_true_lang.js} +6 -7
  27. package/dist/es/fields/CheckboxGroup/effect.js +8 -0
  28. package/dist/es/fields/ColorPicker.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/dist/es/fields/Date/Index.js +5 -0
  30. package/dist/es/fields/{Date.vue_vue_type_script_setup_true_lang.js → Date/Index.vue_vue_type_script_setup_true_lang.js} +5 -7
  31. package/dist/es/fields/Date/effect.js +10 -0
  32. package/dist/es/fields/DateTime/Index.js +5 -0
  33. package/dist/es/fields/{DateTime.vue_vue_type_script_setup_true_lang.js → DateTime/Index.vue_vue_type_script_setup_true_lang.js} +5 -9
  34. package/dist/es/fields/DateTime/effect.js +15 -0
  35. package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +2 -2
  36. package/dist/es/fields/Display/Index.js +5 -0
  37. package/dist/es/fields/{Display.vue_vue_type_script_setup_true_lang.js → Display/Index.vue_vue_type_script_setup_true_lang.js} +6 -7
  38. package/dist/es/fields/Display/effect.js +8 -0
  39. package/dist/es/fields/DynamicField/Index.js +5 -0
  40. package/dist/es/fields/{DynamicField.vue_vue_type_script_setup_true_lang.js → DynamicField/Index.vue_vue_type_script_setup_true_lang.js} +11 -15
  41. package/dist/es/fields/DynamicField/effect.js +40 -0
  42. package/dist/es/fields/Hidden.vue_vue_type_script_setup_true_lang.js +1 -1
  43. package/dist/es/fields/Link.vue_vue_type_script_setup_true_lang.js +4 -4
  44. package/dist/es/fields/Number.vue_vue_type_script_setup_true_lang.js +4 -2
  45. package/dist/es/fields/NumberRange/Index.js +5 -0
  46. package/dist/es/fields/{NumberRange.vue_vue_type_script_setup_true_lang.js → NumberRange/Index.vue_vue_type_script_setup_true_lang.js} +5 -6
  47. package/dist/es/fields/NumberRange/effect.js +8 -0
  48. package/dist/es/fields/RadioGroup.vue_vue_type_script_setup_true_lang.js +5 -2
  49. package/dist/es/fields/Select.vue_vue_type_script_setup_true_lang.js +14 -6
  50. package/dist/es/fields/Switch.vue_vue_type_script_setup_true_lang.js +1 -1
  51. package/dist/es/fields/Text.vue_vue_type_script_setup_true_lang.js +13 -10
  52. package/dist/es/fields/Textarea.vue_vue_type_script_setup_true_lang.js +1 -1
  53. package/dist/es/fields/Time.vue_vue_type_script_setup_true_lang.js +1 -1
  54. package/dist/es/fields/Timerange.vue_vue_type_script_setup_true_lang.js +3 -3
  55. package/dist/es/headless.js +13 -0
  56. package/dist/es/index.js +19 -12
  57. package/dist/es/plugin.js +57 -39
  58. package/dist/es/schema.js +11 -2
  59. package/dist/es/style.css +123 -3
  60. package/dist/es/submitForm.js +270 -72
  61. package/dist/es/utils/builtInFields.js +49 -0
  62. package/dist/es/utils/collectFields.js +407 -0
  63. package/dist/es/utils/config.js +4 -8
  64. package/dist/es/utils/fieldInnerConfig.js +42 -0
  65. package/dist/es/utils/fieldValueEffects.js +80 -0
  66. package/dist/es/utils/form.js +154 -19
  67. package/dist/es/utils/formStateProxy.js +111 -0
  68. package/dist/es/utils/registerField.js +158 -0
  69. package/dist/es/utils/submitHeadless.js +54 -0
  70. package/dist/es/utils/tableGroupList.js +104 -0
  71. package/dist/es/utils/typeMatch.js +532 -0
  72. package/dist/es/utils/validateError.js +57 -0
  73. package/dist/es/utils/validateValues.js +115 -0
  74. package/dist/style.css +123 -3
  75. package/dist/themes/magic-admin.css +576 -14
  76. package/dist/tmagic-form-headless.umd.cjs +4515 -0
  77. package/dist/tmagic-form.umd.cjs +3444 -983
  78. package/package.json +16 -10
  79. package/src/Form.vue +113 -129
  80. package/src/FormBox.vue +16 -4
  81. package/src/FormDialog.vue +16 -5
  82. package/src/FormDrawer.vue +41 -13
  83. package/src/containers/Col.vue +3 -0
  84. package/src/containers/Container.vue +40 -45
  85. package/src/containers/Fieldset.vue +5 -0
  86. package/src/containers/FlexLayout.vue +2 -0
  87. package/src/containers/GroupList.vue +64 -13
  88. package/src/containers/GroupListItem.vue +88 -81
  89. package/src/containers/Panel.vue +3 -0
  90. package/src/containers/Row.vue +2 -0
  91. package/src/containers/Step.vue +2 -0
  92. package/src/containers/Tabs.vue +13 -0
  93. package/src/containers/table/ActionsColumn.vue +1 -1
  94. package/src/containers/table/Table.vue +5 -3
  95. package/src/containers/table/usePagination.ts +1 -1
  96. package/src/containers/table/useSortable.ts +1 -1
  97. package/src/containers/table/useTableColumns.ts +15 -22
  98. package/src/containers/table-group-list/TableGroupList.vue +46 -72
  99. package/src/containers/table-group-list/useAdd.ts +40 -25
  100. package/src/containers/table-group-list/useScrollLastItemIntoView.ts +94 -0
  101. package/src/fields/{CheckboxGroup.vue → CheckboxGroup/Index.vue} +3 -8
  102. package/src/fields/CheckboxGroup/effect.ts +27 -0
  103. package/src/fields/{Date.vue → Date/Index.vue} +2 -5
  104. package/src/fields/Date/effect.ts +29 -0
  105. package/src/fields/{DateTime.vue → DateTime/Index.vue} +2 -16
  106. package/src/fields/DateTime/effect.ts +36 -0
  107. package/src/fields/{Display.vue → Display/Index.vue} +3 -7
  108. package/src/fields/Display/effect.ts +28 -0
  109. package/src/fields/{DynamicField.vue → DynamicField/Index.vue} +11 -11
  110. package/src/fields/DynamicField/effect.ts +74 -0
  111. package/src/fields/Link.vue +3 -4
  112. package/src/fields/Number.vue +2 -1
  113. package/src/fields/{NumberRange.vue → NumberRange/Index.vue} +2 -6
  114. package/src/fields/NumberRange/effect.ts +27 -0
  115. package/src/fields/RadioGroup.vue +13 -1
  116. package/src/fields/Select.vue +13 -4
  117. package/src/headless.ts +78 -0
  118. package/src/index.ts +46 -9
  119. package/src/plugin.ts +68 -37
  120. package/src/schema.ts +13 -2
  121. package/src/submitForm.ts +410 -131
  122. package/src/theme/fieldset.scss +1 -0
  123. package/src/theme/form-box.scss +5 -0
  124. package/src/theme/form-dialog.scss +1 -1
  125. package/src/theme/group-list.scss +143 -2
  126. package/src/theme/table.scss +11 -1
  127. package/src/theme/themes/magic-admin/index.scss +27 -16
  128. package/src/utils/builtInFields.ts +69 -0
  129. package/src/utils/collectFields.ts +561 -0
  130. package/src/utils/config.ts +7 -15
  131. package/src/utils/fieldInnerConfig.ts +127 -0
  132. package/src/utils/fieldValueEffects.ts +140 -0
  133. package/src/utils/form.ts +230 -30
  134. package/src/utils/formStateProxy.ts +149 -0
  135. package/src/utils/registerField.ts +308 -0
  136. package/src/utils/submitHeadless.ts +206 -0
  137. package/src/utils/tableGroupList.ts +147 -0
  138. package/src/utils/typeMatch.ts +948 -0
  139. package/src/utils/validateError.ts +92 -0
  140. package/src/utils/validateValues.ts +177 -0
  141. package/types/headless.d.ts +682 -0
  142. package/types/index.d.ts +900 -180
  143. package/dist/es/_virtual/_rolldown/runtime.js +0 -27
  144. package/dist/es/fields/CheckboxGroup.js +0 -5
  145. package/dist/es/fields/Date.js +0 -5
  146. package/dist/es/fields/DateTime.js +0 -5
  147. package/dist/es/fields/Display.js +0 -5
  148. package/dist/es/fields/DynamicField.js +0 -5
  149. package/dist/es/fields/NumberRange.js +0 -5
package/types/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { App, AppContext, Component, InjectionKey } from "vue";
2
- import { FlexLayoutConfig, FormItemConfig, GroupListConfig, TableConfig } from "@tmagic/form-schema";
1
+ import { App, AppContext, Component, ComputedRef, InjectionKey, MaybeRef, Ref } from "vue";
2
+ import { FlexLayoutConfig, FormContext, FormItemConfig, GroupListConfig, TableConfig } from "@tmagic/form-schema";
3
3
  export * from "@tmagic/form-schema";
4
-
5
- //#region \0rolldown/runtime.js
6
4
  declare namespace schema_d_exports {
7
- export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FormDiffConfig, FormLabelSlotProps, FormSlots, ValidateError };
5
+ export { ChangeRecord, ContainerChangeEventData, FORM_CONTEXT_KEY, FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, FormDiffConfig, FormLabelSlotProps, FormSlots, ValidateError };
8
6
  }
9
7
  import * as import__tmagic_form_schema from "@tmagic/form-schema";
10
8
  /**
@@ -12,7 +10,7 @@ import * as import__tmagic_form_schema from "@tmagic/form-schema";
12
10
  * 所有层级的 Container(含嵌套在 fieldset / panel 等容器组件内部的 Container)通过 `inject` 获取,
13
11
  * 无需逐层透传 prop。
14
12
  */
15
- interface FormDiffConfig {
13
+ export interface FormDiffConfig {
16
14
  /**
17
15
  * 自定义"是否展示对比内容"的判断函数(仅在对比模式下生效)。
18
16
  *
@@ -32,21 +30,31 @@ interface FormDiffConfig {
32
30
  */
33
31
  selfDiffFieldTypes?: string[] | ((_defaultTypes: string[]) => string[]);
34
32
  }
35
- declare const FORM_DIFF_CONFIG_KEY: InjectionKey<FormDiffConfig>;
36
- interface ValidateError {
33
+ export declare const FORM_DIFF_CONFIG_KEY: InjectionKey<FormDiffConfig>;
34
+ export declare const FORM_TYPE_MATCH_VALID_KEY: InjectionKey<ComputedRef<boolean>>;
35
+ /**
36
+ * 宿主业务上下文,由 `MForm`(或更外层的 Editor)通过 `provide` 下发。
37
+ *
38
+ * 嵌套表单(Link 子表单、FormBox、临时校验表单等)会自动继承最近祖先的 context,
39
+ * 无需层层透传。
40
+ *
41
+ * 配置回调统一通过 `mForm.xxx` 读取,由 formState 的读穿 Proxy 落到这里。
42
+ */
43
+ export declare const FORM_CONTEXT_KEY: InjectionKey<ComputedRef<FormContext>>;
44
+ export interface ValidateError {
37
45
  message: string;
38
46
  field: string;
39
47
  }
40
- interface ChangeRecord {
48
+ export interface ChangeRecord {
41
49
  propPath?: string;
42
50
  value: any;
43
51
  }
44
- interface ContainerChangeEventData {
52
+ export interface ContainerChangeEventData {
45
53
  modifyKey?: string;
46
54
  changeRecords?: ChangeRecord[];
47
55
  }
48
56
  /** 自定义 label slot 的作用域参数 */
49
- interface FormLabelSlotProps {
57
+ export interface FormLabelSlotProps {
50
58
  /** 当前表单项配置 */
51
59
  config: FormItemConfig;
52
60
  /** 经处理后的类型 */
@@ -59,11 +67,72 @@ interface FormLabelSlotProps {
59
67
  disabled?: boolean;
60
68
  }
61
69
  /** Form / Container 暴露的具名 slot 定义 */
62
- interface FormSlots {
70
+ export interface FormSlots {
63
71
  label(_props: FormLabelSlotProps): any;
64
72
  }
65
73
  //#endregion
66
- //#region temp/packages/form/src/submitForm.d.ts
74
+ //#region temp/packages/form/src/utils/validateValues.d.ts
75
+ /** 构造无渲染 formState 所需的参数(与 MForm 的同名 props 对齐) */
76
+ interface HeadlessFormStateOptions {
77
+ config: schema_d_exports.FormConfig;
78
+ initValues?: schema_d_exports.FormValue;
79
+ parentValues?: schema_d_exports.FormValue;
80
+ keyProp?: string;
81
+ popperClass?: string;
82
+ /** 宿主业务上下文,与 MForm 的同名 prop 语义一致 */
83
+ context?: schema_d_exports.FormContext;
84
+ }
85
+ /**
86
+ * 构造一个不依赖组件实例的 `formState`。
87
+ *
88
+ * 字段结构与 `Form.vue` 中 provide 给子树的 `mForm` 保持一致,使配置里的
89
+ * `display` / `rules.validator` / `filter` 等回调拿到的上下文与渲染式校验相同。
90
+ *
91
+ * 差异:没有真实的表单实例,因此 `$emit` 为空实现、`fields` 注册表始终为空
92
+ * (该注册表在整个仓库中只写不读,不参与校验)。
93
+ */
94
+ export declare const createHeadlessFormState: (options: HeadlessFormStateOptions) => schema_d_exports.FormState;
95
+ /** `validateValues` 参数 */
96
+ interface ValidateValuesOptions extends HeadlessFormStateOptions {
97
+ /** 是否开启类型匹配校验 */
98
+ typeMatchValid?: boolean;
99
+ /**
100
+ * 校验失败时错误提示前缀是否使用字段的 text 文案。默认 `true`。
101
+ */
102
+ useFieldTextInError?: boolean;
103
+ }
104
+ /** `validateValues` 结果 */
105
+ interface ValidateValuesResult {
106
+ /** 经 `initValue` 初始化并执行字段值初始化写入后的表单值 */
107
+ values: schema_d_exports.FormValue;
108
+ /** 汇总后的错误文案(多条以 `<br>` 拼接),校验通过为空字符串 */
109
+ error: string;
110
+ /** 原始错误映射,形如 `{ [prop]: [{ field, message }] }` */
111
+ invalidFields: Record<string, any>;
112
+ }
113
+ /**
114
+ * 不挂载任何组件,纯逻辑地对「一份 config + 一份值」执行一次完整校验。
115
+ *
116
+ * 流程与渲染式校验一一对应,但不需要 DOM,也不会实例化任何字段组件:
117
+ *
118
+ * 1. 构造 headless `formState` 并挂上 `context` 读穿;
119
+ * 2. `initValue` 初始化表单值(默认值、嵌套结构、`onInitValue` 等);
120
+ * 3. `applyMountValueEffects` 执行字段登记的值初始化写入(与渲染式共用同一份登记表);
121
+ * 4. 遍历 config 树收集所有带规则的字段(等价于渲染出的 FormItem 集合);
122
+ * 5. 逐字段交给 async-validator 执行,汇总错误文案。
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const { error, values } = await validateValues({
127
+ * config: [...],
128
+ * initValues: { name: '' },
129
+ * typeMatchValid: true,
130
+ * });
131
+ * ```
132
+ */
133
+ export declare const validateValues: (options: ValidateValuesOptions) => Promise<ValidateValuesResult>;
134
+ //#endregion
135
+ //#region temp/packages/form/src/utils/submitHeadless.d.ts
67
136
  /**
68
137
  * submitForm 函数参数(与 Form.vue 组件 props 对齐)
69
138
  */
@@ -83,11 +152,17 @@ interface SubmitFormOptions {
83
152
  stepActive?: string | number;
84
153
  size?: 'small' | 'default' | 'large';
85
154
  inline?: boolean;
86
- labelPosition?: string;
155
+ labelPosition?: 'top' | 'left' | 'right';
87
156
  keyProp?: string;
88
157
  popperClass?: string;
89
158
  preventSubmitDefault?: boolean;
90
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
159
+ /**
160
+ * 表单校验失败时,错误提示前缀是否使用字段的 text 文案(通过 `getTextByName` 从 config 中查找)。
161
+ * 默认 `true`,置为 `false` 时直接使用字段 name。
162
+ */
163
+ useFieldTextInError?: boolean;
164
+ /** 宿主业务上下文,与 MForm 的同名 prop 语义一致 */
165
+ context?: schema_d_exports.FormContext;
91
166
  /** 透传给 Form.submitForm 的参数:是否直接返回原始响应式 values */
92
167
  native?: boolean;
93
168
  /**
@@ -97,11 +172,24 @@ interface SubmitFormOptions {
97
172
  returnChangeRecords?: boolean;
98
173
  /**
99
174
  * 父级应用上下文,用于继承全局组件、指令、provide 等。
100
- * 通常通过 `app._context` 或 `getCurrentInstance()?.appContext` 获取。
175
+ * 仅 `dialog: true` 时生效。`@tmagic/form/headless` 不支持弹层。
101
176
  */
102
177
  appContext?: AppContext | null;
103
- /** 等待表单初始化的最长时间(毫秒),超时将以错误 reject。默认 10000ms */
104
- timeout?: number;
178
+ /**
179
+ * 是否以弹层展示表单。默认 `false`。
180
+ *
181
+ * `@tmagic/form/headless` 不支持 `dialog: true`,请从 `@tmagic/form` 引入。
182
+ */
183
+ dialog?: boolean;
184
+ /**
185
+ * 弹层标题,仅 `dialog: true` 时生效。
186
+ */
187
+ title?: string;
188
+ typeMatchValid?: boolean;
189
+ /**
190
+ * 外部中断信号。abort 时会立即以 `signal.reason` reject。
191
+ */
192
+ signal?: AbortSignal;
105
193
  }
106
194
  /**
107
195
  * 开启 `returnChangeRecords` 时 submitForm 的返回结果
@@ -113,79 +201,201 @@ interface SubmitFormResult {
113
201
  changeRecords: ChangeRecord[];
114
202
  }
115
203
  /**
116
- * 以命令式方式调用 Form.vue 完成一次表单校验/提交。
204
+ * validateForm 函数参数(与 Form.vue 组件 props 对齐,取校验所需子集)
205
+ */
206
+ interface ValidateFormOptions {
207
+ /** 表单配置 */
208
+ config: schema_d_exports.FormConfig;
209
+ /** 待校验的表单值 */
210
+ initValues?: Record<string, any>;
211
+ parentValues?: Record<string, any>;
212
+ labelWidth?: string;
213
+ keyProp?: string;
214
+ /**
215
+ * 校验失败时,错误提示前缀是否使用字段的 text 文案(通过 `getTextByName` 从 config 中查找)。
216
+ * 默认 `true`,置为 `false` 时直接使用字段 name。
217
+ */
218
+ useFieldTextInError?: boolean;
219
+ /** 宿主业务上下文,与 MForm 的同名 prop 语义一致 */
220
+ context?: schema_d_exports.FormContext;
221
+ /**
222
+ * 父级应用上下文。仅 `dialog: true` 时生效。`@tmagic/form/headless` 不支持弹层。
223
+ */
224
+ appContext?: AppContext | null;
225
+ /**
226
+ * 是否以弹层展示表单。默认 `false`。
227
+ *
228
+ * `@tmagic/form/headless` 不支持 `dialog: true`,请从 `@tmagic/form` 引入。
229
+ */
230
+ dialog?: boolean;
231
+ /**
232
+ * 弹层标题,仅 `dialog: true` 时生效。
233
+ */
234
+ title?: string;
235
+ typeMatchValid?: boolean;
236
+ /**
237
+ * 外部中断信号。abort 时会立即以 `signal.reason` reject。
238
+ */
239
+ signal?: AbortSignal;
240
+ }
241
+ //#endregion
242
+ //#region temp/packages/form/src/submitForm.d.ts
243
+ /**
244
+ * 返回一份去除了 tab 标签页 lazy 的配置副本。
117
245
  *
118
- * 类似 ElMessage 的用法:传入 props(包含 `config`/`initValues` 等),函数内部会临时挂载
119
- * 一个不可见的 Form 组件实例,等待初始化完成后调用其 `submitForm` 方法,
120
- * 校验通过则 resolve 表单值,校验失败则 reject 错误信息,最后自动卸载实例。
246
+ * tab 容器开启 lazy 时,非激活标签页的内容不会渲染,导致 validateForm 静默挂载后
247
+ * 无法校验到这些标签页内的字段。校验场景需要一次性渲染全部字段,故在此统一去除 lazy。
248
+ * 处理基于深拷贝,不会污染调用方传入的原始 config。
249
+ */
250
+ export declare const stripTabItemsLazy: (config: schema_d_exports.FormConfig) => schema_d_exports.FormConfig;
251
+ /**
252
+ * 以命令式方式对一份「表单配置 + 值」做一次校验并取回表单值。
121
253
  *
122
- * @example
123
- * ```ts
124
- * import { submitForm } from '@tmagic/form';
254
+ * 默认走无渲染实现(见 `@tmagic/form/headless`)。`dialog: true` 会把表单以弹层渲染出来。
255
+ */
256
+ export declare const submitForm: (options: SubmitFormOptions) => Promise<any>;
257
+ /**
258
+ * 以命令式方式对一份「表单配置 + 值」做一次静默校验。
259
+ *
260
+ * 默认走无渲染实现。`dialog: true` 的处理详见 `submitForm`。
261
+ */
262
+ export declare const validateForm: (options: ValidateFormOptions) => Promise<string>;
263
+ //#endregion
264
+ //#region temp/packages/form/src/utils/formStateProxy.d.ts
265
+ /**
266
+ * 按优先级分层合并上下文,**靠后的层优先**。
125
267
  *
126
- * try {
127
- * const values = await submitForm({
128
- * config: [...],
129
- * initValues: { name: 'foo' },
130
- * });
131
- * console.log(values);
132
- * } catch (e) {
133
- * console.error(e);
134
- * }
268
+ * 用读穿 Proxy 而非 `{ ...a, ...b }`:展开会立即执行 accessor,
269
+ * 而宿主允许用 `{ get stage() { ... } }` 这类读时求值的描述符。
270
+ */
271
+ export declare const mergeFormContexts: (...layers: (schema_d_exports.FormContext | undefined | null)[]) => schema_d_exports.FormContext;
272
+ /**
273
+ * 将 coreState 与宿主业务上下文关联:读取时优先 core,miss 再读穿到 context。
135
274
  *
136
- * // 需要同时获取变更记录时:
137
- * const { values, changeRecords } = await submitForm({
138
- * config: [...],
139
- * initValues: { name: 'foo' },
140
- * returnChangeRecords: true,
141
- * });
142
- * ```
275
+ * - `get` 用属性访问而非 `Reflect.get(t, k, receiver)`,避免破坏 Vue reactive 的 `__v_raw`;
276
+ * - symbol 键一律只走 core,四个 trap 保持一致。context 是业务数据袋,不承载 symbol 键,
277
+ * 把 Vue / 工具链的内部 symbol 隔离在 core 上才能让 `toRaw` / `isReactive` 判定正确;
278
+ * - `ownKeys` + `getOwnPropertyDescriptor` 保证 `Object.entries(formState)` 能枚举到扩展字段
279
+ * (admin-web-next 的 `pickPanelFormStateExtendFields` 依赖此语义);
280
+ * - `set` 写入 coreState,第三方 `formState.xxx = v` 仍生效且优先于 context。
281
+ *
282
+ * 独立成文件,避免与 `form.ts` ↔ `typeMatch.ts` 形成循环依赖。
143
283
  */
144
- declare const submitForm: (options: SubmitFormOptions) => Promise<any>;
284
+ export declare const createFormStateProxy: (coreState: schema_d_exports.FormState, getContext: (() => schema_d_exports.FormContext) | Ref<schema_d_exports.FormContext>) => schema_d_exports.FormState;
145
285
  //#endregion
146
286
  //#region temp/packages/form/src/utils/form.d.ts
147
- declare const createValues: (mForm: schema_d_exports.FormState | undefined, config?: schema_d_exports.FormConfig | schema_d_exports.TabPaneConfig[], initValue?: schema_d_exports.FormValue, value?: schema_d_exports.FormValue) => schema_d_exports.FormValue;
148
- declare const filterFunction: <T = any>(mForm: schema_d_exports.FormState | undefined, config: T | schema_d_exports.FilterFunction<T> | undefined, props: any) => T | undefined;
149
- declare const display: (mForm: schema_d_exports.FormState | undefined, config: any, props: any) => any;
150
- declare const getRules: (mForm: schema_d_exports.FormState | undefined, rules: (schema_d_exports.Rule[] | schema_d_exports.Rule) | undefined, props: any) => schema_d_exports.Rule[];
151
- declare const initValue: (mForm: schema_d_exports.FormState | undefined, {
152
- initValues,
153
- config
154
- }: {
287
+ type AsyncValidatorFn = (rule: any, value: any, callback: Function, source?: any, options?: any) => any;
288
+ /**
289
+ * 将 async-validator(Element Plus)风格的 validator 适配到当前 UI 库。
290
+ * TDesign 调用签名为 `(val) => boolean | CustomValidateObj | Promise`,无 callback。
291
+ */
292
+ export declare const adaptFormValidator: (validator: AsyncValidatorFn) => AsyncValidatorFn;
293
+ export declare const createValues: (mForm: schema_d_exports.FormState | undefined, config?: schema_d_exports.FormConfig | schema_d_exports.TabPaneConfig[], initValue?: schema_d_exports.FormValue, value?: schema_d_exports.FormValue) => schema_d_exports.FormValue;
294
+ export declare const createFormStateBase: (ui?: {
295
+ $message?: any;
296
+ $messageBox?: any;
297
+ }) => {
298
+ fields: Map<string, any>;
299
+ setField: (prop: string, field: any) => Map<string, any>;
300
+ getField: (prop: string) => any;
301
+ deleteField: (prop: string) => boolean;
302
+ $messageBox: any;
303
+ $message: any;
304
+ post: (options: any) => any;
305
+ };
306
+ /**
307
+ * 配置项的 `name` 是否可用于从 model 中下钻取值。
308
+ *
309
+ * 供 `Container.vue` 与无渲染校验(`collectValidatableFields`)共用,两者对「该不该下钻」
310
+ * 的判断必须一致。
311
+ */
312
+ export declare const isValidName: (name: unknown) => boolean;
313
+ /**
314
+ * 在 `prop` 后追加一段路径。
315
+ *
316
+ * 用于容器把 `prop` 透传给子级时再拼上索引 / key(如 group-list 的行、table 的行)。
317
+ */
318
+ export declare const appendProp: (prop: string | undefined, key: string | number) => string;
319
+ /**
320
+ * 由父级 `prop` 与配置项 `name` 拼出该配置项的完整 `prop`(即 FormItem 的 prop)。
321
+ *
322
+ * 调用方传入的 name 已按 `config.name || ''` 归一化,空 name 表示该配置项不占据值路径上的一层,
323
+ * 此时沿用父级 `prop`。
324
+ */
325
+ export declare const getItemProp: (prop?: string | undefined, name?: string | number | undefined) => string;
326
+ /**
327
+ * 归一化配置项的 `type`:求值动态 type、剥离容器语义的 type、驼峰转中划线、补默认值。
328
+ *
329
+ * 供 `Container.vue` 与无渲染校验共用,保证两者分派到的 type 完全一致。
330
+ */
331
+ export declare const resolveItemType: (mForm: schema_d_exports.FormState | undefined, config: any, props: any) => string;
332
+ export declare const filterFunction: <T = any>(mForm: schema_d_exports.FormState | undefined, config: T | schema_d_exports.FilterFunction<T> | undefined, props: any) => T | undefined;
333
+ export declare const display: (mForm: schema_d_exports.FormState | undefined, config: any, props: any) => any;
334
+ export declare const getRules: (mForm: schema_d_exports.FormState | undefined, r: (schema_d_exports.Rule[] | schema_d_exports.Rule) | undefined, props: any, typeMatchValid?: MaybeRef<boolean>) => schema_d_exports.Rule[];
335
+ /**
336
+ * 与 `getRules` 相同,但 validator 保持 async-validator(Element Plus)原生签名,不做 UI 库适配。
337
+ *
338
+ * 供无渲染校验(`validateValues`)使用:它直接把规则交给 async-validator 执行,
339
+ * 不经过 TDesign 的 `validator(val)` 调用约定,因此不能套 `adaptFormValidator`。
340
+ */
341
+ export declare const getNativeRules: (mForm: schema_d_exports.FormState | undefined, r: (schema_d_exports.Rule[] | schema_d_exports.Rule) | undefined, props: any, typeMatchValid?: MaybeRef<boolean>) => schema_d_exports.Rule[];
342
+ export declare const initValue: (mForm: schema_d_exports.FormState | undefined, { initValues, config }: {
155
343
  initValues: schema_d_exports.FormValue;
156
344
  config: schema_d_exports.FormConfig;
157
345
  }) => Promise<schema_d_exports.FormValue>;
158
- declare const datetimeFormatter: (v: string | Date, defaultValue?: string, format?: string) => string | number;
159
- declare const getDataByPage: (data: any[] | undefined, pagecontext: number, pagesize: number) => any[];
160
- declare const sortArray: (data: any[], newIndex: number, oldIndex: number, sortKey?: string) => any[];
161
- declare const sortChange: (data: any[], {
162
- prop,
163
- order
164
- }: schema_d_exports.SortProp) => void;
165
- declare const createObjectProp: (prop: string, key: string, name?: string | number) => string;
346
+ export declare const datetimeFormatter: (v: string | Date, defaultValue?: string, format?: string) => string | number;
347
+ export declare const getDataByPage: (data: any[] | undefined, pagecontext: number, pagesize: number) => any[];
348
+ export declare const sortArray: (data: any[], newIndex: number, oldIndex: number, sortKey?: string) => any[];
349
+ export declare const sortChange: (data: any[], { prop, order }: schema_d_exports.SortProp) => void;
350
+ export declare const createObjectProp: (prop: string, key: string, name?: string | number) => string;
166
351
  //#endregion
167
352
  //#region temp/packages/form/src/utils/useAddField.d.ts
168
- declare const useAddField: (prop?: string) => void;
353
+ export declare const useAddField: (prop?: string) => void;
169
354
  //#endregion
170
355
  //#region temp/packages/form/src/Form.vue.d.ts
171
- type __VLS_Slots$5 = FormSlots;
356
+ type __VLS_Slots$6 = FormSlots;
172
357
  type __VLS_Props$30 = {
173
- /** 表单配置 */config: schema_d_exports.FormConfig; /** 表单值 */
174
- initValues: Record<string, any>; /** 需对比的值(开启对比模式时传入) */
175
- lastValues?: Record<string, any>; /** 是否开启对比模式 */
358
+ /** 表单配置 */
359
+ config: schema_d_exports.FormConfig;
360
+ /** 表单值 */
361
+ initValues: Record<string, any>;
362
+ /** 需对比的值(开启对比模式时传入) */
363
+ lastValues?: Record<string, any>;
364
+ /** 是否开启对比模式 */
176
365
  isCompare?: boolean;
177
366
  parentValues?: Record<string, any>;
178
367
  labelWidth?: string;
368
+ /** 是否开启类型匹配校验 */
369
+ typeMatchValid?: boolean;
370
+ /**
371
+ * 初始化(`config` / `initValues` 就绪)后是否立即执行一次表单校验。
372
+ *
373
+ * - `false`(默认):不自动校验,避免打开表单时就展示错误态;
374
+ * - `true`:初始化完成后在 `nextTick` 中调用 `validate()`。
375
+ */
376
+ validateOnInit?: boolean;
179
377
  disabled?: boolean;
180
378
  height?: string;
181
379
  stepActive?: string | number;
182
380
  size?: 'small' | 'default' | 'large';
183
381
  inline?: boolean;
184
- labelPosition?: string;
382
+ labelPosition?: 'top' | 'left' | 'right';
185
383
  keyProp?: string;
186
384
  popperClass?: string;
187
385
  preventSubmitDefault?: boolean;
188
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
386
+ /**
387
+ * 表单校验失败时,错误提示前缀是否使用字段的 text 文案(通过 `getTextByName` 从 config 中查找)。
388
+ *
389
+ * - `true`(默认):错误提示形如 `字段文案 -> 错误信息`,找不到 text 时回退为字段 name;
390
+ * - `false`:跳过查找,直接使用字段 name 作为错误提示前缀(形如 `字段name -> 错误信息`)。
391
+ */
392
+ useFieldTextInError?: boolean;
393
+ /**
394
+ * 宿主业务上下文。也可由祖先 `provide(FORM_CONTEXT_KEY)` 下发,本 prop 覆盖祖先的同名字段。
395
+ *
396
+ * 配置回调通过 `mForm.xxx` 读取,由 formState 的读穿 Proxy 落到这里。
397
+ */
398
+ context?: schema_d_exports.FormContext;
189
399
  /**
190
400
  * 自定义"是否展示对比内容"的判断函数(仅在 `isCompare === true` 时生效)。
191
401
  *
@@ -227,7 +437,7 @@ type __VLS_Props$30 = {
227
437
  */
228
438
  theme?: string;
229
439
  };
230
- declare const __VLS_base$5: import("@vue/runtime-core").DefineComponent<__VLS_Props$30, {
440
+ declare const __VLS_base$6: import("@vue/runtime-core").DefineComponent<__VLS_Props$30, {
231
441
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
232
442
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
233
443
  formState: schema_d_exports.FormState;
@@ -236,6 +446,23 @@ declare const __VLS_base$5: import("@vue/runtime-core").DefineComponent<__VLS_Pr
236
446
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
237
447
  resetForm: () => void;
238
448
  submitForm: (native?: boolean) => Promise<any>;
449
+ /**
450
+ * 校验:对表单当前值执行校验,返回汇总后的错误文案。
451
+ *
452
+ * 与 `submitForm` 的区别:
453
+ * - 校验失败时不抛异常、不触发 `error` 事件,而是以返回值形式给出错误文案;
454
+ * - 不重置 `changeRecords`,不改变提交语义,仅用于「探测」当前配置是否合法。
455
+ *
456
+ * 注意:本方法只改变「校验结果的返回方式」,并不负责「不污染页面表单状态」——
457
+ * 若需对一份独立的「配置 + 值」做完全不影响页面上已渲染表单的校验,请使用 `validateForm`
458
+ * (内部会新建一个隐藏的 MForm 实例,通过 `initValues` 传入待校验值,用完即卸载)。
459
+ *
460
+ * 典型用途:作为 `validateForm` 内部复用的校验实现;也可在已渲染的表单实例上主动调用,
461
+ * 根据返回的错误文案自行决定后续处理(如记录节点错误状态)。
462
+ *
463
+ * @returns 校验通过返回空字符串 `''`,否则返回以 `<br>` 拼接的错误文案。
464
+ */
465
+ validate: () => Promise<string>;
239
466
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
240
467
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
241
468
  error: (...args: any[]) => void;
@@ -253,7 +480,7 @@ declare const __VLS_base$5: import("@vue/runtime-core").DefineComponent<__VLS_Pr
253
480
  disabled: boolean;
254
481
  labelWidth: string;
255
482
  inline: boolean;
256
- labelPosition: string;
483
+ labelPosition: "top" | "left" | "right";
257
484
  config: schema_d_exports.FormConfig;
258
485
  height: string;
259
486
  initValues: Record<string, any>;
@@ -261,11 +488,13 @@ declare const __VLS_base$5: import("@vue/runtime-core").DefineComponent<__VLS_Pr
261
488
  isCompare: boolean;
262
489
  keyProp: string;
263
490
  parentValues: Record<string, any>;
491
+ useFieldTextInError: boolean;
264
492
  stepActive: string | number;
493
+ validateOnInit: boolean;
265
494
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
266
- declare const __VLS_export$30: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
495
+ declare const __VLS_export$30: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
267
496
  declare const _default$12: typeof __VLS_export$30;
268
- type __VLS_WithSlots$5<T, S> = T & {
497
+ type __VLS_WithSlots$6<T, S> = T & {
269
498
  new (): {
270
499
  $slots: S;
271
500
  };
@@ -278,11 +507,15 @@ type __VLS_Props$29 = {
278
507
  parentValues?: Object;
279
508
  width?: string | number;
280
509
  labelWidth?: string;
510
+ /** 是否开启类型匹配校验 */
511
+ typeMatchValid?: boolean;
512
+ /** 透传给内部 `MForm`,初始化完成后是否立即校验(默认 `false`) */
513
+ validateOnInit?: boolean;
281
514
  fullscreen?: boolean;
282
515
  disabled?: boolean;
283
516
  title?: string;
284
517
  inline?: boolean;
285
- labelPosition?: string;
518
+ labelPosition?: 'top' | 'left' | 'right';
286
519
  zIndex?: number;
287
520
  size?: 'small' | 'default' | 'large';
288
521
  confirmText?: string;
@@ -291,8 +524,11 @@ type __VLS_Props$29 = {
291
524
  closeOnPressEscape?: boolean;
292
525
  destroyOnClose?: boolean;
293
526
  showClose?: boolean;
294
- showCancel?: boolean; /** 透传给内部 `MForm`,用于扩展 `formState`(如注入 `$message` / `$store` 等) */
295
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
527
+ showCancel?: boolean;
528
+ /** 透传给内部 `MForm`,控制表单校验失败时错误提示前缀是否使用字段的 text 文案 */
529
+ useFieldTextInError?: boolean;
530
+ /** 透传给内部 `MForm` 的宿主业务上下文 */
531
+ context?: schema_d_exports.FormContext;
296
532
  /**
297
533
  * 主题名。优先级:传入 `theme` prop > 祖先 `provide(M_THEME_KEY)` > 空串。
298
534
  * 计算结果会再次 `provide` 出去,使得 Dialog 被 Teleport 到 body 后,内部子树
@@ -301,14 +537,14 @@ type __VLS_Props$29 = {
301
537
  theme?: string;
302
538
  };
303
539
  declare var __VLS_19: {}, __VLS_34: {}, __VLS_42: {};
304
- type __VLS_Slots$4 = {} & {
540
+ type __VLS_Slots$5 = {} & {
305
541
  default?: (props: typeof __VLS_19) => any;
306
542
  } & {
307
543
  left?: (props: typeof __VLS_34) => any;
308
544
  } & {
309
545
  footer?: (props: typeof __VLS_42) => any;
310
546
  };
311
- declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Props$29, {
547
+ declare const __VLS_base$5: import("@vue/runtime-core").DefineComponent<__VLS_Props$29, {
312
548
  form: import("@vue/reactivity").Ref<({
313
549
  $: import("@vue/runtime-core").ComponentInternalInstance;
314
550
  $data: {};
@@ -319,16 +555,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
319
555
  readonly isCompare?: boolean | undefined;
320
556
  readonly parentValues?: Record<string, any> | undefined;
321
557
  readonly labelWidth?: string | undefined;
558
+ readonly typeMatchValid?: boolean | undefined;
559
+ readonly validateOnInit?: boolean | undefined;
322
560
  readonly disabled?: boolean | undefined;
323
561
  readonly height?: string | undefined;
324
562
  readonly stepActive?: string | number | undefined;
325
563
  readonly size?: "small" | "default" | "large" | undefined;
326
564
  readonly inline?: boolean | undefined;
327
- readonly labelPosition?: string | undefined;
565
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
328
566
  readonly keyProp?: string | undefined;
329
567
  readonly popperClass?: string | undefined;
330
568
  readonly preventSubmitDefault?: boolean | undefined;
331
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
569
+ readonly useFieldTextInError?: boolean | undefined;
570
+ readonly context?: schema_d_exports.FormContext | undefined;
332
571
  readonly showDiff?: ((_data: {
333
572
  curValue: any;
334
573
  lastValue: any;
@@ -361,16 +600,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
361
600
  isCompare?: boolean;
362
601
  parentValues?: Record<string, any>;
363
602
  labelWidth?: string;
603
+ typeMatchValid?: boolean;
604
+ validateOnInit?: boolean;
364
605
  disabled?: boolean;
365
606
  height?: string;
366
607
  stepActive?: string | number;
367
608
  size?: "small" | "default" | "large";
368
609
  inline?: boolean;
369
- labelPosition?: string;
610
+ labelPosition?: "top" | "left" | "right";
370
611
  keyProp?: string;
371
612
  popperClass?: string;
372
613
  preventSubmitDefault?: boolean;
373
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
614
+ useFieldTextInError?: boolean;
615
+ context?: schema_d_exports.FormContext;
374
616
  showDiff?: (_data: {
375
617
  curValue: any;
376
618
  lastValue: any;
@@ -387,12 +629,13 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
387
629
  }>, {
388
630
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
389
631
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
390
- formState: schema_d_exports.FormState;
632
+ formState: import("@tmagic/form-schema").FormState;
391
633
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
392
634
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
393
635
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
394
636
  resetForm: () => void;
395
637
  submitForm: (native?: boolean) => Promise<any>;
638
+ validate: () => Promise<string>;
396
639
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
397
640
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
398
641
  error: (...args: any[]) => void;
@@ -404,7 +647,7 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
404
647
  disabled: boolean;
405
648
  labelWidth: string;
406
649
  inline: boolean;
407
- labelPosition: string;
650
+ labelPosition: "top" | "left" | "right";
408
651
  config: schema_d_exports.FormConfig;
409
652
  height: string;
410
653
  initValues: Record<string, any>;
@@ -412,7 +655,9 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
412
655
  isCompare: boolean;
413
656
  keyProp: string;
414
657
  parentValues: Record<string, any>;
658
+ useFieldTextInError: boolean;
415
659
  stepActive: string | number;
660
+ validateOnInit: boolean;
416
661
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
417
662
  beforeCreate?: (() => void) | (() => void)[];
418
663
  created?: (() => void) | (() => void)[];
@@ -437,7 +682,7 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
437
682
  disabled: boolean;
438
683
  labelWidth: string;
439
684
  inline: boolean;
440
- labelPosition: string;
685
+ labelPosition: "top" | "left" | "right";
441
686
  config: schema_d_exports.FormConfig;
442
687
  height: string;
443
688
  initValues: Record<string, any>;
@@ -445,7 +690,9 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
445
690
  isCompare: boolean;
446
691
  keyProp: string;
447
692
  parentValues: Record<string, any>;
693
+ useFieldTextInError: boolean;
448
694
  stepActive: string | number;
695
+ validateOnInit: boolean;
449
696
  }> & Omit<Readonly<{
450
697
  config: schema_d_exports.FormConfig;
451
698
  initValues: Record<string, any>;
@@ -453,16 +700,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
453
700
  isCompare?: boolean;
454
701
  parentValues?: Record<string, any>;
455
702
  labelWidth?: string;
703
+ typeMatchValid?: boolean;
704
+ validateOnInit?: boolean;
456
705
  disabled?: boolean;
457
706
  height?: string;
458
707
  stepActive?: string | number;
459
708
  size?: "small" | "default" | "large";
460
709
  inline?: boolean;
461
- labelPosition?: string;
710
+ labelPosition?: "top" | "left" | "right";
462
711
  keyProp?: string;
463
712
  popperClass?: string;
464
713
  preventSubmitDefault?: boolean;
465
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
714
+ useFieldTextInError?: boolean;
715
+ context?: schema_d_exports.FormContext;
466
716
  showDiff?: (_data: {
467
717
  curValue: any;
468
718
  lastValue: any;
@@ -476,15 +726,16 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
476
726
  "onField-input"?: ((...args: any[]) => any) | undefined;
477
727
  "onField-change"?: ((...args: any[]) => any) | undefined;
478
728
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
479
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
729
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
480
730
  values: schema_d_exports.FormValue;
481
731
  lastValuesProcessed: schema_d_exports.FormValue;
482
- formState: schema_d_exports.FormState;
732
+ formState: import("@tmagic/form-schema").FormState;
483
733
  initialized: boolean;
484
734
  changeRecords: import("@tmagic/editor").ChangeRecord[];
485
735
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
486
736
  resetForm: () => void;
487
737
  submitForm: (native?: boolean) => Promise<any>;
738
+ validate: () => Promise<string>;
488
739
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
489
740
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
490
741
  $slots: import("@tmagic/editor").FormSlots;
@@ -498,16 +749,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
498
749
  readonly isCompare?: boolean | undefined;
499
750
  readonly parentValues?: Record<string, any> | undefined;
500
751
  readonly labelWidth?: string | undefined;
752
+ readonly typeMatchValid?: boolean | undefined;
753
+ readonly validateOnInit?: boolean | undefined;
501
754
  readonly disabled?: boolean | undefined;
502
755
  readonly height?: string | undefined;
503
756
  readonly stepActive?: string | number | undefined;
504
757
  readonly size?: "small" | "default" | "large" | undefined;
505
758
  readonly inline?: boolean | undefined;
506
- readonly labelPosition?: string | undefined;
759
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
507
760
  readonly keyProp?: string | undefined;
508
761
  readonly popperClass?: string | undefined;
509
762
  readonly preventSubmitDefault?: boolean | undefined;
510
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
763
+ readonly useFieldTextInError?: boolean | undefined;
764
+ readonly context?: schema_d_exports.FormContext | undefined;
511
765
  readonly showDiff?: ((_data: {
512
766
  curValue: any;
513
767
  lastValue: any;
@@ -540,16 +794,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
540
794
  isCompare?: boolean;
541
795
  parentValues?: Record<string, any>;
542
796
  labelWidth?: string;
797
+ typeMatchValid?: boolean;
798
+ validateOnInit?: boolean;
543
799
  disabled?: boolean;
544
800
  height?: string;
545
801
  stepActive?: string | number;
546
802
  size?: "small" | "default" | "large";
547
803
  inline?: boolean;
548
- labelPosition?: string;
804
+ labelPosition?: "top" | "left" | "right";
549
805
  keyProp?: string;
550
806
  popperClass?: string;
551
807
  preventSubmitDefault?: boolean;
552
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
808
+ useFieldTextInError?: boolean;
809
+ context?: schema_d_exports.FormContext;
553
810
  showDiff?: (_data: {
554
811
  curValue: any;
555
812
  lastValue: any;
@@ -566,12 +823,13 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
566
823
  }>, {
567
824
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
568
825
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
569
- formState: schema_d_exports.FormState;
826
+ formState: import("@tmagic/form-schema").FormState;
570
827
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
571
828
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
572
829
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
573
830
  resetForm: () => void;
574
831
  submitForm: (native?: boolean) => Promise<any>;
832
+ validate: () => Promise<string>;
575
833
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
576
834
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
577
835
  error: (...args: any[]) => void;
@@ -583,7 +841,7 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
583
841
  disabled: boolean;
584
842
  labelWidth: string;
585
843
  inline: boolean;
586
- labelPosition: string;
844
+ labelPosition: "top" | "left" | "right";
587
845
  config: schema_d_exports.FormConfig;
588
846
  height: string;
589
847
  initValues: Record<string, any>;
@@ -591,7 +849,9 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
591
849
  isCompare: boolean;
592
850
  keyProp: string;
593
851
  parentValues: Record<string, any>;
852
+ useFieldTextInError: boolean;
594
853
  stepActive: string | number;
854
+ validateOnInit: boolean;
595
855
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
596
856
  beforeCreate?: (() => void) | (() => void)[];
597
857
  created?: (() => void) | (() => void)[];
@@ -616,7 +876,7 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
616
876
  disabled: boolean;
617
877
  labelWidth: string;
618
878
  inline: boolean;
619
- labelPosition: string;
879
+ labelPosition: "top" | "left" | "right";
620
880
  config: schema_d_exports.FormConfig;
621
881
  height: string;
622
882
  initValues: Record<string, any>;
@@ -624,7 +884,9 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
624
884
  isCompare: boolean;
625
885
  keyProp: string;
626
886
  parentValues: Record<string, any>;
887
+ useFieldTextInError: boolean;
627
888
  stepActive: string | number;
889
+ validateOnInit: boolean;
628
890
  }> & Omit<Readonly<{
629
891
  config: schema_d_exports.FormConfig;
630
892
  initValues: Record<string, any>;
@@ -632,16 +894,19 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
632
894
  isCompare?: boolean;
633
895
  parentValues?: Record<string, any>;
634
896
  labelWidth?: string;
897
+ typeMatchValid?: boolean;
898
+ validateOnInit?: boolean;
635
899
  disabled?: boolean;
636
900
  height?: string;
637
901
  stepActive?: string | number;
638
902
  size?: "small" | "default" | "large";
639
903
  inline?: boolean;
640
- labelPosition?: string;
904
+ labelPosition?: "top" | "left" | "right";
641
905
  keyProp?: string;
642
906
  popperClass?: string;
643
907
  preventSubmitDefault?: boolean;
644
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
908
+ useFieldTextInError?: boolean;
909
+ context?: schema_d_exports.FormContext;
645
910
  showDiff?: (_data: {
646
911
  curValue: any;
647
912
  lastValue: any;
@@ -655,15 +920,16 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
655
920
  "onField-input"?: ((...args: any[]) => any) | undefined;
656
921
  "onField-change"?: ((...args: any[]) => any) | undefined;
657
922
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
658
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
923
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
659
924
  values: schema_d_exports.FormValue;
660
925
  lastValuesProcessed: schema_d_exports.FormValue;
661
- formState: schema_d_exports.FormState;
926
+ formState: import("@tmagic/form-schema").FormState;
662
927
  initialized: boolean;
663
928
  changeRecords: import("@tmagic/editor").ChangeRecord[];
664
929
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
665
930
  resetForm: () => void;
666
931
  submitForm: (native?: boolean) => Promise<any>;
932
+ validate: () => Promise<string>;
667
933
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
668
934
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
669
935
  $slots: import("@tmagic/editor").FormSlots;
@@ -691,12 +957,14 @@ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Pr
691
957
  destroyOnClose: boolean;
692
958
  showClose: boolean;
693
959
  config: schema_d_exports.FormConfig;
960
+ useFieldTextInError: boolean;
961
+ validateOnInit: boolean;
694
962
  confirmText: string;
695
963
  showCancel: boolean;
696
964
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
697
- declare const __VLS_export$29: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
965
+ declare const __VLS_export$29: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
698
966
  declare const _default$14: typeof __VLS_export$29;
699
- type __VLS_WithSlots$4<T, S> = T & {
967
+ type __VLS_WithSlots$5<T, S> = T & {
700
968
  new (): {
701
969
  $slots: S;
702
970
  };
@@ -709,6 +977,10 @@ type __VLS_Props$28 = {
709
977
  parentValues?: Object;
710
978
  width?: string | number;
711
979
  labelWidth?: string;
980
+ /** 是否开启类型匹配校验 */
981
+ typeMatchValid?: boolean;
982
+ /** 透传给内部 `MForm`,初始化完成后是否立即校验(默认 `false`) */
983
+ validateOnInit?: boolean;
712
984
  disabled?: boolean;
713
985
  closeOnPressEscape?: boolean;
714
986
  title?: string;
@@ -716,10 +988,14 @@ type __VLS_Props$28 = {
716
988
  size?: 'small' | 'default' | 'large';
717
989
  confirmText?: string;
718
990
  inline?: boolean;
719
- labelPosition?: string;
720
- preventSubmitDefault?: boolean; /** 关闭前的回调,会暂停 Drawer 的关闭; done 是个 function type 接受一个 boolean 参数, 执行 done 使用 true 参数或不提供参数将会终止关闭 */
721
- beforeClose?: (_done: (_cancel?: boolean) => void) => void; /** 透传给内部 `MForm`,用于扩展 `formState`(如注入 `$message` / `$store` 等) */
722
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
991
+ labelPosition?: 'top' | 'left' | 'right';
992
+ preventSubmitDefault?: boolean;
993
+ /** 透传给内部 `MForm`,控制表单校验失败时错误提示前缀是否使用字段的 text 文案 */
994
+ useFieldTextInError?: boolean;
995
+ /** 关闭前的回调,会暂停 Drawer 的关闭; done 是个 function type 接受一个 boolean 参数, 执行 done 使用 true 参数或不提供参数将会终止关闭 */
996
+ beforeClose?: (_done: (_cancel?: boolean) => void) => void;
997
+ /** 透传给内部 `MForm` 的宿主业务上下文 */
998
+ context?: schema_d_exports.FormContext;
723
999
  /**
724
1000
  * 主题名。优先级:传入 `theme` prop > 祖先 `provide(M_THEME_KEY)` > 空串。
725
1001
  * 计算结果会再次 `provide` 出去,使得 Drawer 被 Teleport 到 body 后,内部子树
@@ -728,14 +1004,14 @@ type __VLS_Props$28 = {
728
1004
  theme?: string;
729
1005
  };
730
1006
  declare var __VLS_23: {}, __VLS_38: {}, __VLS_46: {};
731
- type __VLS_Slots$3 = {} & {
1007
+ type __VLS_Slots$4 = {} & {
732
1008
  default?: (props: typeof __VLS_23) => any;
733
1009
  } & {
734
1010
  left?: (props: typeof __VLS_38) => any;
735
1011
  } & {
736
1012
  footer?: (props: typeof __VLS_46) => any;
737
1013
  };
738
- declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Props$28, {
1014
+ declare const __VLS_base$4: import("@vue/runtime-core").DefineComponent<__VLS_Props$28, {
739
1015
  form: import("@vue/reactivity").Ref<({
740
1016
  $: import("@vue/runtime-core").ComponentInternalInstance;
741
1017
  $data: {};
@@ -746,16 +1022,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
746
1022
  readonly isCompare?: boolean | undefined;
747
1023
  readonly parentValues?: Record<string, any> | undefined;
748
1024
  readonly labelWidth?: string | undefined;
1025
+ readonly typeMatchValid?: boolean | undefined;
1026
+ readonly validateOnInit?: boolean | undefined;
749
1027
  readonly disabled?: boolean | undefined;
750
1028
  readonly height?: string | undefined;
751
1029
  readonly stepActive?: string | number | undefined;
752
1030
  readonly size?: "small" | "default" | "large" | undefined;
753
1031
  readonly inline?: boolean | undefined;
754
- readonly labelPosition?: string | undefined;
1032
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
755
1033
  readonly keyProp?: string | undefined;
756
1034
  readonly popperClass?: string | undefined;
757
1035
  readonly preventSubmitDefault?: boolean | undefined;
758
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
1036
+ readonly useFieldTextInError?: boolean | undefined;
1037
+ readonly context?: schema_d_exports.FormContext | undefined;
759
1038
  readonly showDiff?: ((_data: {
760
1039
  curValue: any;
761
1040
  lastValue: any;
@@ -788,16 +1067,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
788
1067
  isCompare?: boolean;
789
1068
  parentValues?: Record<string, any>;
790
1069
  labelWidth?: string;
1070
+ typeMatchValid?: boolean;
1071
+ validateOnInit?: boolean;
791
1072
  disabled?: boolean;
792
1073
  height?: string;
793
1074
  stepActive?: string | number;
794
1075
  size?: "small" | "default" | "large";
795
1076
  inline?: boolean;
796
- labelPosition?: string;
1077
+ labelPosition?: "top" | "left" | "right";
797
1078
  keyProp?: string;
798
1079
  popperClass?: string;
799
1080
  preventSubmitDefault?: boolean;
800
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1081
+ useFieldTextInError?: boolean;
1082
+ context?: schema_d_exports.FormContext;
801
1083
  showDiff?: (_data: {
802
1084
  curValue: any;
803
1085
  lastValue: any;
@@ -814,12 +1096,13 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
814
1096
  }>, {
815
1097
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
816
1098
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
817
- formState: schema_d_exports.FormState;
1099
+ formState: import("@tmagic/form-schema").FormState;
818
1100
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
819
1101
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
820
1102
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
821
1103
  resetForm: () => void;
822
1104
  submitForm: (native?: boolean) => Promise<any>;
1105
+ validate: () => Promise<string>;
823
1106
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
824
1107
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
825
1108
  error: (...args: any[]) => void;
@@ -831,7 +1114,7 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
831
1114
  disabled: boolean;
832
1115
  labelWidth: string;
833
1116
  inline: boolean;
834
- labelPosition: string;
1117
+ labelPosition: "top" | "left" | "right";
835
1118
  config: schema_d_exports.FormConfig;
836
1119
  height: string;
837
1120
  initValues: Record<string, any>;
@@ -839,7 +1122,9 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
839
1122
  isCompare: boolean;
840
1123
  keyProp: string;
841
1124
  parentValues: Record<string, any>;
1125
+ useFieldTextInError: boolean;
842
1126
  stepActive: string | number;
1127
+ validateOnInit: boolean;
843
1128
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
844
1129
  beforeCreate?: (() => void) | (() => void)[];
845
1130
  created?: (() => void) | (() => void)[];
@@ -864,7 +1149,7 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
864
1149
  disabled: boolean;
865
1150
  labelWidth: string;
866
1151
  inline: boolean;
867
- labelPosition: string;
1152
+ labelPosition: "top" | "left" | "right";
868
1153
  config: schema_d_exports.FormConfig;
869
1154
  height: string;
870
1155
  initValues: Record<string, any>;
@@ -872,7 +1157,9 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
872
1157
  isCompare: boolean;
873
1158
  keyProp: string;
874
1159
  parentValues: Record<string, any>;
1160
+ useFieldTextInError: boolean;
875
1161
  stepActive: string | number;
1162
+ validateOnInit: boolean;
876
1163
  }> & Omit<Readonly<{
877
1164
  config: schema_d_exports.FormConfig;
878
1165
  initValues: Record<string, any>;
@@ -880,16 +1167,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
880
1167
  isCompare?: boolean;
881
1168
  parentValues?: Record<string, any>;
882
1169
  labelWidth?: string;
1170
+ typeMatchValid?: boolean;
1171
+ validateOnInit?: boolean;
883
1172
  disabled?: boolean;
884
1173
  height?: string;
885
1174
  stepActive?: string | number;
886
1175
  size?: "small" | "default" | "large";
887
1176
  inline?: boolean;
888
- labelPosition?: string;
1177
+ labelPosition?: "top" | "left" | "right";
889
1178
  keyProp?: string;
890
1179
  popperClass?: string;
891
1180
  preventSubmitDefault?: boolean;
892
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1181
+ useFieldTextInError?: boolean;
1182
+ context?: schema_d_exports.FormContext;
893
1183
  showDiff?: (_data: {
894
1184
  curValue: any;
895
1185
  lastValue: any;
@@ -903,15 +1193,16 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
903
1193
  "onField-input"?: ((...args: any[]) => any) | undefined;
904
1194
  "onField-change"?: ((...args: any[]) => any) | undefined;
905
1195
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
906
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
1196
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
907
1197
  values: schema_d_exports.FormValue;
908
1198
  lastValuesProcessed: schema_d_exports.FormValue;
909
- formState: schema_d_exports.FormState;
1199
+ formState: import("@tmagic/form-schema").FormState;
910
1200
  initialized: boolean;
911
1201
  changeRecords: import("@tmagic/editor").ChangeRecord[];
912
1202
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
913
1203
  resetForm: () => void;
914
1204
  submitForm: (native?: boolean) => Promise<any>;
1205
+ validate: () => Promise<string>;
915
1206
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
916
1207
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
917
1208
  $slots: import("@tmagic/editor").FormSlots;
@@ -925,16 +1216,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
925
1216
  readonly isCompare?: boolean | undefined;
926
1217
  readonly parentValues?: Record<string, any> | undefined;
927
1218
  readonly labelWidth?: string | undefined;
1219
+ readonly typeMatchValid?: boolean | undefined;
1220
+ readonly validateOnInit?: boolean | undefined;
928
1221
  readonly disabled?: boolean | undefined;
929
1222
  readonly height?: string | undefined;
930
1223
  readonly stepActive?: string | number | undefined;
931
1224
  readonly size?: "small" | "default" | "large" | undefined;
932
1225
  readonly inline?: boolean | undefined;
933
- readonly labelPosition?: string | undefined;
1226
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
934
1227
  readonly keyProp?: string | undefined;
935
1228
  readonly popperClass?: string | undefined;
936
1229
  readonly preventSubmitDefault?: boolean | undefined;
937
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
1230
+ readonly useFieldTextInError?: boolean | undefined;
1231
+ readonly context?: schema_d_exports.FormContext | undefined;
938
1232
  readonly showDiff?: ((_data: {
939
1233
  curValue: any;
940
1234
  lastValue: any;
@@ -967,16 +1261,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
967
1261
  isCompare?: boolean;
968
1262
  parentValues?: Record<string, any>;
969
1263
  labelWidth?: string;
1264
+ typeMatchValid?: boolean;
1265
+ validateOnInit?: boolean;
970
1266
  disabled?: boolean;
971
1267
  height?: string;
972
1268
  stepActive?: string | number;
973
1269
  size?: "small" | "default" | "large";
974
1270
  inline?: boolean;
975
- labelPosition?: string;
1271
+ labelPosition?: "top" | "left" | "right";
976
1272
  keyProp?: string;
977
1273
  popperClass?: string;
978
1274
  preventSubmitDefault?: boolean;
979
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1275
+ useFieldTextInError?: boolean;
1276
+ context?: schema_d_exports.FormContext;
980
1277
  showDiff?: (_data: {
981
1278
  curValue: any;
982
1279
  lastValue: any;
@@ -993,12 +1290,13 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
993
1290
  }>, {
994
1291
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
995
1292
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
996
- formState: schema_d_exports.FormState;
1293
+ formState: import("@tmagic/form-schema").FormState;
997
1294
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
998
1295
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
999
1296
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1000
1297
  resetForm: () => void;
1001
1298
  submitForm: (native?: boolean) => Promise<any>;
1299
+ validate: () => Promise<string>;
1002
1300
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1003
1301
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1004
1302
  error: (...args: any[]) => void;
@@ -1010,7 +1308,7 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1010
1308
  disabled: boolean;
1011
1309
  labelWidth: string;
1012
1310
  inline: boolean;
1013
- labelPosition: string;
1311
+ labelPosition: "top" | "left" | "right";
1014
1312
  config: schema_d_exports.FormConfig;
1015
1313
  height: string;
1016
1314
  initValues: Record<string, any>;
@@ -1018,7 +1316,9 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1018
1316
  isCompare: boolean;
1019
1317
  keyProp: string;
1020
1318
  parentValues: Record<string, any>;
1319
+ useFieldTextInError: boolean;
1021
1320
  stepActive: string | number;
1321
+ validateOnInit: boolean;
1022
1322
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
1023
1323
  beforeCreate?: (() => void) | (() => void)[];
1024
1324
  created?: (() => void) | (() => void)[];
@@ -1043,7 +1343,7 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1043
1343
  disabled: boolean;
1044
1344
  labelWidth: string;
1045
1345
  inline: boolean;
1046
- labelPosition: string;
1346
+ labelPosition: "top" | "left" | "right";
1047
1347
  config: schema_d_exports.FormConfig;
1048
1348
  height: string;
1049
1349
  initValues: Record<string, any>;
@@ -1051,7 +1351,9 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1051
1351
  isCompare: boolean;
1052
1352
  keyProp: string;
1053
1353
  parentValues: Record<string, any>;
1354
+ useFieldTextInError: boolean;
1054
1355
  stepActive: string | number;
1356
+ validateOnInit: boolean;
1055
1357
  }> & Omit<Readonly<{
1056
1358
  config: schema_d_exports.FormConfig;
1057
1359
  initValues: Record<string, any>;
@@ -1059,16 +1361,19 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1059
1361
  isCompare?: boolean;
1060
1362
  parentValues?: Record<string, any>;
1061
1363
  labelWidth?: string;
1364
+ typeMatchValid?: boolean;
1365
+ validateOnInit?: boolean;
1062
1366
  disabled?: boolean;
1063
1367
  height?: string;
1064
1368
  stepActive?: string | number;
1065
1369
  size?: "small" | "default" | "large";
1066
1370
  inline?: boolean;
1067
- labelPosition?: string;
1371
+ labelPosition?: "top" | "left" | "right";
1068
1372
  keyProp?: string;
1069
1373
  popperClass?: string;
1070
1374
  preventSubmitDefault?: boolean;
1071
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1375
+ useFieldTextInError?: boolean;
1376
+ context?: schema_d_exports.FormContext;
1072
1377
  showDiff?: (_data: {
1073
1378
  curValue: any;
1074
1379
  lastValue: any;
@@ -1082,23 +1387,27 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1082
1387
  "onField-input"?: ((...args: any[]) => any) | undefined;
1083
1388
  "onField-change"?: ((...args: any[]) => any) | undefined;
1084
1389
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
1085
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
1390
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
1086
1391
  values: schema_d_exports.FormValue;
1087
1392
  lastValuesProcessed: schema_d_exports.FormValue;
1088
- formState: schema_d_exports.FormState;
1393
+ formState: import("@tmagic/form-schema").FormState;
1089
1394
  initialized: boolean;
1090
1395
  changeRecords: import("@tmagic/editor").ChangeRecord[];
1091
1396
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1092
1397
  resetForm: () => void;
1093
1398
  submitForm: (native?: boolean) => Promise<any>;
1399
+ validate: () => Promise<string>;
1094
1400
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1095
1401
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
1096
1402
  $slots: import("@tmagic/editor").FormSlots;
1097
1403
  }) | undefined>;
1098
1404
  saveFetch: import("@vue/reactivity").Ref<boolean, boolean>;
1099
1405
  bodyHeight: import("@vue/reactivity").Ref<number, number>;
1406
+ close: () => void;
1100
1407
  show: () => void;
1101
1408
  hide: () => void;
1409
+ save: () => Promise<void>;
1410
+ cancel: () => void;
1102
1411
  handleClose: () => void;
1103
1412
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1104
1413
  error: (...args: any[]) => void;
@@ -1120,11 +1429,13 @@ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1120
1429
  values: Object;
1121
1430
  closeOnPressEscape: boolean;
1122
1431
  config: schema_d_exports.FormConfig;
1432
+ useFieldTextInError: boolean;
1433
+ validateOnInit: boolean;
1123
1434
  confirmText: string;
1124
1435
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1125
- declare const __VLS_export$28: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1436
+ declare const __VLS_export$28: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1126
1437
  declare const _default$15: typeof __VLS_export$28;
1127
- type __VLS_WithSlots$3<T, S> = T & {
1438
+ type __VLS_WithSlots$4<T, S> = T & {
1128
1439
  new (): {
1129
1440
  $slots: S;
1130
1441
  };
@@ -1138,23 +1449,30 @@ type __VLS_Props$27 = {
1138
1449
  width?: number;
1139
1450
  height?: number;
1140
1451
  labelWidth?: string;
1452
+ /** 是否开启类型匹配校验 */
1453
+ typeMatchValid?: boolean;
1454
+ /** 透传给内部 `MForm`,初始化完成后是否立即校验(默认 `false`) */
1455
+ validateOnInit?: boolean;
1141
1456
  disabled?: boolean;
1142
1457
  size?: 'small' | 'default' | 'large';
1143
1458
  confirmText?: string;
1144
1459
  inline?: boolean;
1145
- labelPosition?: string;
1460
+ labelPosition?: 'top' | 'left' | 'right';
1146
1461
  preventSubmitDefault?: boolean;
1147
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1462
+ /** 透传给内部 `MForm`,控制表单校验失败时错误提示前缀是否使用字段的 text 文案 */
1463
+ useFieldTextInError?: boolean;
1464
+ /** 透传给内部 `MForm` 的宿主业务上下文 */
1465
+ context?: schema_d_exports.FormContext;
1148
1466
  };
1149
1467
  declare var __VLS_16$1: {}, __VLS_18$1: {}, __VLS_20: {};
1150
- type __VLS_Slots$2 = {} & {
1468
+ type __VLS_Slots$3 = {} & {
1151
1469
  default?: (props: typeof __VLS_16$1) => any;
1152
1470
  } & {
1153
1471
  left?: (props: typeof __VLS_18$1) => any;
1154
1472
  } & {
1155
1473
  footer?: (props: typeof __VLS_20) => any;
1156
1474
  };
1157
- declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Props$27, {
1475
+ declare const __VLS_base$3: import("@vue/runtime-core").DefineComponent<__VLS_Props$27, {
1158
1476
  form: import("@vue/reactivity").Ref<({
1159
1477
  $: import("@vue/runtime-core").ComponentInternalInstance;
1160
1478
  $data: {};
@@ -1165,16 +1483,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1165
1483
  readonly isCompare?: boolean | undefined;
1166
1484
  readonly parentValues?: Record<string, any> | undefined;
1167
1485
  readonly labelWidth?: string | undefined;
1486
+ readonly typeMatchValid?: boolean | undefined;
1487
+ readonly validateOnInit?: boolean | undefined;
1168
1488
  readonly disabled?: boolean | undefined;
1169
1489
  readonly height?: string | undefined;
1170
1490
  readonly stepActive?: string | number | undefined;
1171
1491
  readonly size?: "small" | "default" | "large" | undefined;
1172
1492
  readonly inline?: boolean | undefined;
1173
- readonly labelPosition?: string | undefined;
1493
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
1174
1494
  readonly keyProp?: string | undefined;
1175
1495
  readonly popperClass?: string | undefined;
1176
1496
  readonly preventSubmitDefault?: boolean | undefined;
1177
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
1497
+ readonly useFieldTextInError?: boolean | undefined;
1498
+ readonly context?: schema_d_exports.FormContext | undefined;
1178
1499
  readonly showDiff?: ((_data: {
1179
1500
  curValue: any;
1180
1501
  lastValue: any;
@@ -1207,16 +1528,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1207
1528
  isCompare?: boolean;
1208
1529
  parentValues?: Record<string, any>;
1209
1530
  labelWidth?: string;
1531
+ typeMatchValid?: boolean;
1532
+ validateOnInit?: boolean;
1210
1533
  disabled?: boolean;
1211
1534
  height?: string;
1212
1535
  stepActive?: string | number;
1213
1536
  size?: "small" | "default" | "large";
1214
1537
  inline?: boolean;
1215
- labelPosition?: string;
1538
+ labelPosition?: "top" | "left" | "right";
1216
1539
  keyProp?: string;
1217
1540
  popperClass?: string;
1218
1541
  preventSubmitDefault?: boolean;
1219
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1542
+ useFieldTextInError?: boolean;
1543
+ context?: schema_d_exports.FormContext;
1220
1544
  showDiff?: (_data: {
1221
1545
  curValue: any;
1222
1546
  lastValue: any;
@@ -1233,12 +1557,13 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1233
1557
  }>, {
1234
1558
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
1235
1559
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
1236
- formState: schema_d_exports.FormState;
1560
+ formState: import("@tmagic/form-schema").FormState;
1237
1561
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
1238
1562
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
1239
1563
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1240
1564
  resetForm: () => void;
1241
1565
  submitForm: (native?: boolean) => Promise<any>;
1566
+ validate: () => Promise<string>;
1242
1567
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1243
1568
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1244
1569
  error: (...args: any[]) => void;
@@ -1250,7 +1575,7 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1250
1575
  disabled: boolean;
1251
1576
  labelWidth: string;
1252
1577
  inline: boolean;
1253
- labelPosition: string;
1578
+ labelPosition: "top" | "left" | "right";
1254
1579
  config: schema_d_exports.FormConfig;
1255
1580
  height: string;
1256
1581
  initValues: Record<string, any>;
@@ -1258,7 +1583,9 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1258
1583
  isCompare: boolean;
1259
1584
  keyProp: string;
1260
1585
  parentValues: Record<string, any>;
1586
+ useFieldTextInError: boolean;
1261
1587
  stepActive: string | number;
1588
+ validateOnInit: boolean;
1262
1589
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
1263
1590
  beforeCreate?: (() => void) | (() => void)[];
1264
1591
  created?: (() => void) | (() => void)[];
@@ -1283,7 +1610,7 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1283
1610
  disabled: boolean;
1284
1611
  labelWidth: string;
1285
1612
  inline: boolean;
1286
- labelPosition: string;
1613
+ labelPosition: "top" | "left" | "right";
1287
1614
  config: schema_d_exports.FormConfig;
1288
1615
  height: string;
1289
1616
  initValues: Record<string, any>;
@@ -1291,7 +1618,9 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1291
1618
  isCompare: boolean;
1292
1619
  keyProp: string;
1293
1620
  parentValues: Record<string, any>;
1621
+ useFieldTextInError: boolean;
1294
1622
  stepActive: string | number;
1623
+ validateOnInit: boolean;
1295
1624
  }> & Omit<Readonly<{
1296
1625
  config: schema_d_exports.FormConfig;
1297
1626
  initValues: Record<string, any>;
@@ -1299,16 +1628,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1299
1628
  isCompare?: boolean;
1300
1629
  parentValues?: Record<string, any>;
1301
1630
  labelWidth?: string;
1631
+ typeMatchValid?: boolean;
1632
+ validateOnInit?: boolean;
1302
1633
  disabled?: boolean;
1303
1634
  height?: string;
1304
1635
  stepActive?: string | number;
1305
1636
  size?: "small" | "default" | "large";
1306
1637
  inline?: boolean;
1307
- labelPosition?: string;
1638
+ labelPosition?: "top" | "left" | "right";
1308
1639
  keyProp?: string;
1309
1640
  popperClass?: string;
1310
1641
  preventSubmitDefault?: boolean;
1311
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1642
+ useFieldTextInError?: boolean;
1643
+ context?: schema_d_exports.FormContext;
1312
1644
  showDiff?: (_data: {
1313
1645
  curValue: any;
1314
1646
  lastValue: any;
@@ -1322,15 +1654,16 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1322
1654
  "onField-input"?: ((...args: any[]) => any) | undefined;
1323
1655
  "onField-change"?: ((...args: any[]) => any) | undefined;
1324
1656
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
1325
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
1657
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
1326
1658
  values: schema_d_exports.FormValue;
1327
1659
  lastValuesProcessed: schema_d_exports.FormValue;
1328
- formState: schema_d_exports.FormState;
1660
+ formState: import("@tmagic/form-schema").FormState;
1329
1661
  initialized: boolean;
1330
1662
  changeRecords: import("@tmagic/editor").ChangeRecord[];
1331
1663
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1332
1664
  resetForm: () => void;
1333
1665
  submitForm: (native?: boolean) => Promise<any>;
1666
+ validate: () => Promise<string>;
1334
1667
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1335
1668
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
1336
1669
  $slots: import("@tmagic/editor").FormSlots;
@@ -1344,16 +1677,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1344
1677
  readonly isCompare?: boolean | undefined;
1345
1678
  readonly parentValues?: Record<string, any> | undefined;
1346
1679
  readonly labelWidth?: string | undefined;
1680
+ readonly typeMatchValid?: boolean | undefined;
1681
+ readonly validateOnInit?: boolean | undefined;
1347
1682
  readonly disabled?: boolean | undefined;
1348
1683
  readonly height?: string | undefined;
1349
1684
  readonly stepActive?: string | number | undefined;
1350
1685
  readonly size?: "small" | "default" | "large" | undefined;
1351
1686
  readonly inline?: boolean | undefined;
1352
- readonly labelPosition?: string | undefined;
1687
+ readonly labelPosition?: "top" | "left" | "right" | undefined;
1353
1688
  readonly keyProp?: string | undefined;
1354
1689
  readonly popperClass?: string | undefined;
1355
1690
  readonly preventSubmitDefault?: boolean | undefined;
1356
- readonly extendState?: ((_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
1691
+ readonly useFieldTextInError?: boolean | undefined;
1692
+ readonly context?: schema_d_exports.FormContext | undefined;
1357
1693
  readonly showDiff?: ((_data: {
1358
1694
  curValue: any;
1359
1695
  lastValue: any;
@@ -1386,16 +1722,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1386
1722
  isCompare?: boolean;
1387
1723
  parentValues?: Record<string, any>;
1388
1724
  labelWidth?: string;
1725
+ typeMatchValid?: boolean;
1726
+ validateOnInit?: boolean;
1389
1727
  disabled?: boolean;
1390
1728
  height?: string;
1391
1729
  stepActive?: string | number;
1392
1730
  size?: "small" | "default" | "large";
1393
1731
  inline?: boolean;
1394
- labelPosition?: string;
1732
+ labelPosition?: "top" | "left" | "right";
1395
1733
  keyProp?: string;
1396
1734
  popperClass?: string;
1397
1735
  preventSubmitDefault?: boolean;
1398
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1736
+ useFieldTextInError?: boolean;
1737
+ context?: schema_d_exports.FormContext;
1399
1738
  showDiff?: (_data: {
1400
1739
  curValue: any;
1401
1740
  lastValue: any;
@@ -1412,12 +1751,13 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1412
1751
  }>, {
1413
1752
  values: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
1414
1753
  lastValuesProcessed: import("@vue/reactivity").Ref<schema_d_exports.FormValue, schema_d_exports.FormValue>;
1415
- formState: schema_d_exports.FormState;
1754
+ formState: import("@tmagic/form-schema").FormState;
1416
1755
  initialized: import("@vue/reactivity").Ref<boolean, boolean>;
1417
1756
  changeRecords: import("@vue/reactivity").ShallowRef<import("@tmagic/editor").ChangeRecord[], import("@tmagic/editor").ChangeRecord[]>;
1418
1757
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1419
1758
  resetForm: () => void;
1420
1759
  submitForm: (native?: boolean) => Promise<any>;
1760
+ validate: () => Promise<string>;
1421
1761
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1422
1762
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1423
1763
  error: (...args: any[]) => void;
@@ -1429,7 +1769,7 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1429
1769
  disabled: boolean;
1430
1770
  labelWidth: string;
1431
1771
  inline: boolean;
1432
- labelPosition: string;
1772
+ labelPosition: "top" | "left" | "right";
1433
1773
  config: schema_d_exports.FormConfig;
1434
1774
  height: string;
1435
1775
  initValues: Record<string, any>;
@@ -1437,7 +1777,9 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1437
1777
  isCompare: boolean;
1438
1778
  keyProp: string;
1439
1779
  parentValues: Record<string, any>;
1780
+ useFieldTextInError: boolean;
1440
1781
  stepActive: string | number;
1782
+ validateOnInit: boolean;
1441
1783
  }, {}, string, {}, import("@vue/runtime-core").GlobalComponents, import("@vue/runtime-core").GlobalDirectives, string, import("@vue/runtime-core").ComponentProvideOptions> & {
1442
1784
  beforeCreate?: (() => void) | (() => void)[];
1443
1785
  created?: (() => void) | (() => void)[];
@@ -1462,7 +1804,7 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1462
1804
  disabled: boolean;
1463
1805
  labelWidth: string;
1464
1806
  inline: boolean;
1465
- labelPosition: string;
1807
+ labelPosition: "top" | "left" | "right";
1466
1808
  config: schema_d_exports.FormConfig;
1467
1809
  height: string;
1468
1810
  initValues: Record<string, any>;
@@ -1470,7 +1812,9 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1470
1812
  isCompare: boolean;
1471
1813
  keyProp: string;
1472
1814
  parentValues: Record<string, any>;
1815
+ useFieldTextInError: boolean;
1473
1816
  stepActive: string | number;
1817
+ validateOnInit: boolean;
1474
1818
  }> & Omit<Readonly<{
1475
1819
  config: schema_d_exports.FormConfig;
1476
1820
  initValues: Record<string, any>;
@@ -1478,16 +1822,19 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1478
1822
  isCompare?: boolean;
1479
1823
  parentValues?: Record<string, any>;
1480
1824
  labelWidth?: string;
1825
+ typeMatchValid?: boolean;
1826
+ validateOnInit?: boolean;
1481
1827
  disabled?: boolean;
1482
1828
  height?: string;
1483
1829
  stepActive?: string | number;
1484
1830
  size?: "small" | "default" | "large";
1485
1831
  inline?: boolean;
1486
- labelPosition?: string;
1832
+ labelPosition?: "top" | "left" | "right";
1487
1833
  keyProp?: string;
1488
1834
  popperClass?: string;
1489
1835
  preventSubmitDefault?: boolean;
1490
- extendState?: (_state: schema_d_exports.FormState) => Record<string, any> | Promise<Record<string, any>>;
1836
+ useFieldTextInError?: boolean;
1837
+ context?: schema_d_exports.FormContext;
1491
1838
  showDiff?: (_data: {
1492
1839
  curValue: any;
1493
1840
  lastValue: any;
@@ -1501,15 +1848,16 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1501
1848
  "onField-input"?: ((...args: any[]) => any) | undefined;
1502
1849
  "onField-change"?: ((...args: any[]) => any) | undefined;
1503
1850
  "onUpdate:stepActive"?: ((...args: any[]) => any) | undefined;
1504
- }>, "values" | "changeHandler" | "initialized" | "lastValuesProcessed" | "formState" | "changeRecords" | "resetForm" | "submitForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "stepActive")> & {
1851
+ }>, "values" | "changeHandler" | "validate" | "lastValuesProcessed" | "submitForm" | "changeRecords" | "initialized" | "formState" | "resetForm" | "getTextByName" | ("disabled" | "labelWidth" | "inline" | "labelPosition" | "config" | "height" | "initValues" | "lastValues" | "isCompare" | "keyProp" | "parentValues" | "useFieldTextInError" | "stepActive" | "validateOnInit")> & {
1505
1852
  values: schema_d_exports.FormValue;
1506
1853
  lastValuesProcessed: schema_d_exports.FormValue;
1507
- formState: schema_d_exports.FormState;
1854
+ formState: import("@tmagic/form-schema").FormState;
1508
1855
  initialized: boolean;
1509
1856
  changeRecords: import("@tmagic/editor").ChangeRecord[];
1510
1857
  changeHandler: (v: schema_d_exports.FormValue, eventData: ContainerChangeEventData) => void;
1511
1858
  resetForm: () => void;
1512
1859
  submitForm: (native?: boolean) => Promise<any>;
1860
+ validate: () => Promise<string>;
1513
1861
  getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
1514
1862
  } & {} & import("@vue/runtime-core").ComponentCustomProperties & {} & {
1515
1863
  $slots: import("@tmagic/editor").FormSlots;
@@ -1528,31 +1876,39 @@ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1528
1876
  }>, {
1529
1877
  values: Object;
1530
1878
  config: schema_d_exports.FormConfig;
1879
+ useFieldTextInError: boolean;
1880
+ validateOnInit: boolean;
1531
1881
  confirmText: string;
1532
1882
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1533
- declare const __VLS_export$27: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1883
+ declare const __VLS_export$27: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1534
1884
  declare const _default$13: typeof __VLS_export$27;
1535
- type __VLS_WithSlots$2<T, S> = T & {
1885
+ type __VLS_WithSlots$3<T, S> = T & {
1536
1886
  new (): {
1537
1887
  $slots: S;
1538
1888
  };
1539
1889
  };
1540
1890
  //#endregion
1541
1891
  //#region temp/packages/form/src/containers/Container.vue.d.ts
1542
- type __VLS_Slots$1 = FormSlots;
1892
+ type __VLS_Slots$2 = FormSlots;
1543
1893
  type __VLS_Props$26 = {
1544
- /** 表单值 */model: schema_d_exports.FormValue; /** 需对比的值(开启对比模式时传入) */
1894
+ /** 表单值 */
1895
+ model: schema_d_exports.FormValue;
1896
+ /** 需对比的值(开启对比模式时传入) */
1545
1897
  lastValues?: schema_d_exports.FormValue;
1546
1898
  config: schema_d_exports.FormItemConfig;
1547
1899
  prop?: string;
1548
1900
  disabled?: boolean;
1549
1901
  labelWidth?: string | number;
1902
+ labelPosition?: 'top' | 'left' | 'right';
1550
1903
  expandMore?: boolean;
1551
1904
  stepActive?: string | number;
1552
- size?: string; /** 是否开启对比模式 */
1905
+ size?: string;
1906
+ /** 是否开启对比模式 */
1553
1907
  isCompare?: boolean;
1908
+ /** 是否在行容器中 */
1909
+ isInRow?: boolean;
1554
1910
  };
1555
- declare const __VLS_base$1: import("@vue/runtime-core").DefineComponent<__VLS_Props$26, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1911
+ declare const __VLS_base$2: import("@vue/runtime-core").DefineComponent<__VLS_Props$26, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1556
1912
  change: (v: any, eventData: ContainerChangeEventData) => any;
1557
1913
  addDiffCount: () => any;
1558
1914
  }, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props$26> & Readonly<{
@@ -1565,9 +1921,9 @@ declare const __VLS_base$1: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1565
1921
  isCompare: boolean;
1566
1922
  expandMore: boolean;
1567
1923
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1568
- declare const __VLS_export$26: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1924
+ declare const __VLS_export$26: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1569
1925
  declare const _default$4: typeof __VLS_export$26;
1570
- type __VLS_WithSlots$1<T, S> = T & {
1926
+ type __VLS_WithSlots$2<T, S> = T & {
1571
1927
  new (): {
1572
1928
  $slots: S;
1573
1929
  };
@@ -1576,6 +1932,7 @@ type __VLS_WithSlots$1<T, S> = T & {
1576
1932
  //#region temp/packages/form/src/containers/Fieldset.vue.d.ts
1577
1933
  type __VLS_Props$25 = {
1578
1934
  labelWidth?: string;
1935
+ labelPosition?: 'top' | 'left' | 'right';
1579
1936
  prop: string;
1580
1937
  size?: string;
1581
1938
  model: Record<string, any>;
@@ -1607,6 +1964,7 @@ type __VLS_Props$24 = {
1607
1964
  config: FlexLayoutConfig;
1608
1965
  name?: string;
1609
1966
  labelWidth?: string;
1967
+ labelPosition?: 'top' | 'left' | 'right';
1610
1968
  prop?: string;
1611
1969
  size?: string;
1612
1970
  disabled?: boolean;
@@ -1628,18 +1986,19 @@ type __VLS_Props$23 = {
1628
1986
  config: schema_d_exports.PanelConfig;
1629
1987
  name?: string;
1630
1988
  labelWidth?: string;
1989
+ labelPosition?: 'top' | 'left' | 'right';
1631
1990
  prop?: string;
1632
1991
  size?: string;
1633
1992
  disabled?: boolean;
1634
1993
  hideExpand?: boolean;
1635
1994
  };
1636
1995
  declare var __VLS_16: {}, __VLS_18: {};
1637
- type __VLS_Slots = {} & {
1996
+ type __VLS_Slots$1 = {} & {
1638
1997
  header?: (props: typeof __VLS_16) => any;
1639
1998
  } & {
1640
1999
  default?: (props: typeof __VLS_18) => any;
1641
2000
  };
1642
- declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props$23, {
2001
+ declare const __VLS_base$1: import("@vue/runtime-core").DefineComponent<__VLS_Props$23, {
1643
2002
  getExpand: () => boolean;
1644
2003
  setExpand: (v: boolean) => void;
1645
2004
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
@@ -1649,9 +2008,9 @@ declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Prop
1649
2008
  onChange?: ((v: any, eventData: ContainerChangeEventData) => any) | undefined;
1650
2009
  onAddDiffCount?: (() => any) | undefined;
1651
2010
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1652
- declare const __VLS_export$23: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
2011
+ declare const __VLS_export$23: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1653
2012
  declare const _default$21: typeof __VLS_export$23;
1654
- type __VLS_WithSlots<T, S> = T & {
2013
+ type __VLS_WithSlots$1<T, S> = T & {
1655
2014
  new (): {
1656
2015
  $slots: S;
1657
2016
  };
@@ -1665,6 +2024,7 @@ type __VLS_Props$22 = {
1665
2024
  config: schema_d_exports.RowConfig;
1666
2025
  name: string;
1667
2026
  labelWidth?: string;
2027
+ labelPosition?: 'top' | 'left' | 'right';
1668
2028
  prop?: string;
1669
2029
  size?: string;
1670
2030
  expandMore?: boolean;
@@ -1688,6 +2048,7 @@ type __VLS_Props$21 = {
1688
2048
  name: string;
1689
2049
  size?: string;
1690
2050
  labelWidth?: string;
2051
+ labelPosition?: 'top' | 'left' | 'right';
1691
2052
  prop?: string;
1692
2053
  expandMore?: boolean;
1693
2054
  disabled?: boolean;
@@ -1714,6 +2075,7 @@ type __VLS_Props$20 = {
1714
2075
  name: string;
1715
2076
  prop?: string;
1716
2077
  labelWidth?: string;
2078
+ labelPosition?: 'top' | 'left' | 'right';
1717
2079
  disabled?: boolean;
1718
2080
  size?: string;
1719
2081
  enableToggleMode?: true;
@@ -1721,7 +2083,11 @@ type __VLS_Props$20 = {
1721
2083
  sortKey?: string;
1722
2084
  sort?: boolean;
1723
2085
  };
1724
- declare const __VLS_export$20: import("@vue/runtime-core").DefineComponent<__VLS_Props$20, {
2086
+ declare var __VLS_33: any;
2087
+ type __VLS_Slots = {} & {
2088
+ title?: (props: typeof __VLS_33) => any;
2089
+ };
2090
+ declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props$20, {
1725
2091
  toggleRowSelection: (row: any, selected: boolean) => void | undefined;
1726
2092
  }, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1727
2093
  change: (...args: any[]) => void;
@@ -1732,7 +2098,13 @@ declare const __VLS_export$20: import("@vue/runtime-core").DefineComponent<__VLS
1732
2098
  onSelect?: ((...args: any[]) => any) | undefined;
1733
2099
  onAddDiffCount?: ((...args: any[]) => any) | undefined;
1734
2100
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
2101
+ declare const __VLS_export$20: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
1735
2102
  declare const _default$16: typeof __VLS_export$20;
2103
+ type __VLS_WithSlots<T, S> = T & {
2104
+ new (): {
2105
+ $slots: S;
2106
+ };
2107
+ };
1736
2108
  //#endregion
1737
2109
  //#region temp/packages/form/src/fields/Text.vue.d.ts
1738
2110
  type __VLS_Props$19 = schema_d_exports.FieldProps<schema_d_exports.TextConfig>;
@@ -1756,7 +2128,7 @@ declare const __VLS_export$18: import("@vue/runtime-core").DefineComponent<__VLS
1756
2128
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1757
2129
  declare const _default$19: typeof __VLS_export$18;
1758
2130
  //#endregion
1759
- //#region temp/packages/form/src/fields/NumberRange.vue.d.ts
2131
+ //#region temp/packages/form/src/fields/NumberRange/Index.vue.d.ts
1760
2132
  type __VLS_Props$17 = schema_d_exports.FieldProps<schema_d_exports.NumberRangeConfig>;
1761
2133
  declare const __VLS_export$17: import("@vue/runtime-core").DefineComponent<__VLS_Props$17, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1762
2134
  change: (values: [number, number]) => any;
@@ -1785,7 +2157,7 @@ type __VLS_Props$15 = {
1785
2157
  declare const __VLS_export$15: import("@vue/runtime-core").DefineComponent<__VLS_Props$15, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props$15> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1786
2158
  declare const _default$17: typeof __VLS_export$15;
1787
2159
  //#endregion
1788
- //#region temp/packages/form/src/fields/Date.vue.d.ts
2160
+ //#region temp/packages/form/src/fields/Date/Index.vue.d.ts
1789
2161
  type __VLS_Props$14 = schema_d_exports.FieldProps<schema_d_exports.DateConfig>;
1790
2162
  declare const __VLS_export$14: import("@vue/runtime-core").DefineComponent<__VLS_Props$14, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1791
2163
  change: (value: string) => any;
@@ -1794,7 +2166,7 @@ declare const __VLS_export$14: import("@vue/runtime-core").DefineComponent<__VLS
1794
2166
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1795
2167
  declare const _default$5: typeof __VLS_export$14;
1796
2168
  //#endregion
1797
- //#region temp/packages/form/src/fields/DateTime.vue.d.ts
2169
+ //#region temp/packages/form/src/fields/DateTime/Index.vue.d.ts
1798
2170
  type __VLS_Props$13 = schema_d_exports.FieldProps<schema_d_exports.DateTimeConfig>;
1799
2171
  declare const __VLS_export$13: import("@vue/runtime-core").DefineComponent<__VLS_Props$13, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1800
2172
  change: (value: string) => any;
@@ -1857,7 +2229,7 @@ declare const __VLS_export$7: import("@vue/runtime-core").DefineComponent<__VLS_
1857
2229
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1858
2230
  declare const _default$3: typeof __VLS_export$7;
1859
2231
  //#endregion
1860
- //#region temp/packages/form/src/fields/CheckboxGroup.vue.d.ts
2232
+ //#region temp/packages/form/src/fields/CheckboxGroup/Index.vue.d.ts
1861
2233
  type __VLS_Props$6 = schema_d_exports.FieldProps<schema_d_exports.CheckboxGroupConfig>;
1862
2234
  declare const __VLS_export$6: import("@vue/runtime-core").DefineComponent<__VLS_Props$6, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1863
2235
  change: (...args: any[]) => void;
@@ -1875,7 +2247,7 @@ declare const __VLS_export$5: import("@vue/runtime-core").DefineComponent<__VLS_
1875
2247
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1876
2248
  declare const _default$22: typeof __VLS_export$5;
1877
2249
  //#endregion
1878
- //#region temp/packages/form/src/fields/Display.vue.d.ts
2250
+ //#region temp/packages/form/src/fields/Display/Index.vue.d.ts
1879
2251
  type __VLS_Props$4 = schema_d_exports.FieldProps<schema_d_exports.DisplayConfig>;
1880
2252
  declare const __VLS_export$4: import("@vue/runtime-core").DefineComponent<__VLS_Props$4, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props$4> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1881
2253
  declare const _default$8: typeof __VLS_export$4;
@@ -1938,7 +2310,7 @@ declare const __VLS_export$1: import("@vue/runtime-core").DefineComponent<__VLS_
1938
2310
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1939
2311
  declare const _default: typeof __VLS_export$1;
1940
2312
  //#endregion
1941
- //#region temp/packages/form/src/fields/DynamicField.vue.d.ts
2313
+ //#region temp/packages/form/src/fields/DynamicField/Index.vue.d.ts
1942
2314
  type __VLS_Props = schema_d_exports.FieldProps<schema_d_exports.DynamicFieldConfig>;
1943
2315
  declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
1944
2316
  change: (...args: any[]) => void;
@@ -1947,21 +2319,369 @@ declare const __VLS_export: import("@vue/runtime-core").DefineComponent<__VLS_Pr
1947
2319
  }>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
1948
2320
  declare const _default$9: typeof __VLS_export;
1949
2321
  //#endregion
1950
- //#region temp/packages/form/src/utils/config.d.ts
1951
- declare const registerField: (tagName: string, component: Component) => void;
1952
- declare const getField: (tagName: string) => Component | undefined;
1953
- declare const deleteField: (tagName: string) => boolean;
2322
+ //#region temp/packages/form/src/utils/collectFields.d.ts
2323
+ /** 一个参与校验的字段:与渲染式校验中「一个带 rules 的 TMagicFormItem」一一对应 */
2324
+ interface CollectedField {
2325
+ /** 字段的完整 prop 路径(从表单根 values 起算,与 FormItem 的 prop 一致) */
2326
+ prop: string;
2327
+ /** 经 `getNativeRules` 处理后的规则(validator 为 async-validator 原生签名) */
2328
+ rules: schema_d_exports.Rule[];
2329
+ /** 字段配置 */
2330
+ config: schema_d_exports.FormItemConfig;
2331
+ /** 字段所在层级的 model 切片 */
2332
+ model: schema_d_exports.FormValue;
2333
+ }
2334
+ /** 已登记的 innerConfig 回调自身抛错时抛出(机制故障,不是漏登记) */
2335
+ export declare class FieldInnerConfigError extends Error {
2336
+ readonly code = "FIELD_INNER_CONFIG";
2337
+ readonly type: string;
2338
+ readonly prop: string;
2339
+ constructor(type: string, prop: string, cause: unknown);
2340
+ }
2341
+ export declare const isFieldInnerConfigError: (error: unknown) => error is FieldInnerConfigError;
2342
+ /**
2343
+ * 遍历模式。同一套遍历规则服务两个用途,避免两条链路各写一份而产生偏差:
2344
+ *
2345
+ * - `collect`:收集带 rules 的字段,按 `display` 过滤(对应「渲染出来的 FormItem 集合」);
2346
+ * - `effects`:执行字段登记的值初始化写入,不收集字段,且不看 `display`
2347
+ * (`display: false` 的字段同样要规整;`type: 'hidden'` 在该节点停止,不往下分派)。
2348
+ */
2349
+ type WalkMode = 'collect' | 'effects';
2350
+ interface WalkContext {
2351
+ mForm: schema_d_exports.FormState | undefined;
2352
+ /**
2353
+ * 是否自动给字段注入 typeMatch 规则,对应 MForm 的 `typeMatchValid`。
2354
+ *
2355
+ * 只在 `collect` 模式下有用:`addField` 把它交给 `getNativeRules`。为 true 且字段
2356
+ * rules 尚未显式声明 `typeMatch`(true / false)时,自动补一条 `{ typeMatch: true }`,
2357
+ * 按字段 `type` 校验当前值形态是否合法(空值放行,必填仍靠 `required`)。
2358
+ * 单字段可在 rules 里写 `typeMatch: false` 关闭自动注入。
2359
+ *
2360
+ * `effects` 模式不收集规则,无需传入。
2361
+ */
2362
+ typeMatchValid?: boolean;
2363
+ fields: CollectedField[];
2364
+ /** 本次遍历处理的表单值根对象(对比模式下为 lastValues 那一份) */
2365
+ values: schema_d_exports.FormValue;
2366
+ mode: WalkMode;
2367
+ }
2368
+ interface WalkNode {
2369
+ config: schema_d_exports.FormItemConfig;
2370
+ /** 所在层级的 model 切片(对应 Container 的 `props.model`) */
2371
+ model: schema_d_exports.FormValue;
2372
+ /** 父级 prop(对应 Container 的 `props.prop`) */
2373
+ prop: string;
2374
+ }
2375
+ type ContainerWalker = (_ctx: WalkContext, _node: WalkNode, _itemProp: string) => void;
2376
+ /**
2377
+ * 纯逻辑收集「一份 config + 一份 values」中所有参与校验的字段。
2378
+ *
2379
+ * 遍历规则与 `Container.vue` 及各容器组件的模板一一对应,因此产出的 prop / rules
2380
+ * 与渲染式校验(挂载 MForm 后调用 `validate()`)等价,无需任何 DOM 或组件实例。
2381
+ *
2382
+ * 本函数只读不写。字段的值初始化副作用由 `applyMountValueEffects` 负责,
2383
+ * 调用方需在初始化表单值之后、收集字段之前执行一次(`validateValues` 已经这么做)。
2384
+ *
2385
+ * @param mForm - 表单状态;无渲染时由 `createHeadlessFormState` 构造
2386
+ * @param config - 表单配置
2387
+ * @param values - 表单值
2388
+ * @param [typeMatchValid] - 是否自动注入 typeMatch 规则;为 true 时,未显式声明
2389
+ * `typeMatch` 的字段会补上 `{ typeMatch: true }`,按字段 type 校验值形态
2390
+ * @returns 带规则的字段列表
2391
+ */
2392
+ export declare const collectValidatableFields: (mForm: schema_d_exports.FormState | undefined, config: schema_d_exports.FormConfig, values: schema_d_exports.FormValue, typeMatchValid?: boolean) => CollectedField[];
2393
+ /**
2394
+ * 执行「一份 config + 一份 values」中所有叶子字段登记的值初始化写入,就地改写 `values`。
2395
+ *
2396
+ * 渲染与无渲染两条链路共用的唯一执行点:字段组件自身不再在 setup 里改写 model,
2397
+ * 由持有完整表单值的一方(`Form.vue` / `validateValues`)在表单值初始化完成、
2398
+ * 且已挂到 `mForm.values` 之后调用一次。这样 effect 与动态 `type` 回调读到的
2399
+ * `formValue` 就是最新值,而不是上一轮的旧值。
2400
+ *
2401
+ * 与 `collectValidatableFields` 的差异:不看 `display`(`display: false` 的字段也会规整)。
2402
+ * `type: 'hidden'` 会在该节点停止遍历,内部字段不执行 effect。
2403
+ *
2404
+ * `prop` 与 `values` 都以传入的 `values` 为根,因此也可以用于 tab / table 新增行这类
2405
+ * 「先构造一份子树的值,再挂到表单上」的场景:传入子树配置与该行的值即可。
2406
+ *
2407
+ * @param mForm - 表单状态;无渲染时由 `createHeadlessFormState` 构造
2408
+ * @param config - 表单配置
2409
+ * @param values - 表单值(会被就地修改)
2410
+ */
2411
+ export declare const applyMountValueEffects: (mForm: schema_d_exports.FormState | undefined, config: schema_d_exports.FormConfig, values: schema_d_exports.FormValue) => void;
2412
+ //#endregion
2413
+ //#region temp/packages/form/src/utils/fieldInnerConfig.d.ts
2414
+ /** innerConfig 回调的入参:字段自身的配置、所在层级的 model、完整字段路径与表单状态 */
2415
+ interface FieldInnerConfigContext {
2416
+ /** 字段自身的配置(已经过 filterFunction 之外的原样配置) */
2417
+ config: schema_d_exports.FormItemConfig;
2418
+ /** 字段所在层级的 model 切片 */
2419
+ model: schema_d_exports.FormValue;
2420
+ /** 字段的完整 prop 路径(含父级前缀),即字段组件拿到的 `props.prop` */
2421
+ prop: string;
2422
+ /** 字段所在层级的 prop 基准(父级 Container 的 `props.prop`),即 `prop` 去掉自身 name 的部分 */
2423
+ parentProp: string;
2424
+ /** 表单状态 */
2425
+ mForm: schema_d_exports.FormState | undefined;
2426
+ }
2427
+ /** innerConfig 回调的返回值:需要继续遍历的内部配置及其 model / prop 基准 */
2428
+ interface FieldInnerConfigResult {
2429
+ /** 内部配置(对应字段组件内部渲染的 `MContainer` 的 `config`) */
2430
+ config: schema_d_exports.FormItemConfig | schema_d_exports.FormItemConfig[];
2431
+ /**
2432
+ * 内部配置对应的 model 切片,默认沿用字段所在层级的 `model`。
2433
+ *
2434
+ * 例如 `code-select` 内部是 `:model="model[name]"`,就应返回 `model[config.name]`。
2435
+ */
2436
+ model?: schema_d_exports.FormValue;
2437
+ /**
2438
+ * 内部配置对应的 prop 基准,默认沿用字段自身的 `prop`。
2439
+ *
2440
+ * 返回的 config 的 `name` 会被追加到这个基准上。所以当内部配置复用了字段自身的 `name`
2441
+ * (如 `display-conds` 内部的 group-list 就叫 `props.name`)时,要返回 `parentProp`,
2442
+ * 否则 name 会被拼两次。
2443
+ */
2444
+ prop?: string;
2445
+ }
2446
+ /**
2447
+ * 复合字段的内部配置回调。
2448
+ *
2449
+ * 有一类字段组件会在自身内部再渲染 `MContainer` 并传入组件内部临时算出来的 config
2450
+ * (如编辑器的 `code-select` / `event-select` / `style-setter`),这些内部字段同样会向
2451
+ * 父级表单注册 FormItem、参与父表单校验。无渲染校验(`validateValues`)只遍历调用方
2452
+ * 传入的 config 树,看不到这些运行期才产生的配置,因此需要字段作者通过
2453
+ * `registerField(type, { innerConfig })` 把内部配置交出来。
2454
+ *
2455
+ * 返回 `null` / `undefined` 表示该字段本次没有内部配置(例如某些分支下不渲染子表单)。
2456
+ *
2457
+ * 既未登记 innerConfig、也不在叶子字段表里的 type:配置里有 `items` 会下钻子项,
2458
+ * 自身有 `rules` 会校验自身。
2459
+ */
2460
+ type FieldInnerConfig = (_ctx: FieldInnerConfigContext) => FieldInnerConfigResult | null | undefined | void;
2461
+ //#endregion
2462
+ //#region temp/packages/form/src/utils/fieldValueEffects.d.ts
2463
+ /** effect 的入参:字段自身的配置、所在层级的 model、完整字段路径、表单值根对象与表单状态 */
2464
+ interface FieldMountValueEffectContext {
2465
+ /** 字段自身的配置 */
2466
+ config: schema_d_exports.FormItemConfig;
2467
+ /** 字段所在层级的 model 切片 */
2468
+ model: schema_d_exports.FormValue;
2469
+ /** 字段的完整 prop 路径(含父级前缀),对应 Container 的 `itemProp` */
2470
+ prop: string;
2471
+ /**
2472
+ * 本次处理的表单值根对象,`prop` 即以它为根。
2473
+ *
2474
+ * 需要按路径跨层级写值时用它,不要用 `mForm.values`:对比模式下处理的是 lastValues 那一份,
2475
+ * tab / table 新增行处理的则是还没挂到表单上的一行值,两者都与 `mForm.values` 不是同一个对象。
2476
+ */
2477
+ values: schema_d_exports.FormValue;
2478
+ /** 表单状态 */
2479
+ mForm: schema_d_exports.FormState | undefined;
2480
+ }
2481
+ /**
2482
+ * 字段对表单值的初始化写入(如 `display` 的 `initValue`、`date` 的格式归一化)。
2483
+ *
2484
+ * 由 `applyMountValueEffects` 在表单值初始化完成后统一执行一次,渲染与无渲染共用。
2485
+ * 因为可能对同一份值重复执行(如 `initValues` 变化后重新初始化),实现必须幂等。
2486
+ */
2487
+ type FieldMountValueEffect = (_ctx: FieldMountValueEffectContext) => void;
2488
+ /**
2489
+ * 是否为叶子字段 type(内置 ∪ 已登记)。
2490
+ *
2491
+ * @param type - 字段 type
2492
+ * @returns 是否为叶子
2493
+ */
2494
+ export declare const isLeafFieldType: (type: string) => boolean;
2495
+ //#endregion
2496
+ //#region temp/packages/form/src/utils/typeMatch.d.ts
2497
+ interface TypeMatchValidateContext {
2498
+ fieldType: string;
2499
+ mForm: schema_d_exports.FormState | undefined;
2500
+ props: any;
2501
+ message?: string;
2502
+ }
2503
+ /**
2504
+ * 自定义 type 校验器:返回错误文案;通过则返回 undefined。
2505
+ *
2506
+ * 支持返回 Promise,用于需要异步确认取值是否合法的场景(如请求接口校验 id 是否存在)。
2507
+ */
2508
+ type TypeMatchValidator = (value: any, context: TypeMatchValidateContext) => string | undefined | Promise<string | undefined>;
2509
+ /** 获取某个字段 type 的 typeMatch 校验规则(业务侧优先于内置) */
2510
+ export declare const getTypeMatchRule: (type: string) => TypeMatchValidator | undefined;
2511
+ /** 删除业务侧 typeMatch 校验规则(不影响内置) */
2512
+ export declare const deleteTypeMatchRule: (type: string) => boolean;
2513
+ /** 清空业务侧 typeMatch 校验规则(不影响内置) */
2514
+ export declare const clearTypeMatchRules: () => void;
2515
+ /**
2516
+ * 将值格式化为可读的参考示例字符串。
2517
+ */
2518
+ export declare const stringifyExampleValue: (value: any) => string;
2519
+ /** 参考建议中可选值全量展示上限;超出时仅举例 EXAMPLE_SUGGESTION_COUNT 个并标明总数。 */
2520
+ export declare const MAX_SUGGESTION_OPTIONS = 20;
2521
+ /**
2522
+ * 生成可选项参考建议;无可选值时返回空字符串(不追加建议)。
2523
+ * 未超过 MAX_SUGGESTION_OPTIONS 时全部列举;超过时仅举例前 EXAMPLE_SUGGESTION_COUNT 个并标明总数,避免 AI 误以为仅有举例值合法。
2524
+ */
2525
+ export declare const optionSuggestion: (optionValues: any[]) => string;
2526
+ /**
2527
+ * 校验取值与字段 type 是否匹配;通过返回 undefined,否则返回错误文案。
2528
+ *
2529
+ * 命中的自定义规则是异步校验器时返回 Promise,内置规则始终同步返回。
2530
+ */
2531
+ export declare const validateTypeMatch: (value: any, mForm: schema_d_exports.FormState | undefined, props: any, message?: string) => string | undefined | Promise<string | undefined>;
2532
+ //#endregion
2533
+ //#region temp/packages/form/src/utils/registerField.d.ts
2534
+ /**
2535
+ * 自定义字段 type 的登记项。
2536
+ *
2537
+ * 不传或只传空对象:当作叶子,不再下钻 `items`。
2538
+ */
2539
+ interface FieldOptions {
2540
+ /**
2541
+ * 渲染用的 Vue 组件,写入字段注册表。
2542
+ * 传入 `app` 时同时 `app.component('m-fields-*')`。
2543
+ */
2544
+ component?: Component;
2545
+ /**
2546
+ * 容器组件,写入字段注册表。
2547
+ * 传入 `app` 时同时 `app.component('m-form-*')`。
2548
+ */
2549
+ container?: Component;
2550
+ /** 字段挂载时改写 model 的副作用。可与 `innerConfig` 同时登记。 */
2551
+ effect?: FieldMountValueEffect;
2552
+ /**
2553
+ * 按容器模板遍历(tab / table 等)。
2554
+ * 与 `innerConfig` / `effect` 同时传入时 `walk` 优先。
2555
+ */
2556
+ walk?: ContainerWalker;
2557
+ /**
2558
+ * 把内部会挂到父表单的配置交出来。
2559
+ * 可与 `effect` 同时传入:`effect` 负责本字段的值初始化,`innerConfig` 只做配置派生。
2560
+ */
2561
+ innerConfig?: FieldInnerConfig;
2562
+ /** 该 type 的 typeMatch 校验;可与叶子、walk 或 innerConfig 同时登记。 */
2563
+ typeMatch?: TypeMatchValidator;
2564
+ }
2565
+ /**
2566
+ * 无渲染校验用的登记项,不含 Vue 组件。
2567
+ *
2568
+ * 给 Node / `validateForm` / `submitForm` 用。
2569
+ */
2570
+ type HeadlessFieldOptions = Omit<FieldOptions, 'component' | 'container'>;
2571
+ /**
2572
+ * 把多份字段登记表按 type 浅合并。后一份只覆盖自己带了的 key,未出现的 key 保留前一份。
2573
+ *
2574
+ * 安装插件时用:Node 侧只登记 `headless`,浏览器再补 `component` / `container`。
2575
+ *
2576
+ * @param tables - 待合并的登记表,`undefined` 会被跳过
2577
+ * @returns 合并后的登记表
2578
+ */
2579
+ export declare const mergeFieldOptions: (...tables: Array<Record<string, HeadlessFieldOptions | FieldOptions> | undefined>) => Record<string, FieldOptions>;
2580
+ /**
2581
+ * 按字段 type 取已登记的渲染组件(`codeSelect` 与 `code-select` 等价)。
2582
+ *
2583
+ * @param type - 字段 type
2584
+ * @returns 已登记的 Vue 组件;未登记则为 `undefined`
2585
+ */
2586
+ declare const getField: (type: string) => Component | undefined;
2587
+ /**
2588
+ * 登记一个字段 type 在无渲染校验里的行为,以及可选的渲染组件。
2589
+ *
2590
+ * `type` 会按 Container 的规则归一化为中划线形式(`codeSelect` 与 `code-select` 等价)。
2591
+ * 对同一 type 重复登记按字段浅合并:后一次只覆盖自己传入的 key,未传入的 key 保留。
2592
+ * 传入 `app` 且带了 `component` / `container` 时,会同步 `app.component('m-fields-*'` / `'m-form-*')`。
2593
+ *
2594
+ * @param type - 字段 type
2595
+ * @param [options] - 登记项;省略或空对象视为叶子
2596
+ * @param [app] - Vue 应用;省略则不调用 `app.component`
2597
+ */
2598
+ export declare const registerField: (type: string, options?: FieldOptions, app?: App) => void;
2599
+ /**
2600
+ * 批量登记字段。
2601
+ *
2602
+ * @param fields - type 到登记项的映射
2603
+ * @param [app] - Vue 应用;省略则不调用 `app.component`
2604
+ */
2605
+ export declare const registerFields: (fields: Record<string, FieldOptions>, app?: App) => void;
2606
+ /**
2607
+ * 登记内置字段(`clearFields` / `unregisterField` 不会清掉)。
2608
+ *
2609
+ * @param fields - type 到登记项的映射
2610
+ * @param [app] - Vue 应用;省略则不调用 `app.component`
2611
+ */
2612
+ export declare const registerBuiltInFields: (fields: Record<string, FieldOptions>, app?: App) => void;
2613
+ /**
2614
+ * 删除业务侧对指定 type 的登记(不影响内置;主要用于单测)。
2615
+ *
2616
+ * @param type - 字段 type
2617
+ */
2618
+ export declare const unregisterField: (type: string) => void;
2619
+ /** 清空业务侧登记(不影响内置;主要用于单测)。 */
2620
+ export declare const clearFields: () => void;
2621
+ //#endregion
2622
+ //#region temp/packages/form/src/utils/builtInFields.d.ts
2623
+ /**
2624
+ * 内置字段的无渲染登记表(不含 Vue 组件)。
2625
+ *
2626
+ * 本模块只导出数据,不登记。调用方自行 `registerBuiltInFields(builtInFields)`,
2627
+ * 或 `app.use(MagicForm)`(install 里会登记叠上 Vue 组件后的表)。
2628
+ */
2629
+ export declare const builtInFields: Record<string, HeadlessFieldOptions>;
2630
+ //#endregion
2631
+ //#region temp/packages/form/src/utils/validateError.d.ts
2632
+ /**
2633
+ * 通过 name 从 config 中查找对应的 text
2634
+ *
2635
+ * @param name - 字段名,支持点分隔的路径格式,如 'a.b.c'
2636
+ * @param config - 表单配置数组
2637
+ * @returns 找到的 text 值,如果未找到则返回 undefined
2638
+ */
2639
+ export declare const getTextByName: (name: string, config?: schema_d_exports.FormConfig) => string | undefined;
2640
+ /**
2641
+ * 将校验返回的 invalidFields 汇总为可读的错误文案(多条以 `<br>` 拼接)。
2642
+ *
2643
+ * `useFieldTextInError` 为 `true`(默认)时用字段的 text 文案作为错误前缀,找不到则回退为字段 name。
2644
+ *
2645
+ * 由渲染式校验(Form.vue 的 `submitForm` / `validate`)与无渲染校验(`validateValues`)共用,
2646
+ * 保证两条校验链路产出的错误文案格式完全一致。
2647
+ *
2648
+ * @param invalidFields - async-validator 产出的字段错误表
2649
+ * @param [options] - 文案选项
2650
+ * @param [options.config] - 用于查找 text 的表单配置
2651
+ * @param [options.useFieldTextInError=true] - 错误前缀是否使用字段 text
2652
+ * @returns 拼接后的错误文案;无错误时为空串
2653
+ */
2654
+ export declare const formatValidateError: (invalidFields: Record<string, any>, { config, useFieldTextInError }?: {
2655
+ config?: schema_d_exports.FormConfig;
2656
+ useFieldTextInError?: boolean;
2657
+ }) => string;
1954
2658
  //#endregion
1955
2659
  //#region temp/packages/form/src/plugin.d.ts
2660
+ /**
2661
+ * `@tmagic/form` 插件安装选项。
2662
+ */
1956
2663
  interface FormInstallOptions {
2664
+ /** 是否启用全局 flat 模式。 */
2665
+ flat?: boolean;
2666
+ /**
2667
+ * 自定义字段 type 的登记(叶子 / innerConfig / walk / typeMatch / component / container)。
2668
+ * 与 `registerFields` 相同。
2669
+ */
2670
+ fields?: Record<string, FieldOptions>;
1957
2671
  [key: string]: any;
1958
2672
  }
1959
2673
  declare const _default$31: {
2674
+ /**
2675
+ * 安装 `@tmagic/form`:登记内置字段、挂载 `m-form` / `m-form-dialog` / `m-form-drawer`。
2676
+ *
2677
+ * @param app - Vue 应用
2678
+ * @param [opt] - 安装选项
2679
+ */
1960
2680
  install(app: App, opt?: FormInstallOptions): void;
1961
2681
  };
1962
2682
  declare namespace index_d_exports {
1963
- export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FormDiffConfig, FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$16 as MTable, _default$16 as MTableGroupList, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, ValidateError, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, display, filterFunction, getDataByPage, getField as getFormField, getRules, initValue, registerField as registerFormField, sortArray, sortChange, submitForm, useAddField };
2683
+ export { ChangeRecord, CollectedField, ContainerChangeEventData, FORM_CONTEXT_KEY, FORM_DIFF_CONFIG_KEY, FORM_TYPE_MATCH_VALID_KEY, FieldInnerConfig, FieldInnerConfigContext, FieldInnerConfigError, FieldInnerConfigResult, FieldMountValueEffect, FieldMountValueEffectContext, FieldOptions, FormDiffConfig, FormInstallOptions, FormLabelSlotProps, FormSlots, HeadlessFieldOptions, HeadlessFormStateOptions, MAX_SUGGESTION_OPTIONS, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$16 as MTable, _default$16 as MTableGroupList, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, TypeMatchValidateContext, TypeMatchValidator, ValidateError, ValidateFormOptions, ValidateValuesOptions, ValidateValuesResult, adaptFormValidator, appendProp, applyMountValueEffects, builtInFields, clearFields, clearTypeMatchRules, collectValidatableFields, createForm, createFormStateBase, createFormStateProxy, createHeadlessFormState, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteTypeMatchRule, display, filterFunction, formatValidateError, getDataByPage, getField as getFormField, getItemProp, getNativeRules, getRules, getTextByName, getTypeMatchRule, initValue, isFieldInnerConfigError, isLeafFieldType, isValidName, mergeFieldOptions, mergeFormContexts, optionSuggestion, registerBuiltInFields, registerField, registerFields, resolveItemType, sortArray, sortChange, stringifyExampleValue, stripTabItemsLazy, submitForm, unregisterField, useAddField, validateForm, validateTypeMatch, validateValues };
1964
2684
  }
1965
- declare const createForm: <T extends [] = []>(config: schema_d_exports.FormConfig | T) => schema_d_exports.FormConfig | T;
2685
+ export declare const createForm: <T extends [] = []>(config: schema_d_exports.FormConfig | T) => schema_d_exports.FormConfig | T;
1966
2686
  //#endregion
1967
- export { ChangeRecord, ContainerChangeEventData, FORM_DIFF_CONFIG_KEY, FormDiffConfig, type FormInstallOptions, FormLabelSlotProps, FormSlots, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$16 as MTable, _default$16 as MTableGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, SubmitFormOptions, SubmitFormResult, ValidateError, createForm, createObjectProp, createValues, datetimeFormatter, _default$31 as default, deleteField as deleteFormField, display, filterFunction, getDataByPage, getField as getFormField, getRules, initValue, registerField as registerFormField, sortArray, sortChange, submitForm, useAddField };
2687
+ export { type CollectedField, type FieldInnerConfig, type FieldInnerConfigContext, type FieldInnerConfigResult, type FieldMountValueEffect, type FieldMountValueEffectContext, type FieldOptions, type FormInstallOptions, type HeadlessFieldOptions, type HeadlessFormStateOptions, _default as MCascader, _default$1 as MCheckbox, _default$2 as MCheckboxGroup, _default$3 as MColorPicker, _default$4 as MContainer, _default$5 as MDate, _default$6 as MDateTime, _default$7 as MDaterange, _default$8 as MDisplay, _default$9 as MDynamicField, _default$10 as MFieldset, _default$11 as MFlexLayout, _default$12 as MForm, _default$13 as MFormBox, _default$14 as MFormDialog, _default$15 as MFormDrawer, _default$16 as MGroupList, _default$16 as MTable, _default$16 as MTableGroupList, _default$17 as MHidden, _default$18 as MLink, _default$19 as MNumber, _default$20 as MNumberRange, _default$21 as MPanel, _default$22 as MRadioGroup, _default$23 as MRow, _default$24 as MSelect, _default$25 as MSwitch, _default$26 as MTabs, _default$27 as MText, _default$28 as MTextarea, _default$29 as MTime, _default$30 as MTimerange, type SubmitFormOptions, type SubmitFormResult, type TypeMatchValidateContext, type TypeMatchValidator, type ValidateFormOptions, type ValidateValuesOptions, type ValidateValuesResult, _default$31 as default, getField as getFormField };