@dooboostore/simple-web-component 1.0.44 → 1.0.46
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.
- package/README.md +25 -25
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +36 -15
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +53 -22
- package/dist/cjs/decorators/applyClass.js.map +2 -2
- package/dist/cjs/decorators/applyNode.js +54 -24
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +38 -17
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +53 -22
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +49 -33
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +61 -47
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/lifecycles.js +11 -36
- package/dist/cjs/decorators/lifecycles.js.map +2 -2
- package/dist/cjs/decorators/query.js +91 -56
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +104 -66
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +6 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/types/window.d.js.map +1 -1
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +36 -15
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +53 -22
- package/dist/esm/decorators/applyClass.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +54 -24
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +38 -17
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +53 -22
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +50 -34
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +61 -47
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/lifecycles.js +11 -36
- package/dist/esm/decorators/lifecycles.js.map +2 -2
- package/dist/esm/decorators/query.js +91 -56
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +104 -66
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +6 -2
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +572 -320
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
- package/dist/types/decorators/addEventListener.d.ts +7 -6
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +13 -8
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +8 -7
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +18 -17
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +14 -9
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +6 -5
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +3 -2
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/lifecycles.d.ts +12 -13
- package/dist/types/decorators/lifecycles.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +15 -5
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +15 -5
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +572 -320
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
- package/package.json +3 -3
- package/src/decorators/addEventListener.ts +9 -7
- package/src/decorators/applyAttribute.ts +60 -27
- package/src/decorators/applyClass.ts +78 -32
- package/src/decorators/applyNode.ts +118 -73
- package/src/decorators/applyProperty.ts +63 -30
- package/src/decorators/applyStyle.ts +76 -30
- package/src/decorators/elementDefine.ts +57 -37
- package/src/decorators/emitCustomEvent.ts +63 -39
- package/src/decorators/lifecycles.ts +53 -52
- package/src/decorators/query.ts +111 -49
- package/src/decorators/queryAll.ts +121 -61
- package/src/elements/SwcAppMixin.ts +7 -3
- package/src/types/window.d.ts +3 -0
- package/dist/cjs/examples/RxJSOperatorsExample.js +0 -285
- package/dist/cjs/examples/RxJSOperatorsExample.js.map +0 -7
- package/dist/esm/examples/RxJSOperatorsExample.js +0 -266
- package/dist/esm/examples/RxJSOperatorsExample.js.map +0 -7
- package/dist/types/examples/RxJSOperatorsExample.d.ts +0 -94
- package/dist/types/examples/RxJSOperatorsExample.d.ts.map +0 -1
- package/src/examples/RxJSOperatorsExample.ts +0 -279
|
@@ -4,6 +4,26 @@ import { SwcUtils } from "../utils/Utils.js";
|
|
|
4
4
|
import { findAllStateMetadata } from "./state.js";
|
|
5
5
|
import { ElementApply } from "@dooboostore/core-web";
|
|
6
6
|
const APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
|
|
7
|
+
const resolveSelector = (selector, inst, win) => {
|
|
8
|
+
if (typeof selector === "function") {
|
|
9
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
10
|
+
const result = selector(inst, hostSet);
|
|
11
|
+
if (result instanceof win.Element) {
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
if (result instanceof win.NodeList) {
|
|
15
|
+
return result.length > 0 ? result[0] : null;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(result)) {
|
|
18
|
+
return result.length > 0 ? result[0] : null;
|
|
19
|
+
}
|
|
20
|
+
if (result === null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
return selector;
|
|
26
|
+
};
|
|
7
27
|
const applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
8
28
|
if (!targetEl) return;
|
|
9
29
|
if (pos === "clearChildren") {
|
|
@@ -14,7 +34,9 @@ const applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
|
14
34
|
const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
|
|
15
35
|
const id = currentThis._swcId;
|
|
16
36
|
const nodes = [];
|
|
17
|
-
if (
|
|
37
|
+
if (res instanceof win.Node) {
|
|
38
|
+
nodes.push(res);
|
|
39
|
+
} else if (typeof res === "string" && pos === "innerHtml") {
|
|
18
40
|
const t = win.document.createElement("template");
|
|
19
41
|
t.innerHTML = res;
|
|
20
42
|
nodes.push(...Array.from(t.content.childNodes));
|
|
@@ -48,7 +70,7 @@ const applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
|
48
70
|
function applyNode(selectorOrOptions, maybeOptions) {
|
|
49
71
|
let selector;
|
|
50
72
|
let options;
|
|
51
|
-
if (typeof selectorOrOptions === "string") {
|
|
73
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
52
74
|
selector = selectorOrOptions;
|
|
53
75
|
options = maybeOptions || { position: "replaceChildren" };
|
|
54
76
|
} else {
|
|
@@ -80,14 +102,22 @@ function applyNode(selectorOrOptions, maybeOptions) {
|
|
|
80
102
|
if (r === "all") return t.shadowRoot || t;
|
|
81
103
|
return t;
|
|
82
104
|
};
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (
|
|
88
|
-
|
|
105
|
+
const resolved = resolveSelector(selector, this, currentWin);
|
|
106
|
+
if (resolved instanceof currentWin.Element) {
|
|
107
|
+
return applyRoot(resolved);
|
|
108
|
+
}
|
|
109
|
+
if (resolved === null) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const stringSelector = resolved;
|
|
113
|
+
if (stringSelector === "$this") return applyRoot(this);
|
|
114
|
+
if (stringSelector === "$host") return applyRoot(hostSet.$host);
|
|
115
|
+
if (stringSelector === "$parentHost") return applyRoot(hostSet.$parentHost);
|
|
116
|
+
if (stringSelector === "$appHost") return applyRoot(hostSet.$appHost);
|
|
117
|
+
if (stringSelector === "$firstHost") return applyRoot(hostSet.$firstHost);
|
|
118
|
+
if (stringSelector === "$lastHost") return applyRoot(hostSet.$lastHost);
|
|
89
119
|
const targetRoot = applyRoot(this);
|
|
90
|
-
return targetRoot ? targetRoot.querySelector(
|
|
120
|
+
return targetRoot ? targetRoot.querySelector(stringSelector) : null;
|
|
91
121
|
};
|
|
92
122
|
const targetEl = getTarget();
|
|
93
123
|
const res = original.apply(this, args);
|
|
@@ -129,7 +159,7 @@ function replaceChildren(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
129
159
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
130
160
|
return applyNode({ position: "replaceChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
131
161
|
}
|
|
132
|
-
if (typeof selectorOrOptions === "string") {
|
|
162
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
133
163
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren" });
|
|
134
164
|
}
|
|
135
165
|
return applyNode({ ...selectorOrOptions, position: "replaceChildren" });
|
|
@@ -138,7 +168,7 @@ function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
138
168
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
139
169
|
return applyNode({ position: "clearChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
140
170
|
}
|
|
141
|
-
if (typeof selectorOrOptions === "string") {
|
|
171
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
142
172
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren" });
|
|
143
173
|
}
|
|
144
174
|
return applyNode({ ...selectorOrOptions, position: "clearChildren" });
|
|
@@ -148,7 +178,7 @@ function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
148
178
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
149
179
|
return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
|
|
150
180
|
}
|
|
151
|
-
if (typeof selectorOrOptions === "string") {
|
|
181
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
152
182
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml" });
|
|
153
183
|
}
|
|
154
184
|
return applyNode({ ...selectorOrOptions, position: "innerHtml" });
|
|
@@ -157,7 +187,7 @@ function innerHtmlLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
157
187
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
158
188
|
return applyNode({ position: "innerHtml", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
159
189
|
}
|
|
160
|
-
if (typeof selectorOrOptions === "string") {
|
|
190
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
161
191
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "light" });
|
|
162
192
|
}
|
|
163
193
|
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "light" });
|
|
@@ -166,7 +196,7 @@ function innerHtmlShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
166
196
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
167
197
|
return applyNode({ position: "innerHtml", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
168
198
|
}
|
|
169
|
-
if (typeof selectorOrOptions === "string") {
|
|
199
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
170
200
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "shadow" });
|
|
171
201
|
}
|
|
172
202
|
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "shadow" });
|
|
@@ -175,7 +205,7 @@ function innerText(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
175
205
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
176
206
|
return applyNode({ position: "innerText" })(selectorOrOptions, maybeOptions, descriptor);
|
|
177
207
|
}
|
|
178
|
-
if (typeof selectorOrOptions === "string") {
|
|
208
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
179
209
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText" });
|
|
180
210
|
}
|
|
181
211
|
return applyNode({ ...selectorOrOptions, position: "innerText" });
|
|
@@ -184,7 +214,7 @@ function innerTextLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
184
214
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
185
215
|
return applyNode({ position: "innerText", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
186
216
|
}
|
|
187
|
-
if (typeof selectorOrOptions === "string") {
|
|
217
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
188
218
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "light" });
|
|
189
219
|
}
|
|
190
220
|
return applyNode({ ...selectorOrOptions, position: "innerText", root: "light" });
|
|
@@ -193,7 +223,7 @@ function innerTextShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
193
223
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
194
224
|
return applyNode({ position: "innerText", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
195
225
|
}
|
|
196
|
-
if (typeof selectorOrOptions === "string") {
|
|
226
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
197
227
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "shadow" });
|
|
198
228
|
}
|
|
199
229
|
return applyNode({ ...selectorOrOptions, position: "innerText", root: "shadow" });
|
|
@@ -202,7 +232,7 @@ function insertBeforeEnd(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
202
232
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
203
233
|
return applyNode({ position: "beforeEnd" })(selectorOrOptions, maybeOptions, descriptor);
|
|
204
234
|
}
|
|
205
|
-
if (typeof selectorOrOptions === "string") {
|
|
235
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
206
236
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd" });
|
|
207
237
|
}
|
|
208
238
|
return applyNode({ ...selectorOrOptions, position: "beforeEnd" });
|
|
@@ -211,7 +241,7 @@ function insertBeforeEndLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
211
241
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
212
242
|
return applyNode({ position: "beforeEnd", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
213
243
|
}
|
|
214
|
-
if (typeof selectorOrOptions === "string") {
|
|
244
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
215
245
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "light" });
|
|
216
246
|
}
|
|
217
247
|
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "light" });
|
|
@@ -220,7 +250,7 @@ function insertBeforeEndShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
220
250
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
221
251
|
return applyNode({ position: "beforeEnd", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
222
252
|
}
|
|
223
|
-
if (typeof selectorOrOptions === "string") {
|
|
253
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
224
254
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "shadow" });
|
|
225
255
|
}
|
|
226
256
|
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "shadow" });
|
|
@@ -229,7 +259,7 @@ function insertAfterBegin(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
229
259
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
230
260
|
return applyNode({ position: "afterBegin" })(selectorOrOptions, maybeOptions, descriptor);
|
|
231
261
|
}
|
|
232
|
-
if (typeof selectorOrOptions === "string") {
|
|
262
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
233
263
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin" });
|
|
234
264
|
}
|
|
235
265
|
return applyNode({ ...selectorOrOptions, position: "afterBegin" });
|
|
@@ -238,7 +268,7 @@ function insertAfterBeginLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
238
268
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
239
269
|
return applyNode({ position: "afterBegin", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
240
270
|
}
|
|
241
|
-
if (typeof selectorOrOptions === "string") {
|
|
271
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
242
272
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin", root: "light" });
|
|
243
273
|
}
|
|
244
274
|
return applyNode({ ...selectorOrOptions, position: "afterBegin", root: "light" });
|
|
@@ -247,7 +277,7 @@ function replaceChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
247
277
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
248
278
|
return applyNode({ position: "replaceChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
249
279
|
}
|
|
250
|
-
if (typeof selectorOrOptions === "string") {
|
|
280
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
251
281
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren", root: "light" });
|
|
252
282
|
}
|
|
253
283
|
return applyNode({ ...selectorOrOptions, position: "replaceChildren", root: "light" });
|
|
@@ -256,7 +286,7 @@ function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
|
256
286
|
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
257
287
|
return applyNode({ position: "clearChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
258
288
|
}
|
|
259
|
-
if (typeof selectorOrOptions === "string") {
|
|
289
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
260
290
|
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren", root: "light" });
|
|
261
291
|
}
|
|
262
292
|
return applyNode({ ...selectorOrOptions, position: "clearChildren", root: "light" });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/decorators/applyNode.ts"],
|
|
4
|
-
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit, getElementConfig } from './elementDefine';\nimport {SpecialSelector, SwcQueryOptions, HelperHostSet, SwcRootType} from '../types';\nimport { SwcUtils} from \"../utils/Utils\";\nimport {findAllStateMetadata} from \"./state\";\nimport {ElementApply} from \"@dooboostore/core-web\";\n/*\n<!-- beforebegin -->\n<p> <-- it's me\n <!-- afterbegin -->\n foo\n <!-- beforeend -->\n</p>\n<!-- afterend -->\n */\nexport type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';\n\nexport interface ApplyNodeOptions {\n position?: ApplyNodePosition;\n root?: SwcRootType;\n /**\n * Filter function to determine whether to perform DOM operation.\n * If it returns false, the operation is skipped.\n */\n filter?: (target: HTMLElement | ShadowRoot, newValue: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n /**\n * Optional loading content to display while an async method is executing.\n */\n fallback?: (helper: HelperHostSet) => any;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses APPLY_NODE_METADATA_KEY by default.\n * Useful when multiple @applyNode decorators are on the same method.\n */\n valueKey?: symbol | string;\n}\n\nexport interface ApplyNodeMetadata {\n propertyKey: string | symbol;\n selector: string;\n options: ApplyNodeOptions;\n}\n\nexport const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-node');\n\n// const normalizeNodes = (res: any, doc: Document): Node[] => {\n// const items = Array.isArray(res) ? res : [res];\n// return items.map(it => {\n// if (it instanceof Node) return it;\n// return doc.createTextNode(it !== undefined && it !== null ? String(it) : '');\n// });\n// };\n\nconst applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {\n if (!targetEl) return;\n \n // Handle clearChildren - ignore return value and always clear\n if (pos === 'clearChildren') {\n targetEl.replaceChildren();\n return [];\n }\n \n const doc = win.document;\n const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);\n const id = currentThis._swcId;\n\n const nodes: Node[] = [];\n\n if (typeof res === 'string' && pos === 'innerHtml') {\n const t = win.document.createElement('template');\n t.innerHTML = res;\n nodes.push(...Array.from(t.content.childNodes));\n } else if (typeof res === 'string' && pos === 'innerText') {\n nodes.push(win.document.createTextNode(res));\n }\n\n SwcUtils.projectProcessHtml(id, nodes, doc);\n\n const isShadowRoot = targetEl instanceof win.ShadowRoot;\n // const nodes = normalizeNodes(res, doc);\n if (pos === 'replace') {\n if (!isShadowRoot) targetEl.replaceWith(...nodes);\n } else if (pos === 'innerHtml') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'innerText') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'replaceChildren') {\n targetEl.replaceChildren(...nodes);\n } else {\n if (pos === 'beforeEnd') {\n targetEl.append(...nodes)\n }\n else if (pos === 'afterBegin') targetEl.prepend(...nodes);\n else if (pos === 'beforeBegin' && !isShadowRoot) targetEl.before(...nodes);\n else if (pos === 'afterEnd' && !isShadowRoot) targetEl.after(...nodes);\n }\n\n const stateContext: any = {...hostSet};\n findAllStateMetadata(currentThis).forEach(it => {\n stateContext[it.name] = currentThis[it.propertyKey]\n })\n new ElementApply(targetEl, {id: id}).apply({target: 'noInitialized', context: stateContext, bind: currentThis});\n return nodes;\n};\n\n/**\n * @applyNode decorator to surgically add/replace nodes to a target element.\n * \n * Overloads:\n * - applyNode(selector, options) - Apply to specific selector\n * - applyNode(options) - Apply to $this (current element)\n */\nexport function applyNode(selector: string, options?: ApplyNodeOptions): MethodDecorator;\nexport function applyNode(options: ApplyNodeOptions): MethodDecorator;\nexport function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {\n // Determine selector and options based on overload\n let selector: string;\n let options: ApplyNodeOptions;\n\n if (typeof selectorOrOptions === 'string') {\n // First overload: applyNode(selector, options)\n selector = selectorOrOptions;\n options = maybeOptions || {position: 'replaceChildren'};\n } else {\n // Second overload: applyNode(options) - default to $this\n selector = '$this';\n options = selectorOrOptions || {position: 'replaceChildren'};\n }\n\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ApplyNodeMetadata>();\n ReflectUtils.defineMetadata(APPLY_NODE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, {propertyKey, selector, options});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n const currentDoc = currentWin.document;\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this);\n\n const getTarget = () => {\n const r = options.root || 'auto';\n const applyRoot = (t: any) => {\n if (!t) return t;\n if (r === 'auto') return t.shadowRoot || t;\n if (r === 'shadow') return t.shadowRoot;\n if (r === 'light') return t;\n if (r === 'all') return t.shadowRoot || t;\n return t;\n };\n\n if (selector === '$this') return applyRoot(this);\n if (selector === '$host') return applyRoot(hostSet.$host);\n if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);\n if (selector === '$appHost') return applyRoot(hostSet.$appHost);\n if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);\n if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);\n\n const targetRoot = applyRoot(this);\n return targetRoot ? targetRoot.querySelector(selector) : null;\n };\n\n const targetEl = getTarget();\n const res = original.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses APPLY_NODE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options.valueKey ?? APPLY_NODE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const runApply = (target: any, val: any) => {\n const pos = options.position || 'beforeEnd';\n // Delegate HTML/node processing to applyToDom which centralizes\n // processing. runApply should not call processHtml itself to avoid\n // duplicate processing.\n const processedVal = val;\n\n // \uC0AC\uC6A9\uC790\uAC00 filter\uB97C \uBA85\uC2DC\uD558\uBA74 \uADF8 \uC870\uAC74\uC73C\uB85C, \uC544\uB2C8\uBA74 \uD56D\uC0C1 \uC801\uC6A9\n if (!options.filter || options.filter(target, processedVal, {currentThis: this, helper: hostSet})) {\n applyToDom(this, target, processedVal, pos, currentWin);\n }\n };\n\n\n const fallbackNodes: Node[] = [];\n if (targetEl && options.fallback) {\n const loadingRes = options.fallback.call(this, hostSet);\n // applyToDom expects a Window as the 4th argument\n fallbackNodes.push(...applyToDom(this, targetEl, loadingRes, options.position || 'beforeEnd', currentWin));\n }\n\n if (res instanceof Promise) {\n return res.then(finalRes => {\n const extracted = extractValue(finalRes);\n fallbackNodes.forEach((it: any)=>it.remove());\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return finalRes;\n });\n } else {\n const extracted = extractValue(res);\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return res;\n }\n };\n };\n}\n\n// --- Overloaded convenience functions for common patterns ---\n\n/**\n * @replaceChildrenNode decorator - replaces children of target element\n * \n * Overloads:\n * - replaceChildrenNode(selector, options) - Replace children of specific selector\n * - replaceChildrenNode(options) - Replace children of $this (current element)\n * - @replaceChildrenNode - Bare decorator, replaces children of $this\n */\nexport function replaceChildren(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildren(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n}\n\n/**\n * @clearChildrenNode decorator - clears all children of target element\n * \n * Overloads:\n * - clearChildrenNode(selector, options) - Clear children of specific selector\n * - clearChildrenNode(options) - Clear children of $this (current element)\n * - @clearChildrenNode - Bare decorator, clears children of $this\n */\nexport function clearChildrenNode(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenNode(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n}\n\n// Alias for clearChildrenNode\nexport const clearNode = clearChildrenNode;\n\n/**\n * @innerHtmlNode decorator - sets innerHTML of target element\n * \n * Overloads:\n * - innerHtmlNode(selector, options) - Set innerHTML of specific selector\n * - innerHtmlNode(options) - Set innerHTML of $this (current element)\n * - @innerHtmlNode - Bare decorator, sets innerHTML of $this\n */\nexport function innerHtml(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtml(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n}\n\n// Alias for innerHtmlNode\n// export const setHtmlNode = innerHtml;\n\n/**\n * @innerHtmlLightNode decorator - sets innerHTML of light DOM element\n * \n * Overloads:\n * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM\n * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM\n * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM\n */\nexport function innerHtmlLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n}\n\n\n/**\n * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element\n * \n * Overloads:\n * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM\n * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM\n * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM\n */\nexport function innerHtmlShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n}\n\n\n/**\n * @innerTextNode decorator - sets innerText of target element\n * \n * Overloads:\n * - innerTextNode(selector, options) - Set innerText of specific selector\n * - innerTextNode(options) - Set innerText of $this (current element)\n * - @innerTextNode - Bare decorator, sets innerText of $this\n */\nexport function innerText(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerText(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n}\n\n\n/**\n * @innerTextLightNode decorator - sets innerText of light DOM element\n * \n * Overloads:\n * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM\n * - innerTextLightNode(options) - Set innerText of $this in light DOM\n * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM\n */\nexport function innerTextLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n}\n\n/**\n * @innerTextShadowNode decorator - sets innerText of shadow DOM element\n * \n * Overloads:\n * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM\n * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM\n * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM\n */\nexport function innerTextShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n}\n\n/**\n * @beforeEndNode decorator - appends nodes to target element\n * \n * Overloads:\n * - beforeEndNode(selector, options) - Append to specific selector\n * - beforeEndNode(options) - Append to $this (current element)\n * - @beforeEndNode - Bare decorator, appends to $this\n */\nexport function insertBeforeEnd(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEnd(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n}\n\n\n/**\n * @beforeEndLightNode decorator - appends nodes to light DOM element\n * \n * Overloads:\n * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM\n * - beforeEndLightNode(options) - Append to $this in light DOM\n * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM\n */\nexport function insertBeforeEndLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n}\n\n\n/**\n * @beforeEndShadowNode decorator - appends nodes to shadow DOM element\n * \n * Overloads:\n * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM\n * - beforeEndShadowNode(options) - Append to $this in shadow DOM\n * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM\n */\nexport function insertBeforeEndShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n}\n\n\n/**\n * @afterBeginNode decorator - prepends nodes to target element\n * \n * Overloads:\n * - afterBeginNode(selector, options) - Prepend to specific selector\n * - afterBeginNode(options) - Prepend to $this (current element)\n * - @afterBeginNode - Bare decorator, prepends to $this\n */\nexport function insertAfterBegin(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBegin(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n}\n\n\n/**\n * @afterBeginLightNode decorator - prepends nodes to light DOM element\n * \n * Overloads:\n * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM\n * - afterBeginLightNode(options) - Prepend to $this in light DOM\n * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM\n */\nexport function insertAfterBeginLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBeginLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n}\n\n\n/**\n * @replaceChildrenLightNode decorator - replaces children of light DOM element\n * \n * Overloads:\n * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM\n * - replaceChildrenLightNode(options) - Replace children of $this in light DOM\n * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM\n */\nexport function replaceChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n}\n\n/**\n * @clearChildrenLightNode decorator - clears children of light DOM element\n * \n * Overloads:\n * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM\n * - clearChildrenLightNode(options) - Clear children of $this in light DOM\n * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM\n */\nexport function clearChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string') {\n return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n}\n\n\n\n\nexport const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {\n const result = new Map<string | symbol, ApplyNodeMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};"],
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,wBAAwB;AAE7C,SAAS,gBAAe;AACxB,SAAQ,4BAA2B;AACnC,SAAQ,oBAAmB;
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit, getElementConfig } from './elementDefine';\nimport {SpecialSelector, SwcQueryOptions, HelperHostSet, SwcRootType} from '../types';\nimport { SwcUtils} from \"../utils/Utils\";\nimport {findAllStateMetadata} from \"./state\";\nimport {ElementApply} from \"@dooboostore/core-web\";\n/*\n<!-- beforebegin -->\n<p> <-- it's me\n <!-- afterbegin -->\n foo\n <!-- beforeend -->\n</p>\n<!-- afterend -->\n */\nexport type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';\n\nexport type ApplyNodeSelector = string | ((currentThis: any, helper: HelperHostSet) => NodeList | Element | Element[] | null);\n\nexport interface ApplyNodeOptions {\n position?: ApplyNodePosition;\n root?: SwcRootType;\n /**\n * Filter function to determine whether to perform DOM operation.\n * If it returns false, the operation is skipped.\n */\n filter?: (target: HTMLElement | ShadowRoot, newValue: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n /**\n * Optional loading content to display while an async method is executing.\n */\n fallback?: (helper: HelperHostSet) => any;\n /**\n * Custom key to extract value from return object.\n * If not provided, uses APPLY_NODE_METADATA_KEY by default.\n * Useful when multiple @applyNode decorators are on the same method.\n */\n valueKey?: symbol | string;\n}\n\nexport interface ApplyNodeMetadata {\n propertyKey: string | symbol;\n selector: ApplyNodeSelector;\n options: ApplyNodeOptions;\n}\n\nexport const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-node');\n\n/**\n * Resolve selector to string or elements\n * Handles function-based selectors and returns elements if applicable\n */\nconst resolveSelector = (selector: ApplyNodeSelector, inst: any, win: Window): string | HTMLElement | null => {\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(win, inst);\n const result = selector(inst, hostSet);\n \n if (result instanceof win.Element) {\n return result as HTMLElement;\n }\n if (result instanceof win.NodeList) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (Array.isArray(result)) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (result === null) {\n return null;\n }\n // result must be a string at this point\n return result as unknown as string;\n }\n return selector as string;\n};\n\n// const normalizeNodes = (res: any, doc: Document): Node[] => {\n// const items = Array.isArray(res) ? res : [res];\n// return items.map(it => {\n// if (it instanceof Node) return it;\n// return doc.createTextNode(it !== undefined && it !== null ? String(it) : '');\n// });\n// };\n\nconst applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {\n if (!targetEl) return;\n \n // Handle clearChildren - ignore return value and always clear\n if (pos === 'clearChildren') {\n targetEl.replaceChildren();\n return [];\n }\n \n const doc = win.document;\n const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);\n const id = currentThis._swcId;\n\n const nodes: Node[] = [];\n\n if (res instanceof win.Node) {\n nodes.push(res);\n } else if (typeof res === 'string' && pos === 'innerHtml') {\n const t = win.document.createElement('template');\n t.innerHTML = res;\n nodes.push(...Array.from(t.content.childNodes));\n } else if (typeof res === 'string' && pos === 'innerText') {\n nodes.push(win.document.createTextNode(res));\n }\n\n SwcUtils.projectProcessHtml(id, nodes, doc);\n\n const isShadowRoot = targetEl instanceof win.ShadowRoot;\n // const nodes = normalizeNodes(res, doc);\n if (pos === 'replace') {\n if (!isShadowRoot) targetEl.replaceWith(...nodes);\n } else if (pos === 'innerHtml') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'innerText') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'replaceChildren') {\n targetEl.replaceChildren(...nodes);\n } else {\n if (pos === 'beforeEnd') {\n targetEl.append(...nodes)\n }\n else if (pos === 'afterBegin') targetEl.prepend(...nodes);\n else if (pos === 'beforeBegin' && !isShadowRoot) targetEl.before(...nodes);\n else if (pos === 'afterEnd' && !isShadowRoot) targetEl.after(...nodes);\n }\n\n const stateContext: any = {...hostSet};\n findAllStateMetadata(currentThis).forEach(it => {\n stateContext[it.name] = currentThis[it.propertyKey]\n })\n new ElementApply(targetEl, {id: id}).apply({target: 'noInitialized', context: stateContext, bind: currentThis});\n return nodes;\n};\n\n/**\n * @applyNode decorator to surgically add/replace nodes to a target element.\n * \n * Overloads:\n * - applyNode(selector, options) - Apply to specific selector\n * - applyNode(options) - Apply to $this (current element)\n */\nexport function applyNode(selector: ApplyNodeSelector, options?: ApplyNodeOptions): MethodDecorator;\nexport function applyNode(options: ApplyNodeOptions): MethodDecorator;\nexport function applyNode(selectorOrOptions: ApplyNodeSelector | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {\n // Determine selector and options based on overload\n let selector: ApplyNodeSelector;\n let options: ApplyNodeOptions;\n\n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n // First overload: applyNode(selector, options)\n selector = selectorOrOptions;\n options = maybeOptions || {position: 'replaceChildren'};\n } else {\n // Second overload: applyNode(options) - default to $this\n selector = '$this';\n options = selectorOrOptions || {position: 'replaceChildren'};\n }\n\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ApplyNodeMetadata>();\n ReflectUtils.defineMetadata(APPLY_NODE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, {propertyKey, selector, options});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n\n const conf = getElementConfig(this);\n const currentWin = (this as any)._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as Window);\n const currentDoc = currentWin.document;\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this);\n\n const getTarget = () => {\n const r = options.root || 'auto';\n const applyRoot = (t: any) => {\n if (!t) return t;\n if (r === 'auto') return t.shadowRoot || t;\n if (r === 'shadow') return t.shadowRoot;\n if (r === 'light') return t;\n if (r === 'all') return t.shadowRoot || t;\n return t;\n };\n\n // Resolve selector if it's a function\n const resolved = resolveSelector(selector, this, currentWin);\n \n // If selector function returned an element directly, use it\n if (resolved instanceof currentWin.Element) {\n return applyRoot(resolved);\n }\n if (resolved === null) {\n return null;\n }\n\n // Handle string selector\n const stringSelector = resolved as string;\n\n if (stringSelector === '$this') return applyRoot(this);\n if (stringSelector === '$host') return applyRoot(hostSet.$host);\n if (stringSelector === '$parentHost') return applyRoot(hostSet.$parentHost);\n if (stringSelector === '$appHost') return applyRoot(hostSet.$appHost);\n if (stringSelector === '$firstHost') return applyRoot(hostSet.$firstHost);\n if (stringSelector === '$lastHost') return applyRoot(hostSet.$lastHost);\n\n const targetRoot = applyRoot(this);\n return targetRoot ? targetRoot.querySelector(stringSelector) : null;\n };\n\n const targetEl = getTarget();\n const res = original.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses APPLY_NODE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options.valueKey ?? APPLY_NODE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const runApply = (target: any, val: any) => {\n const pos = options.position || 'beforeEnd';\n // Delegate HTML/node processing to applyToDom which centralizes\n // processing. runApply should not call processHtml itself to avoid\n // duplicate processing.\n const processedVal = val;\n\n // \uC0AC\uC6A9\uC790\uAC00 filter\uB97C \uBA85\uC2DC\uD558\uBA74 \uADF8 \uC870\uAC74\uC73C\uB85C, \uC544\uB2C8\uBA74 \uD56D\uC0C1 \uC801\uC6A9\n if (!options.filter || options.filter(target, processedVal, {currentThis: this, helper: hostSet})) {\n applyToDom(this, target, processedVal, pos, currentWin);\n }\n };\n\n\n const fallbackNodes: Node[] = [];\n if (targetEl && options.fallback) {\n const loadingRes = options.fallback.call(this, hostSet);\n // applyToDom expects a Window as the 4th argument\n fallbackNodes.push(...applyToDom(this, targetEl, loadingRes, options.position || 'beforeEnd', currentWin));\n }\n\n if (res instanceof Promise) {\n return res.then(finalRes => {\n const extracted = extractValue(finalRes);\n fallbackNodes.forEach((it: any)=>it.remove());\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return finalRes;\n });\n } else {\n const extracted = extractValue(res);\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return res;\n }\n };\n };\n}\n\n// --- Overloaded convenience functions for common patterns ---\n\n/**\n * @replaceChildrenNode decorator - replaces children of target element\n * \n * Overloads:\n * - replaceChildrenNode(selector, options) - Replace children of specific selector\n * - replaceChildrenNode(options) - Replace children of $this (current element)\n * - @replaceChildrenNode - Bare decorator, replaces children of $this\n */\nexport function replaceChildren(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildren(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n}\n\n/**\n * @clearChildrenNode decorator - clears all children of target element\n * \n * Overloads:\n * - clearChildrenNode(selector, options) - Clear children of specific selector\n * - clearChildrenNode(options) - Clear children of $this (current element)\n * - @clearChildrenNode - Bare decorator, clears children of $this\n */\nexport function clearChildrenNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n}\n\n// Alias for clearChildrenNode\nexport const clearNode = clearChildrenNode;\n\n/**\n * @innerHtmlNode decorator - sets innerHTML of target element\n * \n * Overloads:\n * - innerHtmlNode(selector, options) - Set innerHTML of specific selector\n * - innerHtmlNode(options) - Set innerHTML of $this (current element)\n * - @innerHtmlNode - Bare decorator, sets innerHTML of $this\n */\nexport function innerHtml(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtml(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n}\n\n// Alias for innerHtmlNode\n// export const setHtmlNode = innerHtml;\n\n/**\n * @innerHtmlLightNode decorator - sets innerHTML of light DOM element\n * \n * Overloads:\n * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM\n * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM\n * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM\n */\nexport function innerHtmlLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n}\n\n\n/**\n * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element\n * \n * Overloads:\n * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM\n * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM\n * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM\n */\nexport function innerHtmlShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n}\n\n\n/**\n * @innerTextNode decorator - sets innerText of target element\n * \n * Overloads:\n * - innerTextNode(selector, options) - Set innerText of specific selector\n * - innerTextNode(options) - Set innerText of $this (current element)\n * - @innerTextNode - Bare decorator, sets innerText of $this\n */\nexport function innerText(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerText(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n}\n\n\n/**\n * @innerTextLightNode decorator - sets innerText of light DOM element\n * \n * Overloads:\n * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM\n * - innerTextLightNode(options) - Set innerText of $this in light DOM\n * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM\n */\nexport function innerTextLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n}\n\n/**\n * @innerTextShadowNode decorator - sets innerText of shadow DOM element\n * \n * Overloads:\n * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM\n * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM\n * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM\n */\nexport function innerTextShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n}\n\n/**\n * @beforeEndNode decorator - appends nodes to target element\n * \n * Overloads:\n * - beforeEndNode(selector, options) - Append to specific selector\n * - beforeEndNode(options) - Append to $this (current element)\n * - @beforeEndNode - Bare decorator, appends to $this\n */\nexport function insertBeforeEnd(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEnd(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n}\n\n\n/**\n * @beforeEndLightNode decorator - appends nodes to light DOM element\n * \n * Overloads:\n * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM\n * - beforeEndLightNode(options) - Append to $this in light DOM\n * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM\n */\nexport function insertBeforeEndLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n}\n\n\n/**\n * @beforeEndShadowNode decorator - appends nodes to shadow DOM element\n * \n * Overloads:\n * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM\n * - beforeEndShadowNode(options) - Append to $this in shadow DOM\n * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM\n */\nexport function insertBeforeEndShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n}\n\n\n/**\n * @afterBeginNode decorator - prepends nodes to target element\n * \n * Overloads:\n * - afterBeginNode(selector, options) - Prepend to specific selector\n * - afterBeginNode(options) - Prepend to $this (current element)\n * - @afterBeginNode - Bare decorator, prepends to $this\n */\nexport function insertAfterBegin(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBegin(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n}\n\n\n/**\n * @afterBeginLightNode decorator - prepends nodes to light DOM element\n * \n * Overloads:\n * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM\n * - afterBeginLightNode(options) - Prepend to $this in light DOM\n * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM\n */\nexport function insertAfterBeginLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBeginLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n}\n\n\n/**\n * @replaceChildrenLightNode decorator - replaces children of light DOM element\n * \n * Overloads:\n * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM\n * - replaceChildrenLightNode(options) - Replace children of $this in light DOM\n * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM\n */\nexport function replaceChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n}\n\n/**\n * @clearChildrenLightNode decorator - clears children of light DOM element\n * \n * Overloads:\n * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM\n * - clearChildrenLightNode(options) - Clear children of $this in light DOM\n * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM\n */\nexport function clearChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n}\n\n\n\n\nexport const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {\n const result = new Map<string | symbol, ApplyNodeMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,wBAAwB;AAE7C,SAAS,gBAAe;AACxB,SAAQ,4BAA2B;AACnC,SAAQ,oBAAmB;AAwCpB,MAAM,0BAA0B,OAAO,IAAI,iCAAiC;AAMnF,MAAM,kBAAkB,CAAC,UAA6B,MAAW,QAA6C;AAC5G,MAAI,OAAO,aAAa,YAAY;AAClC,UAAM,UAAU,SAAS,oBAAoB,KAAK,IAAI;AACtD,UAAM,SAAS,SAAS,MAAM,OAAO;AAErC,QAAI,kBAAkB,IAAI,SAAS;AACjC,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,IAAI,UAAU;AAClC,aAAO,OAAO,SAAS,IAAK,OAAO,CAAC,IAAoB;AAAA,IAC1D;AACA,QAAI,MAAM,QAAQ,MAAM,GAAG;AACzB,aAAO,OAAO,SAAS,IAAK,OAAO,CAAC,IAAoB;AAAA,IAC1D;AACA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B,MAAM,QAAO,CAAC;AAAA,EACvK;AACA,SAAO,UAAU,EAAC,GAAG,mBAAkE,UAAU,mBAAmB,MAAM,QAAO,CAAC;AACpI;AAaO,SAAS,mBAAmB,mBAA8F,cAA8E,YAA8E;AAE3R,MAAI,eAAe,WAAc,OAAO,iBAAiB,YAAY,OAAO,iBAAiB,WAAW;AACtG,WAAO,UAAU,EAAC,UAAU,iBAAiB,MAAM,QAAO,CAAC,EAAE,mBAAmB,cAAc,UAAU;AAAA,EAC1G;AAEA,MAAI,OAAO,sBAAsB,YAAY,OAAO,sBAAsB,YAAY;AACpF,WAAO,UAAU,mBAAwC,EAAC,GAAG,cAA6D,UAAU,iBAAiB,MAAM,QAAO,CAAC;AAAA,EACrK;AACA,SAAO,UAAU,EAAC,GAAG,mBAAkE,UAAU,iBAAiB,MAAM,QAAO,CAAC;AAClI;AAKO,MAAM,2BAA2B,CAAC,WAAyD;AAChG,QAAM,SAAS,oBAAI,IAAwC;AAC3D,QAAM,OAAO,aAAa,gBAAyD,yBAAyB,MAAM;AAClH,OAAK,QAAQ,SAAO;AAClB,QAAI,eAAe,KAAK;AACtB,UAAI,QAAQ,CAAC,GAAG,MAAM,OAAO,IAAI,GAAG,CAAC,CAAC;AAAA,IACxC;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,6 +7,27 @@ const resolvePropertyTargets = (inst, selector, options) => {
|
|
|
7
7
|
const currentWin = conf.window;
|
|
8
8
|
const r = options.root || "auto";
|
|
9
9
|
const results = [];
|
|
10
|
+
let resolvedSelector = selector;
|
|
11
|
+
if (typeof selector === "function") {
|
|
12
|
+
const hostSet = SwcUtils.getHelperAndHostSet(currentWin, inst);
|
|
13
|
+
resolvedSelector = selector(inst, hostSet);
|
|
14
|
+
}
|
|
15
|
+
if (resolvedSelector instanceof currentWin.Element) {
|
|
16
|
+
results.push(resolvedSelector);
|
|
17
|
+
return results;
|
|
18
|
+
}
|
|
19
|
+
if (resolvedSelector instanceof currentWin.NodeList) {
|
|
20
|
+
results.push(...Array.from(resolvedSelector));
|
|
21
|
+
return results;
|
|
22
|
+
}
|
|
23
|
+
if (Array.isArray(resolvedSelector)) {
|
|
24
|
+
results.push(...resolvedSelector);
|
|
25
|
+
return results;
|
|
26
|
+
}
|
|
27
|
+
if (resolvedSelector === null) {
|
|
28
|
+
return results;
|
|
29
|
+
}
|
|
30
|
+
const stringSelector = resolvedSelector;
|
|
10
31
|
const applyRoot = (target) => {
|
|
11
32
|
if (!target) return;
|
|
12
33
|
if (r === "auto") {
|
|
@@ -16,37 +37,37 @@ const resolvePropertyTargets = (inst, selector, options) => {
|
|
|
16
37
|
if ((r === "shadow" || r === "all") && target.shadowRoot) results.push(target.shadowRoot);
|
|
17
38
|
}
|
|
18
39
|
};
|
|
19
|
-
if (
|
|
40
|
+
if (stringSelector === "$this" || !stringSelector) {
|
|
20
41
|
applyRoot(inst);
|
|
21
|
-
} else if (
|
|
42
|
+
} else if (stringSelector === "$window") {
|
|
22
43
|
results.push(currentWin);
|
|
23
|
-
} else if (
|
|
44
|
+
} else if (stringSelector === "$document") {
|
|
24
45
|
results.push(currentWin.document);
|
|
25
46
|
} else {
|
|
26
47
|
const hostSet = SwcUtils.getHostSet(inst);
|
|
27
|
-
if (
|
|
28
|
-
else if (
|
|
29
|
-
else if (
|
|
30
|
-
else if (
|
|
31
|
-
else if (
|
|
32
|
-
else if (
|
|
33
|
-
else if (
|
|
34
|
-
else if (
|
|
35
|
-
else if (
|
|
48
|
+
if (stringSelector === "$host") applyRoot(hostSet.$host);
|
|
49
|
+
else if (stringSelector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
50
|
+
else if (stringSelector === "$appHost") applyRoot(hostSet.$appHost);
|
|
51
|
+
else if (stringSelector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
52
|
+
else if (stringSelector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
53
|
+
else if (stringSelector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
54
|
+
else if (stringSelector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
55
|
+
else if (stringSelector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
56
|
+
else if (stringSelector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
36
57
|
else {
|
|
37
58
|
if (r === "shadow") {
|
|
38
|
-
const found = inst.shadowRoot?.querySelectorAll(
|
|
59
|
+
const found = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
39
60
|
if (found) results.push(...found);
|
|
40
61
|
} else if (r === "light") {
|
|
41
|
-
const found = inst.querySelectorAll(
|
|
62
|
+
const found = inst.querySelectorAll(stringSelector);
|
|
42
63
|
if (found) results.push(...found);
|
|
43
64
|
} else if (r === "all") {
|
|
44
|
-
const sMatch = inst.shadowRoot?.querySelectorAll(
|
|
45
|
-
const lMatch = inst.querySelectorAll(
|
|
65
|
+
const sMatch = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
66
|
+
const lMatch = inst.querySelectorAll(stringSelector);
|
|
46
67
|
if (sMatch) results.push(...sMatch);
|
|
47
68
|
if (lMatch) results.push(...lMatch);
|
|
48
69
|
} else {
|
|
49
|
-
const found = (inst.shadowRoot || inst).querySelectorAll(
|
|
70
|
+
const found = (inst.shadowRoot || inst).querySelectorAll(stringSelector);
|
|
50
71
|
if (found) results.push(...found);
|
|
51
72
|
}
|
|
52
73
|
}
|