@schukai/monster 4.44.2 → 4.45.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
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"schukai GmbH","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":"schukai GmbH","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.45.0"}
|
|
@@ -136,12 +136,29 @@ class LocaleSelect extends CustomElement {
|
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Default options
|
|
139
|
+
*
|
|
140
|
+
* @properties {Object} templates - Templates for the component.
|
|
141
|
+
* @properties {string} templates.main - Main template.
|
|
142
|
+
* @properties {Object} features - Feature toggles.
|
|
143
|
+
* @properties {boolean} features.resetCookie - Whether to show a reset cookie button.
|
|
144
|
+
* @properties {Object} cookie - Cookie settings.
|
|
145
|
+
* @properties {string} cookie.name - Name of the cookie to store the selected language.
|
|
146
|
+
* @properties {Object} labels - Localized labels.
|
|
147
|
+
* @properties {string} labels["select-an-option"] - Label for the select option.
|
|
148
|
+
* @properties {Object} callbacks - Callback functions.
|
|
149
|
+
* @properties {boolean} disabled - Whether the component is disabled.
|
|
139
150
|
*/
|
|
140
151
|
get defaults() {
|
|
141
152
|
return Object.assign({}, super.defaults, {
|
|
142
153
|
templates: {
|
|
143
154
|
main: getTemplate(),
|
|
144
155
|
},
|
|
156
|
+
features: {
|
|
157
|
+
resetCookie: true,
|
|
158
|
+
},
|
|
159
|
+
cookie: {
|
|
160
|
+
name: "language",
|
|
161
|
+
},
|
|
145
162
|
labels: {
|
|
146
163
|
"select-an-option": getLocalizedLabel(),
|
|
147
164
|
},
|
|
@@ -257,6 +274,13 @@ function initEventHandler() {
|
|
|
257
274
|
this[selectElementSymbol].addEventListener("change", (event) => {
|
|
258
275
|
const selected = event.target?.value;
|
|
259
276
|
if (selected) {
|
|
277
|
+
if (
|
|
278
|
+
this.getOption("features.resetCookie") &&
|
|
279
|
+
this.getOption("cookie.name")
|
|
280
|
+
) {
|
|
281
|
+
document.cookie = `${this.getOption("cookie.name")}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
|
|
282
|
+
}
|
|
283
|
+
|
|
260
284
|
window.location.href = selected;
|
|
261
285
|
}
|
|
262
286
|
});
|
|
@@ -2392,8 +2392,6 @@ function filterFromRemote() {
|
|
|
2392
2392
|
return Promise.reject(new Error("Missing Filter Element."));
|
|
2393
2393
|
}
|
|
2394
2394
|
|
|
2395
|
-
show.call(this);
|
|
2396
|
-
|
|
2397
2395
|
const url = this.getOption("url");
|
|
2398
2396
|
if (!url) {
|
|
2399
2397
|
addErrorAttribute(this, "Missing URL for Remote Filter.");
|
|
@@ -2405,6 +2403,7 @@ function filterFromRemote() {
|
|
|
2405
2403
|
|
|
2406
2404
|
switch (this.getOption("filter.position")) {
|
|
2407
2405
|
case FILTER_POSITION_INLINE:
|
|
2406
|
+
setTimeoput(() => show.call(this), 0);
|
|
2408
2407
|
if (this[inlineFilterElementSymbol] instanceof HTMLElement) {
|
|
2409
2408
|
filterValue = this[inlineFilterElementSymbol].value.toLowerCase();
|
|
2410
2409
|
}
|