@dazhicheng/ui 1.5.141 → 1.5.142
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.
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
+
import { Recordable } from '../../../../../../utils/src';
|
|
2
3
|
import { FieldEntry } from '../types/forms';
|
|
3
4
|
import { FormSchema } from '../types';
|
|
4
|
-
|
|
5
|
+
/** 数组字段:整表赋值后按 `formApi.arrayFieldSyncKey` remount 内层官方 `useFieldArray` */
|
|
5
6
|
declare const FormArrayRegister: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
-
fieldName: {
|
|
7
|
-
type: PropType<string>;
|
|
8
|
-
required: true;
|
|
7
|
+
readonly fieldName: {
|
|
8
|
+
readonly type: PropType<string>;
|
|
9
|
+
readonly required: true;
|
|
9
10
|
};
|
|
10
|
-
arraySchema: {
|
|
11
|
-
type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
12
|
-
default: () => FormSchema[];
|
|
11
|
+
readonly arraySchema: {
|
|
12
|
+
readonly type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
13
|
+
readonly default: () => FormSchema[];
|
|
13
14
|
};
|
|
14
|
-
formItemClass: {
|
|
15
|
-
type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
16
|
-
default: undefined;
|
|
15
|
+
readonly formItemClass: {
|
|
16
|
+
readonly type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
17
|
+
readonly default: undefined;
|
|
17
18
|
};
|
|
18
|
-
rules: {
|
|
19
|
-
type: PropType<FormSchema["rules"]>;
|
|
20
|
-
default: undefined;
|
|
19
|
+
readonly rules: {
|
|
20
|
+
readonly type: PropType<FormSchema["rules"]>;
|
|
21
|
+
readonly default: undefined;
|
|
21
22
|
};
|
|
22
|
-
virtual: {
|
|
23
|
-
type: BooleanConstructor;
|
|
24
|
-
default:
|
|
23
|
+
readonly virtual: {
|
|
24
|
+
readonly type: BooleanConstructor;
|
|
25
|
+
readonly default: false;
|
|
25
26
|
};
|
|
26
|
-
}>, () =>
|
|
27
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
27
28
|
[key: string]: any;
|
|
28
|
-
}
|
|
29
|
-
fieldName: {
|
|
30
|
-
type: PropType<string>;
|
|
31
|
-
required: true;
|
|
29
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
30
|
+
readonly fieldName: {
|
|
31
|
+
readonly type: PropType<string>;
|
|
32
|
+
readonly required: true;
|
|
32
33
|
};
|
|
33
|
-
arraySchema: {
|
|
34
|
-
type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
35
|
-
default: () => FormSchema[];
|
|
34
|
+
readonly arraySchema: {
|
|
35
|
+
readonly type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
36
|
+
readonly default: () => FormSchema[];
|
|
36
37
|
};
|
|
37
|
-
formItemClass: {
|
|
38
|
-
type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
39
|
-
default: undefined;
|
|
38
|
+
readonly formItemClass: {
|
|
39
|
+
readonly type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
40
|
+
readonly default: undefined;
|
|
40
41
|
};
|
|
41
|
-
rules: {
|
|
42
|
-
type: PropType<FormSchema["rules"]>;
|
|
43
|
-
default: undefined;
|
|
42
|
+
readonly rules: {
|
|
43
|
+
readonly type: PropType<FormSchema["rules"]>;
|
|
44
|
+
readonly default: undefined;
|
|
44
45
|
};
|
|
45
|
-
virtual: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default:
|
|
46
|
+
readonly virtual: {
|
|
47
|
+
readonly type: BooleanConstructor;
|
|
48
|
+
readonly default: false;
|
|
48
49
|
};
|
|
49
50
|
}>> & Readonly<{}>, {
|
|
50
|
-
rules: import('../types').FormSchemaRuleType | undefined;
|
|
51
|
-
arraySchema: FormSchema<keyof import('../types').BaseFormComponentMap>[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[]);
|
|
52
|
-
formItemClass: NonNullable<string | (() => string) | undefined>;
|
|
53
|
-
virtual: boolean;
|
|
51
|
+
readonly rules: import('../types').FormSchemaRuleType | undefined;
|
|
52
|
+
readonly arraySchema: FormSchema<keyof import('../types').BaseFormComponentMap>[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[]);
|
|
53
|
+
readonly formItemClass: NonNullable<string | (() => string) | undefined>;
|
|
54
|
+
readonly virtual: boolean;
|
|
54
55
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
55
56
|
export { FormArrayRegister };
|
|
@@ -11,6 +11,10 @@ export declare class FormApi {
|
|
|
11
11
|
stateHandler: StateHandler;
|
|
12
12
|
store: Store<TtFormProps>;
|
|
13
13
|
private readonly _arrayFields;
|
|
14
|
+
/**
|
|
15
|
+
* 整表赋值后递增,用于 remount `FormArrayRegister` 内官方 `useFieldArray` 实例,避免与外部 `setValues` 循环更新。
|
|
16
|
+
*/
|
|
17
|
+
readonly arrayFieldSyncKey: import('vue').Ref<number, number>;
|
|
14
18
|
/**
|
|
15
19
|
* 组件实例映射
|
|
16
20
|
*/
|
|
@@ -87,6 +91,12 @@ export declare class FormApi {
|
|
|
87
91
|
* @param shouldValidate
|
|
88
92
|
*/
|
|
89
93
|
setValues(fields: Record<string, any>, filterFields?: boolean, shouldValidate?: boolean): Promise<void>;
|
|
94
|
+
/** 声明了 `useArraySchema` 的顶层 fieldName */
|
|
95
|
+
protected getArraySchemaFieldNames(): string[];
|
|
96
|
+
protected bumpArrayFieldSyncKey(): void;
|
|
97
|
+
/** 整表写入后:remount 数组块 + 对已注册的数组字段调用官方 `replace` */
|
|
98
|
+
protected afterArrayValuesPatch(source?: Record<string, any>): Promise<void>;
|
|
99
|
+
protected syncRegisteredArrayFields(source?: Record<string, any>): Promise<void>;
|
|
90
100
|
submitForm(e?: Event): Promise<Recordable<any>>;
|
|
91
101
|
unmount(): void;
|
|
92
102
|
updateSchema(schema: Partial<FormSchema>[]): void;
|
|
@@ -431,6 +431,8 @@ export interface TtFormProps<T extends BaseFormComponentType = BaseFormComponent
|
|
|
431
431
|
submitOnEnter?: boolean;
|
|
432
432
|
}
|
|
433
433
|
export type ExtendedFormApi = Omit<FormApi, "getValues" | "validate" | "setState"> & {
|
|
434
|
+
/** 数组字段整表同步版本号,供 `FormArrayRegister` remount 官方 `useFieldArray` */
|
|
435
|
+
arrayFieldSyncKey: FormApi["arrayFieldSyncKey"];
|
|
434
436
|
/**
|
|
435
437
|
* @description 设置表单状态,支持扩展字段(如 navAnchorProps、groupSchema 等)
|
|
436
438
|
* @param {Partial<TtFormProps & Record<string, any>> | ((prev: TtFormProps & Record<string, any>) => Partial<TtFormProps & Record<string, any>>)} stateOrFn - 新状态或更新函数
|