@schukai/monster 3.71.2 → 3.72.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.
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
@@ -327,7 +327,6 @@ class CustomElement extends HTMLElement {
327
327
  * @property {Object} templates Specifies the templates used by the control.
328
328
  * @property {string} templates.main=undefined Specifies the main template used by the control.
329
329
  * @property {Object} templateMapping Specifies the mapping of templates.
330
- * @property {string} display=block Specifies the display mode of the control.
331
330
  * @since 1.8.0
332
331
  */
333
332
  get defaults() {
@@ -339,20 +338,19 @@ class CustomElement extends HTMLElement {
339
338
  main: undefined,
340
339
  },
341
340
  templateMapping: {},
342
- display: "block"
343
341
  };
344
342
  }
345
343
 
346
344
  /**
347
345
  * This method updates the labels of the element.
348
- * The labels are defined in the options object.
346
+ * The labels are defined in the option object.
349
347
  * The key of the label is used to retrieve the translation from the document.
350
348
  * If the translation is different from the label, the label is updated.
351
349
  *
352
350
  * Before you can use this method, you must have loaded the translations.
353
351
  *
354
352
  * @returns {Monster.DOM.CustomElement}
355
- * @throws {Error} Cannot find element with translations. Add a translations object to the document.
353
+ * @throws {Error} Cannot find an element with translations. Add a translation object to the document.
356
354
  */
357
355
  updateI18n() {
358
356
  let translations;
@@ -597,8 +595,6 @@ class CustomElement extends HTMLElement {
597
595
  let elements;
598
596
  let nodeList;
599
597
 
600
- this.style.setProperty("display", this.getOption("display"));
601
-
602
598
  // Extract options from attributes and set them
603
599
  const AttributeOptions = getOptionsFromAttributes.call(this);
604
600
  if (
@@ -12,10 +12,10 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import { isString } from "../types/is.mjs";
16
- import { validateString } from "../types/validate.mjs";
15
+ import {isString} from "../types/is.mjs";
16
+ import {validateString} from "../types/validate.mjs";
17
17
 
18
- export { getSlottedElements, getSlottedNodes };
18
+ export {getSlottedElements, getSlottedNodes};
19
19
 
20
20
  /**
21
21
  * @private
@@ -28,46 +28,46 @@ export { getSlottedElements, getSlottedNodes };
28
28
  * @throws {Error} query must be a string
29
29
  */
30
30
  function getSlottedNodes(query, name) {
31
- const result = new Set();
32
-
33
- if (!this.shadowRoot) {
34
- return result;
35
- }
36
-
37
- let selector = "slot";
38
- if (name !== undefined) {
39
- if (name === null) {
40
- selector += ":not([name])";
41
- } else {
42
- selector += `[name=${validateString(name)}]`;
43
- }
44
- }
45
-
46
- const slots = this.shadowRoot.querySelectorAll(selector);
47
-
48
- for (const [, slot] of Object.entries(slots)) {
49
- slot.assignedNodes().forEach(function (node) {
50
- if (node === null || node === undefined) {
51
- return;
52
- }
53
-
54
- if (isString(query)) {
55
- node.querySelectorAll(query).forEach(function (n) {
56
- result.add(n);
57
- });
58
-
59
- if (node.matches(query)) {
60
- result.add(node);
61
- }
62
- } else if (query !== undefined) {
63
- throw new Error("query must be a string");
64
- } else {
65
- result.add(node);
66
- }
67
- });
68
- }
69
-
70
- return result;
31
+ const result = new Set();
32
+
33
+ if (!this.shadowRoot) {
34
+ return result;
35
+ }
36
+
37
+ let selector = "slot";
38
+ if (name !== undefined) {
39
+ if (name === null) {
40
+ selector += ":not([name])";
41
+ } else {
42
+ selector += `[name=${validateString(name)}]`;
43
+ }
44
+ }
45
+
46
+ const slots = this.shadowRoot.querySelectorAll(selector);
47
+
48
+ for (const [, slot] of Object.entries(slots)) {
49
+ slot.assignedNodes().forEach(function (node) {
50
+ if (node === null || node === undefined) {
51
+ return;
52
+ }
53
+
54
+ if (isString(query)) {
55
+ node.querySelectorAll(query).forEach(function (n) {
56
+ result.add(n);
57
+ });
58
+
59
+ if (node.matches(query)) {
60
+ result.add(node);
61
+ }
62
+ } else if (query !== undefined) {
63
+ throw new Error("query must be a string");
64
+ } else {
65
+ result.add(node);
66
+ }
67
+ });
68
+ }
69
+
70
+ return result;
71
71
  }
72
72
 
73
73
  /**
@@ -81,46 +81,50 @@ function getSlottedNodes(query, name) {
81
81
  * @throws {Error} query must be a string
82
82
  */
83
83
  function getSlottedElements(query, name) {
84
- const result = new Set();
85
-
86
- if (!(this.shadowRoot instanceof ShadowRoot)) {
87
- return result;
88
- }
89
-
90
- let selector = "slot";
91
- if (name !== undefined) {
92
- if (name === null) {
93
- selector += ":not([name])";
94
- } else {
95
- selector += `[name=${validateString(name)}]`;
96
- }
97
- }
98
-
99
- const slots = this.shadowRoot.querySelectorAll(selector);
100
-
101
- for (const [, slot] of Object.entries(slots)) {
102
- slot.assignedElements().forEach(function (node) {
103
- if (!(node instanceof HTMLElement)) return;
104
-
105
- if (isString(query)) {
106
- if (query.length > 0) {
107
- node.querySelectorAll(query).forEach(function (n) {
108
- result.add(n);
109
- });
110
-
111
- if (node.matches(query)) {
112
- result.add(node);
113
- }
114
- } else {
115
- result.add(node);
116
- }
117
- } else if (query !== undefined) {
118
- throw new Error("query must be a string and not empty");
119
- } else {
120
- result.add(node);
121
- }
122
- });
123
- }
124
-
125
- return result;
84
+ const result = new Set();
85
+
86
+ if (!(this.shadowRoot instanceof ShadowRoot)) {
87
+ return result;
88
+ }
89
+
90
+ let selector = "slot";
91
+ if (name !== undefined) {
92
+ if (name === null) {
93
+ selector += ":not([name])";
94
+ } else {
95
+ selector += `[name=${validateString(name)}]`;
96
+ }
97
+ }
98
+
99
+ const slots = this.shadowRoot.querySelectorAll(selector);
100
+
101
+ for (const [, slot] of Object.entries(slots)) {
102
+ slot.assignedElements().forEach(function (node) {
103
+
104
+ if (!(node instanceof HTMLElement)
105
+ && !(node instanceof SVGElement)
106
+ && !(node instanceof MathMLElement)
107
+ ) return;
108
+
109
+ if (isString(query)) {
110
+ if (query.length > 0) {
111
+ node.querySelectorAll(query).forEach(function (n) {
112
+ result.add(n);
113
+ });
114
+
115
+ if (node.matches(query)) {
116
+ result.add(node);
117
+ }
118
+ } else {
119
+ result.add(node);
120
+ }
121
+ } else if (query !== undefined) {
122
+ throw new Error("query must be a string and not empty");
123
+ } else {
124
+ result.add(node);
125
+ }
126
+ });
127
+ }
128
+
129
+ return result;
126
130
  }
@@ -55,7 +55,7 @@ describe('Details', function () {
55
55
  try {
56
56
 
57
57
  expect(document.getElementById('mocks')).contain.html(
58
- '<monster-details id="details1" style="display: block;" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)" data-monster-button-label="Details"></monster-details>')
58
+ '<monster-details id="details1" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)" data-monster-button-label="Details"></monster-details>')
59
59
  } catch (e) {
60
60
  return done(e);
61
61
  }
@@ -52,7 +52,7 @@ describe('Host', function () {
52
52
 
53
53
  setTimeout(() => {
54
54
  try {
55
- expect(document.getElementById('mocks')).contain.html('<monster-host style="display: block;" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-host>')
55
+ expect(document.getElementById('mocks')).contain.html('<monster-host data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-host>')
56
56
  } catch (e) {
57
57
  return done(e);
58
58
  }
@@ -47,7 +47,7 @@ describe('Overlay', function () {
47
47
  setTimeout(() => {
48
48
  try {
49
49
  expect(document.getElementById('mocks')).contain.html(
50
- ' <monster-overlay style="display: block;" data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-overlay>')
50
+ ' <monster-overlay data-monster-objectlink="Symbol(@schukai/monster/dom/custom-element@@options-updater-link)"></monster-overlay>')
51
51
  } catch (e) {
52
52
  return done(e);
53
53
  }
@@ -138,7 +138,7 @@ describe('DOM', function () {
138
138
 
139
139
  expect(document.getElementsByTagName('monster-customcontrol').length).is.equal(1);
140
140
  // no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
141
- expect(document.getElementById('test1')).contain.html('<monster-customcontrol style="display: block;" data-monster-error="Error: html is not set."></monster-customcontrol>')
141
+ expect(document.getElementById('test1')).contain.html('<monster-customcontrol data-monster-error="Error: html is not set."></monster-customcontrol>')
142
142
  });
143
143
  });
144
144
 
@@ -242,7 +242,7 @@ describe('DOM', function () {
242
242
  expect(document.getElementsByTagName('monster-testclass').length).is.equal(1);
243
243
  // no data-monster-objectlink="Symbol(monsterUpdater)" because it has nothing to update
244
244
  // but data-monster-error="Error: html is not set."
245
- expect(document.getElementById('test1')).contain.html('<monster-testclass style="display: block;" data-monster-error="Error: html is not set."></monster-testclass>');
245
+ expect(document.getElementById('test1')).contain.html('<monster-testclass data-monster-error="Error: html is not set."></monster-testclass>');
246
246
  });
247
247
  });
248
248
 
@@ -256,7 +256,7 @@ describe('DOM', function () {
256
256
  try {
257
257
  expect(document.getElementsByTagName('monster-testclass2').length).is.equal(1);
258
258
  expect(document.getElementsByTagName('monster-testclass2').item(0).shadowRoot.innerHTML).is.equal('<h1></h1><article><p>test</p><div id="container"></div></article>');
259
- expect(document.getElementById('test1')).contain.html('<monster-testclass2 style="display: block;" data-monster-objectlink="Symbol(' + updaterSymbolKey + ')"></monster-testclass2>');
259
+ expect(document.getElementById('test1')).contain.html('<monster-testclass2 data-monster-objectlink="Symbol(' + updaterSymbolKey + ')"></monster-testclass2>');
260
260
  return done();
261
261
  } catch (e) {
262
262
  done(e);