@schukai/monster 3.71.2 → 3.72.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/dataset.mjs +272 -272
  4. package/source/components/datatable/datasource/dom.mjs +1 -1
  5. package/source/components/datatable/datasource/rest.mjs +408 -410
  6. package/source/components/datatable/filter.mjs +0 -1
  7. package/source/components/datatable/style/datatable.pcss +7 -5
  8. package/source/components/datatable/style/embedded-pagination.pcss +1 -1
  9. package/source/components/datatable/style/pagination.pcss +1 -1
  10. package/source/components/datatable/stylesheet/change-button.mjs +2 -4
  11. package/source/components/datatable/stylesheet/column-bar.mjs +2 -4
  12. package/source/components/datatable/stylesheet/dataset.mjs +2 -4
  13. package/source/components/datatable/stylesheet/datasource.mjs +1 -3
  14. package/source/components/datatable/stylesheet/datatable.mjs +2 -4
  15. package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
  16. package/source/components/datatable/stylesheet/filter-button.mjs +1 -3
  17. package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +14 -7
  18. package/source/components/datatable/stylesheet/filter-date-range.mjs +1 -3
  19. package/source/components/datatable/stylesheet/filter-range.mjs +1 -3
  20. package/source/components/datatable/stylesheet/filter.mjs +2 -4
  21. package/source/components/datatable/stylesheet/pagination.mjs +2 -4
  22. package/source/components/datatable/stylesheet/save-button.mjs +2 -4
  23. package/source/components/datatable/stylesheet/select-filter.mjs +2 -4
  24. package/source/components/datatable/stylesheet/status.mjs +2 -4
  25. package/source/components/form/context-error.mjs +0 -2
  26. package/source/components/form/context-help.mjs +1 -2
  27. package/source/components/form/field-set.mjs +219 -219
  28. package/source/components/form/form.mjs +137 -187
  29. package/source/components/form/reload.mjs +211 -211
  30. package/source/components/form/select.mjs +12 -13
  31. package/source/components/form/style/field-set.pcss +2 -2
  32. package/source/components/form/style/form.pcss +8 -0
  33. package/source/components/form/stylesheet/action-button.mjs +2 -4
  34. package/source/components/form/stylesheet/api-button.mjs +1 -3
  35. package/source/components/form/stylesheet/button-bar.mjs +2 -4
  36. package/source/components/form/stylesheet/button.mjs +2 -4
  37. package/source/components/form/stylesheet/confirm-button.mjs +2 -4
  38. package/source/components/form/stylesheet/context-error.mjs +2 -4
  39. package/source/components/form/stylesheet/context-help.mjs +2 -4
  40. package/source/components/form/stylesheet/field-set.mjs +14 -7
  41. package/source/components/form/stylesheet/form.mjs +1 -1
  42. package/source/components/form/stylesheet/message-state-button.mjs +1 -3
  43. package/source/components/form/stylesheet/popper-button.mjs +2 -4
  44. package/source/components/form/stylesheet/select.mjs +14 -7
  45. package/source/components/form/stylesheet/state-button.mjs +2 -4
  46. package/source/components/form/stylesheet/tree-select.mjs +1 -3
  47. package/source/components/host/stylesheet/call-button.mjs +2 -4
  48. package/source/components/host/stylesheet/config-manager.mjs +1 -3
  49. package/source/components/host/stylesheet/host.mjs +2 -4
  50. package/source/components/host/stylesheet/overlay.mjs +2 -4
  51. package/source/components/host/stylesheet/toggle-button.mjs +2 -4
  52. package/source/components/host/stylesheet/viewer.mjs +2 -4
  53. package/source/components/layout/style/collapse.pcss +2 -2
  54. package/source/components/layout/style/details.pcss +2 -2
  55. package/source/components/layout/stylesheet/collapse.mjs +14 -7
  56. package/source/components/layout/stylesheet/details.mjs +2 -4
  57. package/source/components/layout/stylesheet/panel.mjs +2 -4
  58. package/source/components/layout/stylesheet/popper.mjs +2 -4
  59. package/source/components/layout/stylesheet/split-panel.mjs +1 -3
  60. package/source/components/layout/stylesheet/tabs.mjs +2 -4
  61. package/source/components/layout/stylesheet/width-toggle.mjs +1 -3
  62. package/source/components/navigation/stylesheet/table-of-content.mjs +2 -4
  63. package/source/components/notify/stylesheet/message.mjs +2 -4
  64. package/source/components/notify/stylesheet/notify.mjs +2 -4
  65. package/source/components/state/stylesheet/log.mjs +2 -4
  66. package/source/components/state/stylesheet/state.mjs +2 -4
  67. package/source/components/style/control.pcss +5 -0
  68. package/source/components/style/data-grid.pcss +2 -2
  69. package/source/components/style/mixin/typography.pcss +7 -1
  70. package/source/components/style/normalize.pcss +1 -1
  71. package/source/components/stylesheet/badge.mjs +1 -3
  72. package/source/components/stylesheet/border.mjs +1 -3
  73. package/source/components/stylesheet/button.mjs +1 -3
  74. package/source/components/stylesheet/card.mjs +1 -3
  75. package/source/components/stylesheet/color.mjs +1 -3
  76. package/source/components/stylesheet/common.mjs +1 -3
  77. package/source/components/stylesheet/control.mjs +2 -4
  78. package/source/components/stylesheet/data-grid.mjs +2 -4
  79. package/source/components/stylesheet/display.mjs +1 -3
  80. package/source/components/stylesheet/floating-ui.mjs +1 -3
  81. package/source/components/stylesheet/form.mjs +13 -6
  82. package/source/components/stylesheet/host.mjs +1 -3
  83. package/source/components/stylesheet/icons.mjs +1 -3
  84. package/source/components/stylesheet/mixin/badge.mjs +1 -3
  85. package/source/components/stylesheet/mixin/button.mjs +1 -3
  86. package/source/components/stylesheet/mixin/form.mjs +13 -6
  87. package/source/components/stylesheet/mixin/hover.mjs +1 -3
  88. package/source/components/stylesheet/mixin/icon.mjs +1 -3
  89. package/source/components/stylesheet/mixin/media.mjs +1 -3
  90. package/source/components/stylesheet/mixin/property.mjs +13 -6
  91. package/source/components/stylesheet/mixin/skeleton.mjs +1 -3
  92. package/source/components/stylesheet/mixin/spinner.mjs +1 -3
  93. package/source/components/stylesheet/mixin/typography.mjs +1 -3
  94. package/source/components/stylesheet/normalize.mjs +1 -3
  95. package/source/components/stylesheet/popper.mjs +1 -3
  96. package/source/components/stylesheet/property.mjs +2 -4
  97. package/source/components/stylesheet/ripple.mjs +1 -3
  98. package/source/components/stylesheet/skeleton.mjs +1 -3
  99. package/source/components/stylesheet/space.mjs +1 -3
  100. package/source/components/stylesheet/spinner.mjs +1 -3
  101. package/source/components/stylesheet/table.mjs +1 -3
  102. package/source/components/stylesheet/theme.mjs +1 -3
  103. package/source/components/stylesheet/typography.mjs +13 -6
  104. package/source/components/tree-menu/dragable-tree-menu.mjs +693 -0
  105. package/source/components/tree-menu/style/tree-menu.pcss +69 -42
  106. package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -17
  107. package/source/components/tree-menu/tree-menu.mjs +468 -532
  108. package/source/data/datasource/server/restapi.mjs +194 -191
  109. package/source/data/datasource/server.mjs +107 -105
  110. package/source/data/diff.mjs +1 -1
  111. package/source/dom/customelement.mjs +2 -6
  112. package/source/dom/slotted.mjs +89 -85
  113. package/test/cases/components/host/details.mjs +1 -1
  114. package/test/cases/components/host/host.mjs +1 -1
  115. package/test/cases/components/host/overlay.mjs +1 -1
  116. package/test/cases/dom/customcontrol.mjs +1 -1
  117. package/test/cases/dom/customelement.mjs +2 -2
@@ -12,25 +12,25 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {instanceSymbol} from "../../constants.mjs";
16
- import {addAttributeToken} from "../../dom/attributes.mjs";
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { addAttributeToken } from "../../dom/attributes.mjs";
17
17
  import {
18
- ATTRIBUTE_ERRORMESSAGE,
19
- ATTRIBUTE_ROLE,
18
+ ATTRIBUTE_ERRORMESSAGE,
19
+ ATTRIBUTE_ROLE,
20
20
  } from "../../dom/constants.mjs";
21
- import {CustomControl} from "../../dom/customcontrol.mjs";
21
+ import { CustomControl } from "../../dom/customcontrol.mjs";
22
22
  import {
23
- assembleMethodSymbol,
24
- getSlottedElements,
25
- registerCustomElement,
23
+ assembleMethodSymbol,
24
+ getSlottedElements,
25
+ registerCustomElement,
26
26
  } from "../../dom/customelement.mjs";
27
- import {isFunction} from "../../types/is.mjs";
28
- import {FieldSetStyleSheet} from "./stylesheet/field-set.mjs";
27
+ import { isFunction } from "../../types/is.mjs";
28
+ import { FieldSetStyleSheet } from "./stylesheet/field-set.mjs";
29
29
  import "../layout/collapse.mjs";
30
30
  import "./toggle-switch.mjs";
31
31
 
32
- export {FieldSet};
33
-
32
+ export { FieldSet };
33
+
34
34
  /**
35
35
  * @private
36
36
  * @type {symbol}
@@ -101,178 +101,178 @@ const extendedSwitchElementSymbol = Symbol("extendedSwitchElement");
101
101
  * @summary A simple FieldSet
102
102
  */
103
103
  class FieldSet extends CustomControl {
104
- /**
105
- * This method is called by the `instanceof` operator.
106
- * @returns {symbol}
107
- */
108
- static get [instanceSymbol]() {
109
- return Symbol.for("@schukai/monster/components/form/fieldset@@instance");
110
- }
111
-
112
- /**
113
- * @return {Components.Form.FieldSet
114
- */
115
- [assembleMethodSymbol]() {
116
- super[assembleMethodSymbol]();
117
- initControlReferences.call(this);
118
- initEventHandler.call(this);
119
- updateExtendedFields.call(this);
120
- return this;
121
- }
122
-
123
- /**
124
- * To set the options via the html tag the attribute `data-monster-options` must be used.
125
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
126
- *
127
- * The individual configuration values can be found in the table.
128
- *
129
- * @property {Object} templates Template definitions
130
- * @property {string} templates.main Main template
131
- * @property {Object} labels Label definitions
132
- * @property {Object} actions Callbacks
133
- * @property {string} actions.click="throw Error" Callback when clicked
134
- * @property {Object} features Features
135
- * @property {Object} classes CSS classes
136
- * @property {boolean} disabled=false Disabled state
137
- */
138
- get defaults() {
139
- return Object.assign({}, super.defaults, {
140
- templates: {
141
- main: getTemplate(),
142
- },
143
- labels: {
144
- "toggle-switch-on": "✔",
145
- "toggle-switch-off": "✖",
146
- "toggle-switch-label": "Expand",
147
- title: "",
148
- },
149
- classes: {},
150
- disabled: false,
151
- features: {},
152
- actions: {
153
- click: () => {
154
- throw new Error("the click action is not defined");
155
- },
156
- },
157
- value: null,
158
- });
159
- }
160
-
161
- /**
162
- *
163
- * @return {string}
164
- */
165
- static getTag() {
166
- return "monster-field-set";
167
- }
168
-
169
- /**
170
- *
171
- * @return {CSSStyleSheet[]}
172
- */
173
- static getCSSStyleSheet() {
174
- return [FieldSetStyleSheet];
175
- }
176
-
177
- /**
178
- * The FieldSet.click() method simulates a click on the internal element.
179
- *
180
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click}
181
- */
182
- click() {
183
- if (this.getOption("disabled") === true) {
184
- return;
185
- }
186
-
187
- if (
188
- this[fieldSetElementSymbol] &&
189
- isFunction(this[fieldSetElementSymbol].click)
190
- ) {
191
- this[fieldSetElementSymbol].click();
192
- }
193
- }
194
-
195
- /**
196
- * The Button.focus() method sets focus on the internal element.
197
- *
198
- * @param {Object} options
199
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus}
200
- */
201
- focus(options) {
202
- if (this.getOption("disabled") === true) {
203
- return;
204
- }
205
-
206
- if (
207
- this[fieldSetElementSymbol] &&
208
- isFunction(this[fieldSetElementSymbol].focus)
209
- ) {
210
- this[fieldSetElementSymbol].focus(options);
211
- }
212
- }
213
-
214
- /**
215
- * The Button.blur() method removes focus from the internal element.
216
- */
217
- blur() {
218
- if (
219
- this[fieldSetElementSymbol] &&
220
- isFunction(this[fieldSetElementSymbol].blur)
221
- ) {
222
- this[fieldSetElementSymbol].blur();
223
- }
224
- }
225
-
226
- /**
227
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}
228
- * @return {boolean}
229
- */
230
- static get formAssociated() {
231
- return true;
232
- }
233
-
234
- /**
235
- * The current value of the form control.
236
- *
237
- * ```js
238
- * e = document.querySelector('monster-field-set');
239
- * console.log(e.value)
240
- * ```
241
- *
242
- * @property {string}
243
- */
244
- get value() {
245
- return this.getOption("value");
246
- }
247
-
248
- /**
249
- * Set value of the form control.
250
- *
251
- * ```
252
- * e = document.querySelector('monster-field-set');
253
- * e.value=1
254
- * ```
255
- *
256
- * @property {string} value
257
- * @throws {Error} unsupported type
258
- */
259
- set value(value) {
260
- this.setOption("value", value);
261
- try {
262
- this?.setFormValue(this.value);
263
- } catch (e) {
264
- addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
265
- }
266
- }
104
+ /**
105
+ * This method is called by the `instanceof` operator.
106
+ * @returns {symbol}
107
+ */
108
+ static get [instanceSymbol]() {
109
+ return Symbol.for("@schukai/monster/components/form/fieldset@@instance");
110
+ }
111
+
112
+ /**
113
+ * @return {Components.Form.FieldSet
114
+ */
115
+ [assembleMethodSymbol]() {
116
+ super[assembleMethodSymbol]();
117
+ initControlReferences.call(this);
118
+ initEventHandler.call(this);
119
+ updateExtendedFields.call(this);
120
+ return this;
121
+ }
122
+
123
+ /**
124
+ * To set the options via the html tag the attribute `data-monster-options` must be used.
125
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
126
+ *
127
+ * The individual configuration values can be found in the table.
128
+ *
129
+ * @property {Object} templates Template definitions
130
+ * @property {string} templates.main Main template
131
+ * @property {Object} labels Label definitions
132
+ * @property {Object} actions Callbacks
133
+ * @property {string} actions.click="throw Error" Callback when clicked
134
+ * @property {Object} features Features
135
+ * @property {Object} classes CSS classes
136
+ * @property {boolean} disabled=false Disabled state
137
+ */
138
+ get defaults() {
139
+ return Object.assign({}, super.defaults, {
140
+ templates: {
141
+ main: getTemplate(),
142
+ },
143
+ labels: {
144
+ "toggle-switch-on": "✔",
145
+ "toggle-switch-off": "✖",
146
+ "toggle-switch-label": "Expand",
147
+ title: "",
148
+ },
149
+ classes: {},
150
+ disabled: false,
151
+ features: {},
152
+ actions: {
153
+ click: () => {
154
+ throw new Error("the click action is not defined");
155
+ },
156
+ },
157
+ value: null,
158
+ });
159
+ }
160
+
161
+ /**
162
+ *
163
+ * @return {string}
164
+ */
165
+ static getTag() {
166
+ return "monster-field-set";
167
+ }
168
+
169
+ /**
170
+ *
171
+ * @return {CSSStyleSheet[]}
172
+ */
173
+ static getCSSStyleSheet() {
174
+ return [FieldSetStyleSheet];
175
+ }
176
+
177
+ /**
178
+ * The FieldSet.click() method simulates a click on the internal element.
179
+ *
180
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click}
181
+ */
182
+ click() {
183
+ if (this.getOption("disabled") === true) {
184
+ return;
185
+ }
186
+
187
+ if (
188
+ this[fieldSetElementSymbol] &&
189
+ isFunction(this[fieldSetElementSymbol].click)
190
+ ) {
191
+ this[fieldSetElementSymbol].click();
192
+ }
193
+ }
194
+
195
+ /**
196
+ * The Button.focus() method sets focus on the internal element.
197
+ *
198
+ * @param {Object} options
199
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus}
200
+ */
201
+ focus(options) {
202
+ if (this.getOption("disabled") === true) {
203
+ return;
204
+ }
205
+
206
+ if (
207
+ this[fieldSetElementSymbol] &&
208
+ isFunction(this[fieldSetElementSymbol].focus)
209
+ ) {
210
+ this[fieldSetElementSymbol].focus(options);
211
+ }
212
+ }
213
+
214
+ /**
215
+ * The Button.blur() method removes focus from the internal element.
216
+ */
217
+ blur() {
218
+ if (
219
+ this[fieldSetElementSymbol] &&
220
+ isFunction(this[fieldSetElementSymbol].blur)
221
+ ) {
222
+ this[fieldSetElementSymbol].blur();
223
+ }
224
+ }
225
+
226
+ /**
227
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}
228
+ * @return {boolean}
229
+ */
230
+ static get formAssociated() {
231
+ return true;
232
+ }
233
+
234
+ /**
235
+ * The current value of the form control.
236
+ *
237
+ * ```js
238
+ * e = document.querySelector('monster-field-set');
239
+ * console.log(e.value)
240
+ * ```
241
+ *
242
+ * @property {string}
243
+ */
244
+ get value() {
245
+ return this.getOption("value");
246
+ }
247
+
248
+ /**
249
+ * Set value of the form control.
250
+ *
251
+ * ```
252
+ * e = document.querySelector('monster-field-set');
253
+ * e.value=1
254
+ * ```
255
+ *
256
+ * @property {string} value
257
+ * @throws {Error} unsupported type
258
+ */
259
+ set value(value) {
260
+ this.setOption("value", value);
261
+ try {
262
+ this?.setFormValue(this.value);
263
+ } catch (e) {
264
+ addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.message);
265
+ }
266
+ }
267
267
  }
268
268
 
269
269
  function updateExtendedFields() {
270
- const nodes = getSlottedElements.call(this, "", "extended");
271
- if (nodes.size > 0) {
272
- this[extendedSwitchSymbol].classList.remove("hidden");
273
- } else {
274
- this[extendedSwitchSymbol].classList.add("hidden");
275
- }
270
+ const nodes = getSlottedElements.call(this, "", "extended");
271
+ if (nodes.size > 0) {
272
+ this[extendedSwitchSymbol].classList.remove("hidden");
273
+ } else {
274
+ this[extendedSwitchSymbol].classList.add("hidden");
275
+ }
276
276
  }
277
277
 
278
278
  /**
@@ -281,53 +281,53 @@ function updateExtendedFields() {
281
281
  * @fires Monster.Components.Form.event:monster-field-set-clicked
282
282
  */
283
283
  function initEventHandler() {
284
- this[toggleSwitchElementSymbol].setOption(
285
- "labels.toggle-switch-on",
286
- this.getOption("labels.toggle-switch-on"),
287
- );
288
- this[toggleSwitchElementSymbol].setOption(
289
- "labels.toggle-switch-off",
290
- this.getOption("labels.toggle-switch-off"),
291
- );
292
-
293
- this[toggleSwitchElementSymbol].setOption("actions.on", () => {
294
- this[collapseElementSymbol].open();
295
- });
296
-
297
- this[toggleSwitchElementSymbol].setOption("actions.off", () => {
298
- this[collapseElementSymbol].close();
299
- });
300
-
301
- return this;
284
+ this[toggleSwitchElementSymbol].setOption(
285
+ "labels.toggle-switch-on",
286
+ this.getOption("labels.toggle-switch-on"),
287
+ );
288
+ this[toggleSwitchElementSymbol].setOption(
289
+ "labels.toggle-switch-off",
290
+ this.getOption("labels.toggle-switch-off"),
291
+ );
292
+
293
+ this[toggleSwitchElementSymbol].setOption("actions.on", () => {
294
+ this[collapseElementSymbol].open();
295
+ });
296
+
297
+ this[toggleSwitchElementSymbol].setOption("actions.off", () => {
298
+ this[collapseElementSymbol].close();
299
+ });
300
+
301
+ return this;
302
302
  }
303
303
 
304
304
  /**
305
305
  * @private
306
306
  */
307
307
  function initControlReferences() {
308
- this[fieldSetElementSymbol] = this.shadowRoot.querySelector(
309
- `[${ATTRIBUTE_ROLE}="control"]`,
310
- );
308
+ this[fieldSetElementSymbol] = this.shadowRoot.querySelector(
309
+ `[${ATTRIBUTE_ROLE}="control"]`,
310
+ );
311
311
 
312
- this[extendedSwitchElementSymbol] = this.shadowRoot.querySelector(
313
- `[${ATTRIBUTE_ROLE}="extended-switch"]`,
314
- );
312
+ this[extendedSwitchElementSymbol] = this.shadowRoot.querySelector(
313
+ `[${ATTRIBUTE_ROLE}="extended-switch"]`,
314
+ );
315
315
 
316
- this[collapseElementSymbol] = this.shadowRoot.querySelector(
317
- `[${ATTRIBUTE_ROLE}="collapse"]`,
318
- );
316
+ this[collapseElementSymbol] = this.shadowRoot.querySelector(
317
+ `[${ATTRIBUTE_ROLE}="collapse"]`,
318
+ );
319
319
 
320
- this[headerElementSymbol] = this.shadowRoot.querySelector(
321
- `[${ATTRIBUTE_ROLE}="header"]`,
322
- );
320
+ this[headerElementSymbol] = this.shadowRoot.querySelector(
321
+ `[${ATTRIBUTE_ROLE}="header"]`,
322
+ );
323
323
 
324
- this[extendedSwitchSymbol] = this.shadowRoot.querySelector(
325
- `[${ATTRIBUTE_ROLE}="extended-switch"]`,
326
- );
324
+ this[extendedSwitchSymbol] = this.shadowRoot.querySelector(
325
+ `[${ATTRIBUTE_ROLE}="extended-switch"]`,
326
+ );
327
327
 
328
- this[toggleSwitchElementSymbol] = this.shadowRoot.querySelector(
329
- `monster-toggle-switch`,
330
- );
328
+ this[toggleSwitchElementSymbol] = this.shadowRoot.querySelector(
329
+ `monster-toggle-switch`,
330
+ );
331
331
  }
332
332
 
333
333
  /**
@@ -335,8 +335,8 @@ function initControlReferences() {
335
335
  * @return {string}
336
336
  */
337
337
  function getTemplate() {
338
- // language=HTML
339
- return `
338
+ // language=HTML
339
+ return `
340
340
  <div data-monster-role="control" part="control">
341
341
  <div data-monster-role="header">
342
342
  <div data-monster-replace="path:labels.title" data-monster-role="title"></div>