@schukai/monster 4.74.2 → 4.74.3
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":"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.74.
|
|
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.74.3"}
|
|
@@ -17,6 +17,8 @@ import { getSummaryTemplate, Select } from "../../form/select.mjs";
|
|
|
17
17
|
import { FilterControlsDefaultsStyleSheet } from "../stylesheet/filter-controls-defaults.mjs";
|
|
18
18
|
import { FilterSelectStyleSheet } from "../stylesheet/filter-select.mjs";
|
|
19
19
|
|
|
20
|
+
export { FilterSelect, getSummaryTemplate };
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* This is a filter select for the datatable filter.
|
|
22
24
|
*
|
|
@@ -36,37 +38,37 @@ import { FilterSelectStyleSheet } from "../stylesheet/filter-select.mjs";
|
|
|
36
38
|
|
|
37
39
|
*/
|
|
38
40
|
class FilterSelect extends Select {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
/**
|
|
42
|
+
* To set the options via the HTML tag, the attribute `data-monster-options` must be used.
|
|
43
|
+
* @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
|
|
44
|
+
*
|
|
45
|
+
* The individual configuration values can be found in the table.
|
|
46
|
+
*/
|
|
47
|
+
get defaults() {
|
|
48
|
+
return Object.assign({}, super.defaults, {
|
|
49
|
+
type: "checkbox",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @return {string}
|
|
56
|
+
*/
|
|
57
|
+
static getTag() {
|
|
58
|
+
return "monster-filter-select";
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
/**
|
|
62
|
+
* @return {CSSStyleSheet[]}
|
|
63
|
+
*/
|
|
64
|
+
static getCSSStyleSheet() {
|
|
65
|
+
const styleSheet = super.getCSSStyleSheet();
|
|
66
|
+
return [
|
|
67
|
+
...styleSheet,
|
|
68
|
+
FilterControlsDefaultsStyleSheet,
|
|
69
|
+
FilterSelectStyleSheet,
|
|
70
|
+
];
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
registerCustomElement(FilterSelect);
|
|
@@ -719,7 +719,7 @@ function initFilter() {
|
|
|
719
719
|
const v = valuesFromHash[element.id];
|
|
720
720
|
const searchInput = element.firstElementChild;
|
|
721
721
|
try {
|
|
722
|
-
searchInput.value = v;
|
|
722
|
+
searchInput.value = normalizeFilterValue(v);
|
|
723
723
|
} catch (error) {}
|
|
724
724
|
}
|
|
725
725
|
|
|
@@ -738,6 +738,30 @@ function initFilter() {
|
|
|
738
738
|
updateFilterSelections.call(this);
|
|
739
739
|
}
|
|
740
740
|
|
|
741
|
+
/**
|
|
742
|
+
* @private
|
|
743
|
+
* @param {*} value
|
|
744
|
+
* @return {*}
|
|
745
|
+
*/
|
|
746
|
+
function normalizeFilterValue(value) {
|
|
747
|
+
if (!isString(value)) {
|
|
748
|
+
return value;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
const trimmed = value.trim();
|
|
752
|
+
if (trimmed.length < 2) {
|
|
753
|
+
return value;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const first = trimmed[0];
|
|
757
|
+
const last = trimmed[trimmed.length - 1];
|
|
758
|
+
if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
|
|
759
|
+
return trimmed.slice(1, -1);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return value;
|
|
763
|
+
}
|
|
764
|
+
|
|
741
765
|
/**
|
|
742
766
|
* @private
|
|
743
767
|
* @param {string} input
|