comand-component-library 4.2.62 → 4.2.63

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.
@@ -4638,7 +4638,8 @@ const Re = /* @__PURE__ */ P(Pr, [["render", Er]]), Hr = {
4638
4638
  show: !1,
4639
4639
  validationStatus: "",
4640
4640
  message: ""
4641
- }
4641
+ },
4642
+ formElementsWithError: []
4642
4643
  };
4643
4644
  },
4644
4645
  props: {
@@ -4765,6 +4766,9 @@ const Re = /* @__PURE__ */ P(Pr, [["render", Er]]), Hr = {
4765
4766
  }
4766
4767
  },
4767
4768
  methods: {
4769
+ formElementHasError(e, t) {
4770
+ e === "error" && !this.formElementsWithError.includes(t) ? this.formElementsWithError.push(t) : e === "success" && this.formElementsWithError.includes(t) && (this.formElementsWithError = this.formElementsWithError.filter((n) => n !== t)), this.$emit("validation-status-change", this.formElementsWithError.length ? "error" : "success");
4771
+ },
4768
4772
  createHtmlId: Vi,
4769
4773
  showMessage(e, t) {
4770
4774
  this.systemMessage.show = !0, this.systemMessage.validationStatus = e, this.systemMessage.message = t;
@@ -4847,8 +4851,9 @@ function Qr(e, t, n, s, i, l) {
4847
4851
  autocomplete: f.autocomplete,
4848
4852
  minlength: f.minlength,
4849
4853
  maxlength: f.maxlength,
4850
- nativeButton: f.nativeButton
4851
- }, null, 8, ["element", "type", "name", "class", "id", "modelValue", "onUpdate:modelValue", "inputValue", "fieldIconClass", "selectOptions", "labelText", "placeholder", "required", "disabled", "autocomplete", "minlength", "maxlength", "nativeButton"])) : f.component === "CmdInputGroup" ? (a(), v(c, {
4854
+ nativeButton: f.nativeButton,
4855
+ onValidationStatusChange: (g) => l.formElementHasError(g, f.name)
4856
+ }, null, 8, ["element", "type", "name", "class", "id", "modelValue", "onUpdate:modelValue", "inputValue", "fieldIconClass", "selectOptions", "labelText", "placeholder", "required", "disabled", "autocomplete", "minlength", "maxlength", "nativeButton", "onValidationStatusChange"])) : f.component === "CmdInputGroup" ? (a(), v(c, {
4852
4857
  key: 1,
4853
4858
  modelValue: i.formValues[f.name],
4854
4859
  "onUpdate:modelValue": (g) => i.formValues[f.name] = g,
@@ -21417,7 +21422,7 @@ const qx = /* @__PURE__ */ P(Ex, [["render", Hx]]), Rx = [
21417
21422
  text: "Zimbabwe",
21418
21423
  value: "zw"
21419
21424
  }
21420
- ], n1 = "comand-component-library", i1 = "4.2.62", l1 = "GPL-3.0-only", o1 = "CoManD-UI", a1 = "module", s1 = {
21425
+ ], n1 = "comand-component-library", i1 = "4.2.63", l1 = "GPL-3.0-only", o1 = "CoManD-UI", a1 = "module", s1 = {
21421
21426
  prepublishOnly: "npm run build-lib",
21422
21427
  dev: "vite",
21423
21428
  build: "vite build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "4.2.62",
3
+ "version": "4.2.63",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "CoManD-UI",
6
6
  "private": false,
@@ -35,6 +35,7 @@
35
35
  :minlength="item.minlength"
36
36
  :maxlength="item.maxlength"
37
37
  :nativeButton="item.nativeButton"
38
+ @validation-status-change="formElementHasError($event, item.name)"
38
39
  />
39
40
  <CmdInputGroup
40
41
  v-else-if="item.component === 'CmdInputGroup'"
@@ -124,7 +125,8 @@ export default {
124
125
  show: false,
125
126
  validationStatus: "",
126
127
  message: ""
127
- }
128
+ },
129
+ formElementsWithError: []
128
130
  }
129
131
  },
130
132
  props: {
@@ -251,6 +253,14 @@ export default {
251
253
  }
252
254
  },
253
255
  methods: {
256
+ formElementHasError(event, itemName) {
257
+ if (event === "error" && !this.formElementsWithError.includes(itemName)) {
258
+ this.formElementsWithError.push(itemName)
259
+ } else if (event === "success" && this.formElementsWithError.includes(itemName)) {
260
+ this.formElementsWithError = this.formElementsWithError.filter((element) => element !== itemName)
261
+ }
262
+ this.$emit("validation-status-change", this.formElementsWithError.length ? "error" : "success")
263
+ },
254
264
  createHtmlId,
255
265
  showMessage(validationStatus, message) {
256
266
  this.systemMessage.show = true