@schukai/monster 4.154.0 → 4.154.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 +1392 -19
- package/package.json +1 -1
- package/source/components/accessibility/locale-picker.mjs +6 -6
- package/source/components/accessibility/locale-select.mjs +1 -1
- package/source/components/content/camera-capture.mjs +3 -3
- package/source/components/content/copy.mjs +1 -1
- package/source/components/content/fetch-box.mjs +1 -1
- package/source/components/content/image-editor.mjs +2 -4
- package/source/components/content/viewer/html.mjs +2 -2
- package/source/components/content/viewer/message.mjs +3 -3
- package/source/components/content/viewer/sanitize-html.mjs +1 -1
- package/source/components/data/kpi-tile.mjs +5 -5
- package/source/components/data/metric-graph.mjs +2 -2
- package/source/components/data/metric.mjs +1 -1
- package/source/components/datatable/change-button.mjs +1 -1
- package/source/components/datatable/columnbar.mjs +2 -2
- package/source/components/datatable/datasource/rest.mjs +2 -4
- package/source/components/datatable/datatable.mjs +3 -3
- package/source/components/datatable/filter/date-presets.mjs +1 -1
- package/source/components/datatable/filter/input.mjs +1 -1
- package/source/components/datatable/filter/range.mjs +1 -1
- package/source/components/datatable/filter/settings.mjs +1 -3
- package/source/components/datatable/filter/text-operator.mjs +1 -1
- package/source/components/datatable/filter.mjs +1 -1
- package/source/components/datatable/pagination.mjs +2 -4
- package/source/components/datatable/status.mjs +1 -1
- package/source/components/files/file-manager.mjs +1 -1
- package/source/components/form/action-button.mjs +1 -1
- package/source/components/form/api-bar.mjs +1 -1
- package/source/components/form/buy-box.mjs +1 -1
- package/source/components/form/cart-control.mjs +1 -1
- package/source/components/form/checklist.mjs +1 -1
- package/source/components/form/digits.mjs +4 -4
- package/source/components/form/dropzone.mjs +1 -1
- package/source/components/form/field-set.mjs +1 -1
- package/source/components/form/input-group.mjs +1 -1
- package/source/components/form/login.mjs +15 -15
- package/source/components/form/password.mjs +1 -1
- package/source/components/form/popper.mjs +1 -0
- package/source/components/form/repeat-field-set.mjs +1 -1
- package/source/components/form/select-link.mjs +3 -0
- package/source/components/form/select.mjs +33 -33
- package/source/components/form/sheet.mjs +3 -0
- package/source/components/form/tabs.mjs +1 -0
- package/source/components/form/toggle-switch.mjs +1 -1
- package/source/components/form/util/fetch.mjs +3 -3
- package/source/components/form/variant-select.mjs +1 -1
- package/source/components/form/wizard.mjs +1 -3
- package/source/components/host/collapse.mjs +1 -0
- package/source/components/host/config-manager.mjs +2 -2
- package/source/components/host/details.mjs +1 -0
- package/source/components/host/host.mjs +2 -2
- package/source/components/host/overlay.mjs +1 -0
- package/source/components/host/viewer.mjs +1 -0
- package/source/components/layout/board.mjs +1 -1
- package/source/components/layout/collapse.mjs +2 -2
- package/source/components/layout/details.mjs +1 -1
- package/source/components/layout/full-screen.mjs +2 -2
- package/source/components/layout/popper.mjs +1 -1
- package/source/components/layout/tabs.mjs +5 -8
- package/source/components/layout/utils/attach-tabs-hash-sync.mjs +1 -1
- package/source/components/layout/vertical-tabs.mjs +5 -8
- package/source/components/navigation/site-navigation.mjs +3 -3
- package/source/components/navigation/table-of-content.mjs +1 -1
- package/source/components/navigation/wizard-navigation.mjs +9 -11
- package/source/components/notify/monitor-attribute-errors.mjs +1 -1
- package/source/components/time/day.mjs +1 -1
- package/source/components/time/month-calendar.mjs +8 -8
- package/source/components/time/timeline/appointment.mjs +1 -1
- package/source/components/time/timeline/segment.mjs +1 -1
- package/source/components/tree-menu/tree-menu.mjs +0 -1
- package/source/data/datasource/dom.mjs +1 -0
- package/source/dom/customelement.mjs +13 -13
- package/source/dom/sanitize-html.mjs +1 -1
- package/source/i18n/internal.mjs +2 -2
- package/source/i18n/providers/embed.mjs +1 -1
- package/source/i18n/time-ago.mjs +1 -1
- package/source/text/formatter.mjs +1 -0
- package/source/types/dataurl.mjs +1 -0
- package/source/types/has.mjs +1 -1
- package/source/types/is.mjs +2 -2
- package/source/types/mediatype.mjs +1 -0
- package/source/types/observer.mjs +6 -6
- package/source/types/observerlist.mjs +1 -0
- package/source/types/proxyobserver.mjs +1 -0
- package/source/types/stack.mjs +1 -0
- package/source/types/tokenlist.mjs +1 -0
- package/source/types/uuid.mjs +1 -0
- package/source/util/accessiblecolor.mjs +2 -2
- package/source/util/comparator.mjs +3 -3
- package/source/util/deadmansswitch.mjs +3 -4
- package/source/util/processing.mjs +1 -1
- package/test/cases/components/datatable/drag-scroll.mjs +51 -9
- package/test/cases/components/navigation/site-navigation.mjs +10 -1
|
@@ -38,17 +38,17 @@ export { Comparator };
|
|
|
38
38
|
* }).equal({v: 2}, {v: 2}); // ↦ true
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
|
-
* @example /example/comparator/simple/ Simple example
|
|
42
41
|
* @license AGPLv3
|
|
43
42
|
* @since 1.3.0
|
|
43
|
+
* @summary Wraps customizable comparison operations for arbitrary values.
|
|
44
44
|
*/
|
|
45
45
|
class Comparator extends Base {
|
|
46
46
|
/**
|
|
47
47
|
* create new comparator
|
|
48
48
|
*
|
|
49
49
|
* @param {Monster.Util~exampleCallback} [callback] Comparator callback
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
50
|
+
* @throws {TypeError} unsupported type
|
|
51
|
+
* @throws {TypeError} impractical comparison
|
|
52
52
|
*/
|
|
53
53
|
constructor(callback) {
|
|
54
54
|
super();
|
|
@@ -24,7 +24,6 @@ export { DeadMansSwitch };
|
|
|
24
24
|
* The dead man's switch allows setting a timer which can be reset again
|
|
25
25
|
* and again within a defined period of time.
|
|
26
26
|
*
|
|
27
|
-
* @example /example/util/deadmansswitch/simple/ Simple example
|
|
28
27
|
* @copyright Volker Schukai
|
|
29
28
|
* @license AGPLv3
|
|
30
29
|
* @since 1.29.0
|
|
@@ -36,7 +35,7 @@ class DeadMansSwitch extends Base {
|
|
|
36
35
|
*
|
|
37
36
|
* @param {Integer} delay
|
|
38
37
|
* @param {function} callback
|
|
39
|
-
* @
|
|
38
|
+
* @throws {TypeError} the arguments must be either integer or functions
|
|
40
39
|
* @throws {TypeError} value is not an integer
|
|
41
40
|
*/
|
|
42
41
|
constructor(delay, callback) {
|
|
@@ -47,7 +46,7 @@ class DeadMansSwitch extends Base {
|
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* @param delay
|
|
50
|
-
* @
|
|
49
|
+
* @return {DeadMansSwitch}
|
|
51
50
|
* @throws {Error} has already run
|
|
52
51
|
* @throws {Error} unsupported argument
|
|
53
52
|
*/
|
|
@@ -70,7 +69,7 @@ class DeadMansSwitch extends Base {
|
|
|
70
69
|
|
|
71
70
|
/**
|
|
72
71
|
* @throws {Error} has already run
|
|
73
|
-
* @
|
|
72
|
+
* @return {DeadMansSwitch}
|
|
74
73
|
*/
|
|
75
74
|
defuse() {
|
|
76
75
|
if (this[internalSymbol]["isAlreadyRun"] === true) {
|
|
@@ -54,7 +54,7 @@ class Processing extends Base {
|
|
|
54
54
|
*
|
|
55
55
|
* So the execution time is timeout1+timeout1+timeout1+timeout2
|
|
56
56
|
*
|
|
57
|
-
* @
|
|
57
|
+
* @throws {TypeError} the arguments must be either integer or functions
|
|
58
58
|
* @param {...(int|function)} args
|
|
59
59
|
*/
|
|
60
60
|
constructor(...args) {
|
|
@@ -6,6 +6,25 @@ import { ResizeObserverMock } from "../../../util/resize-observer.mjs";
|
|
|
6
6
|
const expect = chai.expect;
|
|
7
7
|
chai.use(chaiDom);
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Waits for a value to appear instead of for a fixed delay.
|
|
11
|
+
*
|
|
12
|
+
* The components under test attach their ResizeObserver inside a
|
|
13
|
+
* requestAnimationFrame, so the precondition is a frame, not a number of
|
|
14
|
+
* milliseconds. A headless browser without a compositor schedules frames less
|
|
15
|
+
* regularly, which is why a fixed 30ms wait failed in CI webkit while passing
|
|
16
|
+
* everywhere else. The deadline keeps a genuine absence failing.
|
|
17
|
+
*/
|
|
18
|
+
async function waitForValue(produce, timeout = 2000, interval = 10) {
|
|
19
|
+
const deadline = Date.now() + timeout;
|
|
20
|
+
for (;;) {
|
|
21
|
+
const value = produce();
|
|
22
|
+
if (value !== undefined && value !== null) return value;
|
|
23
|
+
if (Date.now() >= deadline) return value;
|
|
24
|
+
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
// Supply geometry before the first layout can populate the measurement cache.
|
|
10
29
|
function installColumnBarGeometry(parentWidth) {
|
|
11
30
|
const original = HTMLElement.prototype.getBoundingClientRect;
|
|
@@ -434,10 +453,13 @@ describe("Datatable drag scroll", function () {
|
|
|
434
453
|
);
|
|
435
454
|
expect(control).to.exist;
|
|
436
455
|
expect(control.classList.contains("small")).to.equal(false);
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
456
|
+
const tableResizeObserver = await waitForValue(() =>
|
|
457
|
+
TrackingResizeObserver.instances.find((observer) =>
|
|
458
|
+
observer.elements.includes(wrapper),
|
|
459
|
+
),
|
|
440
460
|
);
|
|
461
|
+
|
|
462
|
+
expect(TrackingResizeObserver.instances).to.have.length.greaterThan(0);
|
|
441
463
|
expect(tableResizeObserver).to.exist;
|
|
442
464
|
|
|
443
465
|
let scheduledCallback = null;
|
|
@@ -456,6 +478,10 @@ describe("Datatable drag scroll", function () {
|
|
|
456
478
|
scheduledCallback();
|
|
457
479
|
|
|
458
480
|
expect(control.classList.contains("small")).to.equal(true);
|
|
481
|
+
|
|
482
|
+
// The responsive layout stays in the document otherwise, and the
|
|
483
|
+
// browser keeps rendering it for the rest of the run.
|
|
484
|
+
wrapper.remove();
|
|
459
485
|
} finally {
|
|
460
486
|
window.ResizeObserver = OriginalResizeObserver;
|
|
461
487
|
globalThis.ResizeObserver = originalGlobalResizeObserver;
|
|
@@ -546,8 +572,10 @@ describe("Datatable drag scroll", function () {
|
|
|
546
572
|
dotsContainer.querySelector(".dots-overflow-indicator"),
|
|
547
573
|
).to.equal(null);
|
|
548
574
|
|
|
549
|
-
const columnBarResizeObserver =
|
|
550
|
-
(observer) =>
|
|
575
|
+
const columnBarResizeObserver = await waitForValue(() =>
|
|
576
|
+
TrackingResizeObserver.instances.find((observer) =>
|
|
577
|
+
observer.elements.includes(control),
|
|
578
|
+
),
|
|
551
579
|
);
|
|
552
580
|
expect(columnBarResizeObserver).to.exist;
|
|
553
581
|
|
|
@@ -660,16 +688,30 @@ describe("Datatable drag scroll", function () {
|
|
|
660
688
|
const first = await createColumnBar();
|
|
661
689
|
const second = await createColumnBar();
|
|
662
690
|
|
|
663
|
-
const firstResizeObserver =
|
|
664
|
-
(observer) =>
|
|
691
|
+
const firstResizeObserver = await waitForValue(() =>
|
|
692
|
+
TrackingResizeObserver.instances.find((observer) =>
|
|
693
|
+
observer.elements.includes(first.control),
|
|
694
|
+
),
|
|
665
695
|
);
|
|
666
|
-
const secondResizeObserver =
|
|
667
|
-
(observer) =>
|
|
696
|
+
const secondResizeObserver = await waitForValue(() =>
|
|
697
|
+
TrackingResizeObserver.instances.find((observer) =>
|
|
698
|
+
observer.elements.includes(second.control),
|
|
699
|
+
),
|
|
668
700
|
);
|
|
669
701
|
|
|
670
702
|
expect(firstResizeObserver).to.exist;
|
|
671
703
|
expect(secondResizeObserver).to.exist;
|
|
672
704
|
|
|
705
|
+
// Drain initialization work from the module-level shared frame before
|
|
706
|
+
// replacing requestAnimationFrame. Otherwise a slow renderer can still
|
|
707
|
+
// have that frame pending and the observer updates correctly join it,
|
|
708
|
+
// leaving the spy below with no newly scheduled callback.
|
|
709
|
+
await new Promise((resolve) => {
|
|
710
|
+
window.requestAnimationFrame(() =>
|
|
711
|
+
window.requestAnimationFrame(resolve),
|
|
712
|
+
);
|
|
713
|
+
});
|
|
714
|
+
|
|
673
715
|
const scheduledCallbacks = [];
|
|
674
716
|
window.requestAnimationFrame = (callback) => {
|
|
675
717
|
scheduledCallbacks.push(callback);
|
|
@@ -77,7 +77,16 @@ describe("SiteNavigation", function () {
|
|
|
77
77
|
resizeObserver.triggerResize([]);
|
|
78
78
|
resizeObserver.triggerResize([]);
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
// The component debounces resizes with a 200ms DeadMansSwitch and then
|
|
81
|
+
// requests exactly one frame. Waiting 260ms left 60ms of margin over
|
|
82
|
+
// that debounce, which is not enough under software rendering: the run
|
|
83
|
+
// then measured zero scheduled frames. Waiting for the first request
|
|
84
|
+
// keeps the coalescing assertion strict without assuming wall clock.
|
|
85
|
+
const deadline = Date.now() + 5000;
|
|
86
|
+
while (scheduledCallbacks.length === 0 && Date.now() < deadline) {
|
|
87
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
88
|
+
}
|
|
89
|
+
|
|
81
90
|
expect(scheduledCallbacks.length).to.equal(1);
|
|
82
91
|
scheduledCallbacks.shift()();
|
|
83
92
|
} finally {
|