@schukai/monster 3.103.1 → 3.104.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,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.104.0] - 2025-02-04
6
+
7
+ ### Add Features
8
+
9
+ - **api-bar:** return the fetched map
10
+
11
+
12
+
5
13
  ## [3.103.1] - 2025-02-03
6
14
 
7
15
  ### Bug Fixes
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.103.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.104.0"}
@@ -32,7 +32,7 @@ import { Datasource } from "./datasource.mjs";
32
32
  import { Rest as RestDatasource } from "./datasource/rest.mjs";
33
33
  import { BadgeStyleSheet } from "../stylesheet/badge.mjs";
34
34
  import { SaveButtonStyleSheet } from "./stylesheet/save-button.mjs";
35
- import "../form/state-button.mjs";
35
+ import "../form/message-state-button.mjs";
36
36
 
37
37
  import {
38
38
  handleDataSourceChanges,
@@ -315,12 +315,13 @@ function getTranslations() {
315
315
  * @throws {Error} the selector must match exactly one element
316
316
  */
317
317
  function initControlReferences() {
318
+
318
319
  if (!this.shadowRoot) {
319
320
  throw new Error("no shadow-root is defined");
320
321
  }
321
322
 
322
323
  this[stateButtonElementSymbol] = this.shadowRoot.querySelector(
323
- "[data-monster-role=state-button]",
324
+ "[data-monster-role=save-button]",
324
325
  );
325
326
 
326
327
  this[badgeElementSymbol] = this.shadowRoot.querySelector(
@@ -332,9 +333,9 @@ function initControlReferences() {
332
333
  const states = {
333
334
  changed: new State(
334
335
  "changed",
335
- '<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">\n' +
336
- ' <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"/>\n' +
337
- ' <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"/>\n' +
336
+ '<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">' +
337
+ '<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"/>' +
338
+ '<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"/>' +
338
339
  "</svg>",
339
340
  ),
340
341
  };
@@ -346,6 +347,9 @@ function initControlReferences() {
346
347
  "labels.button",
347
348
  this.getOption("labels.button"),
348
349
  );
350
+
351
+ console.log(this[stateButtonElementSymbol])
352
+
349
353
  });
350
354
  }
351
355
 
@@ -399,7 +403,9 @@ function getTemplate() {
399
403
  return `
400
404
  <div data-monster-role="control" part="control"
401
405
  data-monster-attributes="disabled path:disabled | if:true">
402
- <monster-state-button data-monster-role="state-button">save</monster-state-button>
406
+ <monster-message-state-button part="button"
407
+ data-monster-role="save-button"
408
+ ></monster-message-state-button>
403
409
  <div data-monster-attributes="disabled path:disabled | if:true, class path:classes.badge"
404
410
  data-monster-role="badge"
405
411
  data-monster-replace="path:changes"></div>
@@ -168,6 +168,7 @@ class ApiBar extends ButtonBar {
168
168
  ) {
169
169
  this.importButtons(map);
170
170
  }
171
+ return map;
171
172
  });
172
173
  }
173
174
 
@@ -69,6 +69,9 @@ class MessageStateButton extends Popper {
69
69
  * @throws {TypeError} value is not an instance
70
70
  */
71
71
  setState(state, timeout) {
72
+
73
+ console.log(this[buttonElementSymbol]);
74
+
72
75
  return this[buttonElementSymbol].setState(state, timeout);
73
76
  }
74
77
 
@@ -81,7 +84,7 @@ class MessageStateButton extends Popper {
81
84
  }
82
85
 
83
86
  /**
84
- * @return {Monster.Components.Form.Types.State|undefined}
87
+ * @return {MessageStateButton|undefined}
85
88
  */
86
89
  getState() {
87
90
  return this[buttonElementSymbol].getState();
@@ -107,7 +107,7 @@ class StateButton extends Button {
107
107
 
108
108
  const obj = this.getOption(`states.${validateString(state)}`);
109
109
  if (obj === undefined) {
110
- throw new Error("not found");
110
+ throw new Error("state not found");
111
111
  }
112
112
 
113
113
  this.setOption("current", validateInstance(obj, State));