3h1-ui 2.14.14 → 2.14.15

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.
Files changed (3) hide show
  1. package/es/index.js +32 -12
  2. package/lib/index.js +32 -12
  3. package/package.json +1 -1
package/es/index.js CHANGED
@@ -7685,8 +7685,10 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
7685
7685
  type: Boolean
7686
7686
  }
7687
7687
  },
7688
+ emits: ["clearCurrValidate"],
7688
7689
  setup(props2, {
7689
- slots
7690
+ slots,
7691
+ emit
7690
7692
  }) {
7691
7693
  const {
7692
7694
  schema,
@@ -7823,6 +7825,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
7823
7825
  dynamicRules,
7824
7826
  required
7825
7827
  } = props2.schema;
7828
+ emit("clearCurrValidate", unref(getValues).field);
7826
7829
  if (isFunction$4(dynamicRules)) {
7827
7830
  return dynamicRules(unref(getValues));
7828
7831
  }
@@ -10402,6 +10405,9 @@ const _sfc_main$N = defineComponent({
10402
10405
  submit: handleSubmit,
10403
10406
  scrollToField
10404
10407
  };
10408
+ const clearCurrValidate = (field) => {
10409
+ clearValidate([field]);
10410
+ };
10405
10411
  onMounted(() => {
10406
10412
  initDefault();
10407
10413
  emit("register", formActionType);
@@ -10426,7 +10432,8 @@ const _sfc_main$N = defineComponent({
10426
10432
  () => ({ ...getProps.value, ...advanceState })
10427
10433
  ),
10428
10434
  fieldsIsAdvancedMap,
10429
- ...formActionType
10435
+ ...formActionType,
10436
+ clearCurrValidate
10430
10437
  };
10431
10438
  }
10432
10439
  });
@@ -10459,7 +10466,8 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
10459
10466
  formProps: _ctx.getProps,
10460
10467
  allDefaultValues: _ctx.defaultValueRef,
10461
10468
  formModel: _ctx.formModel,
10462
- setFormModel: _ctx.setFormModel
10469
+ setFormModel: _ctx.setFormModel,
10470
+ onClearCurrValidate: _ctx.clearCurrValidate
10463
10471
  }, createSlots({ _: 2 }, [
10464
10472
  renderList(Object.keys(_ctx.$slots), (item) => {
10465
10473
  return {
@@ -10469,7 +10477,7 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
10469
10477
  ])
10470
10478
  };
10471
10479
  })
10472
- ]), 1032, ["isAdvanced", "tableAction", "formActionType", "schema", "formProps", "allDefaultValues", "formModel", "setFormModel"]);
10480
+ ]), 1032, ["isAdvanced", "tableAction", "formActionType", "schema", "formProps", "allDefaultValues", "formModel", "setFormModel", "onClearCurrValidate"]);
10473
10481
  }), 128))
10474
10482
  ]),
10475
10483
  _: 3
@@ -17041,7 +17049,7 @@ const basicColProps = 24;
17041
17049
  const basicProps$2 = {
17042
17050
  schema: {
17043
17051
  type: Array,
17044
- default: () => [{ label: "a", field: "a" }]
17052
+ default: () => []
17045
17053
  },
17046
17054
  labelAlign: {
17047
17055
  type: String,
@@ -17108,7 +17116,7 @@ const Description = /* @__PURE__ */ defineComponent({
17108
17116
  };
17109
17117
  const rows = computed(() => {
17110
17118
  return getProps.value.schema.map((item) => {
17111
- var _a2, _b;
17119
+ var _a2, _b, _c, _d;
17112
17120
  if ((item == null ? void 0 : item.component) === "Divider") {
17113
17121
  return createVNode(Divider$1, null, null);
17114
17122
  } else if ((item == null ? void 0 : item.component) === "Group") {
@@ -17131,11 +17139,11 @@ const Description = /* @__PURE__ */ defineComponent({
17131
17139
  textAlign: getProps.value.labelAlign
17132
17140
  },
17133
17141
  "class": `${prefixCls2}-label`
17134
- }, [slots[`${item.field}Label`] ? slots[`${item.field}Label`]() : item.label, ((_b = getProps.value) == null ? void 0 : _b.isShowColon) ? ":" : ""]), createVNode("span", {
17142
+ }, [slots[`${item.field}Label`] ? (_b = slots[`${item.field}Label`]) == null ? void 0 : _b.call(slots) : item.label, ((_c = getProps.value) == null ? void 0 : _c.isShowColon) ? ":" : ""]), createVNode("span", {
17135
17143
  "class": `${prefixCls2}-value`
17136
- }, [slots[`${item.field}Value`] ? slots[`${item.field}Value`]() : getProps.value.data[item.field], (item == null ? void 0 : item.isCopy) ? createVNode("span", {
17144
+ }, [slots[`${item.field}Value`] ? (_d = slots[`${item.field}Value`]) == null ? void 0 : _d.call(slots) : getProps.value.data[`${item.field}`], (item == null ? void 0 : item.isCopy) ? createVNode("span", {
17137
17145
  "style": "cursor:pointer;margin-left:5px",
17138
- "onClick": () => handleClick(getProps.value.data[item.field])
17146
+ "onClick": () => handleClick(getProps.value.data[`${item.field}`])
17139
17147
  }, [createVNode(CopyOutlined$1, {
17140
17148
  "style": {
17141
17149
  color: "#458ef9",
@@ -17162,12 +17170,24 @@ function useDescription(props2) {
17162
17170
  const desc = ref(null);
17163
17171
  const loaded = ref(false);
17164
17172
  function register(instance) {
17165
- if (unref(loaded)) {
17173
+ onUnmounted(() => {
17174
+ desc.value = null;
17175
+ loaded.value = false;
17176
+ });
17177
+ if (unref(loaded) && instance === unref(desc))
17166
17178
  return;
17167
- }
17168
17179
  desc.value = instance;
17169
- props2 && instance.setDescProps(props2);
17170
17180
  loaded.value = true;
17181
+ watch(
17182
+ () => props2,
17183
+ () => {
17184
+ props2 && instance.setDescProps(props2);
17185
+ },
17186
+ {
17187
+ immediate: true,
17188
+ deep: true
17189
+ }
17190
+ );
17171
17191
  }
17172
17192
  const methods2 = {
17173
17193
  setDescProps: (descProps) => {
package/lib/index.js CHANGED
@@ -7687,8 +7687,10 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
7687
7687
  type: Boolean
7688
7688
  }
7689
7689
  },
7690
+ emits: ["clearCurrValidate"],
7690
7691
  setup(props2, {
7691
- slots
7692
+ slots,
7693
+ emit
7692
7694
  }) {
7693
7695
  const {
7694
7696
  schema,
@@ -7825,6 +7827,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
7825
7827
  dynamicRules,
7826
7828
  required
7827
7829
  } = props2.schema;
7830
+ emit("clearCurrValidate", vue.unref(getValues).field);
7828
7831
  if (utils.isFunction(dynamicRules)) {
7829
7832
  return dynamicRules(vue.unref(getValues));
7830
7833
  }
@@ -10404,6 +10407,9 @@ const _sfc_main$N = vue.defineComponent({
10404
10407
  submit: handleSubmit,
10405
10408
  scrollToField
10406
10409
  };
10410
+ const clearCurrValidate = (field) => {
10411
+ clearValidate([field]);
10412
+ };
10407
10413
  vue.onMounted(() => {
10408
10414
  initDefault();
10409
10415
  emit("register", formActionType);
@@ -10428,7 +10434,8 @@ const _sfc_main$N = vue.defineComponent({
10428
10434
  () => ({ ...getProps.value, ...advanceState })
10429
10435
  ),
10430
10436
  fieldsIsAdvancedMap,
10431
- ...formActionType
10437
+ ...formActionType,
10438
+ clearCurrValidate
10432
10439
  };
10433
10440
  }
10434
10441
  });
@@ -10461,7 +10468,8 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
10461
10468
  formProps: _ctx.getProps,
10462
10469
  allDefaultValues: _ctx.defaultValueRef,
10463
10470
  formModel: _ctx.formModel,
10464
- setFormModel: _ctx.setFormModel
10471
+ setFormModel: _ctx.setFormModel,
10472
+ onClearCurrValidate: _ctx.clearCurrValidate
10465
10473
  }, vue.createSlots({ _: 2 }, [
10466
10474
  vue.renderList(Object.keys(_ctx.$slots), (item) => {
10467
10475
  return {
@@ -10471,7 +10479,7 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
10471
10479
  ])
10472
10480
  };
10473
10481
  })
10474
- ]), 1032, ["isAdvanced", "tableAction", "formActionType", "schema", "formProps", "allDefaultValues", "formModel", "setFormModel"]);
10482
+ ]), 1032, ["isAdvanced", "tableAction", "formActionType", "schema", "formProps", "allDefaultValues", "formModel", "setFormModel", "onClearCurrValidate"]);
10475
10483
  }), 128))
10476
10484
  ]),
10477
10485
  _: 3
@@ -17043,7 +17051,7 @@ const basicColProps = 24;
17043
17051
  const basicProps$2 = {
17044
17052
  schema: {
17045
17053
  type: Array,
17046
- default: () => [{ label: "a", field: "a" }]
17054
+ default: () => []
17047
17055
  },
17048
17056
  labelAlign: {
17049
17057
  type: String,
@@ -17110,7 +17118,7 @@ const Description = /* @__PURE__ */ vue.defineComponent({
17110
17118
  };
17111
17119
  const rows = vue.computed(() => {
17112
17120
  return getProps.value.schema.map((item) => {
17113
- var _a2, _b;
17121
+ var _a2, _b, _c, _d;
17114
17122
  if ((item == null ? void 0 : item.component) === "Divider") {
17115
17123
  return vue.createVNode(antDesignVue.Divider, null, null);
17116
17124
  } else if ((item == null ? void 0 : item.component) === "Group") {
@@ -17133,11 +17141,11 @@ const Description = /* @__PURE__ */ vue.defineComponent({
17133
17141
  textAlign: getProps.value.labelAlign
17134
17142
  },
17135
17143
  "class": `${prefixCls2}-label`
17136
- }, [slots[`${item.field}Label`] ? slots[`${item.field}Label`]() : item.label, ((_b = getProps.value) == null ? void 0 : _b.isShowColon) ? ":" : ""]), vue.createVNode("span", {
17144
+ }, [slots[`${item.field}Label`] ? (_b = slots[`${item.field}Label`]) == null ? void 0 : _b.call(slots) : item.label, ((_c = getProps.value) == null ? void 0 : _c.isShowColon) ? ":" : ""]), vue.createVNode("span", {
17137
17145
  "class": `${prefixCls2}-value`
17138
- }, [slots[`${item.field}Value`] ? slots[`${item.field}Value`]() : getProps.value.data[item.field], (item == null ? void 0 : item.isCopy) ? vue.createVNode("span", {
17146
+ }, [slots[`${item.field}Value`] ? (_d = slots[`${item.field}Value`]) == null ? void 0 : _d.call(slots) : getProps.value.data[`${item.field}`], (item == null ? void 0 : item.isCopy) ? vue.createVNode("span", {
17139
17147
  "style": "cursor:pointer;margin-left:5px",
17140
- "onClick": () => handleClick(getProps.value.data[item.field])
17148
+ "onClick": () => handleClick(getProps.value.data[`${item.field}`])
17141
17149
  }, [vue.createVNode(CopyOutlined$1, {
17142
17150
  "style": {
17143
17151
  color: "#458ef9",
@@ -17164,12 +17172,24 @@ function useDescription(props2) {
17164
17172
  const desc = vue.ref(null);
17165
17173
  const loaded = vue.ref(false);
17166
17174
  function register(instance) {
17167
- if (vue.unref(loaded)) {
17175
+ vue.onUnmounted(() => {
17176
+ desc.value = null;
17177
+ loaded.value = false;
17178
+ });
17179
+ if (vue.unref(loaded) && instance === vue.unref(desc))
17168
17180
  return;
17169
- }
17170
17181
  desc.value = instance;
17171
- props2 && instance.setDescProps(props2);
17172
17182
  loaded.value = true;
17183
+ vue.watch(
17184
+ () => props2,
17185
+ () => {
17186
+ props2 && instance.setDescProps(props2);
17187
+ },
17188
+ {
17189
+ immediate: true,
17190
+ deep: true
17191
+ }
17192
+ );
17173
17193
  }
17174
17194
  const methods2 = {
17175
17195
  setDescProps: (descProps) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "2.14.14",
3
+ "version": "2.14.15",
4
4
  "description": "",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",