@rettangoli/ui 0.1.12 → 0.1.14
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/rettangoli-iife-layout.min.js +8 -8
- package/dist/rettangoli-iife-ui.min.js +24 -24
- package/package.json +1 -1
- package/src/components/form/form.handlers.js +60 -5
- package/src/components/form/form.store.js +7 -14
- package/src/components/form/form.view.yaml +11 -19
- package/src/components/globalUi/globalUi.handlers.js +30 -8
- package/src/components/globalUi/globalUi.store.js +1 -1
- package/src/components/popoverInput/popoverInput.handlers.js +8 -7
- package/src/components/popoverInput/popoverInput.store.js +3 -5
- package/src/components/popoverInput/popoverInput.view.yaml +6 -16
- package/src/components/select/select.handlers.js +11 -4
- package/src/components/select/select.store.js +9 -8
- package/src/components/select/select.view.yaml +6 -2
- package/src/components/sliderInput/sliderInput.handlers.js +5 -11
- package/src/components/sliderInput/sliderInput.view.yaml +10 -9
- package/src/deps/createGlobalUI.js +18 -1
- package/src/primitives/input.js +15 -16
package/src/primitives/input.js
CHANGED
|
@@ -123,17 +123,26 @@ class RettangoliInputElement extends HTMLElement {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
126
|
-
|
|
127
|
-
if (name === "key" && oldValue !== newValue) {
|
|
126
|
+
if (name === 'value') {
|
|
128
127
|
requestAnimationFrame((() => {
|
|
129
128
|
const value = this.getAttribute("value");
|
|
130
129
|
this._inputElement.value = value ?? "";
|
|
131
130
|
}))
|
|
132
|
-
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (name === 'placeholder') {
|
|
134
|
+
requestAnimationFrame((() => {
|
|
135
|
+
const placeholder = this.getAttribute("placeholder");
|
|
136
|
+
if (placeholder === undefined || placeholder === 'null') {
|
|
137
|
+
this._inputElement.removeAttribute('placeholder');
|
|
138
|
+
} else {
|
|
139
|
+
this._inputElement.setAttribute('placeholder', placeholder ?? "");
|
|
140
|
+
}
|
|
141
|
+
}))
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
// Handle input-specific attributes first
|
|
136
|
-
if (["type", "
|
|
145
|
+
if (["type", "disabled", "step", "s"].includes(name)) {
|
|
137
146
|
this._updateInputAttributes();
|
|
138
147
|
return;
|
|
139
148
|
}
|
|
@@ -205,23 +214,13 @@ class RettangoliInputElement extends HTMLElement {
|
|
|
205
214
|
|
|
206
215
|
_updateInputAttributes() {
|
|
207
216
|
const type = this.getAttribute("type") || "text";
|
|
208
|
-
const placeholder = this.getAttribute("placeholder");
|
|
209
|
-
const value = this.getAttribute("value");
|
|
217
|
+
// const placeholder = this.getAttribute("placeholder");
|
|
218
|
+
// const value = this.getAttribute("value");
|
|
210
219
|
const step = this.getAttribute("step");
|
|
211
220
|
const isDisabled = this.hasAttribute('disabled');
|
|
212
221
|
|
|
213
222
|
this._inputElement.setAttribute("type", type);
|
|
214
223
|
|
|
215
|
-
if (placeholder !== null) {
|
|
216
|
-
this._inputElement.setAttribute("placeholder", placeholder);
|
|
217
|
-
} else {
|
|
218
|
-
this._inputElement.removeAttribute("placeholder");
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (value !== null) {
|
|
222
|
-
this._inputElement.value = value;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
224
|
if (step !== null) {
|
|
226
225
|
this._inputElement.setAttribute("step", step);
|
|
227
226
|
} else {
|