@schukai/monster 4.108.0 → 4.110.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 CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.110.0] - 2026-01-28
6
+
7
+ ### Add Features
8
+
9
+ - Added new table control for handling large datasets [#379](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/379)
10
+ - new i18n-tag
11
+
12
+
13
+
14
+ ## [4.109.0] - 2026-01-28
15
+
16
+ ### Add Features
17
+
18
+ - Add double-click handling to pagination navigation
19
+ - Improve pagination visibility for zero results
20
+ ### Bug Fixes
21
+
22
+ - webtests
23
+ - update webstest
24
+
25
+
26
+
5
27
  ## [4.108.0] - 2026-01-26
6
28
 
7
29
  ### 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.108.0"}
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.110.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
- let element =
511
- findTargetElementFromEvent(event, ATTRIBUTE_ROLE, "pagination-item") ||
512
- findTargetElementFromEvent(event, ATTRIBUTE_ROLE, "pagination-next") ||
513
- findTargetElementFromEvent(event, ATTRIBUTE_ROLE, "pagination-prev");
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 &&