@schukai/monster 3.72.0 → 3.73.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.
@@ -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}
@@ -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,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
- 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;
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
  }
@@ -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