@simpleform/render 4.3.1 → 4.3.2
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/lib/hooks.d.ts +4 -4
- package/lib/index.js +1 -1
- package/lib/store/index.d.ts +4 -4
- package/lib/typings.d.ts +7 -8
- package/lib/utils/transform.d.ts +4 -5
- package/lib/utils/utils.d.ts +4 -4
- package/package.json +1 -1
package/lib/store/index.d.ts
CHANGED
|
@@ -27,15 +27,15 @@ export declare class SimpleFormRender {
|
|
|
27
27
|
constructor(config?: SimpleFormRender['config']);
|
|
28
28
|
defineConfig(payload?: Partial<SimpleFormRender['config']> | ((config?: SimpleFormRender['config']) => SimpleFormRender['config'])): void;
|
|
29
29
|
getWidgetList(): import("../typings").WithExpression<Omit<import("../typings").FRGenerateNode, "inside" | "outside"> & {
|
|
30
|
-
inside?: import("../typings").ReactComponent<any> | import("
|
|
31
|
-
outside?: import("../typings").ReactComponent<any> | import("
|
|
30
|
+
inside?: import("../typings").ReactComponent<any> | import("../typings").FRNode;
|
|
31
|
+
outside?: import("../typings").ReactComponent<any> | import("../typings").FRNode;
|
|
32
32
|
}>[];
|
|
33
33
|
setWidgetList(data?: SimpleFormRender['widgetList'], option?: {
|
|
34
34
|
ignore?: boolean;
|
|
35
35
|
}): void;
|
|
36
36
|
getItemByPath: (path?: FormRenderNodeProps["path"]) => import("../typings").WithExpression<Omit<import("../typings").FRGenerateNode, "inside" | "outside"> & {
|
|
37
|
-
inside?: import("../typings").ReactComponent<any> | import("
|
|
38
|
-
outside?: import("../typings").ReactComponent<any> | import("
|
|
37
|
+
inside?: import("../typings").ReactComponent<any> | import("../typings").FRNode;
|
|
38
|
+
outside?: import("../typings").ReactComponent<any> | import("../typings").FRNode;
|
|
39
39
|
}>[] | undefined;
|
|
40
40
|
getActions(): {
|
|
41
41
|
[k: string]: (...args: any[]) => void;
|
package/lib/typings.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export type FRGenerateNode = {
|
|
|
17
17
|
type?: string | ReactComponent<any>;
|
|
18
18
|
props?: Record<string, unknown>;
|
|
19
19
|
children?: any;
|
|
20
|
-
inside?: ReactComponent<any> |
|
|
21
|
-
outside?: ReactComponent<any> |
|
|
20
|
+
inside?: ReactComponent<any> | FRGenerateNode;
|
|
21
|
+
outside?: ReactComponent<any> | FRGenerateNode;
|
|
22
22
|
readOnly?: boolean;
|
|
23
23
|
readOnlyRender?: ReactNode | ((context?: FRContext) => ReactNode);
|
|
24
24
|
typeRender?: ReactNode | ((context?: FRContext) => ReactNode);
|
|
@@ -29,12 +29,10 @@ export type WithExpression<T> = {
|
|
|
29
29
|
};
|
|
30
30
|
export type ArrWithExpression<T extends Array<any> | undefined> = Array<WithExpression<NonNullable<T>[number]>>;
|
|
31
31
|
export type FRNode = WithExpression<Omit<FRGenerateNode, 'inside' | 'outside'> & {
|
|
32
|
-
inside?: ReactComponent<any> |
|
|
33
|
-
outside?: ReactComponent<any> |
|
|
32
|
+
inside?: ReactComponent<any> | FRNode;
|
|
33
|
+
outside?: ReactComponent<any> | FRNode;
|
|
34
34
|
}>;
|
|
35
|
-
export type FROptions = Partial<FRGenerateNode
|
|
36
|
-
[key in string]: any;
|
|
37
|
-
};
|
|
35
|
+
export type FROptions = Partial<FRGenerateNode>;
|
|
38
36
|
export type FRContext = {
|
|
39
37
|
_options: FROptions & Pick<FormChildrenProps, 'formrender'> & Pick<FormConfig, 'form'> & {
|
|
40
38
|
index?: number;
|
|
@@ -49,10 +47,11 @@ export type FormRenderNodeProps = {
|
|
|
49
47
|
onValuesChange?: (...args: any[]) => void;
|
|
50
48
|
};
|
|
51
49
|
export type FormChildrenProps = {
|
|
50
|
+
path?: FRContext['_options']['path'];
|
|
52
51
|
/**@deprecated no longer recommended, please use 'variables' instead */
|
|
53
52
|
plugins?: Record<string, unknown>;
|
|
54
53
|
formrender?: SimpleFormRender;
|
|
55
|
-
wrapper?:
|
|
54
|
+
wrapper?: FRGenerateNode['inside'];
|
|
56
55
|
options?: FROptions | ((frGenerateNode: any) => FROptions);
|
|
57
56
|
widgetList?: Array<FRNode>;
|
|
58
57
|
variables?: Record<string, unknown>;
|
package/lib/utils/transform.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormChildrenProps, FormRenderNodeProps, FormRenderProps,
|
|
2
|
+
import { FormChildrenProps, FormRenderNodeProps, FormRenderProps, FRGenerateNode, ReactComponent } from '../typings';
|
|
3
3
|
export declare const mergeFROptions: (oldConfig: any, newConfig: any, mergeFunNames?: string[]) => any;
|
|
4
4
|
export declare const traverseMapObject: (val: any, callback: any) => any;
|
|
5
5
|
export declare const traverseList: <V>(list?: Array<V>, callback?: (item: V, index: number, parent?: Array<string | number>) => any | void, parent?: Array<string | number>) => void[] | undefined;
|
|
6
6
|
export declare const traverseParse: <V>(obj: V, variables?: object, parser?: FormRenderProps["parser"]) => any;
|
|
7
|
+
export declare const getFRComponent: (widget?: ReactComponent<any> | FRGenerateNode, components?: FormRenderProps["components"]) => any[];
|
|
7
8
|
export declare const getInitialValues: (widgetList?: FRGenerateNode[]) => {} | undefined;
|
|
8
|
-
export declare const createFRElement: (
|
|
9
|
+
export declare const createFRElement: (Com?: ReactComponent<any> | React.ReactElement, ComProps?: any, ...children: React.ReactNode[]) => React.ReactNode;
|
|
9
10
|
export declare const parseFRData: (data: any, formrender: FormRenderProps["formrender"], form?: FormRenderProps["form"]) => any;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const renderFRNode: (node?: FormRenderNodeProps, formConfig?: FormChildrenProps["formConfig"]) => React.ReactElement<any, any> | null | undefined;
|
|
12
|
-
export declare const renderFRNodeList: (formrender: FormRenderNodeProps["formrender"], widgetList?: any, formConfig?: FormChildrenProps["formConfig"], parentNode?: Partial<FormRenderNodeProps>) => (React.ReactElement<any, any> | null | undefined)[] | undefined;
|
|
11
|
+
export declare const parseWidget: (widget: FormRenderNodeProps["widget"] | React.ReactElement, formrender: FormRenderNodeProps["formrender"], formConfig?: FormChildrenProps["formConfig"]) => any;
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ 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
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, "inside" | "outside"> & {
|
|
10
|
-
inside?: import("src/typings").ReactComponent<any> | import("
|
|
11
|
-
outside?: import("src/typings").ReactComponent<any> | import("
|
|
10
|
+
inside?: import("src/typings").ReactComponent<any> | import("src/typings").FRNode;
|
|
11
|
+
outside?: import("src/typings").ReactComponent<any> | import("src/typings").FRNode;
|
|
12
12
|
}>[] | undefined;
|
|
13
13
|
export declare const moveItemByPath: (widgetList: FormRenderProps["widgetList"] | undefined, fromPath: FormRenderNodeProps["path"], toPath: FormRenderNodeProps["path"]) => import("src/typings").WithExpression<Omit<import("src/typings").FRGenerateNode, "inside" | "outside"> & {
|
|
14
|
-
inside?: import("src/typings").ReactComponent<any> | import("
|
|
15
|
-
outside?: import("src/typings").ReactComponent<any> | import("
|
|
14
|
+
inside?: import("src/typings").ReactComponent<any> | import("src/typings").FRNode;
|
|
15
|
+
outside?: import("src/typings").ReactComponent<any> | import("src/typings").FRNode;
|
|
16
16
|
}>[] | undefined;
|
package/package.json
CHANGED