@schukai/monster 4.70.2 → 4.70.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.70.
|
|
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.70.3"}
|
|
@@ -21,6 +21,7 @@ import { CustomControl } from "../../../dom/customcontrol.mjs";
|
|
|
21
21
|
import { FilterControlsDefaultsStyleSheet } from "../stylesheet/filter-controls-defaults.mjs";
|
|
22
22
|
import { FilterStyleSheet } from "../stylesheet/filter.mjs";
|
|
23
23
|
import { getLocaleOfDocument } from "../../../dom/locale.mjs";
|
|
24
|
+
import { isString } from "../../../types/is.mjs";
|
|
24
25
|
import "../../form/input-group.mjs";
|
|
25
26
|
|
|
26
27
|
export { TextOperator };
|
|
@@ -75,6 +76,12 @@ class TextOperator extends CustomControl {
|
|
|
75
76
|
templates: {
|
|
76
77
|
main: getTemplate(),
|
|
77
78
|
},
|
|
79
|
+
features: {
|
|
80
|
+
quoteValue: true,
|
|
81
|
+
},
|
|
82
|
+
quotes: {
|
|
83
|
+
char: '"',
|
|
84
|
+
},
|
|
78
85
|
labels: getTranslations(),
|
|
79
86
|
});
|
|
80
87
|
}
|
|
@@ -120,10 +127,13 @@ class TextOperator extends CustomControl {
|
|
|
120
127
|
* @return {*}
|
|
121
128
|
*/
|
|
122
129
|
get value() {
|
|
123
|
-
|
|
130
|
+
let query = `${this[inputElementSymbol].value || ""}`.trim();
|
|
124
131
|
if (!query) {
|
|
125
132
|
return "";
|
|
126
133
|
}
|
|
134
|
+
if (this.getOption("features.quoteValue")) {
|
|
135
|
+
query = quoteValue(query, this.getOption("quotes.char"));
|
|
136
|
+
}
|
|
127
137
|
return `${this[operatorElementSymbol].value}${query}`;
|
|
128
138
|
}
|
|
129
139
|
}
|
|
@@ -369,6 +379,20 @@ function parseValue(value) {
|
|
|
369
379
|
return { operator: ":", query: value };
|
|
370
380
|
}
|
|
371
381
|
|
|
382
|
+
/**
|
|
383
|
+
* @private
|
|
384
|
+
* @param {string} value
|
|
385
|
+
* @param {string} quoteChar
|
|
386
|
+
* @return {string}
|
|
387
|
+
*/
|
|
388
|
+
function quoteValue(value, quoteChar) {
|
|
389
|
+
const char = isString(quoteChar) && quoteChar.length > 0 ? quoteChar[0] : '"';
|
|
390
|
+
if (value.startsWith(char) && value.endsWith(char)) {
|
|
391
|
+
return value;
|
|
392
|
+
}
|
|
393
|
+
return `${char}${value}${char}`;
|
|
394
|
+
}
|
|
395
|
+
|
|
372
396
|
/**
|
|
373
397
|
* @private
|
|
374
398
|
* @return {string}
|