@dazhicheng/ui 1.5.99 → 1.5.100
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.
|
@@ -4,6 +4,7 @@ import { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
|
4
4
|
import { FlattenAndSetPathsType, GenericObject, MapValuesPathsToRefs, MaybeArray, MaybePromise } from './common';
|
|
5
5
|
import { Path, PathValue } from './paths';
|
|
6
6
|
import { FieldValidationMetaInfo } from './shared';
|
|
7
|
+
import { Recordable } from '../../../../../../utils/src';
|
|
7
8
|
export type ValidationResult<TValue = unknown> = {
|
|
8
9
|
errors: string[];
|
|
9
10
|
valid: boolean;
|
|
@@ -86,13 +87,13 @@ export type PathState<TInput = unknown, TOutput = TInput> = {
|
|
|
86
87
|
};
|
|
87
88
|
validate?: FieldValidator<TOutput>;
|
|
88
89
|
};
|
|
89
|
-
export type FieldEntry<TValue =
|
|
90
|
+
export type FieldEntry<TValue = Recordable> = {
|
|
90
91
|
value: TValue;
|
|
91
92
|
key: string | number;
|
|
92
93
|
isFirst: boolean;
|
|
93
94
|
isLast: boolean;
|
|
94
95
|
};
|
|
95
|
-
export type FieldArrayContext<TValue =
|
|
96
|
+
export type FieldArrayContext<TValue = Recordable> = {
|
|
96
97
|
fields: FieldEntry<TValue>[];
|
|
97
98
|
remove: (idx: number) => void;
|
|
98
99
|
replace: (newArray: TValue[]) => void;
|
|
@@ -58,6 +58,7 @@ export type MaybeComponentPropKey = "options" | "placeholder" | "title" | keyof
|
|
|
58
58
|
export type MaybeComponentProps = {
|
|
59
59
|
[K in MaybeComponentPropKey]?: any;
|
|
60
60
|
};
|
|
61
|
+
/** 数组操作方法 */
|
|
61
62
|
export interface FormArrayActions {
|
|
62
63
|
get: <TValue = unknown>(name: string) => Readonly<FieldArrayContext<TValue>> | undefined;
|
|
63
64
|
push: <TValue = unknown>(name: string, value: TValue) => void;
|