@dazhicheng/ui 1.5.160 → 1.5.162

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.
@@ -2,7 +2,7 @@ import { PropType } from 'vue';
2
2
  import { Recordable } from '../../../../../../utils/src';
3
3
  import { FieldEntry } from '../types/forms';
4
4
  import { ArraySchemaContext, FormSchema } from '../types';
5
- type ArraySchemaProp = FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number, ctx?: ArraySchemaContext) => FormSchema[]);
5
+ type ArraySchemaProp = FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number, ctx: ArraySchemaContext) => FormSchema[]);
6
6
  declare const FormArrayRegister: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
7
7
  fieldName: {
8
8
  type: PropType<string>;
@@ -136,7 +136,7 @@ export declare class FormApi {
136
136
  * 子类(如分组表单)可覆盖以同步清理虚拟校验缓存等。
137
137
  * @param {string[]} removedFieldNames 已从 schema 中移除的字段名
138
138
  */
139
- protected onRemovedSchemaFields(fieldNames: string[]): void;
139
+ onRemovedSchemaFields(fieldNames: string[]): void;
140
140
  /**
141
141
  * store 更新后对比前后 `schema` 的 fieldName 集合,对已从 schema 中移除的字段清空 vee-validate 值与错误,
142
142
  * 避免 `removeFields` / 删项后 `getValues` 仍带出旧字段。
@@ -81,10 +81,10 @@ export declare class GroupFormApi extends FormApi {
81
81
  */
82
82
  protected getFieldNamesForSetValuesFilter(): string[];
83
83
  /**
84
- * @description schema 中移除字段后清空虚拟列表场景下缓存的校验错误,与 {@link FormApi} 中清空 vee 值保持一致。
84
+ * @description schema 中移除字段后清空 vee 值/错误,并同步清理虚拟列表 errorCacheMap
85
85
  * @param {string[]} removedFieldNames 已移除的 fieldName 列表
86
86
  */
87
- protected onRemovedSchemaFields(removedFieldNames: string[]): void;
87
+ onRemovedSchemaFields(removedFieldNames: string[]): void;
88
88
  /**
89
89
  * @description 校验表单(含未挂载的虚拟字段),支持通过第二个参数控制是否滚动到第一个错误分组
90
90
  * @param {Partial<ValidationOptions>} [opts] - 原始 validate 选项
@@ -183,6 +183,19 @@ export declare class GroupFormApi extends FormApi {
183
183
  * formApi.removeFields(['v_phone', 'v_email']);
184
184
  */
185
185
  removeFields(fieldNames: string[]): void;
186
+ /**
187
+ * @description 清理已移除分组的运行时状态(隐藏集、折叠、导航徽标等)
188
+ * @param keysToRemove - 待移除的分组 key(含子分组)
189
+ */
190
+ private _purgeRemovedGroupState;
191
+ /**
192
+ * @description 按分组 key 移除分组及其子分组(从 groupSchema 树删除),并清空其下字段值与相关状态
193
+ * @param groupKey - 分组 key(单个或数组)
194
+ * @example
195
+ * formApi.removeGroups(['group1', 'group2']);
196
+ * formApi.removeGroups('group1');
197
+ */
198
+ removeGroups(groupKey: string[] | string): void;
186
199
  /**
187
200
  * @description 合并 vee-validate 实时 errors 与虚拟列表未挂载字段的 errorCacheMap,用于导航徽标与输入联动
188
201
  * @returns {Record<string, string>} 合并后的错误映射
@@ -238,6 +251,11 @@ export declare class GroupFormApi extends FormApi {
238
251
  * @description 清空所有缓存的错误并递增重置信号
239
252
  */
240
253
  private _clearAllCachedErrors;
254
+ /**
255
+ * @description 收集分组 key 及其所有子分组 key(去重)
256
+ * @param keys - 起始分组 key 列表
257
+ */
258
+ private _collectGroupKeysWithDescendants;
241
259
  /**
242
260
  * @description 递归构建各分组 key → 其直属字段名的映射
243
261
  * @param {GroupFormSchema[]} schemas - 分组 schema 数组
@@ -266,7 +284,7 @@ export declare class GroupFormApi extends FormApi {
266
284
  * @description 清空分组下的所有字段值
267
285
  * @param {string} key 分组 key
268
286
  */
269
- clearGroupFieldValues(key: string): void;
287
+ private _clearGroupFieldValues;
270
288
  /**
271
289
  * @description 卸载分组表单时恢复初始schema
272
290
  */
@@ -107,6 +107,12 @@ export declare function insertFieldsByPosition(schemas: GroupFormSchema[], field
107
107
  * @example
108
108
  * removeFieldsFromGroup(schema, new Set(['phone_0', 'divider-contact-0']));
109
109
  */
110
+ /**
111
+ * 从 groupSchema 树中移除指定分组(含其子树),按分组 `key` 匹配
112
+ * @param schemas - 分组 schema 树
113
+ * @param groupKeys - 要移除的分组 key 集合(应包含所有需删除的子分组 key)
114
+ */
115
+ export declare function removeGroupsFromGroup(schemas: GroupFormSchema[], groupKeys: Set<string>): GroupFormSchema[];
110
116
  export declare function removeFieldsFromGroup(schemas: GroupFormSchema[], fieldNames: Set<string>): GroupFormSchema[];
111
117
  /**
112
118
  * 浅拷贝 groupSchema 树结构(只复制数组和分组/行的 children 引用,不深拷贝叶子节点)