lew-ui 2.3.2 → 2.3.3

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.
@@ -49,6 +49,7 @@ declare const _default: import('vue').DefineComponent<{
49
49
  }, {
50
50
  getForm: () => {};
51
51
  setForm: (value?: any) => void;
52
+ resetError: () => void;
52
53
  validate: () => Promise<boolean>;
53
54
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
54
55
  change: (...args: any[]) => void;
package/dist/index.mjs CHANGED
@@ -11415,15 +11415,21 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
11415
11415
  componentOptions.forEach((item) => {
11416
11416
  var _a2;
11417
11417
  const v2 = getNestedFieldValue(value, item.field);
11418
- if (item.field) {
11418
+ if (value !== void 0 && item.field) {
11419
11419
  (_a2 = formItemRefMap.value[item.field]) == null ? void 0 : _a2.setError("");
11420
- if (value !== void 0 && item.field) {
11421
- formMap.value[item.field] = v2;
11422
- }
11420
+ formMap.value[item.field] = v2;
11423
11421
  }
11424
11422
  });
11425
11423
  emit("change", getForm());
11426
11424
  };
11425
+ const resetError = () => {
11426
+ componentOptions.forEach((item) => {
11427
+ var _a2;
11428
+ if (item.field) {
11429
+ (_a2 = formItemRefMap.value[item.field]) == null ? void 0 : _a2.setError("");
11430
+ }
11431
+ });
11432
+ };
11427
11433
  const getNestedFieldValue = (obj, field) => {
11428
11434
  if (!field) {
11429
11435
  return void 0;
@@ -11474,7 +11480,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
11474
11480
  });
11475
11481
  }
11476
11482
  );
11477
- __expose({ getForm, setForm, validate });
11483
+ __expose({ getForm, setForm, resetError, validate });
11478
11484
  return (_ctx, _cache) => {
11479
11485
  return openBlock(), createElementBlock("div", {
11480
11486
  class: normalizeClass(["lew-form", unref(getFormClassNames)]),
@@ -11510,7 +11516,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
11510
11516
  };
11511
11517
  }
11512
11518
  });
11513
- const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-cd69fcb0"]]);
11519
+ const LewForm = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-4900b565"]]);
11514
11520
  const checkboxModel = {
11515
11521
  modelValue: {
11516
11522
  type: Boolean,