@schukai/monster 3.54.0 → 3.55.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +25 -0
- package/package.json +1 -1
- package/source/components/datatable/datasource/rest.mjs +93 -57
- package/source/components/datatable/datatable/header.mjs +8 -0
- package/source/components/datatable/datatable.mjs +88 -44
- package/source/components/datatable/embedded-pagination.mjs +24 -43
- package/source/components/datatable/filter/util.mjs +138 -0
- package/source/components/datatable/filter.mjs +418 -174
- package/source/components/datatable/pagination.mjs +26 -2
- package/source/components/datatable/status.mjs +226 -0
- package/source/components/datatable/style/datatable.pcss +1 -0
- package/source/components/datatable/style/embedded-pagination.pcss +59 -2
- package/source/components/datatable/style/filter.pcss +4 -0
- package/source/components/datatable/style/pagination.pcss +28 -4
- package/source/components/datatable/style/status.pcss +42 -0
- package/source/components/datatable/stylesheet/column-bar.mjs +15 -9
- package/source/components/datatable/stylesheet/dataset.mjs +14 -8
- package/source/components/datatable/stylesheet/datasource.mjs +14 -8
- package/source/components/datatable/stylesheet/datatable.mjs +15 -9
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +14 -8
- package/source/components/datatable/stylesheet/filter-button.mjs +15 -9
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +14 -8
- package/source/components/datatable/stylesheet/filter-date-range.mjs +14 -8
- package/source/components/datatable/stylesheet/filter-range.mjs +14 -8
- package/source/components/datatable/stylesheet/filter.mjs +15 -9
- package/source/components/datatable/stylesheet/pagination.mjs +15 -9
- package/source/components/datatable/stylesheet/select-filter.mjs +14 -8
- package/source/components/datatable/stylesheet/status.mjs +33 -0
- package/source/components/form/action-button.mjs +3 -1
- package/source/components/form/api-button.mjs +1 -1
- package/source/components/form/button-bar.mjs +1 -1
- package/source/components/form/button.mjs +1 -1
- package/source/components/form/confirm-button.mjs +3 -1
- package/source/components/form/context-error.mjs +272 -0
- package/source/components/form/context-help.mjs +7 -5
- package/source/components/form/form.mjs +4 -2
- package/source/components/form/message-state-button.mjs +4 -2
- package/source/components/form/popper-button.mjs +9 -4
- package/source/components/form/popper.mjs +11 -3
- package/source/components/form/reload.mjs +1 -1
- package/source/components/form/select.mjs +3 -3
- package/source/components/form/shadow-reload.mjs +1 -1
- package/source/components/form/state-button.mjs +4 -1
- package/source/components/form/style/context-error.pcss +32 -0
- package/source/components/form/style/context-help.pcss +22 -5
- package/source/components/form/stylesheet/action-button.mjs +14 -8
- package/source/components/form/stylesheet/api-button.mjs +14 -8
- package/source/components/form/stylesheet/button-bar.mjs +14 -8
- package/source/components/form/stylesheet/button.mjs +14 -8
- package/source/components/form/stylesheet/confirm-button.mjs +14 -8
- package/source/components/form/stylesheet/context-error.mjs +33 -0
- package/source/components/form/stylesheet/context-help.mjs +15 -9
- package/source/components/form/stylesheet/form.mjs +14 -8
- package/source/components/form/stylesheet/message-state-button.mjs +14 -8
- package/source/components/form/stylesheet/popper-button.mjs +14 -8
- package/source/components/form/stylesheet/popper.mjs +14 -8
- package/source/components/form/stylesheet/select.mjs +15 -9
- package/source/components/form/stylesheet/state-button.mjs +14 -8
- package/source/components/form/stylesheet/tabs.mjs +15 -9
- package/source/components/form/stylesheet/tree-select.mjs +14 -8
- package/source/components/form/tabs.mjs +53 -7
- package/source/components/form/template.mjs +1 -1
- package/source/components/form/tree-select.mjs +1 -1
- package/source/components/host/collapse.mjs +20 -5
- package/source/components/host/config-manager.mjs +41 -2
- package/source/components/host/host.mjs +14 -0
- package/source/components/host/stylesheet/call-button.mjs +15 -9
- package/source/components/host/stylesheet/collapse.mjs +14 -8
- package/source/components/host/stylesheet/config-manager.mjs +14 -8
- package/source/components/host/stylesheet/details.mjs +14 -8
- package/source/components/host/stylesheet/host.mjs +14 -8
- package/source/components/host/stylesheet/overlay.mjs +15 -9
- package/source/components/host/stylesheet/toggle-button.mjs +15 -9
- package/source/components/host/stylesheet/viewer.mjs +14 -8
- package/source/components/host/util.mjs +6 -1
- package/source/components/notify/stylesheet/message.mjs +15 -9
- package/source/components/notify/stylesheet/notify.mjs +14 -8
- package/source/components/state/stylesheet/log.mjs +14 -8
- package/source/components/state/stylesheet/state.mjs +14 -8
- package/source/components/stylesheet/badge.mjs +14 -8
- package/source/components/stylesheet/border.mjs +14 -8
- package/source/components/stylesheet/button.mjs +14 -8
- package/source/components/stylesheet/card.mjs +14 -8
- package/source/components/stylesheet/color.mjs +14 -8
- package/source/components/stylesheet/common.mjs +14 -8
- package/source/components/stylesheet/control.mjs +14 -8
- package/source/components/stylesheet/data-grid.mjs +14 -8
- package/source/components/stylesheet/display.mjs +14 -8
- package/source/components/stylesheet/floating-ui.mjs +14 -8
- package/source/components/stylesheet/form.mjs +14 -8
- package/source/components/stylesheet/host.mjs +14 -8
- package/source/components/stylesheet/icons.mjs +15 -9
- package/source/components/stylesheet/link.mjs +14 -8
- package/source/components/stylesheet/normalize.mjs +14 -8
- package/source/components/stylesheet/popper.mjs +14 -8
- package/source/components/stylesheet/property.mjs +14 -8
- package/source/components/stylesheet/ripple.mjs +14 -8
- package/source/components/stylesheet/skeleton.mjs +14 -8
- package/source/components/stylesheet/space.mjs +14 -8
- package/source/components/stylesheet/spinner.mjs +14 -8
- package/source/components/stylesheet/table.mjs +14 -8
- package/source/components/stylesheet/theme.mjs +14 -8
- package/source/components/stylesheet/typography.mjs +14 -8
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +14 -8
- package/source/data/transformer.mjs +38 -43
- package/source/dom/attributes.mjs +5 -5
- package/source/dom/customelement.mjs +1 -1
- package/source/dom/updater.mjs +14 -5
- package/source/dom/util.mjs +42 -0
- package/source/i18n/providers/embed.mjs +3 -3
- package/source/monster.mjs +5 -0
- package/source/text/formatter.mjs +2 -2
- package/source/types/noderecursiveiterator.mjs +9 -7
- package/source/types/observer.mjs +1 -1
- package/source/types/version.mjs +1 -1
- package/source/util/sleep.mjs +17 -0
- package/test/cases/components/form/button.mjs +2 -1
- package/test/cases/components/form/select.mjs +1 -1
- package/test/cases/components/form/tree-select.mjs +1 -1
- package/test/cases/data/transformer.mjs +2 -2
- package/test/cases/dom/updater.mjs +67 -46
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +18 -13
@@ -1,15 +1,14 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and contributors
|
2
|
+
* Copyright schukai GmbH and contributors 2024. All Rights Reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
4
|
* This file is licensed under the AGPLv3 License.
|
6
5
|
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
6
|
*/
|
8
7
|
|
9
|
-
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
10
|
-
import {ATTRIBUTE_ERRORMESSAGE} from "../../../dom/constants.mjs";
|
8
|
+
import { addAttributeToken } from "../../../dom/attributes.mjs";
|
9
|
+
import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";
|
11
10
|
|
12
|
-
export {TreeMenuStyleSheet}
|
11
|
+
export { TreeMenuStyleSheet };
|
13
12
|
|
14
13
|
/**
|
15
14
|
* @private
|
@@ -18,10 +17,17 @@ export {TreeMenuStyleSheet}
|
|
18
17
|
const TreeMenuStyleSheet = new CSSStyleSheet();
|
19
18
|
|
20
19
|
try {
|
21
|
-
|
20
|
+
TreeMenuStyleSheet.insertRule(
|
21
|
+
`
|
22
22
|
@layer treemenu {
|
23
23
|
:host{border:1px solid #08e808;box-sizing:border-box;display:flex;height:100%;width:100%}[data-monster-role=control]{height:100%;overflow-x:hidden;overflow-y:auto;scrollbar-color:transparent transparent;width:100%}::-webkit-scrollbar{height:10px;width:5px}::-webkit-scrollbar-thumb{background:rgba(0,0,0,.35)}::-webkit-scrollbar-track{background:transparent}[data-monster-role=button]{background:none;border:0;display:block;overflow:hidden;padding:5px;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%}[data-monster-role=entry][data-monster-visibility=hidden]{display:none}[data-monster-role=entry] .dropzone{background-color:red;height:20px;width:100%}[data-monster-role=entry][data-monster-intend=\"0\"]{display:flex;font-size:1rem;margin:0}[data-monster-role=entry][data-monster-intend=\"1\"]{margin:0 0 0 20px}[data-monster-role=entry][data-monster-intend=\"2\"]{font-size:.75rem;margin:0 0 0 40px}[data-monster-role=entry][data-monster-intend=\"3\"]{font-size:.7rem;margin:0 0 0 60px}[data-monster-role=entry][data-monster-intend=\"4\"]{font-size:.65rem;margin:0 0 0 80px}[data-monster-role=entry][data-monster-intend=\"5\"]{font-size:.65rem;margin:0 0 0 100px}[data-monster-role=entry][data-monster-intend=\"6\"]{font-size:.65rem;margin:0 0 0 110px}[data-monster-role=entry][data-monster-intend=\"7\"]{font-size:.65rem;margin:0 0 0 120px}[data-monster-role=entry][data-monster-intend=\"8\"]{font-size:.65rem;margin:0 0 0 130px}
|
24
|
-
}`,
|
24
|
+
}`,
|
25
|
+
0,
|
26
|
+
);
|
25
27
|
} catch (e) {
|
26
|
-
|
28
|
+
addAttributeToken(
|
29
|
+
document.getRootNode().querySelector("html"),
|
30
|
+
ATTRIBUTE_ERRORMESSAGE,
|
31
|
+
e + "",
|
32
|
+
);
|
27
33
|
}
|
@@ -328,45 +328,10 @@ function transform(value) {
|
|
328
328
|
let trueStatement = args.shift() || undefined;
|
329
329
|
let falseStatement = args.shift() || undefined;
|
330
330
|
|
331
|
-
|
332
|
-
|
333
|
-
}
|
334
|
-
if (trueStatement === "\\value") {
|
335
|
-
trueStatement = "value";
|
336
|
-
}
|
337
|
-
|
338
|
-
if (trueStatement === "\\undefined") {
|
339
|
-
trueStatement = undefined;
|
340
|
-
}
|
341
|
-
|
342
|
-
if (trueStatement === "\\null") {
|
343
|
-
trueStatement = null;
|
344
|
-
}
|
345
|
-
|
346
|
-
if (falseStatement === "value") {
|
347
|
-
falseStatement = value;
|
348
|
-
}
|
349
|
-
if (falseStatement === "\\value") {
|
350
|
-
falseStatement = "value";
|
351
|
-
}
|
352
|
-
|
353
|
-
if (falseStatement === "\\undefined") {
|
354
|
-
falseStatement = undefined;
|
355
|
-
}
|
356
|
-
|
357
|
-
if (falseStatement === "\\null") {
|
358
|
-
falseStatement = null;
|
359
|
-
}
|
331
|
+
trueStatement = convertSpecialStrings(trueStatement, value);
|
332
|
+
falseStatement = convertSpecialStrings(falseStatement, value);
|
360
333
|
|
361
|
-
const condition =
|
362
|
-
(value !== undefined &&
|
363
|
-
value !== "" &&
|
364
|
-
value !== "off" &&
|
365
|
-
value !== "false" &&
|
366
|
-
value !== false) ||
|
367
|
-
value === "on" ||
|
368
|
-
value === "true" ||
|
369
|
-
value === true;
|
334
|
+
const condition = evaluateCondition(value);
|
370
335
|
return condition ? trueStatement : falseStatement;
|
371
336
|
|
372
337
|
case "ucfirst":
|
@@ -622,10 +587,7 @@ function transform(value) {
|
|
622
587
|
* that null is an object.
|
623
588
|
*/
|
624
589
|
if (value === null) {
|
625
|
-
|
626
|
-
return true;
|
627
|
-
}
|
628
|
-
return false;
|
590
|
+
return equalsValue === "null";
|
629
591
|
}
|
630
592
|
|
631
593
|
const typeOfValue = typeof value;
|
@@ -672,7 +634,6 @@ function transform(value) {
|
|
672
634
|
|
673
635
|
return nf.format(amount);
|
674
636
|
|
675
|
-
|
676
637
|
case "timestamp":
|
677
638
|
date = new Date(value);
|
678
639
|
timestamp = date.getTime();
|
@@ -810,9 +771,43 @@ function transform(value) {
|
|
810
771
|
}
|
811
772
|
|
812
773
|
defaultValue = args.shift() || undefined;
|
774
|
+
|
775
|
+
defaultValue = convertSpecialStrings(defaultValue, value);
|
776
|
+
|
813
777
|
return translations.getText(key, defaultValue);
|
814
778
|
|
815
779
|
default:
|
816
780
|
throw new Error(`unknown command ${this.command}`);
|
817
781
|
}
|
818
782
|
}
|
783
|
+
|
784
|
+
function convertSpecialStrings(input, value) {
|
785
|
+
switch (input) {
|
786
|
+
case "value":
|
787
|
+
return value;
|
788
|
+
case "\\value":
|
789
|
+
return "value";
|
790
|
+
case "\\undefined":
|
791
|
+
return undefined;
|
792
|
+
case "\\null":
|
793
|
+
return null;
|
794
|
+
default:
|
795
|
+
return input;
|
796
|
+
}
|
797
|
+
}
|
798
|
+
|
799
|
+
function evaluateCondition(value) {
|
800
|
+
const lowerValue = typeof value === "string" ? value.toLowerCase() : value;
|
801
|
+
|
802
|
+
return (
|
803
|
+
(value !== undefined &&
|
804
|
+
value !== null &&
|
805
|
+
value !== "" &&
|
806
|
+
lowerValue !== "off" &&
|
807
|
+
lowerValue !== "false" &&
|
808
|
+
value !== false) ||
|
809
|
+
lowerValue === "on" ||
|
810
|
+
lowerValue === "true" ||
|
811
|
+
value === true
|
812
|
+
);
|
813
|
+
}
|
@@ -55,10 +55,10 @@ function findClosestObjectLink(element) {
|
|
55
55
|
* @since 1.9.0
|
56
56
|
* @copyright schukai GmbH
|
57
57
|
* @memberOf Monster.DOM
|
58
|
-
* @param
|
59
|
-
* @param
|
60
|
-
* @param
|
61
|
-
* @
|
58
|
+
* @param element
|
59
|
+
* @param symbol
|
60
|
+
* @param object
|
61
|
+
* @returns {*}
|
62
62
|
*/
|
63
63
|
function addToObjectLink(element, symbol, object) {
|
64
64
|
validateInstance(element, HTMLElement);
|
@@ -82,7 +82,7 @@ function addToObjectLink(element, symbol, object) {
|
|
82
82
|
* @memberOf Monster.DOM
|
83
83
|
* @param {HTMLElement} element
|
84
84
|
* @param {Symbol} symbol
|
85
|
-
* @
|
85
|
+
* @returns {*}
|
86
86
|
*/
|
87
87
|
function removeObjectLink(element, symbol) {
|
88
88
|
validateInstance(element, HTMLElement);
|
@@ -1018,7 +1018,7 @@ function initHtmlContent() {
|
|
1018
1018
|
if (isString(html) && html.length > 0) {
|
1019
1019
|
const mapping = this.getOption("templateMapping", {});
|
1020
1020
|
if (isObject(mapping)) {
|
1021
|
-
html = new Formatter(mapping).format(html);
|
1021
|
+
html = new Formatter(mapping, {}).format(html);
|
1022
1022
|
}
|
1023
1023
|
this.innerHTML = html;
|
1024
1024
|
}
|
package/source/dom/updater.mjs
CHANGED
@@ -25,6 +25,7 @@ import { isArray, isInstance, isIterable } from "../types/is.mjs";
|
|
25
25
|
import { Observer } from "../types/observer.mjs";
|
26
26
|
import { ProxyObserver } from "../types/proxyobserver.mjs";
|
27
27
|
import { validateArray, validateInstance } from "../types/validate.mjs";
|
28
|
+
import { Sleep } from "../util/sleep.mjs";
|
28
29
|
import { clone } from "../util/clone.mjs";
|
29
30
|
import { trimSpaces } from "../util/trimspaces.mjs";
|
30
31
|
import { addToObjectLink } from "./attributes.mjs";
|
@@ -95,12 +96,20 @@ class Updater extends Base {
|
|
95
96
|
const diffResult = diff(this[internalSymbol].last, s);
|
96
97
|
this[internalSymbol].last = clone(s);
|
97
98
|
|
99
|
+
const promises = [];
|
100
|
+
|
98
101
|
for (const [, change] of Object.entries(diffResult)) {
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
102
|
+
promises.push(
|
103
|
+
Sleep(1).then(() => {
|
104
|
+
removeElement.call(this, change);
|
105
|
+
insertElement.call(this, change);
|
106
|
+
updateContent.call(this, change);
|
107
|
+
updateAttributes.call(this, change);
|
108
|
+
}),
|
109
|
+
);
|
103
110
|
}
|
111
|
+
|
112
|
+
return Promise.all(promises);
|
104
113
|
}),
|
105
114
|
);
|
106
115
|
}
|
@@ -416,7 +425,7 @@ function insertElement(change) {
|
|
416
425
|
wd++;
|
417
426
|
|
418
427
|
const p = clone(change?.["path"]);
|
419
|
-
if (!isArray(p)) return
|
428
|
+
if (!isArray(p)) return;
|
420
429
|
|
421
430
|
while (p.length > 0) {
|
422
431
|
const current = p.join(".");
|
package/source/dom/util.mjs
CHANGED
@@ -15,6 +15,7 @@ export {
|
|
15
15
|
findElementWithIdUpwards,
|
16
16
|
getContainingDocument,
|
17
17
|
getRegisteredCustomElements,
|
18
|
+
findElementWithSelectorUpwards,
|
18
19
|
};
|
19
20
|
|
20
21
|
/**
|
@@ -207,6 +208,47 @@ function findElementWithIdUpwards(element, targetId) {
|
|
207
208
|
return findElementWithIdUpwards(element.parentElement, targetId);
|
208
209
|
}
|
209
210
|
|
211
|
+
/**
|
212
|
+
* Recursively searches upwards from a given element to find an ancestor element
|
213
|
+
* with a specified selector, considering both normal DOM and shadow DOM.
|
214
|
+
* This method is useful for finding a parent element with a specific class.
|
215
|
+
*
|
216
|
+
* @param {HTMLElement|ShadowRoot} element - The starting element or shadow root to search from.
|
217
|
+
* @param {string} selector - The selector of the target element to find.
|
218
|
+
* @returns {HTMLElement|null} - The ancestor element with the specified selector, or null if not found.
|
219
|
+
* @memberOf Monster.DOM
|
220
|
+
* @since 3.55.0
|
221
|
+
*/
|
222
|
+
function findElementWithSelectorUpwards(element, selector) {
|
223
|
+
if (!element || !selector) {
|
224
|
+
return null;
|
225
|
+
}
|
226
|
+
|
227
|
+
// Search within the current element's shadow root, if it exists
|
228
|
+
if (element.shadowRoot) {
|
229
|
+
const target = element.shadowRoot.querySelector(selector);
|
230
|
+
if (target) {
|
231
|
+
return target;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
if (element === document.documentElement) {
|
236
|
+
const target = document.querySelector(selector);
|
237
|
+
if (target) {
|
238
|
+
return target;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
// If the current element is inside a shadow root, search its host's ancestors
|
243
|
+
const rootNode = element.getRootNode();
|
244
|
+
if (rootNode && rootNode instanceof ShadowRoot) {
|
245
|
+
return findElementWithSelectorUpwards(rootNode.host, selector);
|
246
|
+
}
|
247
|
+
|
248
|
+
// Otherwise, search the current element's parent
|
249
|
+
return findElementWithSelectorUpwards(element.parentElement, selector);
|
250
|
+
}
|
251
|
+
|
210
252
|
/**
|
211
253
|
* @private
|
212
254
|
* @param {HTMLElement} element
|
@@ -141,7 +141,7 @@ class Embed extends Provider {
|
|
141
141
|
* `script[data-monster-role=translations]` is searched for and the translations are assigned to the element.
|
142
142
|
*
|
143
143
|
* @param element
|
144
|
-
* @returns {Promise<unknown[]>}
|
144
|
+
* @returns {Promise<Awaited<unknown>[]>}
|
145
145
|
*/
|
146
146
|
static assignTranslationsToElement(element) {
|
147
147
|
const d = getDocument();
|
@@ -152,13 +152,13 @@ class Embed extends Provider {
|
|
152
152
|
|
153
153
|
const list = d.querySelectorAll("script[data-monster-role=translations]");
|
154
154
|
if (list === null) {
|
155
|
-
return;
|
155
|
+
return Promise.resolve([]);
|
156
156
|
}
|
157
157
|
|
158
158
|
const promises = [];
|
159
159
|
|
160
160
|
list.forEach((translationElement) => {
|
161
|
-
const p = new Embed(translationElement);
|
161
|
+
const p = new Embed(translationElement, {});
|
162
162
|
promises.push(p.assignToElement(undefined, element));
|
163
163
|
});
|
164
164
|
|
package/source/monster.mjs
CHANGED
@@ -27,6 +27,7 @@ export * from "./components/form/state-button.mjs";
|
|
27
27
|
export * from "./components/form/popper.mjs";
|
28
28
|
export * from "./components/form/select.mjs";
|
29
29
|
export * from "./components/form/confirm-button.mjs";
|
30
|
+
export * from "./components/form/context-error.mjs";
|
30
31
|
export * from "./components/form/action-button.mjs";
|
31
32
|
export * from "./components/form/form.mjs";
|
32
33
|
export * from "./components/form/api-button.mjs";
|
@@ -45,6 +46,7 @@ export * from "./components/form/stylesheet/state-button.mjs";
|
|
45
46
|
export * from "./components/form/stylesheet/popper.mjs";
|
46
47
|
export * from "./components/form/stylesheet/select.mjs";
|
47
48
|
export * from "./components/form/stylesheet/confirm-button.mjs";
|
49
|
+
export * from "./components/form/stylesheet/context-error.mjs";
|
48
50
|
export * from "./components/form/stylesheet/action-button.mjs";
|
49
51
|
export * from "./components/form/stylesheet/form.mjs";
|
50
52
|
export * from "./components/form/stylesheet/api-button.mjs";
|
@@ -93,6 +95,7 @@ export * from "./components/datatable/util.mjs";
|
|
93
95
|
export * from "./components/datatable/filter.mjs";
|
94
96
|
export * from "./components/datatable/dataset.mjs";
|
95
97
|
export * from "./components/datatable/embedded-pagination.mjs";
|
98
|
+
export * from "./components/datatable/status.mjs";
|
96
99
|
export * from "./components/datatable/constants.mjs";
|
97
100
|
export * from "./components/datatable/stylesheet/select-filter.mjs";
|
98
101
|
export * from "./components/datatable/stylesheet/datasource.mjs";
|
@@ -105,6 +108,7 @@ export * from "./components/datatable/stylesheet/filter.mjs";
|
|
105
108
|
export * from "./components/datatable/stylesheet/dataset.mjs";
|
106
109
|
export * from "./components/datatable/stylesheet/embedded-pagination.mjs";
|
107
110
|
export * from "./components/datatable/stylesheet/filter-controls-defaults.mjs";
|
111
|
+
export * from "./components/datatable/stylesheet/status.mjs";
|
108
112
|
export * from "./components/datatable/stylesheet/filter-range.mjs";
|
109
113
|
export * from "./components/state/log/entry.mjs";
|
110
114
|
export * from "./components/state/state.mjs";
|
@@ -120,6 +124,7 @@ export * from "./components/stylesheet/spinner.mjs";
|
|
120
124
|
export * from "./components/stylesheet/control.mjs";
|
121
125
|
export * from "./components/stylesheet/card.mjs";
|
122
126
|
export * from "./components/stylesheet/common.mjs";
|
127
|
+
export * from "./components/stylesheet/icons.mjs";
|
123
128
|
export * from "./components/stylesheet/popper.mjs";
|
124
129
|
export * from "./components/stylesheet/theme.mjs";
|
125
130
|
export * from "./components/stylesheet/data-grid.mjs";
|
@@ -112,8 +112,8 @@ class Formatter extends BaseWithOptions {
|
|
112
112
|
/**
|
113
113
|
* Default values for the markers are `${` and `}`
|
114
114
|
*
|
115
|
-
* @param
|
116
|
-
* @
|
115
|
+
* @param object
|
116
|
+
* @param options
|
117
117
|
*/
|
118
118
|
constructor(object, options) {
|
119
119
|
super(options);
|
@@ -22,7 +22,7 @@ export { NodeRecursiveIterator };
|
|
22
22
|
const isNodeListSymbol = Symbol("isNodeList");
|
23
23
|
|
24
24
|
/**
|
25
|
-
*
|
25
|
+
* Represents a recursive iterator for traversing nodes in a DOM tree.
|
26
26
|
*
|
27
27
|
* @externalExample ../../example/types/noderecursiveiterator.mjs
|
28
28
|
* @license AGPLv3
|
@@ -30,22 +30,25 @@ const isNodeListSymbol = Symbol("isNodeList");
|
|
30
30
|
* @copyright schukai GmbH
|
31
31
|
* @memberOf Monster.Types
|
32
32
|
* @summary An iterator to run recursively through a tree of nodes
|
33
|
+
* @extends Base
|
33
34
|
*/
|
34
35
|
class NodeRecursiveIterator extends Base {
|
35
36
|
/**
|
36
|
-
* @param
|
37
|
+
* @param node
|
37
38
|
*/
|
38
39
|
constructor(node) {
|
39
40
|
super();
|
40
41
|
|
41
42
|
this[isNodeListSymbol] = false;
|
42
43
|
|
43
|
-
// iterator is a
|
44
|
+
// iterator is a NodeList
|
44
45
|
if (isInstance(node, NodeList)) {
|
45
46
|
const children = node;
|
46
|
-
|
47
|
-
|
47
|
+
let n = new Node();
|
48
|
+
n.childNodes = children;
|
48
49
|
this[isNodeListSymbol] = true;
|
50
|
+
this[internalSymbol] = n;
|
51
|
+
return;
|
49
52
|
}
|
50
53
|
|
51
54
|
this[internalSymbol] = validateInstance(node, Node);
|
@@ -77,8 +80,7 @@ class NodeRecursiveIterator extends Base {
|
|
77
80
|
yield* new NodeRecursiveIterator(node);
|
78
81
|
}
|
79
82
|
}
|
80
|
-
|
81
|
-
return;
|
83
|
+
|
82
84
|
};
|
83
85
|
|
84
86
|
/**
|
@@ -135,7 +135,7 @@ class Observer extends Base {
|
|
135
135
|
|
136
136
|
setTimeout(() => {
|
137
137
|
try {
|
138
|
-
// the queue and the
|
138
|
+
// the queue and the `setTimeout` ensure that an object is not
|
139
139
|
// informed of the same change more than once.
|
140
140
|
if (self.queue.isEmpty()) {
|
141
141
|
resolve();
|
package/source/types/version.mjs
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright schukai GmbH and contributors 2023. All Rights Reserved.
|
3
|
+
* Node module: @schukai/monster
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
*
|
10
|
+
* @param milliseconds
|
11
|
+
* @returns {Promise<unknown>}
|
12
|
+
* @since 3.55.0
|
13
|
+
* @memberOf Monster.Util
|
14
|
+
*/
|
15
|
+
export function Sleep(milliseconds) {
|
16
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
17
|
+
}
|
@@ -103,6 +103,7 @@ describe('Button', function () {
|
|
103
103
|
|
104
104
|
setTimeout(() => {
|
105
105
|
try {
|
106
|
+
|
106
107
|
const options = button.shadowRoot.querySelector('button');
|
107
108
|
|
108
109
|
expect(options).is.instanceof(HTMLButtonElement);
|
@@ -112,7 +113,7 @@ describe('Button', function () {
|
|
112
113
|
}
|
113
114
|
|
114
115
|
done();
|
115
|
-
},
|
116
|
+
}, 100)
|
116
117
|
|
117
118
|
|
118
119
|
});
|
@@ -110,13 +110,13 @@ describe('Transformer', function () {
|
|
110
110
|
[' if:a: ', false, undefined], // without \\
|
111
111
|
[' if:a:\\ ', false, " "],
|
112
112
|
[' if:a:\\ ', true, "a"],
|
113
|
+
['default:undefined:bool', undefined, false],
|
113
114
|
['default:yes', null, 'yes'],
|
114
115
|
['default:yes', undefined, 'yes'],
|
115
116
|
['default:1:bool', undefined, true],
|
116
117
|
['default:on:bool', undefined, true],
|
117
118
|
['default:true:bool', undefined, true],
|
118
119
|
['default:yes:bool', undefined, true],
|
119
|
-
['default:undefined:bool', undefined, false],
|
120
120
|
['default:false:bool', undefined, false],
|
121
121
|
['default:1:int', undefined, 1],
|
122
122
|
['default:1:string', undefined, '1'],
|
@@ -190,7 +190,7 @@ describe('Transformer', function () {
|
|
190
190
|
});
|
191
191
|
|
192
192
|
const r = t.run(b);
|
193
|
-
expect(r).to.be.eql(c);
|
193
|
+
expect(r).to.be.eql(c, "Transformer.run(" + JSON.stringify(a) + ").run(" + JSON.stringify(b) + ") should return " + JSON.stringify(c));
|
194
194
|
});
|
195
195
|
});
|
196
196
|
|