@schukai/monster 4.15.3 → 4.16.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.16.0] - 2025-06-08
6
+
7
+ ### Add Features
8
+
9
+ - Introduce enhanced select component and archive issue 322
10
+
11
+
12
+
13
+ ## [4.15.4] - 2025-06-07
14
+
15
+ ### Bug Fixes
16
+
17
+ - Remove unused property and improve option fetching in select component
18
+
19
+
20
+
5
21
  ## [4.15.3] - 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.15.3"}
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.16.0"}
@@ -417,7 +417,6 @@ class Select extends CustomControl {
417
417
  * @property {boolean} features.useStrictValueComparison Use strict (`===`) comparison when matching option values.
418
418
  * @property {boolean} features.showRemoteInfo When the filter mode is set to "remote," display a badge indicating the possibility of additional remote options.
419
419
  * @property {Object} remoteInfo Configuration for remote info badge.
420
- * @property {string} remoteInfo.path Path to the remote info badge.
421
420
  * @property {string} remoteInfo.url URL for total count of options when `filter.mode==="remote"` is set.
422
421
  * @property {Object} placeholder Placeholder text for the control.
423
422
  * @property {string} placeholder.filter Placeholder text for filter input.
@@ -474,7 +473,6 @@ class Select extends CustomControl {
474
473
  url: null,
475
474
 
476
475
  remoteInfo: {
477
- path: null,
478
476
  url: null,
479
477
  },
480
478
 
@@ -2440,20 +2438,42 @@ function gatherState() {
2440
2438
  throw new Error("no shadow-root is defined");
2441
2439
  }
2442
2440
 
2443
- const selection = [];
2444
- const elements = this.shadowRoot.querySelectorAll(
2445
- `input[type=${type}]:checked`,
2446
- );
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
+ }
2447
2471
 
2448
- for (const e of elements) {
2449
- selection.push({
2450
- label: getSelectionLabel.call(this, e.value),
2451
- value: e.value,
2452
- });
2453
2472
  }
2454
2473
 
2474
+
2455
2475
  setSelection
2456
- .call(this, selection)
2476
+ .call(this, filteredSelection)
2457
2477
  .then(() => {
2458
2478
  })
2459
2479
  .catch((e) => {
@@ -3035,8 +3055,10 @@ function initTotal() {
3035
3055
  return;
3036
3056
  }
3037
3057
 
3058
+ const fetchOptions = this.getOption("fetch", {});
3059
+
3038
3060
  getGlobal()
3039
- .fetch(url)
3061
+ .fetch(url, fetchOptions)
3040
3062
  .then((response) => {
3041
3063
  if (!response.ok) {
3042
3064
  // Improved status checking using `response.ok`