@schukai/monster 4.5.1 → 4.6.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 +16 -0
- package/package.json +1 -1
- package/source/components/form/select.mjs +27 -23
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,22 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## [4.6.1] - 2025-05-15
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- Improve lazy loading and error handling in select component
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## [4.6.0] - 2025-05-15
|
14
|
+
|
15
|
+
### Add Features
|
16
|
+
|
17
|
+
- Update German and Punjabi translations for clarity
|
18
|
+
|
19
|
+
|
20
|
+
|
5
21
|
## [4.5.1] - 2025-05-14
|
6
22
|
|
7
23
|
### Bug Fixes
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.0","@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.0","@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.6.1"}
|
@@ -561,6 +561,8 @@ class Select extends CustomControl {
|
|
561
561
|
let lazyLoadFlag = self.getOption("features.lazyLoad", false);
|
562
562
|
const remoteFilterFlag = getFilterMode.call(this) === FILTER_MODE_REMOTE;
|
563
563
|
|
564
|
+
initTotal.call(self);
|
565
|
+
|
564
566
|
if (getFilterMode.call(this) === FILTER_MODE_REMOTE) {
|
565
567
|
self.setOption("features.lazyLoad", false);
|
566
568
|
lazyLoadFlag = false;
|
@@ -585,16 +587,13 @@ class Select extends CustomControl {
|
|
585
587
|
lookupSelection.call(self);
|
586
588
|
} else {
|
587
589
|
self.fetch().then(() => {
|
588
|
-
|
590
|
+
|
589
591
|
}).catch((e) => {
|
590
592
|
addErrorAttribute(self, e);
|
591
593
|
});
|
592
594
|
}
|
593
595
|
}
|
594
596
|
|
595
|
-
initTotal.call(self);
|
596
|
-
|
597
|
-
|
598
597
|
setTimeout(() => {
|
599
598
|
let lastValue = self.value;
|
600
599
|
self[internalSymbol].attachObserver(
|
@@ -896,24 +895,25 @@ function getTranslations() {
|
|
896
895
|
case "de":
|
897
896
|
return {
|
898
897
|
"cannot-be-loaded": "Kann nicht geladen werden",
|
899
|
-
"no-options-available": "Keine
|
900
|
-
"click-to-load-options": "Klicken, um
|
901
|
-
"select-an-option": "
|
898
|
+
"no-options-available": "Keine Auswahl verfügbar.",
|
899
|
+
"click-to-load-options": "Klicken, um Auswahl zu laden.",
|
900
|
+
"select-an-option": "Bitte Auswahl treffen",
|
902
901
|
"summary-text": {
|
903
|
-
zero: "Keine
|
904
|
-
one: '<span class="monster-badge-primary-pill">1</span>
|
902
|
+
zero: "Keine Auswahl getroffen",
|
903
|
+
one: '<span class="monster-badge-primary-pill">1</span> Auswahl getroffen',
|
905
904
|
other:
|
906
|
-
'<span class="monster-badge-primary-pill">${count}</span>
|
905
|
+
'<span class="monster-badge-primary-pill">${count}</span> Auswahlen getroffen',
|
907
906
|
},
|
908
|
-
"no-options": '<span class="monster-badge-error-pill">Leider gibt es keine
|
909
|
-
"no-options-found": '<span class="monster-badge-error-pill">Keine
|
907
|
+
"no-options": '<span class="monster-badge-error-pill">Leider gibt es keine Auswahlmöglichkeiten in der Liste.</span>',
|
908
|
+
"no-options-found": '<span class="monster-badge-error-pill">Keine Auswahlmöglichkeiten verfügbar. Bitte ändern Sie den Filter.</span>',
|
910
909
|
"total": {
|
911
|
-
zero: '<span class="monster-badge-primary-pill">Es sind keine weiteren
|
912
|
-
one: '<span class="monster-badge-primary-pill">Es ist 1
|
913
|
-
other: '<span class="monster-badge-primary-pill">Es sind ${count} weitere
|
910
|
+
zero: '<span class="monster-badge-primary-pill">Es sind keine weiteren Auswahlmöglichkeiten verfügbar.</span>',
|
911
|
+
one: '<span class="monster-badge-primary-pill">Es ist 1 weitere Auswahlmöglichkeit verfügbar.</span>',
|
912
|
+
other: '<span class="monster-badge-primary-pill">Es sind ${count} weitere Auswahlmöglichkeiten verfügbar.</span>',
|
914
913
|
}
|
915
914
|
};
|
916
915
|
|
916
|
+
|
917
917
|
case "es":
|
918
918
|
return {
|
919
919
|
"cannot-be-loaded": "No se puede cargar",
|
@@ -1076,9 +1076,9 @@ function getTranslations() {
|
|
1076
1076
|
"no-options": '<span class="monster-badge-error-pill">ਮਾਫ ਕਰਨਾ, ਸੂਚੀ ਵਿੱਚ ਕੋਈ ਚੋਣ ਉਪਲਬਧ ਨਹੀਂ ਹੈ।</span>',
|
1077
1077
|
"no-options-found": '<span class="monster-badge-error-pill">ਸੂਚੀ ਵਿੱਚ ਕੋਈ ਚੋਣ ਉਪਲਬਧ ਨਹੀਂ ਹੈ। ਕਿਰਪਾ ਕਰਕੇ ਫਿਲਟਰ ਬਦਲੋ।</span>',
|
1078
1078
|
"total": {
|
1079
|
-
zero: '<span class="monster-badge-primary-pill"
|
1080
|
-
one: '<span class="monster-badge-primary-pill">1 ਵਾਧੂ ਐਂਟਰੀ ਉਪਲਬਧ
|
1081
|
-
other: '<span class="monster-badge-primary-pill">${count} ਵਾਧੂ ਐਂਟਰੀਆਂ ਉਪਲਬਧ
|
1079
|
+
zero: '<span class="monster-badge-primary-pill">ਕੋਈ ਹੋਰ ਐਂਟਰੀ ਉਪਲਬਧ ਨਹੀਂ ਹੈ.</span>',
|
1080
|
+
one: '<span class="monster-badge-primary-pill">1 ਵਾਧੂ ਐਂਟਰੀ ਉਪਲਬਧ ਹੈ.</span>',
|
1081
|
+
other: '<span class="monster-badge-primary-pill">${count} ਵਾਧੂ ਐਂਟਰੀਆਂ ਉਪਲਬਧ ਹਨ.</span>',
|
1082
1082
|
}
|
1083
1083
|
};
|
1084
1084
|
|
@@ -1407,9 +1407,9 @@ function fetchIt(url, controlOptions) {
|
|
1407
1407
|
|
1408
1408
|
queueMicrotask(() => {
|
1409
1409
|
checkOptionState.call(this);
|
1410
|
-
setStatusOrRemoveBadges.call(this, "closed");
|
1411
|
-
updatePopper.call(this);
|
1412
1410
|
setTotalText.call(this);
|
1411
|
+
updatePopper.call(this);
|
1412
|
+
setStatusOrRemoveBadges.call(this, "closed");
|
1413
1413
|
|
1414
1414
|
resolve(result);
|
1415
1415
|
});
|
@@ -1713,6 +1713,9 @@ function getDefaultTranslation() {
|
|
1713
1713
|
return translation;
|
1714
1714
|
}
|
1715
1715
|
|
1716
|
+
/**
|
1717
|
+
* @private
|
1718
|
+
*/
|
1716
1719
|
function setTotalText() {
|
1717
1720
|
|
1718
1721
|
if (getFilterMode.call(this) !== FILTER_MODE_REMOTE) {
|
@@ -2868,6 +2871,8 @@ function show() {
|
|
2868
2871
|
return;
|
2869
2872
|
}
|
2870
2873
|
|
2874
|
+
setTotalText.call(this);
|
2875
|
+
|
2871
2876
|
focusFilter.call(this);
|
2872
2877
|
|
2873
2878
|
const lazyLoadFlag =
|
@@ -2942,7 +2947,7 @@ function initDefaultOptionsFromUrl() {
|
|
2942
2947
|
this[cleanupOptionsListSymbol] = false;
|
2943
2948
|
importOptionsIntern.call(this, data);
|
2944
2949
|
setStatusOrRemoveBadges.call(this, "open");
|
2945
|
-
|
2950
|
+
initTotal.call(this, data)
|
2946
2951
|
})
|
2947
2952
|
.catch((e) => {
|
2948
2953
|
addErrorAttribute(this, e);
|
@@ -2968,7 +2973,7 @@ function initTotal() {
|
|
2968
2973
|
|
2969
2974
|
getGlobal().fetch(url).then((response) => {
|
2970
2975
|
if (!response.ok) { // Improved status checking using `response.ok`
|
2971
|
-
addErrorAttribute(this, `HTTP error
|
2976
|
+
addErrorAttribute(this, `HTTP error status: ${response.status} - ${response.statusText}`);
|
2972
2977
|
return;
|
2973
2978
|
}
|
2974
2979
|
|
@@ -3291,7 +3296,6 @@ function setStatusOrRemoveBadges(suggestion) {
|
|
3291
3296
|
if (current !== suggestion) {
|
3292
3297
|
this.setOption("classes.statusOrRemoveBadge", suggestion);
|
3293
3298
|
}
|
3294
|
-
return;
|
3295
3299
|
}
|
3296
3300
|
});
|
3297
3301
|
}
|