@schukai/monster 4.76.0 → 4.77.1
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 +19 -0
- package/package.json +1 -1
- package/source/components/datatable/filter/select.mjs +29 -29
- package/source/dom/util.mjs +15 -7
- package/source/monster.mjs +1 -0
- package/source/types/version.mjs +1 -1
- package/test/cases/dom/util.mjs +24 -0
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +505 -30
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.77.1] - 2026-01-05
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- timeing issue
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [4.77.0] - 2026-01-05
|
|
14
|
+
|
|
15
|
+
### Add Features
|
|
16
|
+
|
|
17
|
+
- Add documentation and enhance waitForCustomElement function
|
|
18
|
+
### Changes
|
|
19
|
+
|
|
20
|
+
- update project
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
5
24
|
## [4.76.0] - 2026-01-05
|
|
6
25
|
|
|
7
26
|
### Add Features
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.
|
|
1
|
+
{"author":"Volker Schukai","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.77.1"}
|
|
@@ -38,37 +38,37 @@ export { FilterSelect, getSummaryTemplate };
|
|
|
38
38
|
|
|
39
39
|
*/
|
|
40
40
|
class FilterSelect extends Select {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
/**
|
|
42
|
+
* To set the options via the HTML tag, the attribute `data-monster-options` must be used.
|
|
43
|
+
* @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
|
|
44
|
+
*
|
|
45
|
+
* The individual configuration values can be found in the table.
|
|
46
|
+
*/
|
|
47
|
+
get defaults() {
|
|
48
|
+
return Object.assign({}, super.defaults, {
|
|
49
|
+
type: "checkbox",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @return {string}
|
|
56
|
+
*/
|
|
57
|
+
static getTag() {
|
|
58
|
+
return "monster-filter-select";
|
|
59
|
+
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
/**
|
|
62
|
+
* @return {CSSStyleSheet[]}
|
|
63
|
+
*/
|
|
64
|
+
static getCSSStyleSheet() {
|
|
65
|
+
const styleSheet = super.getCSSStyleSheet();
|
|
66
|
+
return [
|
|
67
|
+
...styleSheet,
|
|
68
|
+
FilterControlsDefaultsStyleSheet,
|
|
69
|
+
FilterSelectStyleSheet,
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
registerCustomElement(FilterSelect);
|
package/source/dom/util.mjs
CHANGED
|
@@ -338,7 +338,7 @@ function getRegisteredCustomElements() {
|
|
|
338
338
|
*/
|
|
339
339
|
function waitForCustomElement(
|
|
340
340
|
element,
|
|
341
|
-
{ method = null, tagName = null, timeout = 2000 } = {},
|
|
341
|
+
{ method = null, tagName = null, timeout = 2000, readyCheck = null } = {},
|
|
342
342
|
) {
|
|
343
343
|
if (!(element instanceof HTMLElement)) {
|
|
344
344
|
return Promise.reject(
|
|
@@ -367,8 +367,18 @@ function waitForCustomElement(
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
const start = Date.now();
|
|
370
|
+
const isReady = () => {
|
|
371
|
+
if (method && typeof element[method] !== "function") {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
if (typeof readyCheck === "function") {
|
|
375
|
+
return readyCheck(element) === true;
|
|
376
|
+
}
|
|
377
|
+
return true;
|
|
378
|
+
};
|
|
379
|
+
|
|
370
380
|
const check = () => {
|
|
371
|
-
if (
|
|
381
|
+
if (isReady()) {
|
|
372
382
|
resolve(element);
|
|
373
383
|
return;
|
|
374
384
|
}
|
|
@@ -379,17 +389,15 @@ function waitForCustomElement(
|
|
|
379
389
|
Date.now() - start > timeout
|
|
380
390
|
) {
|
|
381
391
|
reject(
|
|
382
|
-
new Error(
|
|
383
|
-
`Timed out waiting for "${method}" on <${name}>.`,
|
|
384
|
-
),
|
|
392
|
+
new Error(`Timed out waiting for "${method}" on <${name}>.`),
|
|
385
393
|
);
|
|
386
394
|
return;
|
|
387
395
|
}
|
|
388
396
|
|
|
389
|
-
window.
|
|
397
|
+
window.setTimeout(check, 0);
|
|
390
398
|
};
|
|
391
399
|
|
|
392
|
-
window.
|
|
400
|
+
window.setTimeout(check, 0);
|
|
393
401
|
}),
|
|
394
402
|
);
|
|
395
403
|
}
|
package/source/monster.mjs
CHANGED
|
@@ -101,6 +101,7 @@ export * from "./components/datatable/filter/date-presets.mjs";
|
|
|
101
101
|
export * from "./components/datatable/filter/date.mjs";
|
|
102
102
|
export * from "./components/datatable/filter/date-range.mjs";
|
|
103
103
|
export * from "./components/datatable/filter/abstract-base.mjs";
|
|
104
|
+
export * from "./components/datatable/filter/select.mjs";
|
|
104
105
|
export * from "./components/datatable/filter/settings.mjs";
|
|
105
106
|
export * from "./components/datatable/filter/date-time.mjs";
|
|
106
107
|
export * from "./components/datatable/filter/range.mjs";
|
package/source/types/version.mjs
CHANGED
package/test/cases/dom/util.mjs
CHANGED
|
@@ -135,6 +135,30 @@ describe('DOM', function () {
|
|
|
135
135
|
expect(ready).to.equal(element);
|
|
136
136
|
expect(ready.ping()).to.equal('pong');
|
|
137
137
|
});
|
|
138
|
+
|
|
139
|
+
it('should wait for a readyCheck condition', async () => {
|
|
140
|
+
const tagName = `test-ready-${Date.now()}`;
|
|
141
|
+
const element = document.createElement(tagName);
|
|
142
|
+
document.body.appendChild(element);
|
|
143
|
+
|
|
144
|
+
const promise = waitForCustomElement(element, {
|
|
145
|
+
readyCheck: (el) => el.hasAttribute('data-ready'),
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
class TestReady extends HTMLElement {
|
|
149
|
+
connectedCallback() {
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
this.setAttribute('data-ready', 'true');
|
|
152
|
+
}, 0);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
customElements.define(tagName, TestReady);
|
|
157
|
+
|
|
158
|
+
const ready = await promise;
|
|
159
|
+
expect(ready).to.equal(element);
|
|
160
|
+
expect(ready.getAttribute('data-ready')).to.equal('true');
|
|
161
|
+
});
|
|
138
162
|
});
|
|
139
163
|
|
|
140
164
|
});
|
package/test/cases/monster.mjs
CHANGED
package/test/web/test.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
|
|
12
|
-
<h1 style='margin-bottom: 0.1em;'>Monster 4.
|
|
13
|
-
<div id="lastupdate" style='font-size:0.7em'>last update
|
|
12
|
+
<h1 style='margin-bottom: 0.1em;'>Monster 4.76.0</h1>
|
|
13
|
+
<div id="lastupdate" style='font-size:0.7em'>last update Mo 5. Jan 16:52:49 CET 2026</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div id="mocha-errors"
|
|
16
16
|
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
|