@schukai/monster 4.56.0 → 4.57.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
@@ -2,6 +2,17 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.57.0] - 2025-12-29
6
+
7
+ ### Add Features
8
+
9
+ - Add logging levels to DataSet, DataSource, and Form components
10
+ ### Changes
11
+
12
+ - update flake
13
+
14
+
15
+
5
16
  ## [4.56.0] - 2025-12-29
6
17
 
7
18
  ### Add Features
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.56.0"}
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.57.0"}
@@ -96,6 +96,7 @@ class DataSet extends CustomElement {
96
96
  * @property {boolean} features.refreshOnMutation Refresh on mutation
97
97
  * @property {object} refreshOnMutation The refresh on mutation
98
98
  * @property {string} refreshOnMutation.selector The selector
99
+ * @property {string} logLevel The log level. Possible values are 'debug', 'info', 'warn', 'error'.
99
100
  */
100
101
  get defaults() {
101
102
  const obj = Object.assign({}, super.defaults, {
@@ -112,6 +113,8 @@ class DataSet extends CustomElement {
112
113
  index: 0,
113
114
  },
114
115
 
116
+ logLevel: "error",
117
+
115
118
  features: {
116
119
  /**
117
120
  * @since 3.70.0
@@ -199,6 +202,13 @@ class DataSet extends CustomElement {
199
202
  pathWithIndex = String(index);
200
203
  }
201
204
 
205
+ if (this.getOption("logLevel") === "debug") {
206
+ console.log("monster-dataset: write", {
207
+ path: pathWithIndex,
208
+ data: internalData,
209
+ });
210
+ }
211
+
202
212
  const data = this[datasourceLinkedElementSymbol]?.data;
203
213
  if (!data) {
204
214
  reject(new Error("No data"));
@@ -68,7 +68,9 @@ class Datasource extends CustomElement {
68
68
  * @property {string} templates.main Main template
69
69
  */
70
70
  get defaults() {
71
- return Object.assign({}, super.defaults, {});
71
+ return Object.assign({}, super.defaults, {
72
+ logLevel: "error",
73
+ });
72
74
  }
73
75
 
74
76
  /**
@@ -91,6 +93,11 @@ class Datasource extends CustomElement {
91
93
  * @param {Object} data
92
94
  */
93
95
  set data(data) {
96
+ if (this.getOption("logLevel") === "debug") {
97
+ console.log("monster-datasource: set data", {
98
+ data: data,
99
+ });
100
+ }
94
101
  this[dataSourceSymbol].set(data);
95
102
  }
96
103
 
@@ -186,6 +186,13 @@ function initEventHandler() {
186
186
  const events = this.getOption("writeBack.events");
187
187
  for (const event of events) {
188
188
  this.addEventListener(event, (e) => {
189
+ if (this.getOption("logLevel") === "debug") {
190
+ console.log("monster-form: event triggered write", {
191
+ element: e.target,
192
+ event: e.type,
193
+ });
194
+ }
195
+
189
196
  if (!this.reportValidity()) {
190
197
  this.classList.add("invalid");
191
198
  setTimeout(() => {