@progressive-development/pd-forms 0.2.6 → 0.2.7

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent pd-forms following open-wc recommendations",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.2.6",
6
+ "version": "0.2.7",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -120,6 +120,14 @@ export class PdFormContainer extends PdBaseUI {
120
120
  tmpEl.errorMsg = erMsg;
121
121
  }
122
122
  e.detail.errorMap.set(el.id, erMsg);
123
+
124
+ } else if (el.validate && typeof el.validate === "function" && el.validate(e)) {
125
+ const errMsg = el.validate(e);
126
+ if (!e.detail.singleElement || e.detail.singleElement === el) {
127
+ tmpEl.errorMsg = errMsg;
128
+ }
129
+ e.detail.errorMap.set(el.id, errMsg);
130
+
123
131
  } else if (!e.detail.singleElement || e.detail.singleElement === el) {
124
132
  tmpEl.errorMsg = "";
125
133
  }