@schukai/monster 3.79.0 → 3.80.1
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 +22 -0
- package/package.json +1 -1
- package/source/components/content/copy.mjs +314 -312
- package/source/components/content/stylesheet/copy.mjs +13 -6
- package/source/components/form/field-set.mjs +1 -2
- package/source/components/form/select.mjs +1945 -1957
- package/source/components/form/stylesheet/field-set.mjs +13 -6
- package/source/components/form/toggle-switch.mjs +319 -319
- package/source/components/layout/collapse.mjs +351 -351
- package/source/components/layout/details.mjs +1 -1
- package/source/components/layout/iframe.mjs +1 -1
- package/source/components/layout/width-toggle.mjs +2 -3
- package/source/components/state/log.mjs +151 -152
- package/source/components/state/state.mjs +1 -1
- package/source/components/stylesheet/form.mjs +13 -6
- package/source/components/tree-menu/dragable-tree-menu.mjs +664 -664
- package/source/components/tree-menu/tree-menu.mjs +3 -27
- package/source/dom/customelement.mjs +18 -1
- package/source/monster.mjs +1 -1
- package/source/types/base.mjs +1 -3
- package/source/types/nodelist.mjs +0 -1
- package/source/types/proxyobserver.mjs +0 -2
- package/source/types/queue.mjs +0 -2
- package/source/types/randomid.mjs +0 -1
- package/source/types/regex.mjs +0 -1
- package/source/types/stack.mjs +1 -2
- package/source/types/tokenlist.mjs +0 -2
- package/source/types/typeof.mjs +0 -2
- package/source/types/uniquequeue.mjs +0 -1
- package/source/types/uuid.mjs +1 -2
- package/source/types/version.mjs +3 -6
- package/test/cases/monster.mjs +1 -1
- package/test/util/jsdom.mjs +0 -2
- package/test/web/test.html +2 -2
- package/test/web/tests.js +7455 -8361
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
if (!this.shadowRoot) {
|
|
230
|
+
throw new Error("no shadow-root is defined");
|
|
231
|
+
}
|
|
233
232
|
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
this.shadowRoot.addEventListener("slotchange", (event) => {
|
|
234
|
+
const slottedElements = getSlottedElements.call(this);
|
|
236
235
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
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
|
-
|
|
253
|
-
|
|
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
|
-
|
|
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
|
-
}`,
|
|
29
|
+
}`,
|
|
30
|
+
0,
|
|
31
|
+
);
|
|
29
32
|
} catch (e) {
|
|
30
|
-
|
|
33
|
+
addAttributeToken(
|
|
34
|
+
document.getRootNode().querySelector("html"),
|
|
35
|
+
ATTRIBUTE_ERRORMESSAGE,
|
|
36
|
+
e + "",
|
|
37
|
+
);
|
|
31
38
|
}
|