@schukai/monster 4.108.0 → 4.109.0
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 +13 -0
- package/package.json +1 -1
- package/source/components/datatable/pagination.mjs +39 -4
- package/source/components/form/select.mjs +7 -0
- package/source/types/version.mjs +1 -1
- package/test/cases/components/layout/tabs.mjs +22 -15
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +48 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [4.109.0] - 2026-01-28
|
|
6
|
+
|
|
7
|
+
### Add Features
|
|
8
|
+
|
|
9
|
+
- Add double-click handling to pagination navigation
|
|
10
|
+
- Improve pagination visibility for zero results
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- webtests
|
|
14
|
+
- update webstest
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
## [4.108.0] - 2026-01-26
|
|
6
19
|
|
|
7
20
|
### 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.109.0"}
|
|
@@ -89,6 +89,10 @@ const layoutApplySymbol = Symbol("layoutApply");
|
|
|
89
89
|
*/
|
|
90
90
|
const labelStateSymbol = Symbol("labelState");
|
|
91
91
|
const layoutModeSymbol = Symbol("layoutMode");
|
|
92
|
+
const lastNavClickTimeSymbol = Symbol("lastNavClickTime");
|
|
93
|
+
const lastNavClickTargetSymbol = Symbol("lastNavClickTarget");
|
|
94
|
+
|
|
95
|
+
const minNavDoubleClickDelayMs = 200;
|
|
92
96
|
|
|
93
97
|
const compactPrevIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0m3.5 7.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5z"/></svg>`;
|
|
94
98
|
const compactNextIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5z"/></svg>`;
|
|
@@ -507,10 +511,22 @@ function initEventHandler() {
|
|
|
507
511
|
const self = this;
|
|
508
512
|
|
|
509
513
|
self[paginationElementSymbol].addEventListener("click", function (event) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
+
const prevTarget = findTargetElementFromEvent(
|
|
515
|
+
event,
|
|
516
|
+
ATTRIBUTE_ROLE,
|
|
517
|
+
"pagination-prev",
|
|
518
|
+
);
|
|
519
|
+
const nextTarget = findTargetElementFromEvent(
|
|
520
|
+
event,
|
|
521
|
+
ATTRIBUTE_ROLE,
|
|
522
|
+
"pagination-next",
|
|
523
|
+
);
|
|
524
|
+
const itemTarget = findTargetElementFromEvent(
|
|
525
|
+
event,
|
|
526
|
+
ATTRIBUTE_ROLE,
|
|
527
|
+
"pagination-item",
|
|
528
|
+
);
|
|
529
|
+
const element = itemTarget || prevTarget || nextTarget;
|
|
514
530
|
|
|
515
531
|
if (
|
|
516
532
|
!(element instanceof HTMLElement) ||
|
|
@@ -519,6 +535,14 @@ function initEventHandler() {
|
|
|
519
535
|
return;
|
|
520
536
|
}
|
|
521
537
|
|
|
538
|
+
if (
|
|
539
|
+
(event.detail === 1 || event.detail === 0) &&
|
|
540
|
+
(prevTarget || nextTarget)
|
|
541
|
+
) {
|
|
542
|
+
self[lastNavClickTimeSymbol] = event.timeStamp;
|
|
543
|
+
self[lastNavClickTargetSymbol] = prevTarget ? "prev" : "next";
|
|
544
|
+
}
|
|
545
|
+
|
|
522
546
|
const page = element.getAttribute("data-page-no");
|
|
523
547
|
|
|
524
548
|
if (!page || page === "…" || page === "null" || page === "undefined") {
|
|
@@ -558,6 +582,17 @@ function initEventHandler() {
|
|
|
558
582
|
|
|
559
583
|
event.preventDefault();
|
|
560
584
|
|
|
585
|
+
const lastTarget = self[lastNavClickTargetSymbol];
|
|
586
|
+
const lastTime = self[lastNavClickTimeSymbol];
|
|
587
|
+
const currentTarget = prevTarget ? "prev" : "next";
|
|
588
|
+
if (
|
|
589
|
+
lastTarget !== currentTarget ||
|
|
590
|
+
!Number.isFinite(lastTime) ||
|
|
591
|
+
event.timeStamp - lastTime < minNavDoubleClickDelayMs
|
|
592
|
+
) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
|
|
561
596
|
const maxPage = parseInt(self.getOption("pages"), 10);
|
|
562
597
|
if (!Number.isFinite(maxPage) || maxPage <= 0) {
|
|
563
598
|
return;
|
|
@@ -942,6 +942,13 @@ function processAndApplyPaginationData(data) {
|
|
|
942
942
|
|
|
943
943
|
this.setOption("total", total);
|
|
944
944
|
|
|
945
|
+
if (total === 0) {
|
|
946
|
+
this[paginationElementSymbol].style.display = "none";
|
|
947
|
+
this[paginationElementSymbol].setOption("pages", null);
|
|
948
|
+
this[paginationElementSymbol].setOption("currentPage", null);
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
|
|
945
952
|
if (
|
|
946
953
|
isInteger(currentPage) &&
|
|
947
954
|
currentPage > 0 &&
|
package/source/types/version.mjs
CHANGED
|
@@ -92,25 +92,32 @@ describe('Tabs', function () {
|
|
|
92
92
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
it('should shorten label from content when no explicit label is provided', function (done) {
|
|
96
96
|
|
|
97
97
|
let mocks = document.getElementById('mocks');
|
|
98
98
|
mocks.innerHTML = html1;
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
try {
|
|
102
|
+
const tabs = document.getElementById('mytabs');
|
|
103
|
+
expect(tabs).is.instanceof(Tabs);
|
|
104
|
+
|
|
105
|
+
setTimeout(() => {
|
|
106
|
+
const thirdTab = tabs.children[2];
|
|
107
|
+
expect(thirdTab).to.not.equal(undefined);
|
|
108
|
+
const reference = thirdTab.getAttribute('id');
|
|
109
|
+
expect(reference).to.not.equal(null);
|
|
110
|
+
const button = tabs.shadowRoot.querySelector(
|
|
111
|
+
`button[part=button][data-monster-tab-reference="${reference}"]`,
|
|
112
|
+
);
|
|
113
|
+
expect(button).to.not.equal(null);
|
|
114
|
+
const labelSpan = button.querySelector('span[data-monster-replace]');
|
|
115
|
+
expect(labelSpan).to.not.equal(null);
|
|
116
|
+
expect(labelSpan.textContent.trim()).to.equal('Das ist tab…');
|
|
117
|
+
done();
|
|
118
|
+
}, 100);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return done(e);
|
|
114
121
|
}
|
|
115
122
|
}, 0);
|
|
116
123
|
});
|
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.108.0</h1>
|
|
13
|
+
<div id="lastupdate" style='font-size:0.7em'>last update Mi 28. Jan 02:10:31 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>
|