@schukai/monster 3.72.0 → 3.73.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/source/components/datatable/dataset.mjs +2 -6
- package/source/components/form/context-help.mjs +1 -1
- package/source/components/form/form.mjs +180 -6
- package/source/components/form/stylesheet/form.mjs +13 -6
- package/source/components/layout/tabs.mjs +0 -1
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +13 -6
- package/source/components/tree-menu/tree-menu.mjs +426 -433
- package/source/dom/constants.mjs +18 -0
- package/source/dom/slotted.mjs +90 -89
- package/source/dom/updater.mjs +2 -0
package/source/dom/constants.mjs
CHANGED
@@ -65,6 +65,8 @@ export {
|
|
65
65
|
ATTRIBUTE_ENTERKEYHINT,
|
66
66
|
ATTRIBUTE_EXPORTPARTS,
|
67
67
|
ATTRIBUTE_HIDDEN,
|
68
|
+
ATTRIBUTE_FORM_BIND,
|
69
|
+
ATTRIBUTE_FORM_BIND_TYPE,
|
68
70
|
objectUpdaterLinkSymbol,
|
69
71
|
customElementUpdaterLinkSymbol,
|
70
72
|
initControlCallbackName,
|
@@ -207,6 +209,22 @@ const ATTRIBUTE_UPDATER_REMOVE = `${ATTRIBUTE_PREFIX}remove`;
|
|
207
209
|
*/
|
208
210
|
const ATTRIBUTE_UPDATER_BIND = `${ATTRIBUTE_PREFIX}bind`;
|
209
211
|
|
212
|
+
/**
|
213
|
+
* @memberOf Monster.DOM
|
214
|
+
* @type {string}
|
215
|
+
* @license AGPLv3
|
216
|
+
* @since 3.73.0
|
217
|
+
*/
|
218
|
+
const ATTRIBUTE_FORM_BIND = `${ATTRIBUTE_PREFIX}form-bind`;
|
219
|
+
|
220
|
+
/**
|
221
|
+
* @memberOf Monster.DOM
|
222
|
+
* @type {string}
|
223
|
+
* @license AGPLv3
|
224
|
+
* @since 3.73.0
|
225
|
+
*/
|
226
|
+
const ATTRIBUTE_FORM_BIND_TYPE = `${ATTRIBUTE_PREFIX}form-bind-type`;
|
227
|
+
|
210
228
|
/**
|
211
229
|
* @memberOf Monster.DOM
|
212
230
|
* @type {string}
|
package/source/dom/slotted.mjs
CHANGED
@@ -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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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,50 +81,51 @@ function getSlottedNodes(query, name) {
|
|
81
81
|
* @throws {Error} query must be a string
|
82
82
|
*/
|
83
83
|
function getSlottedElements(query, name) {
|
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
|
-
|
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 (
|
104
|
+
!(node instanceof HTMLElement) &&
|
105
|
+
!(node instanceof SVGElement) &&
|
106
|
+
!(node instanceof MathMLElement)
|
107
|
+
)
|
108
|
+
return;
|
109
|
+
|
110
|
+
if (isString(query)) {
|
111
|
+
if (query.length > 0) {
|
112
|
+
node.querySelectorAll(query).forEach(function (n) {
|
113
|
+
result.add(n);
|
114
|
+
});
|
115
|
+
|
116
|
+
if (node.matches(query)) {
|
117
|
+
result.add(node);
|
118
|
+
}
|
119
|
+
} else {
|
120
|
+
result.add(node);
|
121
|
+
}
|
122
|
+
} else if (query !== undefined) {
|
123
|
+
throw new Error("query must be a string and not empty");
|
124
|
+
} else {
|
125
|
+
result.add(node);
|
126
|
+
}
|
127
|
+
});
|
128
|
+
}
|
129
|
+
|
130
|
+
return result;
|
130
131
|
}
|
package/source/dom/updater.mjs
CHANGED
@@ -156,6 +156,7 @@ class Updater extends Base {
|
|
156
156
|
|
157
157
|
for (const type of this[internalSymbol].eventTypes) {
|
158
158
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
159
|
+
|
159
160
|
this[internalSymbol].element.addEventListener(
|
160
161
|
type,
|
161
162
|
getControlEventHandler.call(this),
|
@@ -399,6 +400,7 @@ function retrieveAndSetValue(element) {
|
|
399
400
|
}
|
400
401
|
|
401
402
|
const copy = clone(this[internalSymbol].subject.getRealSubject());
|
403
|
+
|
402
404
|
const pf = new Pathfinder(copy);
|
403
405
|
pf.setVia(path, value);
|
404
406
|
|