@hzab/form-render 1.7.5 → 1.7.7
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -32,10 +32,10 @@ export interface IArrayBaseItemProps {
|
|
|
32
32
|
|
|
33
33
|
export type ArrayBaseMixins = {
|
|
34
34
|
Addition?: React.FC<React.PropsWithChildren<IArrayBaseAdditionProps>>;
|
|
35
|
-
Copy?: React.
|
|
36
|
-
Remove?: React.
|
|
37
|
-
MoveUp?: React.
|
|
38
|
-
MoveDown?: React.
|
|
35
|
+
Copy?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & { index?: number }>>;
|
|
36
|
+
Remove?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & { index?: number }>>;
|
|
37
|
+
MoveUp?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & { index?: number }>>;
|
|
38
|
+
MoveDown?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & { index?: number }>>;
|
|
39
39
|
SortHandle?: React.FC<React.PropsWithChildren<IArrayBaseOperationProps & { index?: number }>>;
|
|
40
40
|
Index?: React.FC;
|
|
41
41
|
useArray?: () => IArrayBaseContext;
|
package/src/index.tsx
CHANGED
|
@@ -70,15 +70,11 @@ const antdComponents = {
|
|
|
70
70
|
|
|
71
71
|
const FormRender = forwardRef((props: any, parentRef) => {
|
|
72
72
|
/** schema scope 解决父级无 schema Scope 导致 scope 对象刷新的问题 */
|
|
73
|
-
const schemaScopeRef = useRef<{ _$tempData: Object }>(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
if (!schemaScopeRef.current?._$tempData) {
|
|
80
|
-
schemaScopeRef.current._$tempData = {};
|
|
81
|
-
}
|
|
73
|
+
const schemaScopeRef = useRef<{ _$tempData: Object }>({
|
|
74
|
+
scenario: "form-render",
|
|
75
|
+
_$tempData: {},
|
|
76
|
+
...props.schemaScope,
|
|
77
|
+
});
|
|
82
78
|
const SchemaField = useCallback(
|
|
83
79
|
createSchemaField({
|
|
84
80
|
components: {
|