@schukai/monster 3.96.1 → 3.96.2

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,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.96.2] - 2024-12-31
6
+
7
+ ### Bug Fixes
8
+
9
+ - update small things ....
10
+
11
+
12
+
5
13
  ## [3.96.1] - 2024-12-30
6
14
 
7
15
  ### Bug Fixes
@@ -19,15 +27,16 @@
19
27
  ### Add Features
20
28
 
21
29
  - **tabs:** add auto open feature [#273](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/273)
30
+
22
31
  ### Bug Fixes
23
32
 
24
33
  - the form tests are outdated
34
+
25
35
  ### Changes
26
36
 
27
37
  - update project
28
38
 
29
39
 
30
-
31
40
  ## [3.95.2] - 2024-12-28
32
41
 
33
42
  ### Bug Fixes
@@ -35,7 +44,6 @@
35
44
  - datatable, datasource optimisation [#272](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/272)
36
45
 
37
46
 
38
-
39
47
  ## [3.95.1] - 2024-12-23
40
48
 
41
49
  ### Bug Fixes
@@ -43,7 +51,6 @@
43
51
  - check rendering [#271](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/271)
44
52
 
45
53
 
46
-
47
54
  ## [3.95.0] - 2024-12-23
48
55
 
49
56
  ### Add Features
@@ -51,7 +58,6 @@
51
58
  - **log:** set direction
52
59
 
53
60
 
54
-
55
61
  ## [3.94.1] - 2024-12-22
56
62
 
57
63
  ### Bug Fixes
@@ -59,7 +65,6 @@
59
65
  - **log:** optimize layout [#270](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/270)
60
66
 
61
67
 
62
-
63
68
  ## [3.94.0] - 2024-12-22
64
69
 
65
70
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@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.96.1"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@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.96.2"}
@@ -47,42 +47,16 @@ const datasetLinkedElementSymbol = Symbol("datasetLinkedElement");
47
47
  const overlayLinkedElementSymbol = Symbol("overlayLinkedElement");
48
48
 
49
49
  /**
50
- * The ColumnBar component is used to show and configure the columns of a datatable.
50
+ * The change button component is used to change the data of a dataset.
51
51
  *
52
- * <img src="./images/change-button.png">
52
+ * @fragments /fragments/components/datatable/change-button/
53
53
  *
54
- * You can create this control either by specifying the HTML tag <monster-datatable-change-button />` directly in the HTML or using
55
- * Javascript via the `document.createElement('monster-datatable-change-button');` method.
54
+ * @example /examples/components/datatable/change-button-simple Simple change button
56
55
  *
57
- * ```html
58
- * <monster-datatable-change-button></monster-datatable-change-button>
59
- * ```
60
- *
61
- * Or you can create this CustomControl directly in Javascript:
62
- *
63
- * ```js
64
- * import '@schukai/monster/components/datatable/change-button.mjs';
65
- * document.createElement('monster-datatable-change-button');
66
- * ```
67
- *
68
- * The Body should have a class "hidden" to ensure that the
69
- * styles are applied correctly.
70
- *
71
- * ```css
72
- * body.hidden {
73
- * visibility: hidden;
74
- * }
75
- * ```
76
- *
77
- * @startuml change-button.png
78
- * skinparam monochrome true
79
- * skinparam shadowing false
80
- * HTMLElement <|-- CustomElement
81
- * CustomElement <|-- ChangeButton
82
- * @enduml
56
+ * @issue https://localhost.alvine.dev:8443/development/issues/closed/274.html
83
57
  *
84
58
  * @copyright schukai GmbH
85
- * @summary A data set
59
+ * @summary The Status component is used to show the current status of a datasource.
86
60
  */
87
61
  class ChangeButton extends CustomElement {
88
62
  /**
@@ -179,7 +153,16 @@ class ChangeButton extends CustomElement {
179
153
 
180
154
  /**
181
155
  * @private
182
- * @return {Monster.Components.Datatable.Form}
156
+ * @return {ChangeButton}
157
+ * @throws {Error} no shadow-root is defined
158
+ * @throws {TypeError} the element must be a dataset
159
+ * @throws {Error} the selector must match exactly one element
160
+ * @throws {TypeError} the element must be a overlay
161
+ * @throws {Error} the selector must match exactly one element
162
+ * @throws {Error} no reference found
163
+ * @throws {Error} reference is missing or empty
164
+ * @throws {Error} index is not a number
165
+ * @throws {TypeError} this must be a HTMLElement
183
166
  */
184
167
  function initControlReferences() {
185
168
  if (!this.shadowRoot) {
@@ -244,15 +227,21 @@ function initControlReferences() {
244
227
  return this;
245
228
  }
246
229
 
230
+ /**
231
+ * @private
232
+ * @returns {number}
233
+ * @throws {TypeError}
234
+ * @throws {Error}
235
+ */
247
236
  function getIndex() {
248
237
  if (!(this instanceof HTMLElement)) {
249
- return;
238
+ throw new TypeError("this must be a HTMLElement");
250
239
  }
251
240
 
252
241
  const row = this.closest("[data-monster-insert-reference]");
253
242
  if (!row) {
254
243
  addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, "no reference found");
255
- return;
244
+ throw new Error("no reference found");
256
245
  }
257
246
 
258
247
  const ref = row.getAttribute("data-monster-insert-reference");
@@ -262,12 +251,12 @@ function getIndex() {
262
251
  ATTRIBUTE_ERRORMESSAGE,
263
252
  "reference is missing or empty",
264
253
  );
265
- return;
254
+ throw new Error("reference is missing or empty");
266
255
  }
267
256
 
268
257
  const index = Number(ref.split("-").pop());
269
258
  if (isNaN(index)) {
270
- return;
259
+ throw new Error("index is not a number");
271
260
  }
272
261
 
273
262
  return index;
@@ -279,17 +268,26 @@ function getIndex() {
279
268
  function initEventHandler() {
280
269
  queueMicrotask(() => {
281
270
  this[stateButtonElementSymbol].setOption("actions.click", () => {
282
- const index = getIndex.call(this);
283
-
284
- if (!isNaN(index)) {
285
- this[datasetLinkedElementSymbol].setOption("mapping.index", index);
286
- this[overlayLinkedElementSymbol].open();
271
+ try {
272
+ const index = getIndex.call(this);
273
+
274
+ if (!isNaN(index)) {
275
+ this[datasetLinkedElementSymbol].setOption("mapping.index", index);
276
+ this[overlayLinkedElementSymbol].open();
277
+ }
278
+ } catch (error) {
279
+ addAttributeToken(
280
+ this,
281
+ ATTRIBUTE_ERRORMESSAGE,
282
+ error.message || `${error}`,
283
+ );
287
284
  }
288
285
  });
289
286
  });
290
287
  }
291
288
 
292
289
  /**
290
+ * @private
293
291
  * @param {Object} options
294
292
  */
295
293
  function updateOptionsFromArguments(options) {