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

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();
@@ -102,7 +102,7 @@ export interface FormSchema {
102
102
  labelWidth?: string | number;
103
103
  disabledLabelWidth?: boolean;
104
104
  component: ComponentType;
105
- componentProps?: ComponentProps;
105
+ componentProps?: Recordable;
106
106
  required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
107
107
  suffix?: string | number | ((values: RenderCallbackParams) => string | number);
108
108
  rules?: Rule[];
package/lib/index.js CHANGED
@@ -25882,29 +25882,34 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25882
25882
  });
25883
25883
  const tempFormModel = vue.reactive({});
25884
25884
  vue.watch(() => formModel, useDebounceFn$1((val) => {
25885
- var _a2;
25886
25885
  if (isEqual(vue.toRaw(val), vue.toRaw(tempFormModel)))
25887
25886
  return;
25888
25887
  for (const key2 in val) {
25888
+ let handleSchemas = function(schemas = []) {
25889
+ schemas.forEach((item) => {
25890
+ var _a2, _b;
25891
+ const isComponentProps = item.field === key2 && item.componentProps;
25892
+ if (isComponentProps && !isFunction$5(item.componentProps) && ((_a2 = item.componentProps) == null ? void 0 : _a2.onModelChange)) {
25893
+ item.componentProps.onModelChange(val[key2]);
25894
+ } else if (isComponentProps && isFunction$5(item.componentProps)) {
25895
+ const modelProps = item.componentProps({
25896
+ schema: item,
25897
+ formModel,
25898
+ formActionType,
25899
+ tableAction: props2.tableAction
25900
+ });
25901
+ if (modelProps.onModelChange) {
25902
+ modelProps.onModelChange(val[key2]);
25903
+ }
25904
+ }
25905
+ if (item.component === "Group" && ((_b = item.componentProps) == null ? void 0 : _b.schemas)) {
25906
+ handleSchemas(item.componentProps.schemas);
25907
+ }
25908
+ });
25909
+ };
25889
25910
  if (isEqual(vue.toRaw(val[key2]), vue.toRaw(tempFormModel[key2])))
25890
25911
  continue;
25891
- (_a2 = vue.unref(getProps).schemas) == null ? void 0 : _a2.forEach((item) => {
25892
- var _a3;
25893
- const isComponentProps = item.field === key2 && item.componentProps;
25894
- if (isComponentProps && !isFunction$5(item.componentProps) && ((_a3 = item.componentProps) == null ? void 0 : _a3.onModelChange)) {
25895
- item.componentProps.onModelChange(val[key2]);
25896
- } else if (isComponentProps && isFunction$5(item.componentProps)) {
25897
- const modelProps = item.componentProps({
25898
- schema: item,
25899
- formModel,
25900
- formActionType,
25901
- tableAction: props2.tableAction
25902
- });
25903
- if (modelProps.onModelChange) {
25904
- modelProps.onModelChange(val[key2]);
25905
- }
25906
- }
25907
- });
25912
+ handleSchemas(vue.unref(getProps).schemas);
25908
25913
  }
25909
25914
  Object.assign(tempFormModel, cloneDeep(formModel));
25910
25915
  vue.unref(getProps).submitOnChange && handleSubmit();
@@ -102,7 +102,7 @@ export interface FormSchema {
102
102
  labelWidth?: string | number;
103
103
  disabledLabelWidth?: boolean;
104
104
  component: ComponentType;
105
- componentProps?: ComponentProps;
105
+ componentProps?: Recordable;
106
106
  required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
107
107
  suffix?: string | number | ((values: RenderCallbackParams) => string | number);
108
108
  rules?: Rule[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "3.0.0-next.237",
3
+ "version": "3.0.0-next.238",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",