@simpleform/render 4.1.34 → 4.2.1
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/README.md +1 -1
- package/README_CN.md +1 -1
- package/lib/hooks.d.ts +5 -1
- package/lib/index.js +1 -1
- package/lib/store/index.d.ts +6 -2
- package/lib/typings.d.ts +6 -6
- package/lib/utils/parser.d.ts +1 -1
- package/lib/utils/utils.d.ts +6 -2
- package/package.json +1 -1
package/lib/store/index.d.ts
CHANGED
|
@@ -7,11 +7,15 @@ export declare class SimpleFormRender {
|
|
|
7
7
|
private widgetListListeners;
|
|
8
8
|
constructor(config?: SimpleFormRender['config']);
|
|
9
9
|
defineConfig(payload?: SimpleFormRender['config'] | ((config?: FormRenderProps) => Partial<FormRenderProps>)): void;
|
|
10
|
-
getWidgetList(): import("../typings").WithExpression<
|
|
10
|
+
getWidgetList(): import("../typings").WithExpression<Omit<import("../typings").FRGenerateNode, "rules"> & {
|
|
11
|
+
rules?: import("../typings").ArrWithExpression<import("@simpleform/form").FormItemProps["rules"]>;
|
|
12
|
+
}>[];
|
|
11
13
|
setWidgetList(data?: SimpleFormRender['widgetList'], option?: {
|
|
12
14
|
ignore?: boolean;
|
|
13
15
|
}): void;
|
|
14
|
-
getItemByPath: (path?: FormRenderNodeProps["path"]) => import("../typings").WithExpression<
|
|
16
|
+
getItemByPath: (path?: FormRenderNodeProps["path"]) => import("../typings").WithExpression<Omit<import("../typings").FRGenerateNode, "rules"> & {
|
|
17
|
+
rules?: import("../typings").ArrWithExpression<import("@simpleform/form").FormItemProps["rules"]>;
|
|
18
|
+
}>[] | undefined;
|
|
15
19
|
getActions(): {
|
|
16
20
|
[k: string]: (...args: any[]) => void;
|
|
17
21
|
};
|
package/lib/typings.d.ts
CHANGED
|
@@ -6,20 +6,20 @@ export type FRGenerateNode = FormItemProps & {
|
|
|
6
6
|
type?: string | ReactComponent<any>;
|
|
7
7
|
props?: Record<string, unknown>;
|
|
8
8
|
children?: any;
|
|
9
|
-
inside?: ReactComponent<any> | ReactNode;
|
|
10
|
-
outside?: ReactComponent<any> | ReactNode;
|
|
9
|
+
inside?: ReactComponent<any> | ReactNode | FRGenerateNode;
|
|
10
|
+
outside?: ReactComponent<any> | ReactNode | FRGenerateNode;
|
|
11
11
|
readOnly?: boolean;
|
|
12
12
|
readOnlyRender?: ReactNode | ((context?: FRContext) => ReactNode);
|
|
13
13
|
typeRender?: ReactNode | ((context?: FRContext) => ReactNode);
|
|
14
14
|
hidden?: boolean;
|
|
15
15
|
};
|
|
16
|
-
export type WithGenerateNode<T, K extends keyof FRGenerateNode> = {
|
|
17
|
-
[P in keyof T]: P extends K ? T[P] | FRGenerateNode : T[P];
|
|
18
|
-
};
|
|
19
16
|
export type WithExpression<T> = {
|
|
20
17
|
[P in keyof T]: T[P] | string;
|
|
21
18
|
};
|
|
22
|
-
export type
|
|
19
|
+
export type ArrWithExpression<T extends Array<any> | undefined> = Array<WithExpression<NonNullable<T>[number]>>;
|
|
20
|
+
export type FRNode = WithExpression<Omit<FRGenerateNode, 'rules'> & {
|
|
21
|
+
rules?: ArrWithExpression<FormItemProps['rules']>;
|
|
22
|
+
}>;
|
|
23
23
|
export type FROptions = Partial<FRGenerateNode> & {
|
|
24
24
|
[key in string]: any;
|
|
25
25
|
};
|
package/lib/utils/parser.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const toExpression: (val?: unknown) => string | undefined;
|
|
2
|
-
export declare const matchExpression: (value?: unknown) => string | undefined;
|
|
2
|
+
export declare const matchExpression: (value?: unknown) => string[] | undefined;
|
|
3
3
|
export declare const parseExpression: <V>(value: V, variables?: object) => any;
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -6,5 +6,9 @@ export declare function toEntries<T>(data: T[]): [number, T][];
|
|
|
6
6
|
export declare function toEntries<T>(data: Record<string, T>): [string, T][];
|
|
7
7
|
export declare function parseEntries<T>(entries: Array<[number, T]>): T[];
|
|
8
8
|
export declare function parseEntries<T>(entries: Array<[string, T]>): Record<string, T>;
|
|
9
|
-
export declare const insertItemByIndex: (widgetList: FormRenderProps["widgetList"] | undefined, data: unknown, index?: number, parent?: FormRenderNodeProps["path"]) => import("src/typings").WithExpression<
|
|
10
|
-
|
|
9
|
+
export declare const insertItemByIndex: (widgetList: FormRenderProps["widgetList"] | undefined, data: unknown, index?: number, parent?: FormRenderNodeProps["path"]) => import("src/typings").WithExpression<Omit<import("src/typings").FRGenerateNode, "rules"> & {
|
|
10
|
+
rules?: import("src/typings").ArrWithExpression<import("@simpleform/form").FormItemProps["rules"]>;
|
|
11
|
+
}>[] | undefined;
|
|
12
|
+
export declare const moveItemByPath: (widgetList: FormRenderProps["widgetList"] | undefined, fromPath: FormRenderNodeProps["path"], toPath: FormRenderNodeProps["path"]) => import("src/typings").WithExpression<Omit<import("src/typings").FRGenerateNode, "rules"> & {
|
|
13
|
+
rules?: import("src/typings").ArrWithExpression<import("@simpleform/form").FormItemProps["rules"]>;
|
|
14
|
+
}>[] | undefined;
|
package/package.json
CHANGED