@schukai/monster 3.107.0 → 3.108.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 +19 -0
- package/package.json +1 -1
- package/source/components/datatable/filter.mjs +21 -10
- package/source/components/datatable/save-button.mjs +18 -12
- package/source/components/form/select.mjs +2236 -2248
- package/source/components/form/tree-select.mjs +369 -370
- package/source/data/buildmap.mjs +1 -1
- package/source/data/datasource/server/restapi.mjs +3 -3
- package/source/data/transformer.mjs +34 -1
- package/source/dom/updater.mjs +858 -854
- package/source/i18n/internal.mjs +103 -109
- package/source/i18n/map/languages.mjs +1 -3
- package/source/monster.mjs +1 -0
- package/source/types/global.mjs +45 -46
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +478 -149
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,25 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## [3.108.1] - 2025-02-11
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- **save-button:** ignore not work with arrays [#292](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/292)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## [3.108.0] - 2025-02-11
|
14
|
+
|
15
|
+
### Add Features
|
16
|
+
|
17
|
+
- new transformer commands [#292](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/292)
|
18
|
+
### Changes
|
19
|
+
|
20
|
+
- update nix, node, code format
|
21
|
+
|
22
|
+
|
23
|
+
|
5
24
|
## [3.107.0] - 2025-02-09
|
6
25
|
|
7
26
|
### Add Features
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@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":"3.
|
1
|
+
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8","buffer":"^6.0.3"},"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":"3.108.1"}
|
@@ -32,7 +32,13 @@ import { Settings } from "./filter/settings.mjs";
|
|
32
32
|
import { FilterStyleSheet } from "./stylesheet/filter.mjs";
|
33
33
|
import { getDocument, getWindow } from "../../dom/util.mjs";
|
34
34
|
import { getGlobal } from "../../types/global.mjs";
|
35
|
-
import {
|
35
|
+
import {
|
36
|
+
isInstance,
|
37
|
+
isFunction,
|
38
|
+
isObject,
|
39
|
+
isArray,
|
40
|
+
isString,
|
41
|
+
} from "../../types/is.mjs";
|
36
42
|
import { Host } from "../host/host.mjs";
|
37
43
|
import { addAttributeToken } from "../../dom/attributes.mjs";
|
38
44
|
import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
|
@@ -1063,8 +1069,10 @@ function doSearch({ showEffect } = { showEffect: true }) {
|
|
1063
1069
|
return Promise.reject(new Error(msg));
|
1064
1070
|
}
|
1065
1071
|
|
1066
|
-
if (
|
1067
|
-
|
1072
|
+
if (
|
1073
|
+
this.getOption("features.preventSameQuery") &&
|
1074
|
+
buildQuery === this.getOption("query")
|
1075
|
+
) {
|
1068
1076
|
const msg = this.getOption("labels.query-not-changed");
|
1069
1077
|
|
1070
1078
|
if (showEffect) {
|
@@ -1205,8 +1213,7 @@ function collectSearchQueries() {
|
|
1205
1213
|
});
|
1206
1214
|
},
|
1207
1215
|
"tag-list": (value, key) => {
|
1208
|
-
|
1209
|
-
if(isString(value)) {
|
1216
|
+
if (isString(value)) {
|
1210
1217
|
value = value.split(",");
|
1211
1218
|
}
|
1212
1219
|
|
@@ -1214,11 +1221,15 @@ function collectSearchQueries() {
|
|
1214
1221
|
return "";
|
1215
1222
|
}
|
1216
1223
|
|
1217
|
-
return
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1224
|
+
return (
|
1225
|
+
key +
|
1226
|
+
" IN " +
|
1227
|
+
value
|
1228
|
+
.map((v) => {
|
1229
|
+
return `"${encodeURIComponent(v)}"`;
|
1230
|
+
})
|
1231
|
+
.join(",")
|
1232
|
+
);
|
1222
1233
|
},
|
1223
1234
|
"date-range": (value, key) => {
|
1224
1235
|
const query = parseDateInput(value, key);
|
@@ -129,7 +129,6 @@ class SaveButton extends CustomElement {
|
|
129
129
|
disabled: false,
|
130
130
|
|
131
131
|
logLevel: "off",
|
132
|
-
|
133
132
|
});
|
134
133
|
|
135
134
|
updateOptionsFromArguments.call(this, obj);
|
@@ -204,18 +203,20 @@ class SaveButton extends CustomElement {
|
|
204
203
|
const ignoreChanges = self.getOption("ignoreChanges");
|
205
204
|
|
206
205
|
const result = diff(self[originValuesSymbol], currentValues);
|
207
|
-
if(self.getOption("logLevel") === "debug") {
|
206
|
+
if (self.getOption("logLevel") === "debug") {
|
208
207
|
console.groupCollapsed("SaveButton");
|
209
|
-
console.log(
|
208
|
+
console.log("originValues", JSON.parse(JSON.stringify(currentValues)));
|
209
|
+
console.log("result of diff", result);
|
210
|
+
console.log("ignoreChanges", ignoreChanges);
|
210
211
|
|
211
|
-
if(isArray(result)&&result.length>0) {
|
212
|
-
const formattedDiff = result.map(change => ({
|
212
|
+
if (isArray(result) && result.length > 0) {
|
213
|
+
const formattedDiff = result.map((change) => ({
|
213
214
|
Operator: change?.operator,
|
214
215
|
Path: change?.path?.join("."),
|
215
216
|
"First Value": change?.first?.value,
|
216
217
|
"First Type": change?.first?.type,
|
217
218
|
"Second Value": change?.second?.value,
|
218
|
-
"Second Type": change?.second?.type
|
219
|
+
"Second Type": change?.second?.type,
|
219
220
|
}));
|
220
221
|
|
221
222
|
console.table(formattedDiff);
|
@@ -223,7 +224,6 @@ class SaveButton extends CustomElement {
|
|
223
224
|
console.log("There are no changes to save");
|
224
225
|
}
|
225
226
|
console.groupEnd();
|
226
|
-
|
227
227
|
}
|
228
228
|
|
229
229
|
if (isArray(ignoreChanges) && ignoreChanges.length > 0) {
|
@@ -231,7 +231,13 @@ class SaveButton extends CustomElement {
|
|
231
231
|
for (const item of result) {
|
232
232
|
for (const ignorePattern of ignoreChanges) {
|
233
233
|
const p = new RegExp(ignorePattern);
|
234
|
-
|
234
|
+
|
235
|
+
let matchPath = item.path
|
236
|
+
if(isArray(item.path)){
|
237
|
+
matchPath = item.path.join(".");
|
238
|
+
}
|
239
|
+
|
240
|
+
if (p.test(matchPath)) {
|
235
241
|
itemsToRemove.push(item);
|
236
242
|
break;
|
237
243
|
}
|
@@ -359,9 +365,9 @@ function initControlReferences() {
|
|
359
365
|
changed: new State(
|
360
366
|
"changed",
|
361
367
|
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-arrow-up" viewBox="0 0 16 16">' +
|
362
|
-
|
363
|
-
|
364
|
-
|
368
|
+
'<path fill-rule="evenodd" d="M7.646 5.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 6.707V10.5a.5.5 0 0 1-1 0V6.707L6.354 7.854a.5.5 0 1 1-.708-.708z"/>' +
|
369
|
+
'<path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383m.653.757c-.757.653-1.153 1.44-1.153 2.056v.448l-.445.049C2.064 6.805 1 7.952 1 9.318 1 10.785 2.23 12 3.781 12h8.906C13.98 12 15 10.988 15 9.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 4.825 10.328 3 8 3a4.53 4.53 0 0 0-2.941 1.1z"/>' +
|
370
|
+
"</svg>",
|
365
371
|
),
|
366
372
|
};
|
367
373
|
|
@@ -433,4 +439,4 @@ function getTemplate() {
|
|
433
439
|
`;
|
434
440
|
}
|
435
441
|
|
436
|
-
registerCustomElement(SaveButton);
|
442
|
+
registerCustomElement(SaveButton);
|