@schukai/monster 4.15.4 → 4.17.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,22 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## [4.17.0] - 2025-06-10
|
6
|
+
|
7
|
+
### Add Features
|
8
|
+
|
9
|
+
- Add new filtering option for tags in datatable
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## [4.16.0] - 2025-06-08
|
14
|
+
|
15
|
+
### Add Features
|
16
|
+
|
17
|
+
- Introduce enhanced select component and archive issue 322
|
18
|
+
|
19
|
+
|
20
|
+
|
5
21
|
## [4.15.4] - 2025-06-07
|
6
22
|
|
7
23
|
### Bug Fixes
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.1","@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":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.1","@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.17.0"}
|
@@ -1232,6 +1232,25 @@ function collectSearchQueries() {
|
|
1232
1232
|
.join(",")
|
1233
1233
|
);
|
1234
1234
|
},
|
1235
|
+
"tags-in-list": (value, key) => {
|
1236
|
+
if (isString(value)) {
|
1237
|
+
value = value.split(",");
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
if (!isArray(value)) {
|
1241
|
+
return "";
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
let query = "";
|
1245
|
+
value.forEach((v) => {
|
1246
|
+
if (query.length > 0) {
|
1247
|
+
query += " OR ";
|
1248
|
+
}
|
1249
|
+
query += `${encodeURIComponent(key)} IN "${encodeURIComponent(v)}"`;
|
1250
|
+
});
|
1251
|
+
|
1252
|
+
return query;
|
1253
|
+
},
|
1235
1254
|
"array-list": (value, key) => {
|
1236
1255
|
if (isString(value)) {
|
1237
1256
|
value = value.split(",");
|
@@ -2438,20 +2438,42 @@ function gatherState() {
|
|
2438
2438
|
throw new Error("no shadow-root is defined");
|
2439
2439
|
}
|
2440
2440
|
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2441
|
+
let filteredSelection=[];
|
2442
|
+
if (type === "radio") {
|
2443
|
+
|
2444
|
+
const selection = [];
|
2445
|
+
const elements = this.shadowRoot.querySelectorAll(
|
2446
|
+
`input[type=${type}]:checked`,
|
2447
|
+
);
|
2448
|
+
|
2449
|
+
for (const e of elements) {
|
2450
|
+
selection.push({
|
2451
|
+
label: getSelectionLabel.call(this, e.value),
|
2452
|
+
value: e.value,
|
2453
|
+
});
|
2454
|
+
}
|
2455
|
+
|
2456
|
+
filteredSelection = selection;
|
2457
|
+
|
2458
|
+
} else {
|
2459
|
+
|
2460
|
+
const selection = [...this.getOption("selection", [])];
|
2461
|
+
const allElements = this.shadowRoot.querySelectorAll(`input[type=${type}]`);
|
2462
|
+
const checkedElements = this.shadowRoot.querySelectorAll(`input[type=${type}]:checked`);
|
2463
|
+
const currentInputValues = new Set(Array.from(allElements).map(el => el.value));
|
2464
|
+
filteredSelection = selection.filter(sel => !currentInputValues.has(sel.value));
|
2465
|
+
for (const input of checkedElements) {
|
2466
|
+
filteredSelection.push({
|
2467
|
+
label: getSelectionLabel.call(this, input.value),
|
2468
|
+
value: input.value,
|
2469
|
+
});
|
2470
|
+
}
|
2445
2471
|
|
2446
|
-
for (const e of elements) {
|
2447
|
-
selection.push({
|
2448
|
-
label: getSelectionLabel.call(this, e.value),
|
2449
|
-
value: e.value,
|
2450
|
-
});
|
2451
2472
|
}
|
2452
2473
|
|
2474
|
+
|
2453
2475
|
setSelection
|
2454
|
-
.call(this,
|
2476
|
+
.call(this, filteredSelection)
|
2455
2477
|
.then(() => {
|
2456
2478
|
})
|
2457
2479
|
.catch((e) => {
|