@schukai/monster 3.105.2 → 3.106.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.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"},"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.106.0"}
|
@@ -99,6 +99,8 @@ class SaveButton extends CustomElement {
|
|
99
99
|
* @property {string} classes.badge The badge class
|
100
100
|
* @property {Array} ignoreChanges The ignore changes (regex)
|
101
101
|
* @property {Array} data The data
|
102
|
+
* @property {boolean} disabled The disabled state
|
103
|
+
* @property {string} logLevel The log level (off, debug)
|
102
104
|
* @return {Object}
|
103
105
|
*/
|
104
106
|
get defaults() {
|
@@ -125,6 +127,9 @@ class SaveButton extends CustomElement {
|
|
125
127
|
data: {},
|
126
128
|
|
127
129
|
disabled: false,
|
130
|
+
|
131
|
+
logLevel: "off",
|
132
|
+
|
128
133
|
});
|
129
134
|
|
130
135
|
updateOptionsFromArguments.call(this, obj);
|
@@ -199,6 +204,27 @@ class SaveButton extends CustomElement {
|
|
199
204
|
const ignoreChanges = self.getOption("ignoreChanges");
|
200
205
|
|
201
206
|
const result = diff(self[originValuesSymbol], currentValues);
|
207
|
+
if(self.getOption("logLevel") === "debug") {
|
208
|
+
console.groupCollapsed("SaveButton");
|
209
|
+
console.log(result);
|
210
|
+
|
211
|
+
if(isArray(result)&&result.length>0) {
|
212
|
+
const formattedDiff = result.map(change => ({
|
213
|
+
Operator: change?.operator,
|
214
|
+
Path: change?.path?.join("."),
|
215
|
+
"First Value": change?.first?.value,
|
216
|
+
"First Type": change?.first?.type,
|
217
|
+
"Second Value": change?.second?.value,
|
218
|
+
"Second Type": change?.second?.type
|
219
|
+
}));
|
220
|
+
|
221
|
+
console.table(formattedDiff);
|
222
|
+
} else {
|
223
|
+
console.log("There are no changes to save");
|
224
|
+
}
|
225
|
+
console.groupEnd();
|
226
|
+
|
227
|
+
}
|
202
228
|
|
203
229
|
if (isArray(ignoreChanges) && ignoreChanges.length > 0) {
|
204
230
|
const itemsToRemove = [];
|
package/source/dom/updater.mjs
CHANGED
@@ -404,6 +404,16 @@ function retrieveAndSetValue(element) {
|
|
404
404
|
|
405
405
|
const type = element.getAttribute(ATTRIBUTE_UPDATER_BIND_TYPE);
|
406
406
|
switch (type) {
|
407
|
+
|
408
|
+
case "integer?":
|
409
|
+
case "int?":
|
410
|
+
case "number?":
|
411
|
+
value = Number(value);
|
412
|
+
if (isNaN(value)||0===value) {
|
413
|
+
value = undefined;
|
414
|
+
}
|
415
|
+
break;
|
416
|
+
|
407
417
|
case "number":
|
408
418
|
case "int":
|
409
419
|
case "float":
|