@dazhicheng/ui 1.5.142 → 1.5.144
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.
- package/dist/components/tt-form/src/form-render/FormArrayRegister.d.ts +36 -37
- package/dist/components/tt-form/src/formApi.d.ts +0 -10
- package/dist/components/tt-form/src/hooks/useFieldArray.d.ts +9 -0
- package/dist/components/tt-form/src/types.d.ts +0 -2
- package/dist/components/tt-upload/src/TtUpload.d.ts +2 -2
- package/dist/index.js +8596 -8688
- package/package.json +3 -3
|
@@ -2,55 +2,54 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { Recordable } from '../../../../../../utils/src';
|
|
3
3
|
import { FieldEntry } from '../types/forms';
|
|
4
4
|
import { FormSchema } from '../types';
|
|
5
|
-
/** 数组字段:整表赋值后按 `formApi.arrayFieldSyncKey` remount 内层官方 `useFieldArray` */
|
|
6
5
|
declare const FormArrayRegister: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
fieldName: {
|
|
7
|
+
type: PropType<string>;
|
|
8
|
+
required: true;
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
arraySchema: {
|
|
11
|
+
type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
12
|
+
default: () => FormSchema[];
|
|
14
13
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
formItemClass: {
|
|
15
|
+
type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
16
|
+
default: undefined;
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
rules: {
|
|
19
|
+
type: PropType<FormSchema["rules"]>;
|
|
20
|
+
default: undefined;
|
|
22
21
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
virtual: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
26
25
|
};
|
|
27
|
-
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
26
|
+
}>, () => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
28
27
|
[key: string]: any;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
}>[] | undefined)[], {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
29
|
+
fieldName: {
|
|
30
|
+
type: PropType<string>;
|
|
31
|
+
required: true;
|
|
33
32
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
arraySchema: {
|
|
34
|
+
type: PropType<FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[])>;
|
|
35
|
+
default: () => FormSchema[];
|
|
37
36
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
formItemClass: {
|
|
38
|
+
type: PropType<NonNullable<FormSchema["formItemClass"]>>;
|
|
39
|
+
default: undefined;
|
|
41
40
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
rules: {
|
|
42
|
+
type: PropType<FormSchema["rules"]>;
|
|
43
|
+
default: undefined;
|
|
45
44
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
virtual: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
49
48
|
};
|
|
50
49
|
}>> & Readonly<{}>, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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;
|
|
55
54
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
56
55
|
export { FormArrayRegister };
|
|
@@ -11,10 +11,6 @@ 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>;
|
|
18
14
|
/**
|
|
19
15
|
* 组件实例映射
|
|
20
16
|
*/
|
|
@@ -91,12 +87,6 @@ export declare class FormApi {
|
|
|
91
87
|
* @param shouldValidate
|
|
92
88
|
*/
|
|
93
89
|
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>;
|
|
100
90
|
submitForm(e?: Event): Promise<Recordable<any>>;
|
|
101
91
|
unmount(): void;
|
|
102
92
|
updateSchema(schema: Partial<FormSchema>[]): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import { FieldArrayContext, FieldEntry } from '../types/forms';
|
|
3
|
+
/**
|
|
4
|
+
* 与 vee-validate `useFieldArray` API 对齐:稳定 `key`、`entry.value` 可写(支持 v-model),
|
|
5
|
+
* 外部 `resetForm` / `setValues` 时同步行列表;不使用官方 `computedDeep` 与易递归的深拷贝双向 watch。
|
|
6
|
+
*/
|
|
7
|
+
export declare function useFieldArray<TValue extends Record<string, unknown> = Record<string, unknown>>(arrayPath: MaybeRefOrGetter<string>): Omit<FieldArrayContext<TValue>, "fields"> & {
|
|
8
|
+
fields: Ref<FieldEntry<TValue>[]>;
|
|
9
|
+
};
|
|
@@ -431,8 +431,6 @@ 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"];
|
|
436
434
|
/**
|
|
437
435
|
* @description 设置表单状态,支持扩展字段(如 navAnchorProps、groupSchema 等)
|
|
438
436
|
* @param {Partial<TtFormProps & Record<string, any>> | ((prev: TtFormProps & Record<string, any>) => Partial<TtFormProps & Record<string, any>>)} stateOrFn - 新状态或更新函数
|
|
@@ -109,7 +109,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
109
109
|
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
110
110
|
new (): any;
|
|
111
111
|
readonly prototype: any;
|
|
112
|
-
} | (((new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
112
|
+
} | (((new (... /** 渲染上传拖拽区域 */args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
113
113
|
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
114
114
|
new (): any;
|
|
115
115
|
readonly prototype: any;
|
|
@@ -299,7 +299,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
299
299
|
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
300
300
|
new (): any;
|
|
301
301
|
readonly prototype: any;
|
|
302
|
-
} | (((new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
302
|
+
} | (((new (... /** 渲染上传拖拽区域 */args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
303
303
|
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
304
304
|
new (): any;
|
|
305
305
|
readonly prototype: any;
|