@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
@@ -12,49 +12,16 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {instanceSymbol} from "../../constants.mjs";
16
- import {internalSymbol} from "../../constants.mjs";
17
- import {TokenList} from "../../types/tokenlist.mjs";
18
- import {DeadMansSwitch} from "../../util/deadmansswitch.mjs";
19
- import {DataSet} from "../datatable/dataset.mjs";
20
- //import { Datasource } from "../../data/datasource.mjs";
21
- import {RestAPI} from "../../data/datasource/server/restapi.mjs";
22
- import {WebConnect} from "../../data/datasource/server/webconnect.mjs";
23
- import {WriteError} from "../../data/datasource/server/restapi/writeerror.mjs";
24
- import {LocalStorage} from "../../data/datasource/storage/localstorage.mjs";
25
- import {SessionStorage} from "../../data/datasource/storage/sessionstorage.mjs";
15
+ import { DeadMansSwitch } from "../../util/deadmansswitch.mjs";
16
+ import { DataSet } from "../datatable/dataset.mjs";
26
17
  import {
27
- ATTRIBUTE_DISABLED,
28
- ATTRIBUTE_ERRORMESSAGE,
29
- ATTRIBUTE_PREFIX,
30
- ATTRIBUTE_UPDATER_ATTRIBUTES,
31
- ATTRIBUTE_UPDATER_INSERT,
32
- ATTRIBUTE_UPDATER_REMOVE,
33
- ATTRIBUTE_UPDATER_REPLACE,
34
- } from "../../dom/constants.mjs";
35
- import {
36
- assembleMethodSymbol,
37
- CustomElement,
38
- registerCustomElement,
39
- getSlottedElements,
18
+ assembleMethodSymbol,
19
+ registerCustomElement,
20
+ getSlottedElements,
40
21
  } from "../../dom/customelement.mjs";
41
- import {addObjectWithUpdaterToElement} from "../../dom/updater.mjs";
42
- import {findElementWithSelectorUpwards} from "../../dom/util.mjs";
43
- import {isFunction, isString} from "../../types/is.mjs";
44
- import {Observer} from "../../types/observer.mjs";
45
- import {ProxyObserver} from "../../types/proxyobserver.mjs";
46
- import {Processing} from "../../util/processing.mjs";
47
- import {datasourceLinkedElementSymbol, handleDataSourceChanges} from "../datatable/util.mjs";
48
- import {MessageStateButton} from "./message-state-button.mjs";
49
- import {
50
- ATTRIBUTE_FORM_DATASOURCE,
51
- ATTRIBUTE_FORM_DATASOURCE_ARGUMENTS,
52
- } from "./constants.mjs";
53
- import {StateButton} from "./state-button.mjs";
54
- import {FormStyleSheet} from "./stylesheet/form.mjs";
55
-
56
- export {Form};
22
+ import { FormStyleSheet } from "./stylesheet/form.mjs";
57
23
 
24
+ export { Form };
58
25
 
59
26
  /**
60
27
  * @private
@@ -63,155 +30,138 @@ export {Form};
63
30
  const debounceCallbackSymbol = Symbol("timerCallback");
64
31
 
65
32
  class Form extends DataSet {
66
-
67
- /**
68
- *
69
- * @returns {{shadowMode: string, templates: {main: *}, display: string, disabled: boolean, delegatesFocus: boolean, templateMapping: {}} & {templates: {main: string}, classes: {form: string}}}
70
- */
71
- get defaults() {
72
- const obj = Object.assign(
73
- {},
74
- super.defaults,
75
- {
76
- templates: {
77
- main: getTemplate(),
78
- },
79
-
80
- classes: {
81
- form: "",
82
- },
83
-
84
- writeBack: {
85
- events: ["change", "input", "keyup"]
86
- },
87
-
88
- reportValidity: {
89
- selector: "input,select,textarea",
90
- }
91
-
92
- }
93
- );
94
-
95
- obj['features']['mutationObserver'] = false;
96
- obj['features']['writeBack'] = true;
97
-
98
- return obj;
99
-
100
- }
101
-
102
-
103
- /**
104
- *
105
- * @return {string}
106
- */
107
- static getTag() {
108
- return "monster-form";
109
- }
110
-
111
- /**
112
- * @return {CSSStyleSheet[]}
113
- */
114
- static getCSSStyleSheet() {
115
- return [FormStyleSheet];
116
- }
117
-
118
- /**
119
- *
120
- */
121
- [assembleMethodSymbol]() {
122
- super[assembleMethodSymbol]();
123
-
124
- initControlReferences.call(this);
125
- initEventHandler.call(this);
126
- initDataSourceHandler.call(this);
127
-
128
- }
129
-
130
- /**
131
- * This method is called when the component is created.
132
- * @since 3.70.0
133
- * @returns {DataSet}
134
- */
135
- refresh() {
136
- this.write();
137
- super.refresh();
138
- return this;
139
- }
140
-
141
- /**
142
- * Run reportValidation on all child html form controls.
143
- *
144
- * @since 2.10.0
145
- * @returns {boolean}
146
- */
147
- reportValidity() {
148
- let valid = true;
149
-
150
- const selector = this.getOption("reportValidity.selector");
151
- const nodes = getSlottedElements.call(this, selector);
152
-
153
- nodes.forEach((node) => {
154
- if (typeof node.reportValidity === "function") {
155
- if (node.reportValidity() === false) {
156
- valid = false;
157
- }
158
- }
159
- });
160
-
161
- return valid;
162
- }
163
-
33
+ /**
34
+ *
35
+ * @returns {{shadowMode: string, templates: {main: *}, display: string, disabled: boolean, delegatesFocus: boolean, templateMapping: {}} & {templates: {main: string}, classes: {form: string}}}
36
+ */
37
+ get defaults() {
38
+ const obj = Object.assign({}, super.defaults, {
39
+ templates: {
40
+ main: getTemplate(),
41
+ },
42
+
43
+ classes: {
44
+ form: "",
45
+ },
46
+
47
+ writeBack: {
48
+ events: ["change", "input", "keyup"],
49
+ },
50
+
51
+ reportValidity: {
52
+ selector: "input,select,textarea",
53
+ },
54
+ });
55
+
56
+ obj["features"]["mutationObserver"] = false;
57
+ obj["features"]["writeBack"] = true;
58
+
59
+ return obj;
60
+ }
61
+
62
+ /**
63
+ *
64
+ * @return {string}
65
+ */
66
+ static getTag() {
67
+ return "monster-form";
68
+ }
69
+
70
+ /**
71
+ * @return {CSSStyleSheet[]}
72
+ */
73
+ static getCSSStyleSheet() {
74
+ return [FormStyleSheet];
75
+ }
76
+
77
+ /**
78
+ *
79
+ */
80
+ [assembleMethodSymbol]() {
81
+ super[assembleMethodSymbol]();
82
+
83
+ initControlReferences.call(this);
84
+ initEventHandler.call(this);
85
+ initDataSourceHandler.call(this);
86
+ }
87
+
88
+ /**
89
+ * This method is called when the component is created.
90
+ * @since 3.70.0
91
+ * @returns {DataSet}
92
+ */
93
+ refresh() {
94
+ this.write();
95
+ super.refresh();
96
+ return this;
97
+ }
98
+
99
+ /**
100
+ * Run reportValidation on all child html form controls.
101
+ *
102
+ * @since 2.10.0
103
+ * @returns {boolean}
104
+ */
105
+ reportValidity() {
106
+ let valid = true;
107
+
108
+ const selector = this.getOption("reportValidity.selector");
109
+ const nodes = getSlottedElements.call(this, selector);
110
+
111
+ nodes.forEach((node) => {
112
+ if (typeof node.reportValidity === "function") {
113
+ if (node.reportValidity() === false) {
114
+ valid = false;
115
+ }
116
+ }
117
+ });
118
+
119
+ return valid;
120
+ }
164
121
  }
165
122
 
166
- function initDataSourceHandler() {
167
-
168
- }
123
+ function initDataSourceHandler() {}
169
124
 
170
125
  /**
171
126
  * @private
172
127
  * @returns {initEventHandler}
173
128
  */
174
129
  function initEventHandler() {
175
-
176
- if (this.getOption("features.writeBack") === true) {
177
- const events = this.getOption("writeBack.events");
178
- for (const event of events) {
179
-
180
- this.addEventListener(event, (e) => {
181
-
182
- if (!this.reportValidity()) {
183
-
184
- this.classList.add("invalid");
185
- setTimeout(() => {
186
- this.classList.remove("invalid");
187
- }, 1000)
188
-
189
- return;
190
- }
191
-
192
- if (this[debounceCallbackSymbol] instanceof DeadMansSwitch) {
193
- try {
194
- this[debounceCallbackSymbol].touch();
195
- return;
196
- } catch (e) {
197
- if (e.message !== "has already run") {
198
- throw e;
199
- }
200
- delete this[debounceCallbackSymbol];
201
- }
202
- }
203
-
204
- this[debounceCallbackSymbol] = new DeadMansSwitch(200, () => {
205
- setTimeout(() => {
206
- this.write();
207
- }, 0);
208
- });
209
-
210
- });
211
- }
212
- }
213
-
214
- return this;
130
+ if (this.getOption("features.writeBack") === true) {
131
+ const events = this.getOption("writeBack.events");
132
+ for (const event of events) {
133
+ this.addEventListener(event, (e) => {
134
+ if (!this.reportValidity()) {
135
+ this.classList.add("invalid");
136
+ setTimeout(() => {
137
+ this.classList.remove("invalid");
138
+ }, 1000);
139
+
140
+ return;
141
+ }
142
+
143
+ if (this[debounceCallbackSymbol] instanceof DeadMansSwitch) {
144
+ try {
145
+ this[debounceCallbackSymbol].touch();
146
+ return;
147
+ } catch (e) {
148
+ if (e.message !== "has already run") {
149
+ throw e;
150
+ }
151
+ delete this[debounceCallbackSymbol];
152
+ }
153
+ }
154
+
155
+ this[debounceCallbackSymbol] = new DeadMansSwitch(200, () => {
156
+ setTimeout(() => {
157
+ this.write();
158
+ }, 0);
159
+ });
160
+ });
161
+ }
162
+ }
163
+
164
+ return this;
215
165
  }
216
166
 
217
167
  /**
@@ -219,10 +169,10 @@ function initEventHandler() {
219
169
  * @return {FilterButton}
220
170
  */
221
171
  function initControlReferences() {
222
- if (!this.shadowRoot) {
223
- throw new Error("no shadow-root is defined");
224
- }
225
- return this;
172
+ if (!this.shadowRoot) {
173
+ throw new Error("no shadow-root is defined");
174
+ }
175
+ return this;
226
176
  }
227
177
 
228
178
  /**
@@ -230,8 +180,8 @@ function initControlReferences() {
230
180
  * @return {string}
231
181
  */
232
182
  function getTemplate() {
233
- // language=HTML
234
- return `
183
+ // language=HTML
184
+ return `
235
185
  <div data-monster-role="control" part="control">
236
186
  <form data-monster-attributes="disabled path:disabled | if:true, class path:classes.form"
237
187
  data-monster-role="form"