@descope/web-components-ui 1.98.0 → 1.99.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/web-components-ui",
3
- "version": "1.98.0",
3
+ "version": "1.99.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -76,19 +76,19 @@
76
76
  "lodash.debounce": "4.0.8",
77
77
  "lodash.merge": "4.6.2",
78
78
  "markdown-it": "14.1.0",
79
- "@descope-ui/common": "0.0.13",
80
- "@descope-ui/descope-button": "0.0.11",
81
- "@descope-ui/descope-image": "0.0.4",
82
- "@descope-ui/descope-icon": "0.0.10",
83
- "@descope-ui/descope-text": "0.0.13",
84
- "@descope-ui/descope-avatar": "0.0.13",
85
- "@descope-ui/descope-combo-box": "0.1.2",
86
- "@descope-ui/descope-autocomplete-field": "0.0.15",
87
- "@descope-ui/descope-address-field": "0.0.14",
88
- "@descope-ui/descope-timer": "0.0.9",
89
- "@descope-ui/descope-timer-button": "0.0.11",
90
- "@descope-ui/descope-password-strength": "0.0.6",
91
- "@descope-ui/descope-collapsible-container": "0.0.10"
79
+ "@descope-ui/common": "0.0.14",
80
+ "@descope-ui/descope-button": "0.0.12",
81
+ "@descope-ui/descope-image": "0.0.5",
82
+ "@descope-ui/descope-icon": "0.0.11",
83
+ "@descope-ui/descope-text": "0.0.14",
84
+ "@descope-ui/descope-avatar": "0.0.14",
85
+ "@descope-ui/descope-combo-box": "0.1.3",
86
+ "@descope-ui/descope-autocomplete-field": "0.0.16",
87
+ "@descope-ui/descope-address-field": "0.0.15",
88
+ "@descope-ui/descope-timer": "0.0.10",
89
+ "@descope-ui/descope-timer-button": "0.0.12",
90
+ "@descope-ui/descope-password-strength": "0.0.7",
91
+ "@descope-ui/descope-collapsible-container": "0.0.11"
92
92
  },
93
93
  "overrides": {
94
94
  "@vaadin/avatar": "24.3.4",
@@ -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
- this.getAttribute(errorAttributes.valueMissing) || this.defaultErrorMsgValueMissing
96
+ return this.getCustomErrorMessage(
97
+ errorAttributes.valueMissing,
98
+ this.defaultErrorMsgValueMissing
94
99
  );
95
100
  case patternMismatch || stepMismatch || badInput:
96
- return (
97
- this.getAttribute(errorAttributes.patternMismatch) ||
101
+ return this.getCustomErrorMessage(
102
+ errorAttributes.patternMismatch,
98
103
  this.defaultErrorMsgPatternMismatch
99
104
  );
100
105
  case typeMismatch:
101
- return (
102
- this.getAttribute(errorAttributes.typeMismatch) ||
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.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;
111
+ return this.getCustomErrorMessage(errorAttributes.tooShort, this.defaultErrorMsgTooShort);
108
112
  case tooLong:
109
- return this.getAttribute(errorAttributes.tooLong) || this.defaultErrorMsgTooLong;
113
+ return this.getCustomErrorMessage(errorAttributes.tooLong, this.defaultErrorMsgTooLong);
110
114
  case rangeUnderflow:
111
- return (
112
- this.getAttribute(errorAttributes.rangeUnderflow) || this.defaultErrorMsgRangeUnderflow
115
+ return this.getCustomErrorMessage(
116
+ errorAttributes.rangeUnderflow,
117
+ this.defaultErrorMsgRangeUnderflow
113
118
  );
114
119
  case rangeOverflow:
115
- return (
116
- this.getAttribute(errorAttributes.rangeOverflow) || this.defaultErrorMsgRangeOverflow
120
+ return this.getCustomErrorMessage(
121
+ errorAttributes.rangeOverflow,
122
+ this.defaultErrorMsgRangeOverflow
117
123
  );
118
124
  case customError:
119
125
  return this.validationMessage;