@dazhicheng/ui 1.5.156 → 1.5.158
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.
|
@@ -40,6 +40,10 @@ export declare class FormApi {
|
|
|
40
40
|
isFieldValid(fieldName: string): Promise<boolean>;
|
|
41
41
|
merge(formApi: FormApi): any;
|
|
42
42
|
mount(formActions: FormActions, componentRefMap: Map<string, unknown>): void;
|
|
43
|
+
/**
|
|
44
|
+
* @description 为 appendFields 新增的字段写入初始值(与 useFormInitial 规则一致,不覆盖已有数据)
|
|
45
|
+
*/
|
|
46
|
+
protected seedDefaultsForAppendedFields(fields: FormSchema[]): Promise<void>;
|
|
43
47
|
/**
|
|
44
48
|
* @description 增量追加字段到 schema 中,支持通过 position 指定插入位置
|
|
45
49
|
* @param {FormSchema[]} fields - 要插入的字段 schema 数组
|
|
@@ -28,7 +28,7 @@ declare function __VLS_template(): {
|
|
|
28
28
|
readonly fieldMappingTime?: import('./types').FieldMappingTime | undefined;
|
|
29
29
|
readonly form?: import('vee-validate').FormContext<import('vee-validate').GenericObject> | undefined;
|
|
30
30
|
readonly layout?: import('./types').FormLayout | undefined;
|
|
31
|
-
readonly schema?: (import('./types').
|
|
31
|
+
readonly schema?: (FormSchema<keyof import('./types').BaseFormComponentMap> | import('./types').FormSlotSchema)[] | undefined;
|
|
32
32
|
readonly showCollapseButton?: boolean | undefined;
|
|
33
33
|
readonly wrapperClass?: import('./types').WrapperClassType | undefined;
|
|
34
34
|
readonly globalCommonConfig?: import('./types').FormCommonConfig | undefined;
|
|
@@ -115,7 +115,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
115
115
|
readonly fieldMappingTime?: import('./types').FieldMappingTime | undefined;
|
|
116
116
|
readonly form?: import('vee-validate').FormContext<import('vee-validate').GenericObject> | undefined;
|
|
117
117
|
readonly layout?: import('./types').FormLayout | undefined;
|
|
118
|
-
readonly schema?: (import('./types').
|
|
118
|
+
readonly schema?: (FormSchema<keyof import('./types').BaseFormComponentMap> | import('./types').FormSlotSchema)[] | undefined;
|
|
119
119
|
readonly showCollapseButton?: boolean | undefined;
|
|
120
120
|
readonly wrapperClass?: import('./types').WrapperClassType | undefined;
|
|
121
121
|
readonly globalCommonConfig?: import('./types').FormCommonConfig | undefined;
|
|
@@ -3,6 +3,7 @@ import { FormSchema, ExtendedFormApi, FormActions, TtFormProps } from './types';
|
|
|
3
3
|
type ExtendFormProps = TtFormProps & {
|
|
4
4
|
formApi?: ExtendedFormApi;
|
|
5
5
|
};
|
|
6
|
+
export declare function isFormSchema(schema: unknown): schema is FormSchema;
|
|
6
7
|
export declare const injectFormProps: <T extends [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions] | null | undefined = [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions]>(fallback?: T | undefined) => T extends null ? [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions] | null : [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions], provideFormProps: (contextValue: [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions]) => [ExtendFormProps | ComputedRef<ExtendFormProps>, FormActions];
|
|
7
8
|
export declare const injectComponentRefMap: <T extends Map<string, unknown> | null | undefined = Map<string, unknown>>(fallback?: T | undefined) => T extends null ? Map<string, unknown> | null : Map<string, unknown>, provideComponentRefMap: (contextValue: Map<string, unknown>) => Map<string, unknown>;
|
|
8
9
|
/** 提取单个字段默认值:defaultValue 优先,其次 Zod rules */
|
|
@@ -15,6 +16,14 @@ export declare function resolveSchemaItemDefaultValue(item: FormSchema): unknown
|
|
|
15
16
|
* - 父行合并后会对嵌套数组递归补全(空嵌套数组、部分行缺字段)
|
|
16
17
|
*/
|
|
17
18
|
export declare function resolveArrayFieldInitialValue(item: FormSchema): unknown;
|
|
19
|
+
/**
|
|
20
|
+
* @description 解析单个字段的初始值(与 useFormInitial.generateInitialValues 单字段逻辑一致)
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveSchemaFieldInitialValue(item: FormSchema): unknown | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @description appendFields 时判断是否需要为新字段写入初始值(不覆盖已有非空数据)
|
|
25
|
+
*/
|
|
26
|
+
export declare function shouldSeedAppendedFieldValue(values: Record<string, unknown>, item: FormSchema): boolean;
|
|
18
27
|
export declare function useFormInitial(props: ComputedRef<TtFormProps> | TtFormProps): {
|
|
19
28
|
delegatedSlots: ComputedRef<string[]>;
|
|
20
29
|
form: import('vee-validate').FormContext<Record<string, unknown>, Record<string, unknown>>;
|