@schukai/monster 3.79.0 → 3.80.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +1 -1
  3. package/source/components/content/copy.mjs +314 -312
  4. package/source/components/content/stylesheet/copy.mjs +13 -6
  5. package/source/components/form/field-set.mjs +1 -2
  6. package/source/components/form/select.mjs +1945 -1957
  7. package/source/components/form/stylesheet/field-set.mjs +13 -6
  8. package/source/components/form/toggle-switch.mjs +319 -319
  9. package/source/components/layout/collapse.mjs +351 -351
  10. package/source/components/layout/details.mjs +1 -1
  11. package/source/components/layout/iframe.mjs +1 -1
  12. package/source/components/layout/width-toggle.mjs +2 -3
  13. package/source/components/state/log.mjs +151 -152
  14. package/source/components/state/state.mjs +1 -1
  15. package/source/components/stylesheet/form.mjs +13 -6
  16. package/source/components/tree-menu/dragable-tree-menu.mjs +664 -664
  17. package/source/components/tree-menu/tree-menu.mjs +3 -27
  18. package/source/dom/customelement.mjs +18 -1
  19. package/source/monster.mjs +1 -1
  20. package/source/types/base.mjs +1 -3
  21. package/source/types/nodelist.mjs +0 -1
  22. package/source/types/proxyobserver.mjs +0 -2
  23. package/source/types/queue.mjs +0 -2
  24. package/source/types/randomid.mjs +0 -1
  25. package/source/types/regex.mjs +0 -1
  26. package/source/types/stack.mjs +1 -2
  27. package/source/types/tokenlist.mjs +0 -2
  28. package/source/types/typeof.mjs +0 -2
  29. package/source/types/uniquequeue.mjs +0 -1
  30. package/source/types/uuid.mjs +1 -2
  31. package/source/types/version.mjs +3 -6
  32. package/test/cases/monster.mjs +1 -1
  33. package/test/util/jsdom.mjs +0 -2
  34. package/test/web/test.html +2 -2
  35. package/test/web/tests.js +7455 -8361
@@ -188,7 +188,7 @@ function initButtonLabel() {
188
188
  label = "";
189
189
  }
190
190
 
191
- if (label==="") {
191
+ if (label === "") {
192
192
  label = this.innerText;
193
193
  }
194
194
 
@@ -61,7 +61,7 @@ const timerCallbackSymbol = Symbol("timerCallback");
61
61
  * @fragments /fragments/components/layout/iframe/
62
62
  *
63
63
  * @example /examples/components/layout/iframe-simple
64
- *
64
+ *
65
65
  * @since 3.76.0
66
66
  * @copyright schukai GmbH
67
67
  * @summary A cool and fancy Iframe that can make your life easier and also looks good.
@@ -63,8 +63,8 @@ const MODE_WIDE = "wide";
63
63
  *
64
64
  * @since 3.57.0
65
65
  * @copyright schukai GmbH
66
- * @summary The WidthToggle component allows users to dynamically change the width of a panel by clicking a button.
67
- * @summary This feature improves readability and space utilization by allowing the panel width to be adjusted
66
+ * @summary The WidthToggle component allows users to dynamically change the width of a panel by clicking a button.
67
+ * @summary This feature improves readability and space utilization by allowing the panel width to be adjusted
68
68
  * @summary according to user preferences.
69
69
  */
70
70
  class WidthToggle extends CustomElement {
@@ -124,7 +124,6 @@ class WidthToggle extends CustomElement {
124
124
  * @throws {Error} - If the mode is not supported.
125
125
  */
126
126
 
127
-
128
127
  /**
129
128
  * @param {string} mode
130
129
  * @returns {WidthToggle}
@@ -12,19 +12,19 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {instanceSymbol} from "../../constants.mjs";
15
+ import { instanceSymbol } from "../../constants.mjs";
16
16
  import {
17
- assembleMethodSymbol,
18
- CustomElement,
19
- getSlottedElements,
20
- registerCustomElement,
17
+ assembleMethodSymbol,
18
+ CustomElement,
19
+ getSlottedElements,
20
+ registerCustomElement,
21
21
  } from "../../dom/customelement.mjs";
22
- import {LogStyleSheet} from "./stylesheet/log.mjs";
23
- import {Entry} from "./log/entry.mjs";
24
- import {validateInstance} from "../../types/validate.mjs";
22
+ import { LogStyleSheet } from "./stylesheet/log.mjs";
23
+ import { Entry } from "./log/entry.mjs";
24
+ import { validateInstance } from "../../types/validate.mjs";
25
25
  import "./state.mjs";
26
26
 
27
- export {Log};
27
+ export { Log };
28
28
 
29
29
  /**
30
30
  * @private
@@ -72,7 +72,6 @@ const emptyStateElementSymbol = Symbol("emptyStateElement");
72
72
  * @summary Log is a control to show a log message.
73
73
  */
74
74
 
75
-
76
75
  /**
77
76
  * A Log component
78
77
  *
@@ -85,124 +84,124 @@ const emptyStateElementSymbol = Symbol("emptyStateElement");
85
84
  * @summary A Log component to show a log message.
86
85
  */
87
86
  class Log extends CustomElement {
88
- /**
89
- * @return {void}
90
- */
91
- [assembleMethodSymbol]() {
92
- super[assembleMethodSymbol]();
93
-
94
- initControlReferences.call(this);
95
- initEventHandler.call(this);
96
- }
97
-
98
- /**
99
- * This method is called by the `instanceof` operator.
100
- * @returns {symbol}
101
- */
102
- static get [instanceSymbol]() {
103
- return Symbol.for("@schukai/monster/components/state/log@@instance");
104
- }
105
-
106
- /**
107
- * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
108
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
109
- *
110
- * The individual configuration values can be found in the table.
111
- *
112
- * @property {Object} templates Template definitions
113
- * @property {string} templates.main Main template
114
- * @property {Object} labels Labels
115
- * @property {string} labels.nothingToReport Label for empty state
116
- */
117
- get defaults() {
118
- return Object.assign({}, super.defaults, {
119
- templates: {
120
- main: getTemplate(),
121
- },
122
-
123
- labels: {
124
- nothingToReport: "There is nothing to report yet.",
125
- },
126
-
127
- entries: [],
128
- });
129
- }
130
-
131
- /**
132
- * @return {void}
133
- */
134
- connectedCallback() {
135
- super.connectedCallback();
136
-
137
- const slottedElements = getSlottedElements.call(this);
138
- if (slottedElements.size > 0) {
139
- this[emptyStateElementSymbol].style.display = "none";
140
- }
141
- }
142
-
143
- /**
144
- * Clear the log
145
- *
146
- * @return {Log}
147
- */
148
- clear() {
149
- this[logElementSymbol].innerHTML = "";
150
- this[emptyStateElementSymbol].style.display = "block";
151
- return this;
152
- }
153
-
154
- /**
155
- * Add an entry to the log
156
- * @param entry
157
- * @returns {Log}
158
- */
159
- addEntry(entry) {
160
- validateInstance(entry, Entry);
161
-
162
- const entries = this.getOption("entries");
163
- entries.push(entry);
164
-
165
- /** this field is not used, but triggers a change event */
166
- this.setOption("length", entries.length - 1);
167
-
168
- return this;
169
- }
170
-
171
- /**
172
- * Add a log message
173
- * @param message
174
- * @param date
175
- * @returns {Log}
176
- */
177
- addMessage(message, date) {
178
- if (!date) {
179
- date = new Date();
180
- }
181
-
182
- this.addEntry(
183
- new Entry({
184
- message: message,
185
- date: date,
186
- }),
187
- );
188
-
189
- return this;
190
- }
191
-
192
- /**
193
- *
194
- * @return {string}
195
- */
196
- static getTag() {
197
- return "monster-log";
198
- }
199
-
200
- /**
201
- * @return {CSSStyleSheet[]}
202
- */
203
- static getCSSStyleSheet() {
204
- return [LogStyleSheet];
205
- }
87
+ /**
88
+ * @return {void}
89
+ */
90
+ [assembleMethodSymbol]() {
91
+ super[assembleMethodSymbol]();
92
+
93
+ initControlReferences.call(this);
94
+ initEventHandler.call(this);
95
+ }
96
+
97
+ /**
98
+ * This method is called by the `instanceof` operator.
99
+ * @returns {symbol}
100
+ */
101
+ static get [instanceSymbol]() {
102
+ return Symbol.for("@schukai/monster/components/state/log@@instance");
103
+ }
104
+
105
+ /**
106
+ * To set the options via the HTML tag, the attribute `data-monster-options` must be used.
107
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
108
+ *
109
+ * The individual configuration values can be found in the table.
110
+ *
111
+ * @property {Object} templates Template definitions
112
+ * @property {string} templates.main Main template
113
+ * @property {Object} labels Labels
114
+ * @property {string} labels.nothingToReport Label for empty state
115
+ */
116
+ get defaults() {
117
+ return Object.assign({}, super.defaults, {
118
+ templates: {
119
+ main: getTemplate(),
120
+ },
121
+
122
+ labels: {
123
+ nothingToReport: "There is nothing to report yet.",
124
+ },
125
+
126
+ entries: [],
127
+ });
128
+ }
129
+
130
+ /**
131
+ * @return {void}
132
+ */
133
+ connectedCallback() {
134
+ super.connectedCallback();
135
+
136
+ const slottedElements = getSlottedElements.call(this);
137
+ if (slottedElements.size > 0) {
138
+ this[emptyStateElementSymbol].style.display = "none";
139
+ }
140
+ }
141
+
142
+ /**
143
+ * Clear the log
144
+ *
145
+ * @return {Log}
146
+ */
147
+ clear() {
148
+ this[logElementSymbol].innerHTML = "";
149
+ this[emptyStateElementSymbol].style.display = "block";
150
+ return this;
151
+ }
152
+
153
+ /**
154
+ * Add an entry to the log
155
+ * @param entry
156
+ * @returns {Log}
157
+ */
158
+ addEntry(entry) {
159
+ validateInstance(entry, Entry);
160
+
161
+ const entries = this.getOption("entries");
162
+ entries.push(entry);
163
+
164
+ /** this field is not used, but triggers a change event */
165
+ this.setOption("length", entries.length - 1);
166
+
167
+ return this;
168
+ }
169
+
170
+ /**
171
+ * Add a log message
172
+ * @param message
173
+ * @param date
174
+ * @returns {Log}
175
+ */
176
+ addMessage(message, date) {
177
+ if (!date) {
178
+ date = new Date();
179
+ }
180
+
181
+ this.addEntry(
182
+ new Entry({
183
+ message: message,
184
+ date: date,
185
+ }),
186
+ );
187
+
188
+ return this;
189
+ }
190
+
191
+ /**
192
+ *
193
+ * @return {string}
194
+ */
195
+ static getTag() {
196
+ return "monster-log";
197
+ }
198
+
199
+ /**
200
+ * @return {CSSStyleSheet[]}
201
+ */
202
+ static getCSSStyleSheet() {
203
+ return [LogStyleSheet];
204
+ }
206
205
  }
207
206
 
208
207
  /**
@@ -211,37 +210,37 @@ class Log extends CustomElement {
211
210
  * @throws {Error} no shadow-root is defined
212
211
  */
213
212
  function initControlReferences() {
214
- if (!this.shadowRoot) {
215
- throw new Error("no shadow-root is defined");
216
- }
217
-
218
- this[logElementSymbol] = this.shadowRoot.querySelector(
219
- "[data-monster-role=control]",
220
- );
221
- this[emptyStateElementSymbol] = this.shadowRoot.querySelector(
222
- "[data-monster-role=empty-state]",
223
- );
213
+ if (!this.shadowRoot) {
214
+ throw new Error("no shadow-root is defined");
215
+ }
216
+
217
+ this[logElementSymbol] = this.shadowRoot.querySelector(
218
+ "[data-monster-role=control]",
219
+ );
220
+ this[emptyStateElementSymbol] = this.shadowRoot.querySelector(
221
+ "[data-monster-role=empty-state]",
222
+ );
224
223
  }
225
224
 
226
225
  /**
227
226
  * @private
228
227
  */
229
228
  function initEventHandler() {
230
- if (!this.shadowRoot) {
231
- throw new Error("no shadow-root is defined");
232
- }
229
+ if (!this.shadowRoot) {
230
+ throw new Error("no shadow-root is defined");
231
+ }
233
232
 
234
- this.shadowRoot.addEventListener("slotchange", (event) => {
235
- const slottedElements = getSlottedElements.call(this);
233
+ this.shadowRoot.addEventListener("slotchange", (event) => {
234
+ const slottedElements = getSlottedElements.call(this);
236
235
 
237
- if (slottedElements.size > 0) {
238
- this[emptyStateElementSymbol].style.display = "none";
239
- } else {
240
- this[emptyStateElementSymbol].style.display = "block";
241
- }
242
- });
236
+ if (slottedElements.size > 0) {
237
+ this[emptyStateElementSymbol].style.display = "none";
238
+ } else {
239
+ this[emptyStateElementSymbol].style.display = "block";
240
+ }
241
+ });
243
242
 
244
- return this;
243
+ return this;
245
244
  }
246
245
 
247
246
  /**
@@ -249,8 +248,8 @@ function initEventHandler() {
249
248
  * @return {string}
250
249
  */
251
250
  function getTemplate() {
252
- // language=HTML
253
- return `
251
+ // language=HTML
252
+ return `
254
253
  <template id="entry">
255
254
  <li data-monster-role="entry">
256
255
  <span></span>
@@ -53,7 +53,7 @@ class State extends CustomControl {
53
53
  * @returns {symbol}
54
54
  */
55
55
  static get [instanceSymbol]() {
56
- return Symbol.for("@schukai/monster/components/state/state@@instance");
56
+ return Symbol.for("@schukai/monster/components/state/state@@instance");
57
57
  }
58
58
 
59
59
  /**
@@ -10,10 +10,10 @@
10
10
  * For more information about purchasing a commercial license, please contact schukai GmbH.
11
11
  */
12
12
 
13
- import {addAttributeToken} from "../../dom/attributes.mjs";
14
- import {ATTRIBUTE_ERRORMESSAGE} from "../../dom/constants.mjs";
13
+ import { addAttributeToken } from "../../dom/attributes.mjs";
14
+ import { ATTRIBUTE_ERRORMESSAGE } from "../../dom/constants.mjs";
15
15
 
16
- export {FormStyleSheet}
16
+ export { FormStyleSheet };
17
17
 
18
18
  /**
19
19
  * @private
@@ -22,10 +22,17 @@ export {FormStyleSheet}
22
22
  const FormStyleSheet = new CSSStyleSheet();
23
23
 
24
24
  try {
25
- FormStyleSheet.insertRule(`
25
+ FormStyleSheet.insertRule(
26
+ `
26
27
  @layer form {
27
28
  input,meter,progress,select,textarea{accent-color:var(--monster-color-secondary-2);background-color:var(--monster-bg-color-primary-1);border-color:var(--monster-theme-control-border-color);border-radius:var(--monster-theme-control-border-radius);border-style:var(--monster-theme-control-border-style);border-width:var(--monster-theme-control-border-width);box-sizing:border-box;color:var(--monster-color-primary-1);font-family:inherit;font-size:100%;margin:0;outline:none}input,select,textarea{height:-moz-fit-content;height:fit-content;padding:.4rem .6rem}textarea{min-height:6rem;resize:vertical}input[type=color]{height:2rem;margin:0;padding:.1rem;width:2rem}input:hover:not([type=radio]):not([type=checkbox]):not([type=range]),select:hover,textarea:hover{box-shadow:var(--monster-box-shadow-2);transition:background .8s,color .25s .0833333333s}input:focus,select:focus,textarea:focus{outline:1px dashed var(--monster-color-selection-3);outline-offset:3px}
28
- }`, 0);
29
+ }`,
30
+ 0,
31
+ );
29
32
  } catch (e) {
30
- addAttributeToken(document.getRootNode().querySelector('html'), ATTRIBUTE_ERRORMESSAGE, e + "");
33
+ addAttributeToken(
34
+ document.getRootNode().querySelector("html"),
35
+ ATTRIBUTE_ERRORMESSAGE,
36
+ e + "",
37
+ );
31
38
  }