@dooboostore/simple-web-component 1.0.43 → 1.0.45
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 +312 -63
- 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 +66 -43
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +110 -43
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +200 -112
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +49 -45
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +92 -37
- 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 +81 -31
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +80 -52
- 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 +133 -147
- package/dist/cjs/decorators/query.js.map +3 -3
- package/dist/cjs/decorators/queryAll.js +143 -132
- 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/cjs/types/window.d.js.map +1 -1
- 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 +66 -43
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +110 -43
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +200 -112
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +49 -45
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +92 -37
- 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 +79 -29
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +80 -52
- 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 +133 -147
- package/dist/esm/decorators/query.js.map +3 -3
- package/dist/esm/decorators/queryAll.js +143 -132
- 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 +1118 -633
- 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 +19 -15
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +45 -26
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +19 -38
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +175 -32
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +38 -25
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +10 -9
- 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 +6 -12
- 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 +16 -29
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +16 -23
- 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 +1118 -633
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +1 -1
- package/src/SwcAppEngine.ts +3 -1
- package/src/decorators/addEventListener.ts +31 -25
- package/src/decorators/applyAttribute.ts +164 -86
- package/src/decorators/applyClass.ts +161 -41
- package/src/decorators/applyNode.ts +408 -108
- package/src/decorators/applyProperty.ts +100 -89
- package/src/decorators/applyStyle.ts +131 -37
- package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
- package/src/decorators/elementDefine.ts +96 -30
- package/src/decorators/emitCustomEvent.ts +92 -60
- package/src/decorators/index.ts +1 -1
- package/src/decorators/publishSwcAppMessage.ts +1 -1
- package/src/decorators/query.ts +155 -162
- package/src/decorators/queryAll.ts +157 -139
- 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/src/types/window.d.ts +3 -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
|
@@ -6342,6 +6342,155 @@ var getAddEventListenerMetadata = (target) => {
|
|
|
6342
6342
|
return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
|
|
6343
6343
|
};
|
|
6344
6344
|
|
|
6345
|
+
// ../core/dist/esm/message/operators/debounceTime.js
|
|
6346
|
+
function debounceTime(duration, config) {
|
|
6347
|
+
return (source) => {
|
|
6348
|
+
return new Observable((subscriber) => {
|
|
6349
|
+
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
6350
|
+
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
6351
|
+
let timeoutId = null;
|
|
6352
|
+
let lastValue;
|
|
6353
|
+
let hasValue = false;
|
|
6354
|
+
const subscription = source.subscribe({
|
|
6355
|
+
next: (value) => {
|
|
6356
|
+
clearTimeoutFn(timeoutId);
|
|
6357
|
+
lastValue = value;
|
|
6358
|
+
hasValue = true;
|
|
6359
|
+
timeoutId = setTimeoutFn(() => {
|
|
6360
|
+
if (hasValue) {
|
|
6361
|
+
subscriber.next(lastValue);
|
|
6362
|
+
hasValue = false;
|
|
6363
|
+
}
|
|
6364
|
+
}, duration);
|
|
6365
|
+
},
|
|
6366
|
+
error: (err) => {
|
|
6367
|
+
clearTimeoutFn(timeoutId);
|
|
6368
|
+
subscriber.error(err);
|
|
6369
|
+
},
|
|
6370
|
+
complete: () => {
|
|
6371
|
+
clearTimeoutFn(timeoutId);
|
|
6372
|
+
if (hasValue) {
|
|
6373
|
+
subscriber.next(lastValue);
|
|
6374
|
+
}
|
|
6375
|
+
subscriber.complete();
|
|
6376
|
+
}
|
|
6377
|
+
});
|
|
6378
|
+
return subscription;
|
|
6379
|
+
});
|
|
6380
|
+
};
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
// ../core/dist/esm/message/operators/distinctUntilChanged.js
|
|
6384
|
+
function distinctUntilChanged(comparator) {
|
|
6385
|
+
return (source) => {
|
|
6386
|
+
return new Observable((subscriber) => {
|
|
6387
|
+
let hasValue = false;
|
|
6388
|
+
let previousValue;
|
|
6389
|
+
const subscription = source.subscribe({
|
|
6390
|
+
next: (value) => {
|
|
6391
|
+
const areEqual = hasValue ? comparator ? comparator(previousValue, value) : previousValue === value : false;
|
|
6392
|
+
if (!areEqual) {
|
|
6393
|
+
hasValue = true;
|
|
6394
|
+
previousValue = value;
|
|
6395
|
+
subscriber.next(value);
|
|
6396
|
+
}
|
|
6397
|
+
},
|
|
6398
|
+
error: (err) => {
|
|
6399
|
+
subscriber.error(err);
|
|
6400
|
+
},
|
|
6401
|
+
complete: () => {
|
|
6402
|
+
subscriber.complete();
|
|
6403
|
+
}
|
|
6404
|
+
});
|
|
6405
|
+
return subscription;
|
|
6406
|
+
});
|
|
6407
|
+
};
|
|
6408
|
+
}
|
|
6409
|
+
|
|
6410
|
+
// ../core/dist/esm/message/operators/throttleTime.js
|
|
6411
|
+
function throttleTime(duration, config) {
|
|
6412
|
+
const leading = config?.leading ?? true;
|
|
6413
|
+
const trailing = config?.trailing ?? false;
|
|
6414
|
+
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
6415
|
+
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
6416
|
+
return (source) => {
|
|
6417
|
+
return new Observable((subscriber) => {
|
|
6418
|
+
let throttled = false;
|
|
6419
|
+
let trailingValue;
|
|
6420
|
+
let hasTrailingValue = false;
|
|
6421
|
+
let timeoutId = null;
|
|
6422
|
+
const endThrottle = () => {
|
|
6423
|
+
if (timeoutId !== null) {
|
|
6424
|
+
clearTimeoutFn(timeoutId);
|
|
6425
|
+
timeoutId = null;
|
|
6426
|
+
}
|
|
6427
|
+
throttled = false;
|
|
6428
|
+
if (trailing && hasTrailingValue) {
|
|
6429
|
+
const valueToEmit = trailingValue;
|
|
6430
|
+
hasTrailingValue = false;
|
|
6431
|
+
trailingValue = void 0;
|
|
6432
|
+
Promise.resolve().then(() => {
|
|
6433
|
+
if (!subscriber.closed) {
|
|
6434
|
+
subscriber.next(valueToEmit);
|
|
6435
|
+
startThrottle();
|
|
6436
|
+
}
|
|
6437
|
+
});
|
|
6438
|
+
}
|
|
6439
|
+
};
|
|
6440
|
+
const startThrottle = () => {
|
|
6441
|
+
if (throttled) {
|
|
6442
|
+
return;
|
|
6443
|
+
}
|
|
6444
|
+
throttled = true;
|
|
6445
|
+
timeoutId = setTimeoutFn(() => {
|
|
6446
|
+
endThrottle();
|
|
6447
|
+
}, duration);
|
|
6448
|
+
};
|
|
6449
|
+
const subscription = source.subscribe({
|
|
6450
|
+
next: (value) => {
|
|
6451
|
+
if (!throttled) {
|
|
6452
|
+
if (leading) {
|
|
6453
|
+
subscriber.next(value);
|
|
6454
|
+
} else if (trailing) {
|
|
6455
|
+
trailingValue = value;
|
|
6456
|
+
hasTrailingValue = true;
|
|
6457
|
+
}
|
|
6458
|
+
startThrottle();
|
|
6459
|
+
} else if (trailing) {
|
|
6460
|
+
trailingValue = value;
|
|
6461
|
+
hasTrailingValue = true;
|
|
6462
|
+
}
|
|
6463
|
+
},
|
|
6464
|
+
error: (err) => {
|
|
6465
|
+
if (timeoutId !== null) {
|
|
6466
|
+
clearTimeoutFn(timeoutId);
|
|
6467
|
+
timeoutId = null;
|
|
6468
|
+
}
|
|
6469
|
+
throttled = false;
|
|
6470
|
+
subscriber.error(err);
|
|
6471
|
+
},
|
|
6472
|
+
complete: () => {
|
|
6473
|
+
if (timeoutId !== null) {
|
|
6474
|
+
clearTimeoutFn(timeoutId);
|
|
6475
|
+
timeoutId = null;
|
|
6476
|
+
}
|
|
6477
|
+
if (trailing && hasTrailingValue) {
|
|
6478
|
+
subscriber.next(trailingValue);
|
|
6479
|
+
}
|
|
6480
|
+
subscriber.complete();
|
|
6481
|
+
}
|
|
6482
|
+
});
|
|
6483
|
+
return () => {
|
|
6484
|
+
subscription.unsubscribe();
|
|
6485
|
+
if (timeoutId !== null) {
|
|
6486
|
+
clearTimeoutFn(timeoutId);
|
|
6487
|
+
timeoutId = null;
|
|
6488
|
+
}
|
|
6489
|
+
};
|
|
6490
|
+
});
|
|
6491
|
+
};
|
|
6492
|
+
}
|
|
6493
|
+
|
|
6345
6494
|
// src/decorators/lifecycles.ts
|
|
6346
6495
|
var ON_INITIALIZE_METADATA_KEY = Symbol.for("simple-web-component:on-constructor");
|
|
6347
6496
|
var ON_BEFORE_CONNECTED_METADATA_KEY = Symbol.for("simple-web-component:on-before-connected");
|
|
@@ -6846,7 +6995,7 @@ var ElementApply = class _ElementApply {
|
|
|
6846
6995
|
if (!config?.targetVariableName || config?.targetVariableName && tit.variables.find((v) => v === config?.targetVariableName)) {
|
|
6847
6996
|
const data = new Function("ctx", `
|
|
6848
6997
|
with(ctx) {
|
|
6849
|
-
return function(){
|
|
6998
|
+
return function(event){
|
|
6850
6999
|
return (${this.stripWrap(tit.script)});
|
|
6851
7000
|
}
|
|
6852
7001
|
}
|
|
@@ -8800,18 +8949,32 @@ var SwcUtils;
|
|
|
8800
8949
|
|
|
8801
8950
|
// src/decorators/emitCustomEvent.ts
|
|
8802
8951
|
var EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for("simple-web-component:emit-custom-event");
|
|
8803
|
-
function emitCustomEvent(selectorOrTarget,
|
|
8952
|
+
function emitCustomEvent(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor) {
|
|
8953
|
+
if (typeof selectorOrTarget === "object" && typeof typeOrPropertyKey === "string" && typeof optionsOrDescriptor === "object" && "value" in optionsOrDescriptor) {
|
|
8954
|
+
throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);
|
|
8955
|
+
}
|
|
8956
|
+
if ((typeof selectorOrTarget === "string" || typeof selectorOrTarget === "function") && typeof typeOrPropertyKey === "string") {
|
|
8957
|
+
return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor);
|
|
8958
|
+
}
|
|
8959
|
+
if (typeof selectorOrTarget === "string" && typeOrPropertyKey !== "string") {
|
|
8960
|
+
return createEmitDecorator("$this", selectorOrTarget, typeOrPropertyKey);
|
|
8961
|
+
}
|
|
8962
|
+
throw new Error("Invalid @emitCustomEvent usage");
|
|
8963
|
+
}
|
|
8964
|
+
function createEmitDecorator(selector, type, options) {
|
|
8804
8965
|
return (targetObj, propertyKey, descriptor) => {
|
|
8805
8966
|
const constructor = targetObj.constructor;
|
|
8806
|
-
const fullOptions = { ...options, type };
|
|
8807
|
-
if (fullOptions.bubbles === void 0)
|
|
8808
|
-
|
|
8967
|
+
const fullOptions = { ...options || {}, type };
|
|
8968
|
+
if (fullOptions.bubbles === void 0)
|
|
8969
|
+
fullOptions.bubbles = true;
|
|
8970
|
+
if (fullOptions.composed === void 0)
|
|
8971
|
+
fullOptions.composed = true;
|
|
8809
8972
|
let list = ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
8810
8973
|
if (!list) {
|
|
8811
8974
|
list = [];
|
|
8812
8975
|
ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);
|
|
8813
8976
|
}
|
|
8814
|
-
list.push({ propertyKey, selector
|
|
8977
|
+
list.push({ propertyKey, selector, type, options: fullOptions });
|
|
8815
8978
|
const original = descriptor.value;
|
|
8816
8979
|
descriptor.value = function(...args) {
|
|
8817
8980
|
ensureInit(this);
|
|
@@ -8823,45 +8986,72 @@ function emitCustomEvent(selectorOrTarget, type, options = {}) {
|
|
|
8823
8986
|
composed: fullOptions.composed,
|
|
8824
8987
|
cancelable: fullOptions.cancelable
|
|
8825
8988
|
});
|
|
8826
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
8827
8989
|
const conf = getElementConfig(this);
|
|
8828
8990
|
const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
|
|
8991
|
+
const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this);
|
|
8829
8992
|
const eventTargets = [];
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
} else if (
|
|
8837
|
-
|
|
8838
|
-
} else if (
|
|
8839
|
-
|
|
8840
|
-
} else if (
|
|
8841
|
-
if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);
|
|
8842
|
-
} else if (selectorOrTarget === "$firstAppHost") {
|
|
8843
|
-
if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);
|
|
8844
|
-
} else if (selectorOrTarget === "$lastAppHost") {
|
|
8845
|
-
if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);
|
|
8846
|
-
} else if (selectorOrTarget === "$hosts") {
|
|
8847
|
-
hostSet.$hosts.forEach((h) => eventTargets.push(h));
|
|
8848
|
-
} else if (selectorOrTarget === "$appHosts") {
|
|
8849
|
-
hostSet.$appHosts.forEach((h) => eventTargets.push(h));
|
|
8850
|
-
} else if (selectorOrTarget === "$this" || !selectorOrTarget) {
|
|
8851
|
-
eventTargets.push(this);
|
|
8993
|
+
let resolvedSelector = selector;
|
|
8994
|
+
if (typeof selector === "function") {
|
|
8995
|
+
resolvedSelector = selector(this, hostSet);
|
|
8996
|
+
}
|
|
8997
|
+
if (resolvedSelector instanceof currentWin.Element) {
|
|
8998
|
+
eventTargets.push(resolvedSelector);
|
|
8999
|
+
} else if (resolvedSelector instanceof currentWin.NodeList) {
|
|
9000
|
+
eventTargets.push(...Array.from(resolvedSelector));
|
|
9001
|
+
} else if (Array.isArray(resolvedSelector)) {
|
|
9002
|
+
eventTargets.push(...resolvedSelector);
|
|
9003
|
+
} else if (resolvedSelector === null) {
|
|
8852
9004
|
} else {
|
|
8853
|
-
const
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
else if (
|
|
8857
|
-
|
|
8858
|
-
else if (
|
|
8859
|
-
|
|
8860
|
-
|
|
9005
|
+
const stringSelector = resolvedSelector;
|
|
9006
|
+
if (stringSelector === "$window")
|
|
9007
|
+
eventTargets.push(currentWin);
|
|
9008
|
+
else if (stringSelector === "$document")
|
|
9009
|
+
eventTargets.push(currentWin.document);
|
|
9010
|
+
else if (stringSelector === "$host") {
|
|
9011
|
+
if (hostSet.$host)
|
|
9012
|
+
eventTargets.push(hostSet.$host);
|
|
9013
|
+
} else if (stringSelector === "$parentHost") {
|
|
9014
|
+
if (hostSet.$parentHost)
|
|
9015
|
+
eventTargets.push(hostSet.$parentHost);
|
|
9016
|
+
} else if (stringSelector === "$appHost") {
|
|
9017
|
+
if (hostSet.$appHost)
|
|
9018
|
+
eventTargets.push(hostSet.$appHost);
|
|
9019
|
+
} else if (stringSelector === "$firstHost") {
|
|
9020
|
+
if (hostSet.$firstHost)
|
|
9021
|
+
eventTargets.push(hostSet.$firstHost);
|
|
9022
|
+
} else if (stringSelector === "$lastHost") {
|
|
9023
|
+
if (hostSet.$lastHost)
|
|
9024
|
+
eventTargets.push(hostSet.$lastHost);
|
|
9025
|
+
} else if (stringSelector === "$firstAppHost") {
|
|
9026
|
+
if (hostSet.$firstAppHost)
|
|
9027
|
+
eventTargets.push(hostSet.$firstAppHost);
|
|
9028
|
+
} else if (stringSelector === "$lastAppHost") {
|
|
9029
|
+
if (hostSet.$lastAppHost)
|
|
9030
|
+
eventTargets.push(hostSet.$lastAppHost);
|
|
9031
|
+
} else if (stringSelector === "$hosts") {
|
|
9032
|
+
hostSet.$hosts.forEach((h) => eventTargets.push(h));
|
|
9033
|
+
} else if (stringSelector === "$appHosts") {
|
|
9034
|
+
hostSet.$appHosts.forEach((h) => eventTargets.push(h));
|
|
9035
|
+
} else if (stringSelector === "$this" || !stringSelector) {
|
|
9036
|
+
eventTargets.push(this);
|
|
9037
|
+
} else {
|
|
9038
|
+
const r = fullOptions.root || "auto";
|
|
9039
|
+
const searchRoots = [];
|
|
9040
|
+
if (r === "auto")
|
|
9041
|
+
searchRoots.push(this.shadowRoot || this);
|
|
9042
|
+
else if (r === "light")
|
|
9043
|
+
searchRoots.push(this);
|
|
9044
|
+
else if (r === "shadow" && this.shadowRoot)
|
|
9045
|
+
searchRoots.push(this.shadowRoot);
|
|
9046
|
+
else if (r === "all") {
|
|
9047
|
+
searchRoots.push(this);
|
|
9048
|
+
if (this.shadowRoot)
|
|
9049
|
+
searchRoots.push(this.shadowRoot);
|
|
9050
|
+
}
|
|
9051
|
+
searchRoots.forEach((sr) => {
|
|
9052
|
+
sr.querySelectorAll(stringSelector).forEach((el) => eventTargets.push(el));
|
|
9053
|
+
});
|
|
8861
9054
|
}
|
|
8862
|
-
searchRoots.forEach((sr) => {
|
|
8863
|
-
sr.querySelectorAll(selectorOrTarget).forEach((el) => eventTargets.push(el));
|
|
8864
|
-
});
|
|
8865
9055
|
}
|
|
8866
9056
|
eventTargets.forEach((t) => {
|
|
8867
9057
|
if (fullOptions.filter && !fullOptions.filter(t, detail, { currentThis: this, helper: hostSet })) {
|
|
@@ -8884,20 +9074,8 @@ var getEmitCustomEventMetadataList = (target) => {
|
|
|
8884
9074
|
return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
8885
9075
|
};
|
|
8886
9076
|
var emit = emitCustomEvent;
|
|
8887
|
-
function emitCustomEventThis(type, optionsOrAttributeaName) {
|
|
8888
|
-
if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "string") {
|
|
8889
|
-
return emitCustomEventThis(type, { attributeName: optionsOrAttributeaName });
|
|
8890
|
-
} else if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "object") {
|
|
8891
|
-
if (!optionsOrAttributeaName.attributeName) {
|
|
8892
|
-
optionsOrAttributeaName.attributeName = `on-emit-${type}`;
|
|
8893
|
-
}
|
|
8894
|
-
return emitCustomEvent("$this", type, optionsOrAttributeaName);
|
|
8895
|
-
} else {
|
|
8896
|
-
return emitCustomEvent("$this", type, { attributeName: `on-emit-${type}` });
|
|
8897
|
-
}
|
|
8898
|
-
}
|
|
8899
9077
|
|
|
8900
|
-
// src/decorators/
|
|
9078
|
+
// src/decorators/changedAttribute.ts
|
|
8901
9079
|
var ON_ATTRIBUTE_CHANGED_METADATA_KEY = Symbol.for("simple-web-component:on-attribute-changed");
|
|
8902
9080
|
var convertValue = (val, type) => {
|
|
8903
9081
|
if (val === null || val === void 0) return val;
|
|
@@ -8905,7 +9083,7 @@ var convertValue = (val, type) => {
|
|
|
8905
9083
|
if (type === Boolean) return val === "false" || val === "0" ? false : true;
|
|
8906
9084
|
return val;
|
|
8907
9085
|
};
|
|
8908
|
-
function
|
|
9086
|
+
function changedAttribute(attributeName, options = {}) {
|
|
8909
9087
|
return (target, propertyKey) => {
|
|
8910
9088
|
const constructor = target.constructor;
|
|
8911
9089
|
let metaList = ReflectUtils.getOwnMetadata(ON_ATTRIBUTE_CHANGED_METADATA_KEY, constructor);
|
|
@@ -8945,150 +9123,141 @@ var convertAttributeValue = (val, type) => {
|
|
|
8945
9123
|
|
|
8946
9124
|
// src/decorators/query.ts
|
|
8947
9125
|
var QUERY_METADATA_KEY = Symbol.for("simple-web-component:query");
|
|
8948
|
-
function query(selectorOrTarget,
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
if (
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
if (selector === "$this")
|
|
8980
|
-
return applyRoot(this);
|
|
8981
|
-
if (selector === "$host")
|
|
8982
|
-
return applyRoot(hostSet.$host);
|
|
8983
|
-
if (selector === "$parentHost")
|
|
8984
|
-
return applyRoot(hostSet.$parentHost);
|
|
8985
|
-
if (selector === "$appHost")
|
|
8986
|
-
return applyRoot(hostSet.$appHost);
|
|
8987
|
-
if (selector === "$firstHost")
|
|
8988
|
-
return applyRoot(hostSet.$firstHost);
|
|
8989
|
-
if (selector === "$lastHost")
|
|
8990
|
-
return applyRoot(hostSet.$lastHost);
|
|
8991
|
-
if (selector === "$firstAppHost")
|
|
8992
|
-
return applyRoot(hostSet.$firstAppHost);
|
|
8993
|
-
if (selector === "$lastAppHost")
|
|
8994
|
-
return applyRoot(hostSet.$lastAppHost);
|
|
8995
|
-
const config = getElementConfig(this);
|
|
8996
|
-
const win = config?.window || window;
|
|
8997
|
-
if (selector === "$window")
|
|
8998
|
-
return win;
|
|
8999
|
-
if (selector === "$document")
|
|
9000
|
-
return win.document;
|
|
9001
|
-
if (r === "shadow")
|
|
9002
|
-
return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9003
|
-
if (r === "light")
|
|
9004
|
-
return this.querySelector(selector);
|
|
9005
|
-
if (r === "all") {
|
|
9006
|
-
const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9007
|
-
return shadowMatch || this.querySelector(selector);
|
|
9008
|
-
}
|
|
9009
|
-
return (this.shadowRoot || this).querySelector(selector);
|
|
9010
|
-
},
|
|
9011
|
-
set(nv) {
|
|
9012
|
-
ensureInit(this);
|
|
9013
|
-
if (nv === null || nv === void 0) {
|
|
9014
|
-
const selector = selectorOrTarget;
|
|
9015
|
-
if (selector.startsWith("$") && selector !== "$this")
|
|
9016
|
-
return;
|
|
9017
|
-
const r = options.root || "auto";
|
|
9018
|
-
const targets = [];
|
|
9019
|
-
if (r === "shadow") {
|
|
9020
|
-
if (this.shadowRoot?.querySelector(selector))
|
|
9021
|
-
targets.push(this.shadowRoot.querySelector(selector));
|
|
9022
|
-
} else if (r === "light") {
|
|
9023
|
-
if (this.querySelector(selector))
|
|
9024
|
-
targets.push(this.querySelector(selector));
|
|
9025
|
-
} else if (r === "all") {
|
|
9026
|
-
if (this.shadowRoot?.querySelector(selector))
|
|
9027
|
-
targets.push(this.shadowRoot.querySelector(selector));
|
|
9028
|
-
if (this.querySelector(selector))
|
|
9029
|
-
targets.push(this.querySelector(selector));
|
|
9126
|
+
function query(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9127
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9128
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9129
|
+
}
|
|
9130
|
+
if (typeof selectorOrTarget === "string" || typeof selectorOrTarget === "function") {
|
|
9131
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9132
|
+
if (descriptor2 !== void 0) {
|
|
9133
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9134
|
+
}
|
|
9135
|
+
const constructor = targetObj.constructor;
|
|
9136
|
+
let queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
|
|
9137
|
+
if (!queries) {
|
|
9138
|
+
queries = [];
|
|
9139
|
+
ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);
|
|
9140
|
+
}
|
|
9141
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9142
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9143
|
+
get() {
|
|
9144
|
+
ensureInit(this);
|
|
9145
|
+
const config = getElementConfig(this);
|
|
9146
|
+
const win = config?.window || window;
|
|
9147
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
9148
|
+
let resolvedSelector;
|
|
9149
|
+
let resolvedElement = null;
|
|
9150
|
+
if (typeof selectorOrTarget === "function") {
|
|
9151
|
+
const result = selectorOrTarget(this, hostSet);
|
|
9152
|
+
if (result instanceof win.Node || result instanceof win.Element) {
|
|
9153
|
+
resolvedElement = result instanceof win.HTMLElement ? result : null;
|
|
9154
|
+
} else if (result instanceof win.NodeList || Array.isArray(result)) {
|
|
9155
|
+
resolvedElement = result.length > 0 && result[0] instanceof win.HTMLElement ? result[0] : null;
|
|
9156
|
+
}
|
|
9030
9157
|
} else {
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9158
|
+
resolvedSelector = selectorOrTarget;
|
|
9159
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9160
|
+
const applyRoot = (t) => {
|
|
9161
|
+
if (!t || !(t instanceof HTMLElement))
|
|
9162
|
+
return t;
|
|
9163
|
+
if (r === "auto")
|
|
9164
|
+
return t.shadowRoot || t;
|
|
9165
|
+
if (r === "shadow")
|
|
9166
|
+
return t.shadowRoot;
|
|
9167
|
+
if (r === "light")
|
|
9168
|
+
return t;
|
|
9169
|
+
if (r === "all")
|
|
9170
|
+
return t.shadowRoot || t;
|
|
9171
|
+
return t;
|
|
9172
|
+
};
|
|
9173
|
+
if (resolvedSelector === "$this")
|
|
9174
|
+
resolvedElement = applyRoot(this);
|
|
9175
|
+
else if (resolvedSelector === "$host")
|
|
9176
|
+
resolvedElement = applyRoot(hostSet.$host);
|
|
9177
|
+
else if (resolvedSelector === "$parentHost")
|
|
9178
|
+
resolvedElement = applyRoot(hostSet.$parentHost);
|
|
9179
|
+
else if (resolvedSelector === "$appHost")
|
|
9180
|
+
resolvedElement = applyRoot(hostSet.$appHost);
|
|
9181
|
+
else if (resolvedSelector === "$firstHost")
|
|
9182
|
+
resolvedElement = applyRoot(hostSet.$firstHost);
|
|
9183
|
+
else if (resolvedSelector === "$lastHost")
|
|
9184
|
+
resolvedElement = applyRoot(hostSet.$lastHost);
|
|
9185
|
+
else if (resolvedSelector === "$firstAppHost")
|
|
9186
|
+
resolvedElement = applyRoot(hostSet.$firstAppHost);
|
|
9187
|
+
else if (resolvedSelector === "$lastAppHost")
|
|
9188
|
+
resolvedElement = applyRoot(hostSet.$lastAppHost);
|
|
9189
|
+
else if (resolvedSelector === "$window")
|
|
9190
|
+
return win;
|
|
9191
|
+
else if (resolvedSelector === "$document")
|
|
9192
|
+
return win.document;
|
|
9193
|
+
else {
|
|
9194
|
+
if (r === "shadow")
|
|
9195
|
+
resolvedElement = this.shadowRoot ? this.shadowRoot.querySelector(resolvedSelector) : null;
|
|
9196
|
+
else if (r === "light")
|
|
9197
|
+
resolvedElement = this.querySelector(resolvedSelector);
|
|
9198
|
+
else if (r === "all") {
|
|
9199
|
+
const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(resolvedSelector) : null;
|
|
9200
|
+
resolvedElement = shadowMatch || this.querySelector(resolvedSelector);
|
|
9201
|
+
} else
|
|
9202
|
+
resolvedElement = (this.shadowRoot || this).querySelector(resolvedSelector);
|
|
9203
|
+
}
|
|
9034
9204
|
}
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
}
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
}
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
} else {
|
|
9090
|
-
return query("$appHost", {});
|
|
9205
|
+
if (resolvedElement instanceof win.HTMLElement && optionsOrPropertyKey?.filter) {
|
|
9206
|
+
const shouldInclude = optionsOrPropertyKey.filter(resolvedElement, { currentThis: this, helper: hostSet });
|
|
9207
|
+
if (!shouldInclude) {
|
|
9208
|
+
return null;
|
|
9209
|
+
}
|
|
9210
|
+
}
|
|
9211
|
+
return resolvedElement;
|
|
9212
|
+
},
|
|
9213
|
+
set(nv) {
|
|
9214
|
+
ensureInit(this);
|
|
9215
|
+
if (nv === null || nv === void 0) {
|
|
9216
|
+
const config = getElementConfig(this);
|
|
9217
|
+
const win = config?.window || window;
|
|
9218
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
9219
|
+
if (typeof selectorOrTarget === "function") {
|
|
9220
|
+
const result = selectorOrTarget(this, hostSet);
|
|
9221
|
+
if (result instanceof win.Element) {
|
|
9222
|
+
result.remove();
|
|
9223
|
+
} else if (result instanceof win.NodeList || Array.isArray(result)) {
|
|
9224
|
+
const el = result.length > 0 ? result[0] : null;
|
|
9225
|
+
if (el instanceof win.Element) {
|
|
9226
|
+
el.remove();
|
|
9227
|
+
}
|
|
9228
|
+
}
|
|
9229
|
+
return;
|
|
9230
|
+
}
|
|
9231
|
+
const resolvedSelector = selectorOrTarget;
|
|
9232
|
+
if (resolvedSelector.startsWith("$") && resolvedSelector !== "$this")
|
|
9233
|
+
return;
|
|
9234
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9235
|
+
const targets = [];
|
|
9236
|
+
if (r === "shadow") {
|
|
9237
|
+
if (this.shadowRoot?.querySelector(resolvedSelector))
|
|
9238
|
+
targets.push(this.shadowRoot.querySelector(resolvedSelector));
|
|
9239
|
+
} else if (r === "light") {
|
|
9240
|
+
if (this.querySelector(resolvedSelector))
|
|
9241
|
+
targets.push(this.querySelector(resolvedSelector));
|
|
9242
|
+
} else if (r === "all") {
|
|
9243
|
+
if (this.shadowRoot?.querySelector(resolvedSelector))
|
|
9244
|
+
targets.push(this.shadowRoot.querySelector(resolvedSelector));
|
|
9245
|
+
if (this.querySelector(resolvedSelector))
|
|
9246
|
+
targets.push(this.querySelector(resolvedSelector));
|
|
9247
|
+
} else {
|
|
9248
|
+
const el = (this.shadowRoot || this).querySelector(resolvedSelector);
|
|
9249
|
+
if (el)
|
|
9250
|
+
targets.push(el);
|
|
9251
|
+
}
|
|
9252
|
+
targets.forEach((t) => t.remove());
|
|
9253
|
+
}
|
|
9254
|
+
},
|
|
9255
|
+
enumerable: true,
|
|
9256
|
+
configurable: true
|
|
9257
|
+
});
|
|
9258
|
+
};
|
|
9091
9259
|
}
|
|
9260
|
+
return query("$this", selectorOrTarget);
|
|
9092
9261
|
}
|
|
9093
9262
|
var getQueryMetadata = (target) => {
|
|
9094
9263
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9097,139 +9266,153 @@ var getQueryMetadata = (target) => {
|
|
|
9097
9266
|
|
|
9098
9267
|
// src/decorators/queryAll.ts
|
|
9099
9268
|
var QUERY_ALL_METADATA_KEY = Symbol.for("simple-web-component:query-all");
|
|
9100
|
-
function queryAll(selectorOrTarget,
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
const
|
|
9121
|
-
const
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9269
|
+
function queryAll(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9270
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9271
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9272
|
+
}
|
|
9273
|
+
if (typeof selectorOrTarget === "string" || typeof selectorOrTarget === "function") {
|
|
9274
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9275
|
+
if (descriptor2 !== void 0) {
|
|
9276
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9277
|
+
}
|
|
9278
|
+
const constructor = targetObj.constructor;
|
|
9279
|
+
let queries = ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
|
|
9280
|
+
if (!queries) {
|
|
9281
|
+
queries = [];
|
|
9282
|
+
ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);
|
|
9283
|
+
}
|
|
9284
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9285
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9286
|
+
get() {
|
|
9287
|
+
ensureInit(this);
|
|
9288
|
+
const config = getElementConfig(this);
|
|
9289
|
+
const win = config?.window || window;
|
|
9290
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
9291
|
+
let resolvedSelector;
|
|
9292
|
+
let resolvedElements = [];
|
|
9293
|
+
if (typeof selectorOrTarget === "function") {
|
|
9294
|
+
const result = selectorOrTarget(this, hostSet);
|
|
9295
|
+
if (result instanceof win.NodeList) {
|
|
9296
|
+
resolvedElements = Array.from(result).filter((el) => el instanceof win.HTMLElement);
|
|
9297
|
+
} else if (Array.isArray(result)) {
|
|
9298
|
+
resolvedElements = result.filter((el) => el instanceof win.HTMLElement);
|
|
9126
9299
|
}
|
|
9127
|
-
|
|
9128
|
-
|
|
9300
|
+
} else {
|
|
9301
|
+
resolvedSelector = selectorOrTarget;
|
|
9302
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9303
|
+
const applyRoot = (t) => {
|
|
9304
|
+
if (!t)
|
|
9305
|
+
return [];
|
|
9306
|
+
const items = Array.isArray(t) ? t : [t];
|
|
9307
|
+
const results = [];
|
|
9308
|
+
items.forEach((it) => {
|
|
9309
|
+
if (!(it instanceof HTMLElement)) {
|
|
9310
|
+
results.push(it);
|
|
9311
|
+
return;
|
|
9312
|
+
}
|
|
9313
|
+
if (r === "auto")
|
|
9314
|
+
results.push(it.shadowRoot || it);
|
|
9315
|
+
else {
|
|
9316
|
+
if (r === "light" || r === "all")
|
|
9317
|
+
results.push(it);
|
|
9318
|
+
if ((r === "shadow" || r === "all") && it.shadowRoot)
|
|
9319
|
+
results.push(it.shadowRoot);
|
|
9320
|
+
}
|
|
9321
|
+
});
|
|
9322
|
+
return results;
|
|
9323
|
+
};
|
|
9324
|
+
if (resolvedSelector === "$hosts")
|
|
9325
|
+
resolvedElements = applyRoot(hostSet.$hosts).filter((el) => el instanceof HTMLElement);
|
|
9326
|
+
else if (resolvedSelector === "$appHosts")
|
|
9327
|
+
resolvedElements = applyRoot(hostSet.$appHosts).filter((el) => el instanceof HTMLElement);
|
|
9328
|
+
else if (resolvedSelector === "$host")
|
|
9329
|
+
resolvedElements = applyRoot(hostSet.$host).filter((el) => el instanceof HTMLElement);
|
|
9330
|
+
else if (resolvedSelector === "$parentHost")
|
|
9331
|
+
resolvedElements = applyRoot(hostSet.$parentHost).filter((el) => el instanceof HTMLElement);
|
|
9332
|
+
else if (resolvedSelector === "$appHost")
|
|
9333
|
+
resolvedElements = applyRoot(hostSet.$appHost).filter((el) => el instanceof HTMLElement);
|
|
9334
|
+
else if (resolvedSelector === "$firstHost")
|
|
9335
|
+
resolvedElements = applyRoot(hostSet.$firstHost).filter((el) => el instanceof HTMLElement);
|
|
9336
|
+
else if (resolvedSelector === "$lastHost")
|
|
9337
|
+
resolvedElements = applyRoot(hostSet.$lastHost).filter((el) => el instanceof HTMLElement);
|
|
9338
|
+
else if (resolvedSelector === "$firstAppHost")
|
|
9339
|
+
resolvedElements = applyRoot(hostSet.$firstAppHost).filter((el) => el instanceof HTMLElement);
|
|
9340
|
+
else if (resolvedSelector === "$lastAppHost")
|
|
9341
|
+
resolvedElements = applyRoot(hostSet.$lastAppHost).filter((el) => el instanceof HTMLElement);
|
|
9342
|
+
else if (resolvedSelector === "$window")
|
|
9343
|
+
return [win];
|
|
9344
|
+
else if (resolvedSelector === "$document")
|
|
9345
|
+
return [win.document];
|
|
9346
|
+
else if (resolvedSelector === "$this")
|
|
9347
|
+
resolvedElements = applyRoot(this).filter((el) => el instanceof HTMLElement);
|
|
9129
9348
|
else {
|
|
9130
|
-
if (r === "
|
|
9131
|
-
|
|
9132
|
-
if (
|
|
9133
|
-
|
|
9349
|
+
if (r === "shadow")
|
|
9350
|
+
resolvedElements = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(resolvedSelector)) : [];
|
|
9351
|
+
else if (r === "light")
|
|
9352
|
+
resolvedElements = Array.from(this.querySelectorAll(resolvedSelector));
|
|
9353
|
+
else if (r === "all") {
|
|
9354
|
+
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(resolvedSelector)) : [];
|
|
9355
|
+
const lNodes = Array.from(this.querySelectorAll(resolvedSelector));
|
|
9356
|
+
resolvedElements = [...sNodes, ...lNodes];
|
|
9357
|
+
} else
|
|
9358
|
+
resolvedElements = Array.from((this.shadowRoot || this).querySelectorAll(resolvedSelector));
|
|
9134
9359
|
}
|
|
9135
|
-
});
|
|
9136
|
-
return results;
|
|
9137
|
-
};
|
|
9138
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
9139
|
-
if (selector === "$hosts")
|
|
9140
|
-
return applyRoot(hostSet.$hosts);
|
|
9141
|
-
if (selector === "$appHosts")
|
|
9142
|
-
return applyRoot(hostSet.$appHosts);
|
|
9143
|
-
if (selector === "$host")
|
|
9144
|
-
return applyRoot(hostSet.$host);
|
|
9145
|
-
if (selector === "$parentHost")
|
|
9146
|
-
return applyRoot(hostSet.$parentHost);
|
|
9147
|
-
if (selector === "$appHost")
|
|
9148
|
-
return applyRoot(hostSet.$appHost);
|
|
9149
|
-
if (selector === "$firstHost")
|
|
9150
|
-
return applyRoot(hostSet.$firstHost);
|
|
9151
|
-
if (selector === "$lastHost")
|
|
9152
|
-
return applyRoot(hostSet.$lastHost);
|
|
9153
|
-
if (selector === "$firstAppHost")
|
|
9154
|
-
return applyRoot(hostSet.$firstAppHost);
|
|
9155
|
-
if (selector === "$lastAppHost")
|
|
9156
|
-
return applyRoot(hostSet.$lastAppHost);
|
|
9157
|
-
const config = getElementConfig(this);
|
|
9158
|
-
const win = config?.window || window;
|
|
9159
|
-
if (selector === "$window")
|
|
9160
|
-
return [win];
|
|
9161
|
-
if (selector === "$document")
|
|
9162
|
-
return [win.document];
|
|
9163
|
-
if (selector === "$this")
|
|
9164
|
-
return applyRoot(this);
|
|
9165
|
-
if (r === "shadow")
|
|
9166
|
-
return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9167
|
-
if (r === "light")
|
|
9168
|
-
return Array.from(this.querySelectorAll(selector));
|
|
9169
|
-
if (r === "all") {
|
|
9170
|
-
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9171
|
-
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9172
|
-
return [...sNodes, ...lNodes];
|
|
9173
|
-
}
|
|
9174
|
-
const root = this.shadowRoot || this;
|
|
9175
|
-
return Array.from(root.querySelectorAll(selector));
|
|
9176
|
-
},
|
|
9177
|
-
set(nv) {
|
|
9178
|
-
ensureInit(this);
|
|
9179
|
-
if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
|
|
9180
|
-
const selector = selectorOrTarget;
|
|
9181
|
-
if (selector.startsWith("$") && selector !== "$this")
|
|
9182
|
-
return;
|
|
9183
|
-
const r = options.root || "auto";
|
|
9184
|
-
let targets = [];
|
|
9185
|
-
if (r === "shadow")
|
|
9186
|
-
targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9187
|
-
else if (r === "light")
|
|
9188
|
-
targets = Array.from(this.querySelectorAll(selector));
|
|
9189
|
-
else if (r === "all") {
|
|
9190
|
-
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9191
|
-
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9192
|
-
targets = [...sNodes, ...lNodes];
|
|
9193
|
-
} else {
|
|
9194
|
-
targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
|
|
9195
9360
|
}
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
}
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9361
|
+
if (optionsOrPropertyKey?.filter) {
|
|
9362
|
+
resolvedElements = resolvedElements.filter((el) => {
|
|
9363
|
+
if (!(el instanceof win.HTMLElement))
|
|
9364
|
+
return true;
|
|
9365
|
+
return optionsOrPropertyKey.filter(el, { currentThis: this, helper: hostSet });
|
|
9366
|
+
});
|
|
9367
|
+
}
|
|
9368
|
+
return resolvedElements;
|
|
9369
|
+
},
|
|
9370
|
+
set(nv) {
|
|
9371
|
+
ensureInit(this);
|
|
9372
|
+
if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
|
|
9373
|
+
const config = getElementConfig(this);
|
|
9374
|
+
const win = config?.window || window;
|
|
9375
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
9376
|
+
if (typeof selectorOrTarget === "function") {
|
|
9377
|
+
const result = selectorOrTarget(this, hostSet);
|
|
9378
|
+
if (result instanceof win.NodeList) {
|
|
9379
|
+
Array.from(result).forEach((el) => {
|
|
9380
|
+
if (el instanceof win.Element)
|
|
9381
|
+
el.remove();
|
|
9382
|
+
});
|
|
9383
|
+
} else if (Array.isArray(result)) {
|
|
9384
|
+
result.forEach((el) => {
|
|
9385
|
+
if (el instanceof win.Element)
|
|
9386
|
+
el.remove();
|
|
9387
|
+
});
|
|
9388
|
+
}
|
|
9389
|
+
return;
|
|
9390
|
+
}
|
|
9391
|
+
const resolvedSelector = selectorOrTarget;
|
|
9392
|
+
if (resolvedSelector.startsWith("$") && resolvedSelector !== "$this")
|
|
9393
|
+
return;
|
|
9394
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9395
|
+
let targets = [];
|
|
9396
|
+
if (r === "shadow")
|
|
9397
|
+
targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(resolvedSelector)) : [];
|
|
9398
|
+
else if (r === "light")
|
|
9399
|
+
targets = Array.from(this.querySelectorAll(resolvedSelector));
|
|
9400
|
+
else if (r === "all") {
|
|
9401
|
+
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(resolvedSelector)) : [];
|
|
9402
|
+
const lNodes = Array.from(this.querySelectorAll(resolvedSelector));
|
|
9403
|
+
targets = [...sNodes, ...lNodes];
|
|
9404
|
+
} else {
|
|
9405
|
+
targets = Array.from((this.shadowRoot || this).querySelectorAll(resolvedSelector));
|
|
9406
|
+
}
|
|
9407
|
+
targets.forEach((t) => t.remove());
|
|
9408
|
+
}
|
|
9409
|
+
},
|
|
9410
|
+
enumerable: true,
|
|
9411
|
+
configurable: true
|
|
9412
|
+
});
|
|
9413
|
+
};
|
|
9232
9414
|
}
|
|
9415
|
+
return queryAll("$this", selectorOrTarget);
|
|
9233
9416
|
}
|
|
9234
9417
|
var getQueryAllMetadata = (target) => {
|
|
9235
9418
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9419,6 +9602,27 @@ var resolvePropertyTargets = (inst, selector, options) => {
|
|
|
9419
9602
|
const currentWin = conf.window;
|
|
9420
9603
|
const r = options.root || "auto";
|
|
9421
9604
|
const results = [];
|
|
9605
|
+
let resolvedSelector = selector;
|
|
9606
|
+
if (typeof selector === "function") {
|
|
9607
|
+
const hostSet = SwcUtils.getHelperAndHostSet(currentWin, inst);
|
|
9608
|
+
resolvedSelector = selector(inst, hostSet);
|
|
9609
|
+
}
|
|
9610
|
+
if (resolvedSelector instanceof currentWin.Element) {
|
|
9611
|
+
results.push(resolvedSelector);
|
|
9612
|
+
return results;
|
|
9613
|
+
}
|
|
9614
|
+
if (resolvedSelector instanceof currentWin.NodeList) {
|
|
9615
|
+
results.push(...Array.from(resolvedSelector));
|
|
9616
|
+
return results;
|
|
9617
|
+
}
|
|
9618
|
+
if (Array.isArray(resolvedSelector)) {
|
|
9619
|
+
results.push(...resolvedSelector);
|
|
9620
|
+
return results;
|
|
9621
|
+
}
|
|
9622
|
+
if (resolvedSelector === null) {
|
|
9623
|
+
return results;
|
|
9624
|
+
}
|
|
9625
|
+
const stringSelector = resolvedSelector;
|
|
9422
9626
|
const applyRoot = (target) => {
|
|
9423
9627
|
if (!target) return;
|
|
9424
9628
|
if (r === "auto") {
|
|
@@ -9428,37 +9632,37 @@ var resolvePropertyTargets = (inst, selector, options) => {
|
|
|
9428
9632
|
if ((r === "shadow" || r === "all") && target.shadowRoot) results.push(target.shadowRoot);
|
|
9429
9633
|
}
|
|
9430
9634
|
};
|
|
9431
|
-
if (
|
|
9635
|
+
if (stringSelector === "$this" || !stringSelector) {
|
|
9432
9636
|
applyRoot(inst);
|
|
9433
|
-
} else if (
|
|
9637
|
+
} else if (stringSelector === "$window") {
|
|
9434
9638
|
results.push(currentWin);
|
|
9435
|
-
} else if (
|
|
9639
|
+
} else if (stringSelector === "$document") {
|
|
9436
9640
|
results.push(currentWin.document);
|
|
9437
9641
|
} else {
|
|
9438
9642
|
const hostSet = SwcUtils.getHostSet(inst);
|
|
9439
|
-
if (
|
|
9440
|
-
else if (
|
|
9441
|
-
else if (
|
|
9442
|
-
else if (
|
|
9443
|
-
else if (
|
|
9444
|
-
else if (
|
|
9445
|
-
else if (
|
|
9446
|
-
else if (
|
|
9447
|
-
else if (
|
|
9643
|
+
if (stringSelector === "$host") applyRoot(hostSet.$host);
|
|
9644
|
+
else if (stringSelector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
9645
|
+
else if (stringSelector === "$appHost") applyRoot(hostSet.$appHost);
|
|
9646
|
+
else if (stringSelector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
9647
|
+
else if (stringSelector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
9648
|
+
else if (stringSelector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
9649
|
+
else if (stringSelector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
9650
|
+
else if (stringSelector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
9651
|
+
else if (stringSelector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
9448
9652
|
else {
|
|
9449
9653
|
if (r === "shadow") {
|
|
9450
|
-
const found = inst.shadowRoot?.querySelectorAll(
|
|
9654
|
+
const found = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
9451
9655
|
if (found) results.push(...found);
|
|
9452
9656
|
} else if (r === "light") {
|
|
9453
|
-
const found = inst.querySelectorAll(
|
|
9657
|
+
const found = inst.querySelectorAll(stringSelector);
|
|
9454
9658
|
if (found) results.push(...found);
|
|
9455
9659
|
} else if (r === "all") {
|
|
9456
|
-
const sMatch = inst.shadowRoot?.querySelectorAll(
|
|
9457
|
-
const lMatch = inst.querySelectorAll(
|
|
9660
|
+
const sMatch = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
9661
|
+
const lMatch = inst.querySelectorAll(stringSelector);
|
|
9458
9662
|
if (sMatch) results.push(...sMatch);
|
|
9459
9663
|
if (lMatch) results.push(...lMatch);
|
|
9460
9664
|
} else {
|
|
9461
|
-
const found = (inst.shadowRoot || inst).querySelectorAll(
|
|
9665
|
+
const found = (inst.shadowRoot || inst).querySelectorAll(stringSelector);
|
|
9462
9666
|
if (found) results.push(...found);
|
|
9463
9667
|
}
|
|
9464
9668
|
}
|
|
@@ -9557,35 +9761,20 @@ function applyProperty(selector, targetPropertyKeyOrOptions, options) {
|
|
|
9557
9761
|
});
|
|
9558
9762
|
};
|
|
9559
9763
|
}
|
|
9560
|
-
function property(
|
|
9561
|
-
|
|
9562
|
-
}
|
|
9563
|
-
function propertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
|
|
9564
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
|
|
9565
|
-
return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
|
|
9764
|
+
function property(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor) {
|
|
9765
|
+
if (optionsOrDescriptor !== void 0 && (typeof targetPropertyKeyOrOptions === "string" || typeof targetPropertyKeyOrOptions === "symbol")) {
|
|
9766
|
+
return applyProperty("$this", void 0, {})(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9566
9767
|
}
|
|
9567
|
-
if (typeof
|
|
9568
|
-
return applyProperty(
|
|
9569
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
9570
|
-
return applyProperty("$this", void 0, targetOrOptions);
|
|
9571
|
-
} else {
|
|
9572
|
-
return applyProperty("$this", void 0, {});
|
|
9768
|
+
if (typeof selectorOrTarget === "string") {
|
|
9769
|
+
return applyProperty(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9573
9770
|
}
|
|
9771
|
+
return applyProperty("$this", void 0, selectorOrTarget);
|
|
9574
9772
|
}
|
|
9575
|
-
function setProperty(
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
function setPropertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
|
|
9579
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
|
|
9580
|
-
return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
|
|
9581
|
-
}
|
|
9582
|
-
if (typeof targetOrOptions === "string" || typeof targetOrOptions === "symbol") {
|
|
9583
|
-
return applyProperty("$this", targetOrOptions, propertyKeyOrOptions);
|
|
9584
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
9585
|
-
return applyProperty("$this", void 0, targetOrOptions);
|
|
9586
|
-
} else {
|
|
9587
|
-
return applyProperty("$this", void 0, {});
|
|
9773
|
+
function setProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined) {
|
|
9774
|
+
if (typeof selectorOrOptions === "string") {
|
|
9775
|
+
return applyProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined);
|
|
9588
9776
|
}
|
|
9777
|
+
return applyProperty("$this", void 0, selectorOrOptions);
|
|
9589
9778
|
}
|
|
9590
9779
|
var findAllPropertyMetadata = (target) => {
|
|
9591
9780
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -9898,7 +10087,8 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
9898
10087
|
const delegateListeners = [];
|
|
9899
10088
|
const nonDelegateListeners = [];
|
|
9900
10089
|
addEventListenerList.forEach((meta) => {
|
|
9901
|
-
|
|
10090
|
+
const isStringSelector = typeof meta.selector === "string";
|
|
10091
|
+
if (meta.options.delegate && isStringSelector && meta.selector !== "$window" && meta.selector !== "$document" && meta.selector !== "$host" && meta.selector !== "$appHost" && meta.selector !== "$firstHost" && meta.selector !== "$lastHost" && meta.selector !== "$firstAppHost" && meta.selector !== "$lastAppHost" && meta.selector !== "$hosts" && meta.selector !== "$appHosts" && meta.selector !== "$this" && meta.selector !== "") {
|
|
9902
10092
|
delegateListeners.push(meta);
|
|
9903
10093
|
} else {
|
|
9904
10094
|
nonDelegateListeners.push(meta);
|
|
@@ -9961,6 +10151,22 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
9961
10151
|
const opts = { capture: options.capture, once: options.once, passive: options.passive };
|
|
9962
10152
|
const bindTargets = [];
|
|
9963
10153
|
const r = options.root || "auto";
|
|
10154
|
+
let resolvedSelector = null;
|
|
10155
|
+
if (typeof selector === "function") {
|
|
10156
|
+
const hostSet = SwcUtils.getHelperAndHostSet(currentWin, this);
|
|
10157
|
+
const result = selector(this, hostSet);
|
|
10158
|
+
if (typeof result === "string") {
|
|
10159
|
+
resolvedSelector = result;
|
|
10160
|
+
} else if (result instanceof currentWin.Element) {
|
|
10161
|
+
bindTargets.push(result);
|
|
10162
|
+
} else if (result instanceof currentWin.NodeList) {
|
|
10163
|
+
bindTargets.push(...Array.from(result));
|
|
10164
|
+
} else if (Array.isArray(result)) {
|
|
10165
|
+
bindTargets.push(...result);
|
|
10166
|
+
}
|
|
10167
|
+
} else {
|
|
10168
|
+
resolvedSelector = selector;
|
|
10169
|
+
}
|
|
9964
10170
|
const applyRootOption = (target) => {
|
|
9965
10171
|
if (!target) return;
|
|
9966
10172
|
if (r === "auto") {
|
|
@@ -9970,30 +10176,32 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
9970
10176
|
if ((r === "shadow" || r === "all") && target.shadowRoot) bindTargets.push(target.shadowRoot);
|
|
9971
10177
|
}
|
|
9972
10178
|
};
|
|
9973
|
-
if (
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
10179
|
+
if (resolvedSelector) {
|
|
10180
|
+
if (resolvedSelector === "$window") bindTargets.push(currentWin);
|
|
10181
|
+
else if (resolvedSelector === "$document") bindTargets.push(currentWin.document);
|
|
10182
|
+
else if (resolvedSelector === "$host") applyRootOption(helperHostSet.$host);
|
|
10183
|
+
else if (resolvedSelector === "$parentHost") applyRootOption(helperHostSet.$parentHost);
|
|
10184
|
+
else if (resolvedSelector === "$appHost") applyRootOption(helperHostSet.$appHost);
|
|
10185
|
+
else if (resolvedSelector === "$firstHost") applyRootOption(helperHostSet.$firstHost);
|
|
10186
|
+
else if (resolvedSelector === "$lastHost") applyRootOption(helperHostSet.$lastHost);
|
|
10187
|
+
else if (resolvedSelector === "$firstAppHost") applyRootOption(helperHostSet.$firstAppHost);
|
|
10188
|
+
else if (resolvedSelector === "$lastAppHost") applyRootOption(helperHostSet.$lastAppHost);
|
|
10189
|
+
else if (resolvedSelector === "$hosts") helperHostSet.$hosts.forEach(applyRootOption);
|
|
10190
|
+
else if (resolvedSelector === "$appHosts") helperHostSet.$appHosts.forEach(applyRootOption);
|
|
10191
|
+
else if (resolvedSelector === "$this" || !resolvedSelector) applyRootOption(this);
|
|
10192
|
+
else {
|
|
10193
|
+
const searchRoots = [];
|
|
10194
|
+
if (r === "auto") searchRoots.push(this.shadowRoot || this);
|
|
10195
|
+
else if (r === "light") searchRoots.push(this);
|
|
10196
|
+
else if (r === "shadow" && this.shadowRoot) searchRoots.push(this.shadowRoot);
|
|
10197
|
+
else if (r === "all") {
|
|
10198
|
+
searchRoots.push(this);
|
|
10199
|
+
if (this.shadowRoot) searchRoots.push(this.shadowRoot);
|
|
10200
|
+
}
|
|
10201
|
+
searchRoots.forEach((sr) => {
|
|
10202
|
+
sr.querySelectorAll(resolvedSelector).forEach((el) => bindTargets.push(el));
|
|
10203
|
+
});
|
|
9993
10204
|
}
|
|
9994
|
-
searchRoots.forEach((sr) => {
|
|
9995
|
-
sr.querySelectorAll(selector).forEach((el) => bindTargets.push(el));
|
|
9996
|
-
});
|
|
9997
10205
|
}
|
|
9998
10206
|
bindTargets.forEach((t) => {
|
|
9999
10207
|
const handler = async (event2) => {
|
|
@@ -10008,10 +10216,34 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10008
10216
|
if (options.preventDefault) event2.preventDefault();
|
|
10009
10217
|
const currentHostSet = SwcUtils.getHostSet(this);
|
|
10010
10218
|
const args = { event: event2, ...currentHostSet, $el: t, $root: t };
|
|
10011
|
-
await this[meta.propertyKey](event2, { currentHostSet,
|
|
10219
|
+
await this[meta.propertyKey](event2, { currentHostSet, $matchedElement: event2.currentTarget }, args);
|
|
10220
|
+
};
|
|
10221
|
+
const eventSubject = new Subject();
|
|
10222
|
+
let eventStream = eventSubject;
|
|
10223
|
+
if (options.debounceTime !== void 0 && options.debounceTime > 0) {
|
|
10224
|
+
eventStream = eventStream.pipe(debounceTime(options.debounceTime));
|
|
10225
|
+
}
|
|
10226
|
+
if (options.throttleTime !== void 0 && options.throttleTime > 0) {
|
|
10227
|
+
eventStream = eventStream.pipe(throttleTime(options.throttleTime));
|
|
10228
|
+
}
|
|
10229
|
+
if (options.distinctUntilChanged !== void 0 && options.distinctUntilChanged !== false) {
|
|
10230
|
+
if (typeof options.distinctUntilChanged === "function") {
|
|
10231
|
+
eventStream = eventStream.pipe(distinctUntilChanged(options.distinctUntilChanged));
|
|
10232
|
+
} else {
|
|
10233
|
+
eventStream = eventStream.pipe(distinctUntilChanged());
|
|
10234
|
+
}
|
|
10235
|
+
}
|
|
10236
|
+
const subscription = eventStream.subscribe({
|
|
10237
|
+
next: (event2) => {
|
|
10238
|
+
handler(event2).catch((err) => console.error("Event handler error:", err));
|
|
10239
|
+
},
|
|
10240
|
+
error: (err) => console.error("Event stream error:", err)
|
|
10241
|
+
});
|
|
10242
|
+
const wrappedHandler = (event2) => {
|
|
10243
|
+
eventSubject.next(event2);
|
|
10012
10244
|
};
|
|
10013
|
-
t.addEventListener(type,
|
|
10014
|
-
this._boundListeners.push({ target: t, type, handler, options: opts });
|
|
10245
|
+
t.addEventListener(type, wrappedHandler, opts);
|
|
10246
|
+
this._boundListeners.push({ target: t, type, handler: wrappedHandler, options: opts, subscription });
|
|
10015
10247
|
});
|
|
10016
10248
|
});
|
|
10017
10249
|
if (originalConnected) await originalConnected.apply(this);
|
|
@@ -10051,7 +10283,12 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10051
10283
|
const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);
|
|
10052
10284
|
for (const m of bMethods) this._invokeLifecycleMethod(m.propertyKey, helperHostSet);
|
|
10053
10285
|
if (this._boundListeners) {
|
|
10054
|
-
this._boundListeners.forEach((l) =>
|
|
10286
|
+
this._boundListeners.forEach((l) => {
|
|
10287
|
+
l.target.removeEventListener(l.type, l.handler, l.options);
|
|
10288
|
+
if (l.subscription && typeof l.subscription.unsubscribe === "function") {
|
|
10289
|
+
l.subscription.unsubscribe();
|
|
10290
|
+
}
|
|
10291
|
+
});
|
|
10055
10292
|
this._boundListeners = [];
|
|
10056
10293
|
}
|
|
10057
10294
|
new ElementApply(this, { id: this._swcId }).removeAllEventListener();
|
|
@@ -10134,6 +10371,13 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10134
10371
|
|
|
10135
10372
|
// src/decorators/applyAttribute.ts
|
|
10136
10373
|
var ATTRIBUTE_METADATA_KEY = Symbol.for("simple-web-component:attribute");
|
|
10374
|
+
var isCssSelector = (str) => {
|
|
10375
|
+
if (!str) return false;
|
|
10376
|
+
if (str.startsWith("$")) return true;
|
|
10377
|
+
if (/^[#.\[\:>+~]/.test(str)) return true;
|
|
10378
|
+
if (/[>+~:\[\]]/.test(str)) return true;
|
|
10379
|
+
return false;
|
|
10380
|
+
};
|
|
10137
10381
|
var convertValue2 = (val, type) => {
|
|
10138
10382
|
if (val === null || val === void 0) return val;
|
|
10139
10383
|
if (type === Number) return Number(val);
|
|
@@ -10171,6 +10415,27 @@ var resolveAttributeTargets = (inst, selector, options) => {
|
|
|
10171
10415
|
const currentWin = conf.window;
|
|
10172
10416
|
const r = options.root || "auto";
|
|
10173
10417
|
const results = [];
|
|
10418
|
+
let resolvedSelector = selector;
|
|
10419
|
+
if (typeof selector === "function") {
|
|
10420
|
+
const hostSet = SwcUtils.getHelperAndHostSet(currentWin, inst);
|
|
10421
|
+
resolvedSelector = selector(inst, hostSet);
|
|
10422
|
+
}
|
|
10423
|
+
if (resolvedSelector instanceof currentWin.Element) {
|
|
10424
|
+
results.push(resolvedSelector);
|
|
10425
|
+
return results;
|
|
10426
|
+
}
|
|
10427
|
+
if (resolvedSelector instanceof currentWin.NodeList) {
|
|
10428
|
+
results.push(...Array.from(resolvedSelector));
|
|
10429
|
+
return results;
|
|
10430
|
+
}
|
|
10431
|
+
if (Array.isArray(resolvedSelector)) {
|
|
10432
|
+
results.push(...resolvedSelector);
|
|
10433
|
+
return results;
|
|
10434
|
+
}
|
|
10435
|
+
if (resolvedSelector === null) {
|
|
10436
|
+
return results;
|
|
10437
|
+
}
|
|
10438
|
+
const stringSelector = resolvedSelector;
|
|
10174
10439
|
const applyRoot = (target) => {
|
|
10175
10440
|
if (!target) return;
|
|
10176
10441
|
if (r === "auto") {
|
|
@@ -10180,33 +10445,33 @@ var resolveAttributeTargets = (inst, selector, options) => {
|
|
|
10180
10445
|
if ((r === "shadow" || r === "all") && target.shadowRoot) results.push(target.shadowRoot);
|
|
10181
10446
|
}
|
|
10182
10447
|
};
|
|
10183
|
-
if (
|
|
10448
|
+
if (stringSelector === "$this" || !stringSelector) {
|
|
10184
10449
|
applyRoot(inst);
|
|
10185
10450
|
} else {
|
|
10186
10451
|
const hostSet = SwcUtils.getHostSet(inst);
|
|
10187
|
-
if (
|
|
10188
|
-
else if (
|
|
10189
|
-
else if (
|
|
10190
|
-
else if (
|
|
10191
|
-
else if (
|
|
10192
|
-
else if (
|
|
10193
|
-
else if (
|
|
10194
|
-
else if (
|
|
10195
|
-
else if (
|
|
10452
|
+
if (stringSelector === "$host") applyRoot(hostSet.$host);
|
|
10453
|
+
else if (stringSelector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
10454
|
+
else if (stringSelector === "$appHost") applyRoot(hostSet.$appHost);
|
|
10455
|
+
else if (stringSelector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
10456
|
+
else if (stringSelector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
10457
|
+
else if (stringSelector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
10458
|
+
else if (stringSelector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
10459
|
+
else if (stringSelector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
10460
|
+
else if (stringSelector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
10196
10461
|
else {
|
|
10197
10462
|
if (r === "shadow") {
|
|
10198
|
-
const found = inst.shadowRoot?.querySelectorAll(
|
|
10463
|
+
const found = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
10199
10464
|
if (found) results.push(...found);
|
|
10200
10465
|
} else if (r === "light") {
|
|
10201
|
-
const found = inst.querySelectorAll(
|
|
10466
|
+
const found = inst.querySelectorAll(stringSelector);
|
|
10202
10467
|
if (found) results.push(...found);
|
|
10203
10468
|
} else if (r === "all") {
|
|
10204
|
-
const sMatch = inst.shadowRoot?.querySelectorAll(
|
|
10205
|
-
const lMatch = inst.querySelectorAll(
|
|
10469
|
+
const sMatch = inst.shadowRoot?.querySelectorAll(stringSelector);
|
|
10470
|
+
const lMatch = inst.querySelectorAll(stringSelector);
|
|
10206
10471
|
if (sMatch) results.push(...sMatch);
|
|
10207
10472
|
if (lMatch) results.push(...lMatch);
|
|
10208
10473
|
} else {
|
|
10209
|
-
const found = (inst.shadowRoot || inst).querySelectorAll(
|
|
10474
|
+
const found = (inst.shadowRoot || inst).querySelectorAll(stringSelector);
|
|
10210
10475
|
if (found) results.push(...found);
|
|
10211
10476
|
}
|
|
10212
10477
|
}
|
|
@@ -10304,35 +10569,32 @@ function applyAttribute(selector, targetAttributeNameOrOptions, options) {
|
|
|
10304
10569
|
});
|
|
10305
10570
|
};
|
|
10306
10571
|
}
|
|
10307
|
-
function attribute(
|
|
10308
|
-
|
|
10309
|
-
}
|
|
10310
|
-
|
|
10311
|
-
if (typeof
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
return applyAttribute("$this", void 0, {});
|
|
10572
|
+
function attribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor) {
|
|
10573
|
+
if (optionsOrDescriptor !== void 0 && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
|
|
10574
|
+
return applyAttribute("$this", void 0, {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10575
|
+
}
|
|
10576
|
+
if (typeof selectorOrAttributeOrTarget === "string") {
|
|
10577
|
+
const isSelector = isCssSelector(selectorOrAttributeOrTarget);
|
|
10578
|
+
if (isSelector) {
|
|
10579
|
+
return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10580
|
+
} else {
|
|
10581
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10582
|
+
return applyAttribute("$this", selectorOrAttributeOrTarget, options);
|
|
10583
|
+
}
|
|
10320
10584
|
}
|
|
10585
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrTarget);
|
|
10321
10586
|
}
|
|
10322
|
-
function setAttribute(
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
10332
|
-
return applyAttribute("$this", void 0, targetOrOptions);
|
|
10333
|
-
} else {
|
|
10334
|
-
return applyAttribute("$this", void 0, {});
|
|
10587
|
+
function setAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined) {
|
|
10588
|
+
if (typeof selectorOrAttributeOrOptions === "string") {
|
|
10589
|
+
const isSelector = isCssSelector(selectorOrAttributeOrOptions);
|
|
10590
|
+
if (isSelector) {
|
|
10591
|
+
return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
|
|
10592
|
+
} else {
|
|
10593
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10594
|
+
return applyAttribute("$this", selectorOrAttributeOrOptions, options);
|
|
10595
|
+
}
|
|
10335
10596
|
}
|
|
10597
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrOptions);
|
|
10336
10598
|
}
|
|
10337
10599
|
var findAllAttributeMetadata = (target) => {
|
|
10338
10600
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -10348,8 +10610,32 @@ var findAllAttributeApplyMetadata = (target) => {
|
|
|
10348
10610
|
|
|
10349
10611
|
// src/decorators/applyNode.ts
|
|
10350
10612
|
var APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
|
|
10613
|
+
var resolveSelector = (selector, inst, win) => {
|
|
10614
|
+
if (typeof selector === "function") {
|
|
10615
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
10616
|
+
const result = selector(inst, hostSet);
|
|
10617
|
+
if (result instanceof win.Element) {
|
|
10618
|
+
return result;
|
|
10619
|
+
}
|
|
10620
|
+
if (result instanceof win.NodeList) {
|
|
10621
|
+
return result.length > 0 ? result[0] : null;
|
|
10622
|
+
}
|
|
10623
|
+
if (Array.isArray(result)) {
|
|
10624
|
+
return result.length > 0 ? result[0] : null;
|
|
10625
|
+
}
|
|
10626
|
+
if (result === null) {
|
|
10627
|
+
return null;
|
|
10628
|
+
}
|
|
10629
|
+
return result;
|
|
10630
|
+
}
|
|
10631
|
+
return selector;
|
|
10632
|
+
};
|
|
10351
10633
|
var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
10352
10634
|
if (!targetEl) return;
|
|
10635
|
+
if (pos === "clearChildren") {
|
|
10636
|
+
targetEl.replaceChildren();
|
|
10637
|
+
return [];
|
|
10638
|
+
}
|
|
10353
10639
|
const doc = win.document;
|
|
10354
10640
|
const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
|
|
10355
10641
|
const id = currentThis._swcId;
|
|
@@ -10385,7 +10671,16 @@ var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
|
10385
10671
|
new ElementApply(targetEl, { id }).apply({ target: "noInitialized", context: stateContext, bind: currentThis });
|
|
10386
10672
|
return nodes;
|
|
10387
10673
|
};
|
|
10388
|
-
function applyNode(
|
|
10674
|
+
function applyNode(selectorOrOptions, maybeOptions) {
|
|
10675
|
+
let selector;
|
|
10676
|
+
let options;
|
|
10677
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10678
|
+
selector = selectorOrOptions;
|
|
10679
|
+
options = maybeOptions || { position: "replaceChildren" };
|
|
10680
|
+
} else {
|
|
10681
|
+
selector = "$this";
|
|
10682
|
+
options = selectorOrOptions || { position: "replaceChildren" };
|
|
10683
|
+
}
|
|
10389
10684
|
return (targetObj, propertyKey, descriptor) => {
|
|
10390
10685
|
const constructor = targetObj.constructor;
|
|
10391
10686
|
let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor);
|
|
@@ -10411,14 +10706,22 @@ function applyNode(selector, options = { position: "replaceChildren" }) {
|
|
|
10411
10706
|
if (r === "all") return t.shadowRoot || t;
|
|
10412
10707
|
return t;
|
|
10413
10708
|
};
|
|
10414
|
-
|
|
10415
|
-
if (
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
if (
|
|
10419
|
-
|
|
10709
|
+
const resolved = resolveSelector(selector, this, currentWin);
|
|
10710
|
+
if (resolved instanceof currentWin.Element) {
|
|
10711
|
+
return applyRoot(resolved);
|
|
10712
|
+
}
|
|
10713
|
+
if (resolved === null) {
|
|
10714
|
+
return null;
|
|
10715
|
+
}
|
|
10716
|
+
const stringSelector = resolved;
|
|
10717
|
+
if (stringSelector === "$this") return applyRoot(this);
|
|
10718
|
+
if (stringSelector === "$host") return applyRoot(hostSet.$host);
|
|
10719
|
+
if (stringSelector === "$parentHost") return applyRoot(hostSet.$parentHost);
|
|
10720
|
+
if (stringSelector === "$appHost") return applyRoot(hostSet.$appHost);
|
|
10721
|
+
if (stringSelector === "$firstHost") return applyRoot(hostSet.$firstHost);
|
|
10722
|
+
if (stringSelector === "$lastHost") return applyRoot(hostSet.$lastHost);
|
|
10420
10723
|
const targetRoot = applyRoot(this);
|
|
10421
|
-
return targetRoot ? targetRoot.querySelector(
|
|
10724
|
+
return targetRoot ? targetRoot.querySelector(stringSelector) : null;
|
|
10422
10725
|
};
|
|
10423
10726
|
const targetEl = getTarget();
|
|
10424
10727
|
const res = original.apply(this, args);
|
|
@@ -10456,92 +10759,141 @@ function applyNode(selector, options = { position: "replaceChildren" }) {
|
|
|
10456
10759
|
};
|
|
10457
10760
|
};
|
|
10458
10761
|
}
|
|
10459
|
-
function
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
}
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
|
|
10468
|
-
const opt = targetOrOptions || {};
|
|
10469
|
-
return applyNode("$this", { ...opt, ...option });
|
|
10470
|
-
}
|
|
10471
|
-
function beforeEndNodeThis(targetOrOptions, propertyKey, descriptor) {
|
|
10472
|
-
const options = { position: "beforeEnd" };
|
|
10473
|
-
if (propertyKey !== void 0) return applyNode("$this", options)(targetOrOptions, propertyKey, descriptor);
|
|
10474
|
-
const opt = targetOrOptions || {};
|
|
10475
|
-
return applyNode("$this", { ...opt, ...options });
|
|
10476
|
-
}
|
|
10477
|
-
function beforeEndLightNodeThis(targetOrOptions, propertyKey, descriptor) {
|
|
10478
|
-
const option = { position: "beforeEnd", root: "light" };
|
|
10479
|
-
if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
|
|
10480
|
-
const opt = targetOrOptions || {};
|
|
10481
|
-
return applyNode("$this", { ...opt, ...option });
|
|
10762
|
+
function replaceChildren(selectorOrOptions, maybeOptions, descriptor) {
|
|
10763
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10764
|
+
return applyNode({ position: "replaceChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10765
|
+
}
|
|
10766
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10767
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren" });
|
|
10768
|
+
}
|
|
10769
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren" });
|
|
10482
10770
|
}
|
|
10483
|
-
function
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10771
|
+
function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
|
|
10772
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10773
|
+
return applyNode({ position: "clearChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10774
|
+
}
|
|
10775
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10776
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren" });
|
|
10777
|
+
}
|
|
10778
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren" });
|
|
10488
10779
|
}
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
if (
|
|
10492
|
-
|
|
10493
|
-
|
|
10780
|
+
var clearNode = clearChildrenNode;
|
|
10781
|
+
function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
|
|
10782
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10783
|
+
return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10784
|
+
}
|
|
10785
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10786
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml" });
|
|
10787
|
+
}
|
|
10788
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml" });
|
|
10494
10789
|
}
|
|
10495
|
-
function
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10790
|
+
function innerHtmlLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10791
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10792
|
+
return applyNode({ position: "innerHtml", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10793
|
+
}
|
|
10794
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10795
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "light" });
|
|
10796
|
+
}
|
|
10797
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "light" });
|
|
10500
10798
|
}
|
|
10501
|
-
function
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10799
|
+
function innerHtmlShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10800
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10801
|
+
return applyNode({ position: "innerHtml", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10802
|
+
}
|
|
10803
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10804
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "shadow" });
|
|
10805
|
+
}
|
|
10806
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "shadow" });
|
|
10506
10807
|
}
|
|
10507
|
-
function
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10808
|
+
function innerText(selectorOrOptions, maybeOptions, descriptor) {
|
|
10809
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10810
|
+
return applyNode({ position: "innerText" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10811
|
+
}
|
|
10812
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10813
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText" });
|
|
10814
|
+
}
|
|
10815
|
+
return applyNode({ ...selectorOrOptions, position: "innerText" });
|
|
10512
10816
|
}
|
|
10513
|
-
function
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10817
|
+
function innerTextLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10818
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10819
|
+
return applyNode({ position: "innerText", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10820
|
+
}
|
|
10821
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10822
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "light" });
|
|
10823
|
+
}
|
|
10824
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "light" });
|
|
10518
10825
|
}
|
|
10519
|
-
function
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10826
|
+
function innerTextShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10827
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10828
|
+
return applyNode({ position: "innerText", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10829
|
+
}
|
|
10830
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10831
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "shadow" });
|
|
10832
|
+
}
|
|
10833
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "shadow" });
|
|
10524
10834
|
}
|
|
10525
|
-
function
|
|
10526
|
-
|
|
10835
|
+
function insertBeforeEnd(selectorOrOptions, maybeOptions, descriptor) {
|
|
10836
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10837
|
+
return applyNode({ position: "beforeEnd" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10838
|
+
}
|
|
10839
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10840
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd" });
|
|
10841
|
+
}
|
|
10842
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd" });
|
|
10527
10843
|
}
|
|
10528
|
-
function
|
|
10529
|
-
|
|
10844
|
+
function insertBeforeEndLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10845
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10846
|
+
return applyNode({ position: "beforeEnd", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10847
|
+
}
|
|
10848
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10849
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "light" });
|
|
10850
|
+
}
|
|
10851
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "light" });
|
|
10530
10852
|
}
|
|
10531
|
-
function
|
|
10532
|
-
|
|
10853
|
+
function insertBeforeEndShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10854
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10855
|
+
return applyNode({ position: "beforeEnd", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10856
|
+
}
|
|
10857
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10858
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "shadow" });
|
|
10859
|
+
}
|
|
10860
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "shadow" });
|
|
10533
10861
|
}
|
|
10534
|
-
function
|
|
10535
|
-
|
|
10862
|
+
function insertAfterBegin(selectorOrOptions, maybeOptions, descriptor) {
|
|
10863
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10864
|
+
return applyNode({ position: "afterBegin" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10865
|
+
}
|
|
10866
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10867
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin" });
|
|
10868
|
+
}
|
|
10869
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin" });
|
|
10536
10870
|
}
|
|
10537
|
-
function
|
|
10538
|
-
|
|
10871
|
+
function insertAfterBeginLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10872
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10873
|
+
return applyNode({ position: "afterBegin", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10874
|
+
}
|
|
10875
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10876
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin", root: "light" });
|
|
10877
|
+
}
|
|
10878
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin", root: "light" });
|
|
10539
10879
|
}
|
|
10540
|
-
function
|
|
10541
|
-
|
|
10880
|
+
function replaceChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10881
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10882
|
+
return applyNode({ position: "replaceChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10883
|
+
}
|
|
10884
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10885
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren", root: "light" });
|
|
10886
|
+
}
|
|
10887
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren", root: "light" });
|
|
10542
10888
|
}
|
|
10543
|
-
function
|
|
10544
|
-
|
|
10889
|
+
function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10890
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10891
|
+
return applyNode({ position: "clearChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10892
|
+
}
|
|
10893
|
+
if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
|
|
10894
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren", root: "light" });
|
|
10895
|
+
}
|
|
10896
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren", root: "light" });
|
|
10545
10897
|
}
|
|
10546
10898
|
var findAllApplyNodeMetadata = (target) => {
|
|
10547
10899
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -10556,6 +10908,58 @@ var findAllApplyNodeMetadata = (target) => {
|
|
|
10556
10908
|
|
|
10557
10909
|
// src/decorators/applyClass.ts
|
|
10558
10910
|
var CLASS_METADATA_KEY = Symbol.for("simple-web-component:class");
|
|
10911
|
+
var resolveSelector2 = (selector, inst, win) => {
|
|
10912
|
+
if (typeof selector === "function") {
|
|
10913
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
10914
|
+
const result = selector(inst, hostSet);
|
|
10915
|
+
if (result instanceof win.Element) {
|
|
10916
|
+
return [result];
|
|
10917
|
+
}
|
|
10918
|
+
if (result instanceof win.NodeList) {
|
|
10919
|
+
return Array.from(result);
|
|
10920
|
+
}
|
|
10921
|
+
if (Array.isArray(result)) {
|
|
10922
|
+
return result;
|
|
10923
|
+
}
|
|
10924
|
+
if (result === null) {
|
|
10925
|
+
return [];
|
|
10926
|
+
}
|
|
10927
|
+
return result;
|
|
10928
|
+
}
|
|
10929
|
+
return selector;
|
|
10930
|
+
};
|
|
10931
|
+
var getTargetElements = (selector, inst, win, root) => {
|
|
10932
|
+
const resolved = resolveSelector2(selector, inst, win);
|
|
10933
|
+
if (Array.isArray(resolved)) {
|
|
10934
|
+
return resolved;
|
|
10935
|
+
}
|
|
10936
|
+
const stringSelector = resolved;
|
|
10937
|
+
const targetEls = [];
|
|
10938
|
+
const host = inst;
|
|
10939
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
10940
|
+
const applyRoot = (t) => {
|
|
10941
|
+
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
10942
|
+
targetEls.push(t);
|
|
10943
|
+
};
|
|
10944
|
+
if (stringSelector === "$this" || !stringSelector) applyRoot(host);
|
|
10945
|
+
else if (stringSelector === "$host") applyRoot(hostSet.$host);
|
|
10946
|
+
else if (stringSelector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
10947
|
+
else if (stringSelector === "$appHost") applyRoot(hostSet.$appHost);
|
|
10948
|
+
else if (stringSelector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
10949
|
+
else if (stringSelector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
10950
|
+
else if (stringSelector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
10951
|
+
else if (stringSelector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
10952
|
+
else if (stringSelector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
10953
|
+
else if (stringSelector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
10954
|
+
else {
|
|
10955
|
+
const targetRoot = root === "auto" ? host.shadowRoot || host : root === "shadow" ? host.shadowRoot : host;
|
|
10956
|
+
if (targetRoot) {
|
|
10957
|
+
const found = targetRoot.querySelectorAll(stringSelector);
|
|
10958
|
+
if (found) targetEls.push(...Array.from(found));
|
|
10959
|
+
}
|
|
10960
|
+
}
|
|
10961
|
+
return targetEls;
|
|
10962
|
+
};
|
|
10559
10963
|
function createClassDecorator(action) {
|
|
10560
10964
|
return (selector, classMapOrOptions, options = {}) => {
|
|
10561
10965
|
return (target, propertyKey, descriptor) => {
|
|
@@ -10590,28 +10994,7 @@ function createClassDecorator(action) {
|
|
|
10590
10994
|
const host = this;
|
|
10591
10995
|
const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };
|
|
10592
10996
|
const r = finalOptions.root || "auto";
|
|
10593
|
-
const targetEls =
|
|
10594
|
-
const applyRoot = (t) => {
|
|
10595
|
-
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
10596
|
-
targetEls.push(t);
|
|
10597
|
-
};
|
|
10598
|
-
if (selector === "$this" || !selector) applyRoot(host);
|
|
10599
|
-
else if (selector === "$host") applyRoot(hostSet.$host);
|
|
10600
|
-
else if (selector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
10601
|
-
else if (selector === "$appHost") applyRoot(hostSet.$appHost);
|
|
10602
|
-
else if (selector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
10603
|
-
else if (selector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
10604
|
-
else if (selector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
10605
|
-
else if (selector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
10606
|
-
else if (selector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
10607
|
-
else if (selector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
10608
|
-
else {
|
|
10609
|
-
const targetRoot = r === "auto" ? host.shadowRoot || host : r === "shadow" ? host.shadowRoot : host;
|
|
10610
|
-
if (targetRoot) {
|
|
10611
|
-
const found = targetRoot.querySelectorAll(selector);
|
|
10612
|
-
if (found) targetEls.push(...Array.from(found));
|
|
10613
|
-
}
|
|
10614
|
-
}
|
|
10997
|
+
const targetEls = getTargetElements(selector, this, win, r);
|
|
10615
10998
|
targetEls.forEach((targetEl) => {
|
|
10616
10999
|
if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, { currentThis: this, helper: hostSet })) {
|
|
10617
11000
|
return;
|
|
@@ -10672,22 +11055,64 @@ function createClassDecorator(action) {
|
|
|
10672
11055
|
};
|
|
10673
11056
|
};
|
|
10674
11057
|
}
|
|
10675
|
-
function applyClass(
|
|
10676
|
-
|
|
10677
|
-
}
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
11058
|
+
function applyClass(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
11059
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
11060
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
11061
|
+
}
|
|
11062
|
+
if (typeof selectorOrTarget === "string") {
|
|
11063
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
11064
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
11065
|
+
return createClassDecorator(action2)(selectorOrTarget, options2);
|
|
11066
|
+
}
|
|
11067
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
11068
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
10684
11069
|
return createClassDecorator(action)("$this", options);
|
|
10685
11070
|
}
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
11071
|
+
function setClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11072
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11073
|
+
return createClassDecorator("set")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11074
|
+
}
|
|
11075
|
+
if (typeof selectorOrTarget === "string") {
|
|
11076
|
+
return createClassDecorator("set")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11077
|
+
}
|
|
11078
|
+
return createClassDecorator("set")("$this", selectorOrTarget);
|
|
11079
|
+
}
|
|
11080
|
+
function updateClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11081
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11082
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11083
|
+
}
|
|
11084
|
+
if (typeof selectorOrTarget === "string") {
|
|
11085
|
+
return createClassDecorator("update")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11086
|
+
}
|
|
11087
|
+
return createClassDecorator("update")("$this", selectorOrTarget);
|
|
11088
|
+
}
|
|
11089
|
+
function addClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11090
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11091
|
+
return createClassDecorator("add")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11092
|
+
}
|
|
11093
|
+
if (typeof selectorOrTarget === "string") {
|
|
11094
|
+
return createClassDecorator("add")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11095
|
+
}
|
|
11096
|
+
return createClassDecorator("add")("$this", selectorOrTarget);
|
|
11097
|
+
}
|
|
11098
|
+
function removeClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11099
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11100
|
+
return createClassDecorator("remove")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11101
|
+
}
|
|
11102
|
+
if (typeof selectorOrTarget === "string") {
|
|
11103
|
+
return createClassDecorator("remove")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11104
|
+
}
|
|
11105
|
+
return createClassDecorator("remove")("$this", selectorOrTarget);
|
|
11106
|
+
}
|
|
11107
|
+
function toggleClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11108
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11109
|
+
return createClassDecorator("toggle")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11110
|
+
}
|
|
11111
|
+
if (typeof selectorOrTarget === "string") {
|
|
11112
|
+
return createClassDecorator("toggle")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11113
|
+
}
|
|
11114
|
+
return createClassDecorator("toggle")("$this", selectorOrTarget);
|
|
11115
|
+
}
|
|
10691
11116
|
var findAllClassMetadata = (target) => {
|
|
10692
11117
|
const result = /* @__PURE__ */ new Map();
|
|
10693
11118
|
const maps = ReflectUtils.findAllMetadata(CLASS_METADATA_KEY, target);
|
|
@@ -10701,6 +11126,58 @@ var findAllClassMetadata = (target) => {
|
|
|
10701
11126
|
|
|
10702
11127
|
// src/decorators/applyStyle.ts
|
|
10703
11128
|
var STYLE_METADATA_KEY = Symbol.for("simple-web-component:style");
|
|
11129
|
+
var resolveSelector3 = (selector, inst, win) => {
|
|
11130
|
+
if (typeof selector === "function") {
|
|
11131
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
11132
|
+
const result = selector(inst, hostSet);
|
|
11133
|
+
if (result instanceof win.Element) {
|
|
11134
|
+
return [result];
|
|
11135
|
+
}
|
|
11136
|
+
if (result instanceof win.NodeList) {
|
|
11137
|
+
return Array.from(result);
|
|
11138
|
+
}
|
|
11139
|
+
if (Array.isArray(result)) {
|
|
11140
|
+
return result;
|
|
11141
|
+
}
|
|
11142
|
+
if (result === null) {
|
|
11143
|
+
return [];
|
|
11144
|
+
}
|
|
11145
|
+
return result;
|
|
11146
|
+
}
|
|
11147
|
+
return selector;
|
|
11148
|
+
};
|
|
11149
|
+
var getTargetElements2 = (selector, inst, win, root) => {
|
|
11150
|
+
const resolved = resolveSelector3(selector, inst, win);
|
|
11151
|
+
if (Array.isArray(resolved)) {
|
|
11152
|
+
return resolved;
|
|
11153
|
+
}
|
|
11154
|
+
const stringSelector = resolved;
|
|
11155
|
+
const targetEls = [];
|
|
11156
|
+
const host = inst;
|
|
11157
|
+
const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
|
|
11158
|
+
const applyRoot = (t) => {
|
|
11159
|
+
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
11160
|
+
targetEls.push(t);
|
|
11161
|
+
};
|
|
11162
|
+
if (stringSelector === "$this" || !stringSelector) applyRoot(host);
|
|
11163
|
+
else if (stringSelector === "$host") applyRoot(hostSet.$host);
|
|
11164
|
+
else if (stringSelector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
11165
|
+
else if (stringSelector === "$appHost") applyRoot(hostSet.$appHost);
|
|
11166
|
+
else if (stringSelector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
11167
|
+
else if (stringSelector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
11168
|
+
else if (stringSelector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
11169
|
+
else if (stringSelector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
11170
|
+
else if (stringSelector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
11171
|
+
else if (stringSelector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
11172
|
+
else {
|
|
11173
|
+
const targetRoot = root === "auto" ? host.shadowRoot || host : root === "shadow" ? host.shadowRoot : host;
|
|
11174
|
+
if (targetRoot) {
|
|
11175
|
+
const found = targetRoot.querySelectorAll(stringSelector);
|
|
11176
|
+
if (found) targetEls.push(...Array.from(found));
|
|
11177
|
+
}
|
|
11178
|
+
}
|
|
11179
|
+
return targetEls;
|
|
11180
|
+
};
|
|
10704
11181
|
function createStyleDecorator(action) {
|
|
10705
11182
|
return (selector, options = {}) => {
|
|
10706
11183
|
return (target, propertyKey, descriptor) => {
|
|
@@ -10728,28 +11205,7 @@ function createStyleDecorator(action) {
|
|
|
10728
11205
|
const host = this;
|
|
10729
11206
|
const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };
|
|
10730
11207
|
const r = options.root || "auto";
|
|
10731
|
-
const targetEls =
|
|
10732
|
-
const applyRoot = (t) => {
|
|
10733
|
-
if (!t || !(t instanceof win.HTMLElement)) return;
|
|
10734
|
-
targetEls.push(t);
|
|
10735
|
-
};
|
|
10736
|
-
if (selector === "$this" || !selector) applyRoot(host);
|
|
10737
|
-
else if (selector === "$host") applyRoot(hostSet.$host);
|
|
10738
|
-
else if (selector === "$parentHost") applyRoot(hostSet.$parentHost);
|
|
10739
|
-
else if (selector === "$appHost") applyRoot(hostSet.$appHost);
|
|
10740
|
-
else if (selector === "$firstHost") applyRoot(hostSet.$firstHost);
|
|
10741
|
-
else if (selector === "$lastHost") applyRoot(hostSet.$lastHost);
|
|
10742
|
-
else if (selector === "$firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
10743
|
-
else if (selector === "$lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
10744
|
-
else if (selector === "$hosts") hostSet.$hosts.forEach(applyRoot);
|
|
10745
|
-
else if (selector === "$appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
10746
|
-
else {
|
|
10747
|
-
const targetRoot = r === "auto" ? host.shadowRoot || host : r === "shadow" ? host.shadowRoot : host;
|
|
10748
|
-
if (targetRoot) {
|
|
10749
|
-
const found = targetRoot.querySelectorAll(selector);
|
|
10750
|
-
if (found) targetEls.push(...Array.from(found));
|
|
10751
|
-
}
|
|
10752
|
-
}
|
|
11208
|
+
const targetEls = getTargetElements2(selector, this, win, r);
|
|
10753
11209
|
targetEls.forEach((targetEl) => {
|
|
10754
11210
|
if (options.filter && !options.filter(targetEl, resolvedValue, { currentThis: this, helper: hostSet })) {
|
|
10755
11211
|
return;
|
|
@@ -10796,18 +11252,46 @@ function createStyleDecorator(action) {
|
|
|
10796
11252
|
};
|
|
10797
11253
|
};
|
|
10798
11254
|
}
|
|
10799
|
-
function applyStyle(
|
|
10800
|
-
|
|
10801
|
-
}
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
11255
|
+
function applyStyle(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
11256
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
11257
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
11258
|
+
}
|
|
11259
|
+
if (typeof selectorOrTarget === "string") {
|
|
11260
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
11261
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
11262
|
+
return createStyleDecorator(action2)(selectorOrTarget, options2);
|
|
11263
|
+
}
|
|
11264
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
11265
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
10806
11266
|
return createStyleDecorator(action)("$this", options);
|
|
10807
11267
|
}
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
11268
|
+
function setStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11269
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11270
|
+
return createStyleDecorator("set")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11271
|
+
}
|
|
11272
|
+
if (typeof selectorOrTarget === "string") {
|
|
11273
|
+
return createStyleDecorator("set")(selectorOrTarget, optionsOrPropertyKey);
|
|
11274
|
+
}
|
|
11275
|
+
return createStyleDecorator("set")("$this", selectorOrTarget);
|
|
11276
|
+
}
|
|
11277
|
+
function updateStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11278
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11279
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11280
|
+
}
|
|
11281
|
+
if (typeof selectorOrTarget === "string") {
|
|
11282
|
+
return createStyleDecorator("update")(selectorOrTarget, optionsOrPropertyKey);
|
|
11283
|
+
}
|
|
11284
|
+
return createStyleDecorator("update")("$this", selectorOrTarget);
|
|
11285
|
+
}
|
|
11286
|
+
function removeStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11287
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11288
|
+
return createStyleDecorator("remove")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11289
|
+
}
|
|
11290
|
+
if (typeof selectorOrTarget === "string") {
|
|
11291
|
+
return createStyleDecorator("remove")(selectorOrTarget, optionsOrPropertyKey);
|
|
11292
|
+
}
|
|
11293
|
+
return createStyleDecorator("remove")("$this", selectorOrTarget);
|
|
11294
|
+
}
|
|
10811
11295
|
var findAllStyleMetadata = (target) => {
|
|
10812
11296
|
const result = /* @__PURE__ */ new Map();
|
|
10813
11297
|
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
@@ -10855,6 +11339,7 @@ function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOr
|
|
|
10855
11339
|
}
|
|
10856
11340
|
return createSubscribeSwcAppRouteChangeWhileConnected(options);
|
|
10857
11341
|
}
|
|
11342
|
+
var changedRoute = subscribeSwcAppRouteChangeWhileConnected;
|
|
10858
11343
|
var getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
|
|
10859
11344
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10860
11345
|
const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -10895,6 +11380,7 @@ function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions, opti
|
|
|
10895
11380
|
}
|
|
10896
11381
|
return createSubscribeSwcAppMessageWhileConnected(options, messageType);
|
|
10897
11382
|
}
|
|
11383
|
+
var receiveMessage = subscribeSwcAppMessageWhileConnected;
|
|
10898
11384
|
var getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
|
|
10899
11385
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10900
11386
|
return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -10924,7 +11410,7 @@ function createPublishSwcAppMessage(messageType, options) {
|
|
|
10924
11410
|
}
|
|
10925
11411
|
return v;
|
|
10926
11412
|
};
|
|
10927
|
-
const
|
|
11413
|
+
const publishMessage2 = (data) => {
|
|
10928
11414
|
const appHost = SwcUtils.getAppHost(this);
|
|
10929
11415
|
if (appHost) {
|
|
10930
11416
|
appHost.publishMessage({
|
|
@@ -10937,13 +11423,13 @@ function createPublishSwcAppMessage(messageType, options) {
|
|
|
10937
11423
|
if (result instanceof Promise) {
|
|
10938
11424
|
result.then((data) => {
|
|
10939
11425
|
const extracted = extractValue(data);
|
|
10940
|
-
|
|
11426
|
+
publishMessage2(extracted);
|
|
10941
11427
|
}).catch((err) => {
|
|
10942
11428
|
console.warn("publishSwcAppMessage async error:", err);
|
|
10943
11429
|
});
|
|
10944
11430
|
} else {
|
|
10945
11431
|
const extracted = extractValue(result);
|
|
10946
|
-
|
|
11432
|
+
publishMessage2(extracted);
|
|
10947
11433
|
}
|
|
10948
11434
|
return result;
|
|
10949
11435
|
};
|
|
@@ -10968,7 +11454,7 @@ function publishSwcAppMessage(targetOrMessageTypeOrOptions, propertyKeyOrOptions
|
|
|
10968
11454
|
}
|
|
10969
11455
|
return createPublishSwcAppMessage(messageType, options);
|
|
10970
11456
|
}
|
|
10971
|
-
var
|
|
11457
|
+
var publishMessage = publishSwcAppMessage;
|
|
10972
11458
|
var getPublishSwcAppMessageMetadata = (target) => {
|
|
10973
11459
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10974
11460
|
return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
@@ -13085,6 +13571,10 @@ var ElementRouter = class extends Router {
|
|
|
13085
13571
|
super(config);
|
|
13086
13572
|
__publicField(this, "_history", []);
|
|
13087
13573
|
__publicField(this, "_currentIndex", -1);
|
|
13574
|
+
if (config.firstUrl) {
|
|
13575
|
+
this._history.push({ url: config.firstUrl, data: null, title: void 0 });
|
|
13576
|
+
this._currentIndex = 0;
|
|
13577
|
+
}
|
|
13088
13578
|
}
|
|
13089
13579
|
// Override pushState to manage internal history
|
|
13090
13580
|
pushState(data, title, path, config) {
|
|
@@ -13256,7 +13746,9 @@ var SwcAppEngine = class {
|
|
|
13256
13746
|
if (this.router) otherInstanceSim.set(Router, this.router);
|
|
13257
13747
|
this.simpleApplication.run(otherInstanceSim);
|
|
13258
13748
|
if (this._config.onStartedLazyDefineComponent) {
|
|
13259
|
-
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) =>
|
|
13749
|
+
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) => {
|
|
13750
|
+
it(this._config.window);
|
|
13751
|
+
}));
|
|
13260
13752
|
}
|
|
13261
13753
|
if (this._config.onEngineStarted) {
|
|
13262
13754
|
await this._config.onEngineStarted(this.simpleApplication, this.host);
|
|
@@ -13333,6 +13825,13 @@ function SwcAppMixin(Base) {
|
|
|
13333
13825
|
const methodName = metadata.propertyKey;
|
|
13334
13826
|
let pathPattern = metadata.options?.path;
|
|
13335
13827
|
const filter = metadata.options?.filter;
|
|
13828
|
+
const extractValue = (v) => {
|
|
13829
|
+
const keyToUse = metadata.options?.valueKey ?? SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;
|
|
13830
|
+
if (v && typeof v === "object" && keyToUse in v) {
|
|
13831
|
+
return v[keyToUse];
|
|
13832
|
+
}
|
|
13833
|
+
return v;
|
|
13834
|
+
};
|
|
13336
13835
|
if (typeof pathPattern === "function") {
|
|
13337
13836
|
pathPattern = pathPattern(instance);
|
|
13338
13837
|
}
|
|
@@ -13357,7 +13856,7 @@ function SwcAppMixin(Base) {
|
|
|
13357
13856
|
const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);
|
|
13358
13857
|
const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
|
|
13359
13858
|
if (pathMatched && filterPassed && instance[methodName]) {
|
|
13360
|
-
const result = await instance[methodName]({ ...re, pathData });
|
|
13859
|
+
const result = extractValue(await instance[methodName]({ ...re, pathData }));
|
|
13361
13860
|
if (result !== void 0 && result !== null) {
|
|
13362
13861
|
break;
|
|
13363
13862
|
}
|
|
@@ -13472,7 +13971,15 @@ function SwcAppMixin(Base) {
|
|
|
13472
13971
|
context: this,
|
|
13473
13972
|
args: SwcUtils.getHelperAndHostSet(win, this)
|
|
13474
13973
|
});
|
|
13475
|
-
|
|
13974
|
+
if (userConfig instanceof Promise) {
|
|
13975
|
+
userConfig.then((resolvedConfig) => {
|
|
13976
|
+
this.connect(resolvedConfig);
|
|
13977
|
+
}).catch((e) => {
|
|
13978
|
+
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13979
|
+
});
|
|
13980
|
+
} else {
|
|
13981
|
+
this.connect(userConfig);
|
|
13982
|
+
}
|
|
13476
13983
|
} catch (e) {
|
|
13477
13984
|
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13478
13985
|
}
|
|
@@ -13745,6 +14252,7 @@ export {
|
|
|
13745
14252
|
SwcAppAside,
|
|
13746
14253
|
SwcAppBody,
|
|
13747
14254
|
SwcAppDiv,
|
|
14255
|
+
SwcAppEngine,
|
|
13748
14256
|
SwcAppFooter,
|
|
13749
14257
|
SwcAppHeader,
|
|
13750
14258
|
SwcAppMain,
|
|
@@ -13753,7 +14261,6 @@ export {
|
|
|
13753
14261
|
SwcAppSection,
|
|
13754
14262
|
SwcUtils,
|
|
13755
14263
|
addClass,
|
|
13756
|
-
addClassThis,
|
|
13757
14264
|
addEventListener,
|
|
13758
14265
|
addEventListenerAppHost,
|
|
13759
14266
|
addEventListenerDelegate,
|
|
@@ -13763,28 +14270,21 @@ export {
|
|
|
13763
14270
|
addEventListenerDocument,
|
|
13764
14271
|
addEventListenerThis,
|
|
13765
14272
|
addEventListenerWindow,
|
|
13766
|
-
afterBeginLightNodeThis,
|
|
13767
|
-
afterBeginNodeThis,
|
|
13768
|
-
allAppHost,
|
|
13769
|
-
allParentHost,
|
|
13770
14273
|
appendHtmlSlot,
|
|
13771
14274
|
appendSlot,
|
|
13772
14275
|
appendTextSlot,
|
|
13773
14276
|
applyAttribute,
|
|
13774
14277
|
applyClass,
|
|
13775
|
-
applyClassThis,
|
|
13776
14278
|
applyNode,
|
|
13777
|
-
applyNodeThis,
|
|
13778
14279
|
applyProperty,
|
|
13779
14280
|
applySlot,
|
|
13780
14281
|
applyStyle,
|
|
13781
|
-
applyStyleThis,
|
|
13782
14282
|
attribute,
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
14283
|
+
changedAttribute,
|
|
14284
|
+
changedRoute,
|
|
14285
|
+
clearChildrenLight,
|
|
14286
|
+
clearChildrenNode,
|
|
14287
|
+
clearNode,
|
|
13788
14288
|
clearSlot,
|
|
13789
14289
|
commentNode,
|
|
13790
14290
|
convertAttributeValue,
|
|
@@ -13804,7 +14304,6 @@ export {
|
|
|
13804
14304
|
elementDefine,
|
|
13805
14305
|
emit,
|
|
13806
14306
|
emitCustomEvent,
|
|
13807
|
-
emitCustomEventThis,
|
|
13808
14307
|
ensureInit,
|
|
13809
14308
|
event,
|
|
13810
14309
|
eventDelegate,
|
|
@@ -13847,15 +14346,17 @@ export {
|
|
|
13847
14346
|
htmlSectionElement,
|
|
13848
14347
|
htmlSpanElement,
|
|
13849
14348
|
htmlUlElement,
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
14349
|
+
innerHtml,
|
|
14350
|
+
innerHtmlLight,
|
|
14351
|
+
innerHtmlShadow,
|
|
14352
|
+
innerText,
|
|
14353
|
+
innerTextLight,
|
|
14354
|
+
innerTextShadow,
|
|
14355
|
+
insertAfterBegin,
|
|
14356
|
+
insertAfterBeginLight,
|
|
14357
|
+
insertBeforeEnd,
|
|
14358
|
+
insertBeforeEndLight,
|
|
14359
|
+
insertBeforeEndShadow,
|
|
13859
14360
|
isSSR,
|
|
13860
14361
|
onAdopted,
|
|
13861
14362
|
onAdoptedAfter,
|
|
@@ -13875,39 +14376,26 @@ export {
|
|
|
13875
14376
|
prependSlot,
|
|
13876
14377
|
prependTextSlot,
|
|
13877
14378
|
property,
|
|
13878
|
-
|
|
13879
|
-
publish,
|
|
14379
|
+
publishMessage,
|
|
13880
14380
|
publishSwcAppMessage,
|
|
13881
14381
|
query,
|
|
13882
14382
|
queryAll,
|
|
13883
|
-
|
|
13884
|
-
queryAppHost,
|
|
13885
|
-
queryDocument,
|
|
13886
|
-
queryHost,
|
|
13887
|
-
queryThis,
|
|
13888
|
-
queryWindow,
|
|
14383
|
+
receiveMessage,
|
|
13889
14384
|
removeClass,
|
|
13890
|
-
removeClassThis,
|
|
13891
14385
|
removeSSRAttribute,
|
|
13892
14386
|
removeStyle,
|
|
13893
|
-
|
|
14387
|
+
replaceChildren,
|
|
13894
14388
|
replaceChildrenHtmlSlot,
|
|
13895
|
-
|
|
13896
|
-
replaceChildrenNode,
|
|
13897
|
-
replaceChildrenNodeThis,
|
|
14389
|
+
replaceChildrenLight,
|
|
13898
14390
|
replaceChildrenSlot,
|
|
13899
14391
|
replaceChildrenTextSlot,
|
|
13900
14392
|
resolveAttributeTargets,
|
|
13901
14393
|
resolvePropertyTargets,
|
|
13902
14394
|
setAttribute,
|
|
13903
|
-
setAttributeThis,
|
|
13904
14395
|
setClass,
|
|
13905
|
-
setClassThis,
|
|
13906
14396
|
setProperty,
|
|
13907
|
-
setPropertyThis,
|
|
13908
14397
|
setSSRAttribute,
|
|
13909
14398
|
setStyle,
|
|
13910
|
-
setStyleThis,
|
|
13911
14399
|
state,
|
|
13912
14400
|
subscribeSwcAppMessageWhileConnected,
|
|
13913
14401
|
subscribeSwcAppRouteChangeWhileConnected,
|
|
@@ -13924,11 +14412,8 @@ export {
|
|
|
13924
14412
|
swcAppTagName,
|
|
13925
14413
|
textNode,
|
|
13926
14414
|
toggleClass,
|
|
13927
|
-
toggleClassThis,
|
|
13928
14415
|
updateClass,
|
|
13929
|
-
|
|
13930
|
-
updateStyle,
|
|
13931
|
-
updateStyleThis
|
|
14416
|
+
updateStyle
|
|
13932
14417
|
};
|
|
13933
14418
|
/*! Bundled license information:
|
|
13934
14419
|
|