@dooboostore/simple-web-component 1.0.43 → 1.0.44
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 +298 -49
- package/dist/cjs/SwcAppEngine.js +3 -1
- package/dist/cjs/SwcAppEngine.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +30 -28
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +57 -21
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +165 -105
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +11 -28
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +39 -15
- package/dist/cjs/decorators/applyStyle.js.map +3 -3
- package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
- package/dist/cjs/decorators/changedAttribute.js.map +7 -0
- package/dist/cjs/decorators/elementDefine.js +37 -6
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +56 -42
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +1 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/cjs/decorators/query.js +96 -145
- package/dist/cjs/decorators/query.js.map +3 -3
- package/dist/cjs/decorators/queryAll.js +104 -131
- package/dist/cjs/decorators/queryAll.js.map +3 -3
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +17 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
- package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/router/ElementRouter.js +4 -0
- package/dist/cjs/router/ElementRouter.js.map +2 -2
- package/dist/esm/SwcAppEngine.js +3 -1
- package/dist/esm/SwcAppEngine.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +30 -28
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +57 -21
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +165 -105
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +11 -28
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +39 -15
- package/dist/esm/decorators/applyStyle.js.map +3 -3
- package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
- package/dist/esm/decorators/changedAttribute.js.map +7 -0
- package/dist/esm/decorators/elementDefine.js +35 -4
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +56 -42
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +1 -1
- package/dist/esm/decorators/index.js.map +1 -1
- package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
- package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/esm/decorators/query.js +96 -145
- package/dist/esm/decorators/query.js.map +3 -3
- package/dist/esm/decorators/queryAll.js +104 -131
- package/dist/esm/decorators/queryAll.js.map +3 -3
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +18 -3
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
- package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/router/ElementRouter.js +4 -0
- package/dist/esm/router/ElementRouter.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +17 -14
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +35 -20
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +16 -36
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +172 -30
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +27 -18
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +7 -7
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +1 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +3 -26
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +3 -20
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +4 -4
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
- package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/router/ElementRouter.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/SwcAppEngine.ts +3 -1
- package/src/decorators/addEventListener.ts +28 -24
- package/src/decorators/applyAttribute.ts +109 -63
- package/src/decorators/applyClass.ts +89 -15
- package/src/decorators/applyNode.ts +357 -100
- package/src/decorators/applyProperty.ts +42 -63
- package/src/decorators/applyStyle.ts +59 -11
- package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
- package/src/decorators/elementDefine.ts +47 -4
- package/src/decorators/emitCustomEvent.ts +44 -36
- package/src/decorators/index.ts +1 -1
- package/src/decorators/publishSwcAppMessage.ts +1 -1
- package/src/decorators/query.ts +90 -159
- package/src/decorators/queryAll.ts +92 -134
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
- package/src/elements/SwcAppMixin.ts +43 -24
- package/src/examples/RxJSOperatorsExample.ts +279 -0
- package/src/index.ts +2 -0
- package/src/router/ElementRouter.ts +4 -0
- package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
- package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
- package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
|
@@ -13,7 +13,7 @@ import {ElementApply} from "@dooboostore/core-web";
|
|
|
13
13
|
</p>
|
|
14
14
|
<!-- afterend -->
|
|
15
15
|
*/
|
|
16
|
-
export type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove';
|
|
16
|
+
export type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';
|
|
17
17
|
|
|
18
18
|
export interface ApplyNodeOptions {
|
|
19
19
|
position?: ApplyNodePosition;
|
|
@@ -53,11 +53,17 @@ export const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-no
|
|
|
53
53
|
|
|
54
54
|
const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {
|
|
55
55
|
if (!targetEl) return;
|
|
56
|
+
|
|
57
|
+
// Handle clearChildren - ignore return value and always clear
|
|
58
|
+
if (pos === 'clearChildren') {
|
|
59
|
+
targetEl.replaceChildren();
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
const doc = win.document;
|
|
57
64
|
const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
|
|
58
65
|
const id = currentThis._swcId;
|
|
59
66
|
|
|
60
|
-
|
|
61
67
|
const nodes: Node[] = [];
|
|
62
68
|
|
|
63
69
|
if (typeof res === 'string' && pos === 'innerHtml') {
|
|
@@ -70,8 +76,6 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
|
|
|
70
76
|
|
|
71
77
|
SwcUtils.projectProcessHtml(id, nodes, doc);
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
75
79
|
const isShadowRoot = targetEl instanceof win.ShadowRoot;
|
|
76
80
|
// const nodes = normalizeNodes(res, doc);
|
|
77
81
|
if (pos === 'replace') {
|
|
@@ -101,8 +105,28 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
|
|
|
101
105
|
|
|
102
106
|
/**
|
|
103
107
|
* @applyNode decorator to surgically add/replace nodes to a target element.
|
|
108
|
+
*
|
|
109
|
+
* Overloads:
|
|
110
|
+
* - applyNode(selector, options) - Apply to specific selector
|
|
111
|
+
* - applyNode(options) - Apply to $this (current element)
|
|
104
112
|
*/
|
|
105
|
-
export function applyNode(selector: string, options
|
|
113
|
+
export function applyNode(selector: string, options?: ApplyNodeOptions): MethodDecorator;
|
|
114
|
+
export function applyNode(options: ApplyNodeOptions): MethodDecorator;
|
|
115
|
+
export function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {
|
|
116
|
+
// Determine selector and options based on overload
|
|
117
|
+
let selector: string;
|
|
118
|
+
let options: ApplyNodeOptions;
|
|
119
|
+
|
|
120
|
+
if (typeof selectorOrOptions === 'string') {
|
|
121
|
+
// First overload: applyNode(selector, options)
|
|
122
|
+
selector = selectorOrOptions;
|
|
123
|
+
options = maybeOptions || {position: 'replaceChildren'};
|
|
124
|
+
} else {
|
|
125
|
+
// Second overload: applyNode(options) - default to $this
|
|
126
|
+
selector = '$this';
|
|
127
|
+
options = selectorOrOptions || {position: 'replaceChildren'};
|
|
128
|
+
}
|
|
129
|
+
|
|
106
130
|
return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
|
|
107
131
|
const constructor = targetObj.constructor;
|
|
108
132
|
let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;
|
|
@@ -199,137 +223,370 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
|
|
|
199
223
|
};
|
|
200
224
|
}
|
|
201
225
|
|
|
202
|
-
|
|
203
|
-
export function applyNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
204
|
-
export function applyNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
|
|
205
|
-
const option: ApplyNodeOptions = {position: 'replaceChildren'};
|
|
206
|
-
if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
|
|
207
|
-
const opt = targetOrOptions || {};
|
|
208
|
-
return applyNode('$this', {...option, ...opt});
|
|
209
|
-
}
|
|
226
|
+
// --- Overloaded convenience functions for common patterns ---
|
|
210
227
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
228
|
+
/**
|
|
229
|
+
* @replaceChildrenNode decorator - replaces children of target element
|
|
230
|
+
*
|
|
231
|
+
* Overloads:
|
|
232
|
+
* - replaceChildrenNode(selector, options) - Replace children of specific selector
|
|
233
|
+
* - replaceChildrenNode(options) - Replace children of $this (current element)
|
|
234
|
+
* - @replaceChildrenNode - Bare decorator, replaces children of $this
|
|
235
|
+
*/
|
|
236
|
+
export function replaceChildren(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
237
|
+
export function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
238
|
+
export function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
239
|
+
export function replaceChildren(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
240
|
+
// Bare decorator usage: @replaceChildrenNode
|
|
241
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
242
|
+
return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (typeof selectorOrOptions === 'string') {
|
|
246
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
|
|
247
|
+
}
|
|
248
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
|
|
218
249
|
}
|
|
219
250
|
|
|
251
|
+
/**
|
|
252
|
+
* @clearChildrenNode decorator - clears all children of target element
|
|
253
|
+
*
|
|
254
|
+
* Overloads:
|
|
255
|
+
* - clearChildrenNode(selector, options) - Clear children of specific selector
|
|
256
|
+
* - clearChildrenNode(options) - Clear children of $this (current element)
|
|
257
|
+
* - @clearChildrenNode - Bare decorator, clears children of $this
|
|
258
|
+
*/
|
|
259
|
+
export function clearChildrenNode(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
260
|
+
export function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
261
|
+
export function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
262
|
+
export function clearChildrenNode(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
263
|
+
// Bare decorator usage: @clearChildrenNode
|
|
264
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
265
|
+
return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (typeof selectorOrOptions === 'string') {
|
|
269
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
|
|
270
|
+
}
|
|
271
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
|
|
272
|
+
}
|
|
220
273
|
|
|
274
|
+
// Alias for clearChildrenNode
|
|
275
|
+
export const clearNode = clearChildrenNode;
|
|
221
276
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
277
|
+
/**
|
|
278
|
+
* @innerHtmlNode decorator - sets innerHTML of target element
|
|
279
|
+
*
|
|
280
|
+
* Overloads:
|
|
281
|
+
* - innerHtmlNode(selector, options) - Set innerHTML of specific selector
|
|
282
|
+
* - innerHtmlNode(options) - Set innerHTML of $this (current element)
|
|
283
|
+
* - @innerHtmlNode - Bare decorator, sets innerHTML of $this
|
|
284
|
+
*/
|
|
285
|
+
export function innerHtml(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
286
|
+
export function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
287
|
+
export function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
288
|
+
export function innerHtml(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
289
|
+
// Bare decorator usage: @innerHtmlNode
|
|
290
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
291
|
+
return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (typeof selectorOrOptions === 'string') {
|
|
295
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
|
|
296
|
+
}
|
|
297
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
|
|
229
298
|
}
|
|
230
299
|
|
|
231
|
-
|
|
232
|
-
export
|
|
233
|
-
export function beforeEndLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
|
|
234
|
-
const option: ApplyNodeOptions = {position: 'beforeEnd', root: 'light'}
|
|
235
|
-
if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
|
|
236
|
-
const opt = targetOrOptions || {};
|
|
237
|
-
return applyNode('$this', {...opt, ...option});
|
|
238
|
-
}
|
|
300
|
+
// Alias for innerHtmlNode
|
|
301
|
+
// export const setHtmlNode = innerHtml;
|
|
239
302
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
303
|
+
/**
|
|
304
|
+
* @innerHtmlLightNode decorator - sets innerHTML of light DOM element
|
|
305
|
+
*
|
|
306
|
+
* Overloads:
|
|
307
|
+
* - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM
|
|
308
|
+
* - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM
|
|
309
|
+
* - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM
|
|
310
|
+
*/
|
|
311
|
+
export function innerHtmlLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
312
|
+
export function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
313
|
+
export function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
314
|
+
export function innerHtmlLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
315
|
+
// Bare decorator usage: @innerHtmlLightNode
|
|
316
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
317
|
+
return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (typeof selectorOrOptions === 'string') {
|
|
321
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
|
|
322
|
+
}
|
|
323
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
|
|
247
324
|
}
|
|
248
325
|
|
|
249
|
-
export function afterBeginNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
250
|
-
export function afterBeginNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
251
|
-
export function afterBeginNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
|
|
252
|
-
const option: ApplyNodeOptions = {position: 'afterBegin'};
|
|
253
|
-
if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
|
|
254
|
-
const opt = targetOrOptions || {};
|
|
255
|
-
return applyNode('$this', {...opt, ...option});
|
|
256
|
-
}
|
|
257
326
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
327
|
+
/**
|
|
328
|
+
* @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element
|
|
329
|
+
*
|
|
330
|
+
* Overloads:
|
|
331
|
+
* - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM
|
|
332
|
+
* - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM
|
|
333
|
+
* - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM
|
|
334
|
+
*/
|
|
335
|
+
export function innerHtmlShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
336
|
+
export function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
337
|
+
export function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
338
|
+
export function innerHtmlShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
339
|
+
// Bare decorator usage: @innerHtmlShadowNode
|
|
340
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
341
|
+
return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (typeof selectorOrOptions === 'string') {
|
|
345
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
|
|
346
|
+
}
|
|
347
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
|
|
265
348
|
}
|
|
266
349
|
|
|
267
|
-
export function innerHtmlNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
268
|
-
export function innerHtmlNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
269
|
-
export function innerHtmlNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
|
|
270
|
-
const option: ApplyNodeOptions = {position: 'innerHtml'}
|
|
271
|
-
if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
|
|
272
|
-
const opt = targetOrOptions || {};
|
|
273
|
-
return applyNode('$this', {...opt, ...option});
|
|
274
|
-
}
|
|
275
350
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
351
|
+
/**
|
|
352
|
+
* @innerTextNode decorator - sets innerText of target element
|
|
353
|
+
*
|
|
354
|
+
* Overloads:
|
|
355
|
+
* - innerTextNode(selector, options) - Set innerText of specific selector
|
|
356
|
+
* - innerTextNode(options) - Set innerText of $this (current element)
|
|
357
|
+
* - @innerTextNode - Bare decorator, sets innerText of $this
|
|
358
|
+
*/
|
|
359
|
+
export function innerText(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
360
|
+
export function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
361
|
+
export function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
362
|
+
export function innerText(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
363
|
+
// Bare decorator usage: @innerTextNode
|
|
364
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
365
|
+
return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (typeof selectorOrOptions === 'string') {
|
|
369
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
|
|
370
|
+
}
|
|
371
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
|
|
283
372
|
}
|
|
284
373
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @innerTextLightNode decorator - sets innerText of light DOM element
|
|
377
|
+
*
|
|
378
|
+
* Overloads:
|
|
379
|
+
* - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM
|
|
380
|
+
* - innerTextLightNode(options) - Set innerText of $this in light DOM
|
|
381
|
+
* - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM
|
|
382
|
+
*/
|
|
383
|
+
export function innerTextLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
384
|
+
export function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
385
|
+
export function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
386
|
+
export function innerTextLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
387
|
+
// Bare decorator usage: @innerTextLightNode
|
|
388
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
389
|
+
return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (typeof selectorOrOptions === 'string') {
|
|
393
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
|
|
394
|
+
}
|
|
395
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
|
|
292
396
|
}
|
|
293
397
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
398
|
+
/**
|
|
399
|
+
* @innerTextShadowNode decorator - sets innerText of shadow DOM element
|
|
400
|
+
*
|
|
401
|
+
* Overloads:
|
|
402
|
+
* - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM
|
|
403
|
+
* - innerTextShadowNode(options) - Set innerText of $this in shadow DOM
|
|
404
|
+
* - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM
|
|
405
|
+
*/
|
|
406
|
+
export function innerTextShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
407
|
+
export function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
408
|
+
export function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
409
|
+
export function innerTextShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
410
|
+
// Bare decorator usage: @innerTextShadowNode
|
|
411
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
412
|
+
return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (typeof selectorOrOptions === 'string') {
|
|
416
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
|
|
417
|
+
}
|
|
418
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
|
|
301
419
|
}
|
|
302
420
|
|
|
303
|
-
|
|
304
|
-
|
|
421
|
+
/**
|
|
422
|
+
* @beforeEndNode decorator - appends nodes to target element
|
|
423
|
+
*
|
|
424
|
+
* Overloads:
|
|
425
|
+
* - beforeEndNode(selector, options) - Append to specific selector
|
|
426
|
+
* - beforeEndNode(options) - Append to $this (current element)
|
|
427
|
+
* - @beforeEndNode - Bare decorator, appends to $this
|
|
428
|
+
*/
|
|
429
|
+
export function insertBeforeEnd(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
430
|
+
export function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
431
|
+
export function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
432
|
+
export function insertBeforeEnd(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
433
|
+
// Bare decorator usage: @beforeEndNode
|
|
434
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
435
|
+
return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (typeof selectorOrOptions === 'string') {
|
|
439
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
|
|
440
|
+
}
|
|
441
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
|
|
305
442
|
}
|
|
306
443
|
|
|
307
|
-
|
|
308
|
-
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @beforeEndLightNode decorator - appends nodes to light DOM element
|
|
447
|
+
*
|
|
448
|
+
* Overloads:
|
|
449
|
+
* - beforeEndLightNode(selector, options) - Append to specific selector in light DOM
|
|
450
|
+
* - beforeEndLightNode(options) - Append to $this in light DOM
|
|
451
|
+
* - @beforeEndLightNode - Bare decorator, appends to $this in light DOM
|
|
452
|
+
*/
|
|
453
|
+
export function insertBeforeEndLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
454
|
+
export function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
455
|
+
export function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
456
|
+
export function insertBeforeEndLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
457
|
+
// Bare decorator usage: @beforeEndLightNode
|
|
458
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
459
|
+
return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (typeof selectorOrOptions === 'string') {
|
|
463
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
|
|
464
|
+
}
|
|
465
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
|
|
309
466
|
}
|
|
310
467
|
|
|
311
|
-
|
|
312
|
-
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* @beforeEndShadowNode decorator - appends nodes to shadow DOM element
|
|
471
|
+
*
|
|
472
|
+
* Overloads:
|
|
473
|
+
* - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM
|
|
474
|
+
* - beforeEndShadowNode(options) - Append to $this in shadow DOM
|
|
475
|
+
* - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM
|
|
476
|
+
*/
|
|
477
|
+
export function insertBeforeEndShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
478
|
+
export function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
479
|
+
export function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
480
|
+
export function insertBeforeEndShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
481
|
+
// Bare decorator usage: @beforeEndShadowNode
|
|
482
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
483
|
+
return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (typeof selectorOrOptions === 'string') {
|
|
487
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
|
|
488
|
+
}
|
|
489
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
|
|
313
490
|
}
|
|
314
491
|
|
|
315
|
-
|
|
316
|
-
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* @afterBeginNode decorator - prepends nodes to target element
|
|
495
|
+
*
|
|
496
|
+
* Overloads:
|
|
497
|
+
* - afterBeginNode(selector, options) - Prepend to specific selector
|
|
498
|
+
* - afterBeginNode(options) - Prepend to $this (current element)
|
|
499
|
+
* - @afterBeginNode - Bare decorator, prepends to $this
|
|
500
|
+
*/
|
|
501
|
+
export function insertAfterBegin(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
502
|
+
export function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
|
|
503
|
+
export function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
504
|
+
export function insertAfterBegin(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
505
|
+
// Bare decorator usage: @afterBeginNode
|
|
506
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
507
|
+
return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
if (typeof selectorOrOptions === 'string') {
|
|
511
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
|
|
512
|
+
}
|
|
513
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
|
|
317
514
|
}
|
|
318
515
|
|
|
319
|
-
|
|
320
|
-
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* @afterBeginLightNode decorator - prepends nodes to light DOM element
|
|
519
|
+
*
|
|
520
|
+
* Overloads:
|
|
521
|
+
* - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM
|
|
522
|
+
* - afterBeginLightNode(options) - Prepend to $this in light DOM
|
|
523
|
+
* - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM
|
|
524
|
+
*/
|
|
525
|
+
export function insertAfterBeginLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
526
|
+
export function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
527
|
+
export function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
528
|
+
export function insertAfterBeginLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
529
|
+
// Bare decorator usage: @afterBeginLightNode
|
|
530
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
531
|
+
return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (typeof selectorOrOptions === 'string') {
|
|
535
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
|
|
536
|
+
}
|
|
537
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
|
|
321
538
|
}
|
|
322
539
|
|
|
323
|
-
|
|
324
|
-
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* @replaceChildrenLightNode decorator - replaces children of light DOM element
|
|
543
|
+
*
|
|
544
|
+
* Overloads:
|
|
545
|
+
* - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM
|
|
546
|
+
* - replaceChildrenLightNode(options) - Replace children of $this in light DOM
|
|
547
|
+
* - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM
|
|
548
|
+
*/
|
|
549
|
+
export function replaceChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
550
|
+
export function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
551
|
+
export function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
552
|
+
export function replaceChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
553
|
+
// Bare decorator usage: @replaceChildrenLightNode
|
|
554
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
555
|
+
return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (typeof selectorOrOptions === 'string') {
|
|
559
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
|
|
560
|
+
}
|
|
561
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
|
|
325
562
|
}
|
|
326
563
|
|
|
327
|
-
|
|
328
|
-
|
|
564
|
+
/**
|
|
565
|
+
* @clearChildrenLightNode decorator - clears children of light DOM element
|
|
566
|
+
*
|
|
567
|
+
* Overloads:
|
|
568
|
+
* - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM
|
|
569
|
+
* - clearChildrenLightNode(options) - Clear children of $this in light DOM
|
|
570
|
+
* - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM
|
|
571
|
+
*/
|
|
572
|
+
export function clearChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
573
|
+
export function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
|
|
574
|
+
export function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
575
|
+
export function clearChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
|
|
576
|
+
// Bare decorator usage: @clearChildrenLightNode
|
|
577
|
+
if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
|
|
578
|
+
return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (typeof selectorOrOptions === 'string') {
|
|
582
|
+
return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
|
|
583
|
+
}
|
|
584
|
+
return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
|
|
329
585
|
}
|
|
330
586
|
|
|
331
587
|
|
|
332
588
|
|
|
589
|
+
|
|
333
590
|
export const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {
|
|
334
591
|
const result = new Map<string | symbol, ApplyNodeMetadata>();
|
|
335
592
|
const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);
|