@schukai/monster 4.38.0 → 4.38.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,25 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.38.2] - 2025-07-25
6
+
7
+ ### Bug Fixes
8
+
9
+ - filter width
10
+
11
+
12
+
13
+ ## [4.38.1] - 2025-07-23
14
+
15
+ ### Bug Fixes
16
+
17
+ - add event to tree-menu action, selected
18
+ ### Changes
19
+
20
+ - update nix
21
+
22
+
23
+
5
24
  ## [4.38.0] - 2025-07-21
6
25
 
7
26
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.2","@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.38.0"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.2","@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.38.2"}
@@ -14,8 +14,8 @@ import { instanceSymbol } from "../../constants.mjs";
14
14
  import { ATTRIBUTE_ROLE } from "../../dom/constants.mjs";
15
15
  import { CustomElement } from "../../dom/customelement.mjs";
16
16
  import {
17
- assembleMethodSymbol,
18
- registerCustomElement,
17
+ assembleMethodSymbol,
18
+ registerCustomElement,
19
19
  } from "../../dom/customelement.mjs";
20
20
  import { KpiTileStyleSheet } from "./stylesheet/kpi-tile.mjs";
21
21
 
@@ -34,62 +34,62 @@ export { KpiTile };
34
34
  * @summary A KPI Tile Control that displays key performance indicators in a tile format.
35
35
  */
36
36
  class KpiTile extends CustomElement {
37
- static get [instanceSymbol]() {
38
- return Symbol.for("@schukai/monster/components/data/kpi/tile@@instance");
39
- }
37
+ static get [instanceSymbol]() {
38
+ return Symbol.for("@schukai/monster/components/data/kpi/tile@@instance");
39
+ }
40
40
 
41
- /**
42
- * @returns {symbol}
43
- * @summary Returns the instance symbol for the KPI Tile control.
44
- */
45
- [assembleMethodSymbol]() {
46
- super[assembleMethodSymbol]();
47
- return this;
48
- }
41
+ /**
42
+ * @returns {symbol}
43
+ * @summary Returns the instance symbol for the KPI Tile control.
44
+ */
45
+ [assembleMethodSymbol]() {
46
+ super[assembleMethodSymbol]();
47
+ return this;
48
+ }
49
49
 
50
- /**
51
- * To set the option via the HTML Tag use the attribute `data-monster-options-`
52
- * with the name of the option.
53
- *
54
- * @property {Object} templates
55
- * @property {string} templates.main The main template for the KPI Tile control.
56
- * @property {Object} values
57
- * @property {string} values.main The main value displayed in the tile.
58
- * @property {string} values.small The small value displayed in the tile.
59
- * @property {string} values.top The top value displayed in the tile.
60
- * @property {string} values.bottom The bottom value displayed in the tile.
61
- * @returns {Object}
62
- * @summary Returns the default options for the KPI Tile control.
63
- */
64
- get defaults() {
65
- return Object.assign({}, super.defaults, {
66
- templates: {
67
- main: getTemplate(),
68
- },
69
- values: {
70
- main: null,
71
- small: null,
72
- top: null,
73
- bottom: null,
74
- },
75
- });
76
- }
50
+ /**
51
+ * To set the option via the HTML Tag use the attribute `data-monster-options-`
52
+ * with the name of the option.
53
+ *
54
+ * @property {Object} templates
55
+ * @property {string} templates.main The main template for the KPI Tile control.
56
+ * @property {Object} values
57
+ * @property {string} values.main The main value displayed in the tile.
58
+ * @property {string} values.small The small value displayed in the tile.
59
+ * @property {string} values.top The top value displayed in the tile.
60
+ * @property {string} values.bottom The bottom value displayed in the tile.
61
+ * @returns {Object}
62
+ * @summary Returns the default options for the KPI Tile control.
63
+ */
64
+ get defaults() {
65
+ return Object.assign({}, super.defaults, {
66
+ templates: {
67
+ main: getTemplate(),
68
+ },
69
+ values: {
70
+ main: null,
71
+ small: null,
72
+ top: null,
73
+ bottom: null,
74
+ },
75
+ });
76
+ }
77
77
 
78
- /**
79
- * @returns {string}
80
- * @summary Returns the role of the control.
81
- */
82
- static getTag() {
83
- return "monster-kpi-tile";
84
- }
78
+ /**
79
+ * @returns {string}
80
+ * @summary Returns the role of the control.
81
+ */
82
+ static getTag() {
83
+ return "monster-kpi-tile";
84
+ }
85
85
 
86
- /**
87
- * @returns {string}
88
- * @summary Returns the role of the control.
89
- */
90
- static getCSSStyleSheet() {
91
- return [KpiTileStyleSheet];
92
- }
86
+ /**
87
+ * @returns {string}
88
+ * @summary Returns the role of the control.
89
+ */
90
+ static getCSSStyleSheet() {
91
+ return [KpiTileStyleSheet];
92
+ }
93
93
  }
94
94
 
95
95
  /**
@@ -98,7 +98,7 @@ class KpiTile extends CustomElement {
98
98
  * @summary Returns the template for the KPI Tile control.
99
99
  */
100
100
  function getTemplate() {
101
- return `
101
+ return `
102
102
  <div data-monster-role="control" part="control">
103
103
  <div class="top" data-monster-role="top" part="top" data-monster-replace="path:values.top">—</div>
104
104
  <div data-monster-role="main" part="main" data-monster-replace="path:values.main">—</div>
@@ -5,6 +5,8 @@
5
5
 
6
6
 
7
7
  [data-monster-role="control"] {
8
+ width: max-content;
9
+
8
10
  & a {
9
11
  display: flex;
10
12
  align-items: center;
@@ -25,7 +25,7 @@ try {
25
25
  FilterButtonStyleSheet.insertRule(
26
26
  `
27
27
  @layer filterbutton {
28
- :host{display:flex}[data-monster-role=control] a{align-items:center;background:none;color:var(--monster-color-primary-1);display:flex}:is([data-monster-role=control] a):after{background-color:var(--monster-color-primary-1);content:\"\";display:inline-block;height:16px;margin:0 3px 0 5px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-filter-square' viewBox='0 0 16 16'%3E%3Cpath d='M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z'/%3E%3Cpath d='M6 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-filter-square' viewBox='0 0 16 16'%3E%3Cpath d='M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z'/%3E%3Cpath d='M6 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E\");-webkit-mask-size:cover;mask-size:cover;width:16px}
28
+ :host{display:flex}[data-monster-role=control]{width:-moz-max-content;width:max-content}[data-monster-role=control] a{align-items:center;background:none;color:var(--monster-color-primary-1);display:flex}:is([data-monster-role=control] a):after{background-color:var(--monster-color-primary-1);content:\"\";display:inline-block;height:16px;margin:0 3px 0 5px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-filter-square' viewBox='0 0 16 16'%3E%3Cpath d='M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z'/%3E%3Cpath d='M6 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-filter-square' viewBox='0 0 16 16'%3E%3Cpath d='M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z'/%3E%3Cpath d='M6 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E\");-webkit-mask-size:cover;mask-size:cover;width:16px}
29
29
  }`,
30
30
  0,
31
31
  );
@@ -126,6 +126,14 @@ class TreeMenu extends CustomElement {
126
126
  * @property {String} mapping.idTemplate template with the id placeholders in the form ${name}, where name is the key
127
127
  * @property {String} mapping.parentKey the parent key
128
128
  * @property {String} mapping.selection the selection
129
+ * @property {Function} mapping.filter a filter function to filter the entries
130
+ * @property {Object} classes
131
+ * @property {String} classes.control the class for the control element
132
+ * @property {String} classes.label the class for the label element
133
+ * @property {Object} actions
134
+ * @property {Function} actions.open the action to open an entry (arguments, etnry, index, event)
135
+ * @property {Function} actions.close the action to close an entry (arguments, etnry, index, event)
136
+ * @property {Function} actions.select the action to select an entry (arguments, etnry, index, event)
129
137
  */
130
138
  get defaults() {
131
139
  return Object.assign({}, super.defaults, {
@@ -157,7 +165,7 @@ class TreeMenu extends CustomElement {
157
165
  open: null,
158
166
  close: null,
159
167
  select: (entry) => {
160
- throw new Error("no action defined for select");
168
+ console.warn("select action is not defined", entry);
161
169
  },
162
170
  },
163
171
 
@@ -361,7 +369,7 @@ function initEventHandler() {
361
369
  container.classList.add("selected");
362
370
 
363
371
  if (isFunction(doAction)) {
364
- doAction.call(this, currentEntry, index);
372
+ doAction.call(this, currentEntry, index, event);
365
373
  }
366
374
  return;
367
375
  }
@@ -156,7 +156,7 @@ function getMonsterVersion() {
156
156
  }
157
157
 
158
158
  /** don't touch, replaced by make with package.json version */
159
- monsterVersion = new Version("4.37.2");
159
+ monsterVersion = new Version("4.38.0");
160
160
 
161
161
  return monsterVersion;
162
162
  }
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("4.37.2")
10
+ monsterVersion = new Version("4.38.0")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -9,8 +9,8 @@
9
9
  </head>
10
10
  <body>
11
11
  <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
12
- <h1 style='margin-bottom: 0.1em;'>Monster 4.37.2</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Mo 21. Jul 18:16:57 CEST 2025</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 4.38.0</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Mi 23. Jul 15:15:52 CEST 2025</div>
14
14
  </div>
15
15
  <div id="mocha-errors"
16
16
  style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>