@maxax/ui 1.1.17 → 1.1.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FormItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/basic-form/components/FormItem.vue"],"names":[],"mappings":"AA0bA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,cAAc,CAAA;AAOxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,cAAc,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;8BAwBtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAAtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;yBAAtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtB9F,wBAuaC"}
1
+ {"version":3,"file":"FormItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/basic-form/components/FormItem.vue"],"names":[],"mappings":"AA4bA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,cAAc,CAAA;AAOxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAIxD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,cAAc,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;8BAwBtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAAtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;yBAAtD,MAAM,UAAU,GAAG,WAAW,eAAe,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtB9F,wBAyaC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-events.d.ts","sourceRoot":"","sources":["../../../../src/components/basic-form/hooks/use-form-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAElG,UAAU,oBAAoB;IAC5B,IAAI,EAAE,iBAAiB,CAAA;IACvB,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE,WAAW,CAAC,eAAe,EAAE,CAAC,CAAA;IACzC,SAAS,EAAE,UAAU,CAAA;IACrB,eAAe,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IAChC,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAC9B,SAAS,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAA;IACjC,gBAAgB,EAAE,EAAE,CAAA;IACpB,WAAW,EAAE,EAAE,CAAA;CAChB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,oBAAoB,GAAG,cAAc,CAwWlL"}
1
+ {"version":3,"file":"use-form-events.d.ts","sourceRoot":"","sources":["../../../../src/components/basic-form/hooks/use-form-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAElG,UAAU,oBAAoB;IAC5B,IAAI,EAAE,iBAAiB,CAAA;IACvB,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE,WAAW,CAAC,eAAe,EAAE,CAAC,CAAA;IACzC,SAAS,EAAE,UAAU,CAAA;IACrB,eAAe,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IAChC,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IAC9B,SAAS,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAA;IACjC,gBAAgB,EAAE,EAAE,CAAA;IACpB,WAAW,EAAE,EAAE,CAAA;CAChB;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,oBAAoB,GAAG,cAAc,CAqXlL"}
package/dist/index.cjs CHANGED
@@ -9231,7 +9231,7 @@ const getComponentsEventTrigger$1 = (component) => {
9231
9231
  }
9232
9232
  return "onUpdate:value";
9233
9233
  };
9234
- function getComponentDefaultValue$1(component) {
9234
+ function getComponentDefaultValue(component) {
9235
9235
  if (DEFAULT_VALUE_ARRAY$1.includes(component)) {
9236
9236
  return [];
9237
9237
  }
@@ -9491,7 +9491,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
9491
9491
  }
9492
9492
  propsData.codeField = field;
9493
9493
  propsData.formValues = vue.unref(getValues);
9494
- let bindValueValue = props.formModel[field] || props.formModel[field] === 0 ? props.formModel[field] : getComponentDefaultValue$1(component);
9494
+ let bindValueValue = props.formModel[field] || props.formModel[field] === 0 ? props.formModel[field] : getComponentDefaultValue(component);
9495
9495
  if (itemIsDateComponent$1(component)) {
9496
9496
  if (!utils.isArray(bindValueValue)) {
9497
9497
  bindValueValue = bindValueValue ? dayjs(bindValueValue).valueOf() : null;
@@ -10539,12 +10539,6 @@ const getComponentsEventTrigger = (component) => {
10539
10539
  }
10540
10540
  return "onUpdate:value";
10541
10541
  };
10542
- function getComponentDefaultValue(component) {
10543
- if (DEFAULT_VALUE_ARRAY.includes(component)) {
10544
- return [];
10545
- }
10546
- return null;
10547
- }
10548
10542
  function setComponentRuleType(rule, component) {
10549
10543
  if (Reflect.has(rule, "type")) {
10550
10544
  return;
@@ -10901,7 +10895,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
10901
10895
  }
10902
10896
  propsData.codeField = field;
10903
10897
  propsData.formValues = vue.unref(getValues);
10904
- let bindValueValue = props.formModel[field] || props.formModel[field] === 0 ? props.formModel[field] : getComponentDefaultValue(component);
10898
+ let bindValueValue = props.formModel[field];
10905
10899
  if (itemIsDateComponent(component)) {
10906
10900
  if (!utils.isArray(bindValueValue)) {
10907
10901
  bindValueValue = bindValueValue ? dayjs(bindValueValue).valueOf() : null;
@@ -11312,7 +11306,12 @@ function useFormEvents({ emit, getProps, getSchema, formModel, defaultValueRef,
11312
11306
  valuesKeys.forEach((key2) => {
11313
11307
  if (!fields.includes(key2)) {
11314
11308
  const value = lodashEs.get(values, key2);
11315
- vue.unref(formModel)[key2] = value;
11309
+ if (utils.isUndefined(value)) {
11310
+ const defaultValue = lodashEs.cloneDeep(defaultValueRef.value[key2]);
11311
+ vue.unref(formModel)[key2] = defaultValue;
11312
+ } else {
11313
+ vue.unref(formModel)[key2] = value;
11314
+ }
11316
11315
  }
11317
11316
  });
11318
11317
  }
@@ -11366,7 +11365,12 @@ function useFormEvents({ emit, getProps, getSchema, formModel, defaultValueRef,
11366
11365
  if (hasKey) {
11367
11366
  constructValue = lodashEs.get(value, key2);
11368
11367
  const fieldValue = constructValue || value;
11369
- vue.unref(formModel)[key2] = fieldValue;
11368
+ if (utils.isUndefined(fieldValue)) {
11369
+ const defaultValue = lodashEs.cloneDeep(defaultValueRef.value[key2]);
11370
+ vue.unref(formModel)[key2] = defaultValue;
11371
+ } else {
11372
+ vue.unref(formModel)[key2] = fieldValue;
11373
+ }
11370
11374
  if ($props == null ? void 0 : $props.onChange) {
11371
11375
  $props == null ? void 0 : $props.onChange(fieldValue);
11372
11376
  }