@schukai/monster 4.124.0 → 4.124.2
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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/source/components/datatable/datatable.mjs +6 -4
- package/source/components/datatable/save-button.mjs +10 -16
- package/source/components/datatable/style/datatable.pcss +6 -1
- package/source/components/datatable/stylesheet/datatable.mjs +1 -1
- package/source/components/form/digits.mjs +41 -16
- package/source/components/form/login.mjs +3 -2
- package/source/components/form/popper-button.mjs +4 -1
- package/source/components/form/select.mjs +3546 -3544
- package/source/components/form/toggle-switch.mjs +465 -465
- package/source/components/host/host.mjs +7 -2
- package/source/components/layout/popper.mjs +4 -1
|
@@ -100,10 +100,11 @@ class Digits extends CustomControl {
|
|
|
100
100
|
* @property {string} value
|
|
101
101
|
*/
|
|
102
102
|
set value(value) {
|
|
103
|
-
const
|
|
103
|
+
const normalizedValue = value == null ? "" : String(value);
|
|
104
|
+
const chars = normalizedValue.split("");
|
|
104
105
|
|
|
105
|
-
this.setOption("value",
|
|
106
|
-
this.setFormValue(
|
|
106
|
+
this.setOption("value", normalizedValue);
|
|
107
|
+
this.setFormValue(normalizedValue);
|
|
107
108
|
|
|
108
109
|
if (chars.every(checkCharacter.bind(this))) {
|
|
109
110
|
this.setValidity({ badInput: false }, "");
|
|
@@ -209,7 +210,9 @@ function updateDigitControls() {
|
|
|
209
210
|
|
|
210
211
|
const controls = [];
|
|
211
212
|
|
|
212
|
-
const values = this.getOption("value")
|
|
213
|
+
const values = this.getOption("value") == null
|
|
214
|
+
? ""
|
|
215
|
+
: String(this.getOption("value"));
|
|
213
216
|
|
|
214
217
|
if (this[digitsElementSymbol]) {
|
|
215
218
|
this[digitsElementSymbol].style.gridTemplateColumns =
|
|
@@ -218,11 +221,17 @@ function updateDigitControls() {
|
|
|
218
221
|
|
|
219
222
|
for (let i = 0; i < digits; i++) {
|
|
220
223
|
controls.push({
|
|
221
|
-
value: values[i] ?? "
|
|
224
|
+
value: values[i] ?? "",
|
|
222
225
|
});
|
|
223
226
|
}
|
|
224
227
|
|
|
225
228
|
this.setOption("digitsControls", controls);
|
|
229
|
+
|
|
230
|
+
// Keep real input.value in sync with the option model. Attribute updates alone
|
|
231
|
+
// can drift after user interaction because inputs keep an internal dirty value.
|
|
232
|
+
setTimeout(() => {
|
|
233
|
+
syncInputValues.call(this, controls);
|
|
234
|
+
}, 0);
|
|
226
235
|
}
|
|
227
236
|
|
|
228
237
|
/**
|
|
@@ -287,7 +296,7 @@ function initEventHandler() {
|
|
|
287
296
|
}
|
|
288
297
|
|
|
289
298
|
if (pressedKey === "Backspace") {
|
|
290
|
-
if (inputControl.value !== ""
|
|
299
|
+
if (inputControl.value !== "") {
|
|
291
300
|
event.preventDefault();
|
|
292
301
|
inputControl.value = "";
|
|
293
302
|
collectValues.call(self);
|
|
@@ -313,16 +322,14 @@ function initEventHandler() {
|
|
|
313
322
|
return;
|
|
314
323
|
}
|
|
315
324
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
nextControl.focus();
|
|
322
|
-
}
|
|
323
|
-
collectValues.call(self);
|
|
324
|
-
return;
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
inputControl.value = pressedKey;
|
|
327
|
+
const nextControl = inputControl.nextElementSibling;
|
|
328
|
+
if (nextControl && nextControl.tagName === "INPUT") {
|
|
329
|
+
nextControl.focus();
|
|
325
330
|
}
|
|
331
|
+
collectValues.call(self);
|
|
332
|
+
return;
|
|
326
333
|
}
|
|
327
334
|
});
|
|
328
335
|
|
|
@@ -344,10 +351,28 @@ function initEventHandler() {
|
|
|
344
351
|
function collectValues() {
|
|
345
352
|
const controlsValues = Array.from(
|
|
346
353
|
this[digitsElementSymbol].querySelectorAll("input"),
|
|
347
|
-
).map((input) => input.value || "
|
|
354
|
+
).map((input) => input.value || "");
|
|
348
355
|
this.value = controlsValues.join("");
|
|
349
356
|
}
|
|
350
357
|
|
|
358
|
+
/**
|
|
359
|
+
* @private
|
|
360
|
+
* @param {Array<{value:string}>} controls
|
|
361
|
+
* @returns {void}
|
|
362
|
+
*/
|
|
363
|
+
function syncInputValues(controls) {
|
|
364
|
+
if (!this[digitsElementSymbol]) return;
|
|
365
|
+
const inputs = this[digitsElementSymbol].querySelectorAll("input");
|
|
366
|
+
if (!inputs.length) return;
|
|
367
|
+
|
|
368
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
369
|
+
const nextValue = controls?.[i]?.value ?? "";
|
|
370
|
+
if (inputs[i].value !== nextValue) {
|
|
371
|
+
inputs[i].value = nextValue;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
351
376
|
/**
|
|
352
377
|
* @private
|
|
353
378
|
* @return {void}
|
|
@@ -1490,8 +1490,9 @@ function initEventHandler() {
|
|
|
1490
1490
|
getWindow()
|
|
1491
1491
|
.fetch(url, options)
|
|
1492
1492
|
.then((response) => {
|
|
1493
|
-
const disabledCodes =
|
|
1494
|
-
|
|
1493
|
+
const disabledCodes = this.getOption(
|
|
1494
|
+
"behavior.passwordResetDisabledStatusCodes",
|
|
1495
|
+
) || [401];
|
|
1495
1496
|
const isResetDisabled =
|
|
1496
1497
|
disabledCodes.includes(response.status) &&
|
|
1497
1498
|
response.headers.has("x-password-reset") &&
|
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
assembleMethodSymbol,
|
|
19
19
|
registerCustomElement,
|
|
20
20
|
} from "../../dom/customelement.mjs";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
findElementWithSelectorUpwards,
|
|
23
|
+
getDocument,
|
|
24
|
+
} from "../../dom/util.mjs";
|
|
22
25
|
import { isFunction } from "../../types/is.mjs";
|
|
23
26
|
import { DeadMansSwitch } from "../../util/deadmansswitch.mjs";
|
|
24
27
|
import { Popper } from "../layout/popper.mjs";
|