@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.
- package/CHANGELOG.md +26 -0
- package/package.json +1 -1
- package/source/components/datatable/dataset.mjs +272 -272
- package/source/components/datatable/datasource/dom.mjs +1 -1
- package/source/components/datatable/datasource/rest.mjs +408 -410
- package/source/components/datatable/filter.mjs +0 -1
- package/source/components/datatable/style/datatable.pcss +7 -5
- package/source/components/datatable/style/embedded-pagination.pcss +1 -1
- package/source/components/datatable/style/pagination.pcss +1 -1
- package/source/components/datatable/stylesheet/change-button.mjs +2 -4
- package/source/components/datatable/stylesheet/column-bar.mjs +2 -4
- package/source/components/datatable/stylesheet/dataset.mjs +2 -4
- package/source/components/datatable/stylesheet/datasource.mjs +1 -3
- package/source/components/datatable/stylesheet/datatable.mjs +2 -4
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
- package/source/components/datatable/stylesheet/filter-button.mjs +1 -3
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +14 -7
- package/source/components/datatable/stylesheet/filter-date-range.mjs +1 -3
- package/source/components/datatable/stylesheet/filter-range.mjs +1 -3
- package/source/components/datatable/stylesheet/filter.mjs +2 -4
- package/source/components/datatable/stylesheet/pagination.mjs +2 -4
- package/source/components/datatable/stylesheet/save-button.mjs +2 -4
- package/source/components/datatable/stylesheet/select-filter.mjs +2 -4
- package/source/components/datatable/stylesheet/status.mjs +2 -4
- package/source/components/form/context-error.mjs +0 -2
- package/source/components/form/context-help.mjs +1 -2
- package/source/components/form/field-set.mjs +219 -219
- package/source/components/form/form.mjs +137 -187
- package/source/components/form/reload.mjs +211 -211
- package/source/components/form/select.mjs +12 -13
- package/source/components/form/style/field-set.pcss +2 -2
- package/source/components/form/style/form.pcss +8 -0
- package/source/components/form/stylesheet/action-button.mjs +2 -4
- package/source/components/form/stylesheet/api-button.mjs +1 -3
- package/source/components/form/stylesheet/button-bar.mjs +2 -4
- package/source/components/form/stylesheet/button.mjs +2 -4
- package/source/components/form/stylesheet/confirm-button.mjs +2 -4
- package/source/components/form/stylesheet/context-error.mjs +2 -4
- package/source/components/form/stylesheet/context-help.mjs +2 -4
- package/source/components/form/stylesheet/field-set.mjs +14 -7
- package/source/components/form/stylesheet/form.mjs +1 -1
- package/source/components/form/stylesheet/message-state-button.mjs +1 -3
- package/source/components/form/stylesheet/popper-button.mjs +2 -4
- package/source/components/form/stylesheet/select.mjs +14 -7
- package/source/components/form/stylesheet/state-button.mjs +2 -4
- package/source/components/form/stylesheet/tree-select.mjs +1 -3
- package/source/components/host/stylesheet/call-button.mjs +2 -4
- package/source/components/host/stylesheet/config-manager.mjs +1 -3
- package/source/components/host/stylesheet/host.mjs +2 -4
- package/source/components/host/stylesheet/overlay.mjs +2 -4
- package/source/components/host/stylesheet/toggle-button.mjs +2 -4
- package/source/components/host/stylesheet/viewer.mjs +2 -4
- package/source/components/layout/style/collapse.pcss +2 -2
- package/source/components/layout/style/details.pcss +2 -2
- package/source/components/layout/stylesheet/collapse.mjs +14 -7
- package/source/components/layout/stylesheet/details.mjs +2 -4
- package/source/components/layout/stylesheet/panel.mjs +2 -4
- package/source/components/layout/stylesheet/popper.mjs +2 -4
- package/source/components/layout/stylesheet/split-panel.mjs +1 -3
- package/source/components/layout/stylesheet/tabs.mjs +2 -4
- package/source/components/layout/stylesheet/width-toggle.mjs +1 -3
- package/source/components/navigation/stylesheet/table-of-content.mjs +2 -4
- package/source/components/notify/stylesheet/message.mjs +2 -4
- package/source/components/notify/stylesheet/notify.mjs +2 -4
- package/source/components/state/stylesheet/log.mjs +2 -4
- package/source/components/state/stylesheet/state.mjs +2 -4
- package/source/components/style/control.pcss +5 -0
- package/source/components/style/data-grid.pcss +2 -2
- package/source/components/style/mixin/typography.pcss +7 -1
- package/source/components/style/normalize.pcss +1 -1
- package/source/components/stylesheet/badge.mjs +1 -3
- package/source/components/stylesheet/border.mjs +1 -3
- package/source/components/stylesheet/button.mjs +1 -3
- package/source/components/stylesheet/card.mjs +1 -3
- package/source/components/stylesheet/color.mjs +1 -3
- package/source/components/stylesheet/common.mjs +1 -3
- package/source/components/stylesheet/control.mjs +2 -4
- package/source/components/stylesheet/data-grid.mjs +2 -4
- package/source/components/stylesheet/display.mjs +1 -3
- package/source/components/stylesheet/floating-ui.mjs +1 -3
- package/source/components/stylesheet/form.mjs +13 -6
- package/source/components/stylesheet/host.mjs +1 -3
- package/source/components/stylesheet/icons.mjs +1 -3
- package/source/components/stylesheet/mixin/badge.mjs +1 -3
- package/source/components/stylesheet/mixin/button.mjs +1 -3
- package/source/components/stylesheet/mixin/form.mjs +13 -6
- package/source/components/stylesheet/mixin/hover.mjs +1 -3
- package/source/components/stylesheet/mixin/icon.mjs +1 -3
- package/source/components/stylesheet/mixin/media.mjs +1 -3
- package/source/components/stylesheet/mixin/property.mjs +13 -6
- package/source/components/stylesheet/mixin/skeleton.mjs +1 -3
- package/source/components/stylesheet/mixin/spinner.mjs +1 -3
- package/source/components/stylesheet/mixin/typography.mjs +1 -3
- package/source/components/stylesheet/normalize.mjs +1 -3
- package/source/components/stylesheet/popper.mjs +1 -3
- package/source/components/stylesheet/property.mjs +2 -4
- package/source/components/stylesheet/ripple.mjs +1 -3
- package/source/components/stylesheet/skeleton.mjs +1 -3
- package/source/components/stylesheet/space.mjs +1 -3
- package/source/components/stylesheet/spinner.mjs +1 -3
- package/source/components/stylesheet/table.mjs +1 -3
- package/source/components/stylesheet/theme.mjs +1 -3
- package/source/components/stylesheet/typography.mjs +13 -6
- package/source/components/tree-menu/dragable-tree-menu.mjs +693 -0
- package/source/components/tree-menu/style/tree-menu.pcss +69 -42
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -17
- package/source/components/tree-menu/tree-menu.mjs +468 -532
- package/source/data/datasource/server/restapi.mjs +194 -191
- package/source/data/datasource/server.mjs +107 -105
- package/source/data/diff.mjs +1 -1
- package/source/dom/customelement.mjs +2 -6
- package/source/dom/slotted.mjs +89 -85
- package/test/cases/components/host/details.mjs +1 -1
- package/test/cases/components/host/host.mjs +1 -1
- package/test/cases/components/host/overlay.mjs +1 -1
- package/test/cases/dom/customcontrol.mjs +1 -1
- 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 {
|
16
|
-
import {
|
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
|
-
|
28
|
-
|
29
|
-
|
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 {
|
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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
-
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
|
-
|
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
|
-
|
206
|
-
|
207
|
-
|
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
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
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
|
-
|
234
|
-
|
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"
|