3h1-ui 3.0.0-next.237 → 3.0.0-next.239

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/es/index.js CHANGED
@@ -25858,29 +25858,34 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25858
25858
  });
25859
25859
  const tempFormModel = reactive({});
25860
25860
  watch(() => formModel, useDebounceFn$1((val) => {
25861
- var _a2;
25862
25861
  if (isEqual(toRaw(val), toRaw(tempFormModel)))
25863
25862
  return;
25864
25863
  for (const key2 in val) {
25864
+ let handleSchemas = function(schemas = []) {
25865
+ schemas.forEach((item) => {
25866
+ var _a2, _b;
25867
+ const isComponentProps = item.field === key2 && item.componentProps;
25868
+ if (isComponentProps && !isFunction$5(item.componentProps) && ((_a2 = item.componentProps) == null ? void 0 : _a2.onModelChange)) {
25869
+ item.componentProps.onModelChange(val[key2]);
25870
+ } else if (isComponentProps && isFunction$5(item.componentProps)) {
25871
+ const modelProps = item.componentProps({
25872
+ schema: item,
25873
+ formModel,
25874
+ formActionType,
25875
+ tableAction: props2.tableAction
25876
+ });
25877
+ if (modelProps.onModelChange) {
25878
+ modelProps.onModelChange(val[key2]);
25879
+ }
25880
+ }
25881
+ if (item.component === "Group" && ((_b = item.componentProps) == null ? void 0 : _b.schemas)) {
25882
+ handleSchemas(item.componentProps.schemas);
25883
+ }
25884
+ });
25885
+ };
25865
25886
  if (isEqual(toRaw(val[key2]), toRaw(tempFormModel[key2])))
25866
25887
  continue;
25867
- (_a2 = unref(getProps).schemas) == null ? void 0 : _a2.forEach((item) => {
25868
- var _a3;
25869
- const isComponentProps = item.field === key2 && item.componentProps;
25870
- if (isComponentProps && !isFunction$5(item.componentProps) && ((_a3 = item.componentProps) == null ? void 0 : _a3.onModelChange)) {
25871
- item.componentProps.onModelChange(val[key2]);
25872
- } else if (isComponentProps && isFunction$5(item.componentProps)) {
25873
- const modelProps = item.componentProps({
25874
- schema: item,
25875
- formModel,
25876
- formActionType,
25877
- tableAction: props2.tableAction
25878
- });
25879
- if (modelProps.onModelChange) {
25880
- modelProps.onModelChange(val[key2]);
25881
- }
25882
- }
25883
- });
25888
+ handleSchemas(unref(getProps).schemas);
25884
25889
  }
25885
25890
  Object.assign(tempFormModel, cloneDeep(formModel));
25886
25891
  unref(getProps).submitOnChange && handleSubmit();