saasufy-components 7.10.0 → 7.11.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 -1
- package/input-provider.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -696,7 +696,7 @@ This component can be configured to provide its data to multiple components (con
|
|
|
696
696
|
- `autocapitalize`: Can be `on` or `off` - It will set the auto-capitalize attribute on the inner input element. This is useful for mobile devices to enable or disable auto-capitalization of the first character which is typed into the input element.
|
|
697
697
|
- `autocorrect`: Can be `on` or `off` - It will set the auto-correct attribute on the inner input element. This is useful for mobile devices to enable or disable auto-correct.
|
|
698
698
|
- `input-props`: Can be used to set additional attributes on the inner `input` element. Must be in the format `attr1=value1,attr2=value2`.
|
|
699
|
-
- `skip-init-change`: This attribute can be used to prevent an `input-provider`
|
|
699
|
+
- `skip-init-change`: This attribute can be used to prevent an `input-provider` from triggering a change when initialized with a default value. By default, the `input-provider` will trigger a change when initialized with a default value.
|
|
700
700
|
- `force-init-change`: This attribute can be used to force an `input-provider` to always trigger a change when initialized, even if the value is empty.
|
|
701
701
|
|
|
702
702
|
### input-combiner
|
package/input-provider.js
CHANGED
|
@@ -74,6 +74,8 @@ class InputProvider extends HTMLElement {
|
|
|
74
74
|
if (forceInitChange) {
|
|
75
75
|
delete this.forceTriggerChange;
|
|
76
76
|
}
|
|
77
|
+
let skipInitChange = this.skipInitChange && !forceInitChange;
|
|
78
|
+
delete this.skipInitChange;
|
|
77
79
|
if (newValue && this.hasAttribute('computable-value')) {
|
|
78
80
|
newValue = renderTemplate(newValue, null, null, true);
|
|
79
81
|
}
|
|
@@ -86,14 +88,14 @@ class InputProvider extends HTMLElement {
|
|
|
86
88
|
} else {
|
|
87
89
|
this.inputElement.checked = newValue;
|
|
88
90
|
}
|
|
89
|
-
if (oldValue !== newValue || forceInitChange) {
|
|
91
|
+
if ((oldValue !== newValue || forceInitChange) && !skipInitChange) {
|
|
90
92
|
this.triggerChange();
|
|
91
93
|
}
|
|
92
94
|
return;
|
|
93
95
|
}
|
|
94
96
|
oldValue = this.inputElement.value;
|
|
95
97
|
this.inputElement.value = newValue;
|
|
96
|
-
if (oldValue !== newValue || forceInitChange) {
|
|
98
|
+
if ((oldValue !== newValue || forceInitChange) && !skipInitChange) {
|
|
97
99
|
this.triggerChange();
|
|
98
100
|
}
|
|
99
101
|
}
|
|
@@ -197,7 +199,9 @@ class InputProvider extends HTMLElement {
|
|
|
197
199
|
this.forceTriggerChange = true;
|
|
198
200
|
this.value = value;
|
|
199
201
|
} else if (value) {
|
|
200
|
-
if (
|
|
202
|
+
if (this.hasAttribute('skip-init-change')) {
|
|
203
|
+
this.skipInitChange = true;
|
|
204
|
+
} else if (type === 'select') {
|
|
201
205
|
this.forceTriggerChange = true;
|
|
202
206
|
}
|
|
203
207
|
this.value = value;
|