@@ -19,23 +19,29 @@ const props = withDefaults(defineProps<{
1919 validator? : Validator ;
2020 mode? : Mode ;
2121 texts? : Partial <Texts >;
22- }>(), { mode: ' edit' , texts : () => ({}) });
22+ isUpdating? : boolean ;
23+ }>(), {
24+ mode: ' edit' ,
25+ texts : () => ({}),
26+ isUpdating: false ,
27+ });
2328
2429const emit = defineEmits <{
2530 (e : ' valid' , valid : boolean ): void ;
2631 (e : ' schemaValid' , valid : boolean ): void ;
2732}>();
2833
29- const schema = defineModel <SchemaNode []>(' schema' , { required: true });
34+ const isUpdating = toRef (props , ' isUpdating' );
35+ provide (' formerIsUpdating' , isUpdating );
3036
37+ const schema = defineModel <SchemaNode []>(' schema' , { required: true });
3138const internalSchema = ref <InternalSchemaNode []>([]);
3239provide (' schema' , internalSchema );
3340
3441const formId = ref (generateFormId ());
3542provide (' formId' , formId );
3643
3744const latestSchema = ref <SchemaNode []>();
38-
3945watch (schema , (value ) => {
4046 if (! isEqual (latestSchema .value , value )) {
4147 internalSchema .value = toInternalSchema (value );
@@ -69,14 +75,15 @@ provide('rootData', wrappedData);
6975provide (' rootSchema' , schema );
7076
7177provide (' mode' , toRef (props , ' mode' ));
72-
7378provide (' components' , props .components );
79+
7480provide (' showIf' , (node : SchemaNode ) => {
7581 if (! props .showIf ) {
7682 return true ;
7783 }
7884 return props .showIf (node , wrappedData .value , schema .value );
7985});
86+
8087const validator = props .validator || (() => true );
8188provide (' validator' , validator );
8289
0 commit comments