saasufy-components 3.33.0 → 3.34.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/README.md +1 -0
- package/model-input.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -509,6 +509,7 @@ Used for displaying and editing a single field of a model instance in real time.
|
|
|
509
509
|
- `accept`: This attribute should only be used if the `type` is set to `file`; it serves to constrain the types of files which can be selected by the user.
|
|
510
510
|
- `input-id`: Can be used to set an `id` attribute on the inner `input` element.
|
|
511
511
|
- `input-props`: Can be used to set additional attributes on the inner `input` element. Must be in the format `attr1=value1,attr2=value2`.
|
|
512
|
+
- `ignore-invalid-selection`: Can be used with a `model-input` component of type `select` to prevent the `error` class from being added if the selected value is not among the available options.
|
|
512
513
|
|
|
513
514
|
### model-text
|
|
514
515
|
|
package/model-input.js
CHANGED
|
@@ -42,7 +42,8 @@ class ModelInput extends SocketConsumer {
|
|
|
42
42
|
'autocapitalize',
|
|
43
43
|
'autocorrect',
|
|
44
44
|
'input-id',
|
|
45
|
-
'input-props'
|
|
45
|
+
'input-props',
|
|
46
|
+
'ignore-invalid-selection'
|
|
46
47
|
];
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -266,7 +267,12 @@ class ModelInput extends SocketConsumer {
|
|
|
266
267
|
}
|
|
267
268
|
|
|
268
269
|
verifyValue(fieldValue, optionList, inputElement, messageContainerElement) {
|
|
269
|
-
if (
|
|
270
|
+
if (
|
|
271
|
+
optionList &&
|
|
272
|
+
fieldValue != null &&
|
|
273
|
+
!optionList.includes(fieldValue) &&
|
|
274
|
+
!this.hasAttribute('ignore-invalid-selection')
|
|
275
|
+
) {
|
|
270
276
|
inputElement.classList.add('error');
|
|
271
277
|
inputElement.classList.remove('success');
|
|
272
278
|
if (messageContainerElement) {
|