@descope/web-components-ui 1.98.0 → 1.100.0
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/dist/cjs/index.cjs.js +113 -37
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +113 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/8961.js +1 -1
- package/dist/umd/8961.js.map +1 -1
- package/dist/umd/9365.js +1 -1
- package/dist/umd/9365.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/package.json +14 -14
- package/src/components/descope-date-field/DateFieldClass.js +43 -4
- package/src/mixins/inputValidationMixin.js +19 -13
@@ -73,6 +73,10 @@ export const inputValidationMixin = (superclass) =>
|
|
73
73
|
return `Please match the requested type.`;
|
74
74
|
}
|
75
75
|
|
76
|
+
getCustomErrorMessage(attr, defaultMsg) {
|
77
|
+
return this.hasAttribute(attr) ? this.getAttribute(attr) || ' ' : defaultMsg;
|
78
|
+
}
|
79
|
+
|
76
80
|
getErrorMessage(flags) {
|
77
81
|
const {
|
78
82
|
valueMissing,
|
@@ -89,31 +93,33 @@ export const inputValidationMixin = (superclass) =>
|
|
89
93
|
|
90
94
|
switch (true) {
|
91
95
|
case valueMissing:
|
92
|
-
return (
|
93
|
-
|
96
|
+
return this.getCustomErrorMessage(
|
97
|
+
errorAttributes.valueMissing,
|
98
|
+
this.defaultErrorMsgValueMissing
|
94
99
|
);
|
95
100
|
case patternMismatch || stepMismatch || badInput:
|
96
|
-
return (
|
97
|
-
|
101
|
+
return this.getCustomErrorMessage(
|
102
|
+
errorAttributes.patternMismatch,
|
98
103
|
this.defaultErrorMsgPatternMismatch
|
99
104
|
);
|
100
105
|
case typeMismatch:
|
101
|
-
return (
|
102
|
-
|
103
|
-
this.getAttribute(errorAttributes.patternMismatch) ||
|
106
|
+
return this.getCustomErrorMessage(
|
107
|
+
errorAttributes.typeMismatch,
|
104
108
|
this.defaultErrorMsgTypeMismatch
|
105
109
|
);
|
106
110
|
case tooShort:
|
107
|
-
return this.
|
111
|
+
return this.getCustomErrorMessage(errorAttributes.tooShort, this.defaultErrorMsgTooShort);
|
108
112
|
case tooLong:
|
109
|
-
return this.
|
113
|
+
return this.getCustomErrorMessage(errorAttributes.tooLong, this.defaultErrorMsgTooLong);
|
110
114
|
case rangeUnderflow:
|
111
|
-
return (
|
112
|
-
|
115
|
+
return this.getCustomErrorMessage(
|
116
|
+
errorAttributes.rangeUnderflow,
|
117
|
+
this.defaultErrorMsgRangeUnderflow
|
113
118
|
);
|
114
119
|
case rangeOverflow:
|
115
|
-
return (
|
116
|
-
|
120
|
+
return this.getCustomErrorMessage(
|
121
|
+
errorAttributes.rangeOverflow,
|
122
|
+
this.defaultErrorMsgRangeOverflow
|
117
123
|
);
|
118
124
|
case customError:
|
119
125
|
return this.validationMessage;
|