@dooboostore/simple-web-component 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +298 -49
- package/dist/cjs/SwcAppEngine.js +3 -1
- package/dist/cjs/SwcAppEngine.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +30 -28
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +57 -21
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +165 -105
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyProperty.js +11 -28
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +39 -15
- package/dist/cjs/decorators/applyStyle.js.map +3 -3
- package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
- package/dist/cjs/decorators/changedAttribute.js.map +7 -0
- package/dist/cjs/decorators/elementDefine.js +37 -6
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +56 -42
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +1 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/cjs/decorators/query.js +96 -145
- package/dist/cjs/decorators/query.js.map +3 -3
- package/dist/cjs/decorators/queryAll.js +104 -131
- package/dist/cjs/decorators/queryAll.js.map +3 -3
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +17 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
- package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/router/ElementRouter.js +4 -0
- package/dist/cjs/router/ElementRouter.js.map +2 -2
- package/dist/esm/SwcAppEngine.js +3 -1
- package/dist/esm/SwcAppEngine.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +30 -28
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +57 -21
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +165 -105
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyProperty.js +11 -28
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +39 -15
- package/dist/esm/decorators/applyStyle.js.map +3 -3
- package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
- package/dist/esm/decorators/changedAttribute.js.map +7 -0
- package/dist/esm/decorators/elementDefine.js +35 -4
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +56 -42
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +1 -1
- package/dist/esm/decorators/index.js.map +1 -1
- package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
- package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
- package/dist/esm/decorators/query.js +96 -145
- package/dist/esm/decorators/query.js.map +3 -3
- package/dist/esm/decorators/queryAll.js +104 -131
- package/dist/esm/decorators/queryAll.js.map +3 -3
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +18 -3
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
- package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/router/ElementRouter.js +4 -0
- package/dist/esm/router/ElementRouter.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/SwcAppEngine.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +17 -14
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +35 -20
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +16 -36
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +172 -30
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +27 -18
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +7 -7
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +1 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +3 -26
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +3 -20
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts +4 -4
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
- package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/router/ElementRouter.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/SwcAppEngine.ts +3 -1
- package/src/decorators/addEventListener.ts +28 -24
- package/src/decorators/applyAttribute.ts +109 -63
- package/src/decorators/applyClass.ts +89 -15
- package/src/decorators/applyNode.ts +357 -100
- package/src/decorators/applyProperty.ts +42 -63
- package/src/decorators/applyStyle.ts +59 -11
- package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
- package/src/decorators/elementDefine.ts +47 -4
- package/src/decorators/emitCustomEvent.ts +44 -36
- package/src/decorators/index.ts +1 -1
- package/src/decorators/publishSwcAppMessage.ts +1 -1
- package/src/decorators/query.ts +90 -159
- package/src/decorators/queryAll.ts +92 -134
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
- package/src/elements/SwcAppMixin.ts +43 -24
- package/src/examples/RxJSOperatorsExample.ts +279 -0
- package/src/index.ts +2 -0
- package/src/router/ElementRouter.ts +4 -0
- package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
- package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
- package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
|
@@ -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 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);
|
|
@@ -8827,40 +8990,53 @@ function emitCustomEvent(selectorOrTarget, type, options = {}) {
|
|
|
8827
8990
|
const conf = getElementConfig(this);
|
|
8828
8991
|
const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
|
|
8829
8992
|
const eventTargets = [];
|
|
8830
|
-
if (
|
|
8831
|
-
|
|
8832
|
-
else if (
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
if (hostSet.$
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
} else if (
|
|
8841
|
-
if (hostSet.$
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
} else if (
|
|
8993
|
+
if (selector === "$window")
|
|
8994
|
+
eventTargets.push(currentWin);
|
|
8995
|
+
else if (selector === "$document")
|
|
8996
|
+
eventTargets.push(currentWin.document);
|
|
8997
|
+
else if (selector === "$host") {
|
|
8998
|
+
if (hostSet.$host)
|
|
8999
|
+
eventTargets.push(hostSet.$host);
|
|
9000
|
+
} else if (selector === "$parentHost") {
|
|
9001
|
+
if (hostSet.$parentHost)
|
|
9002
|
+
eventTargets.push(hostSet.$parentHost);
|
|
9003
|
+
} else if (selector === "$appHost") {
|
|
9004
|
+
if (hostSet.$appHost)
|
|
9005
|
+
eventTargets.push(hostSet.$appHost);
|
|
9006
|
+
} else if (selector === "$firstHost") {
|
|
9007
|
+
if (hostSet.$firstHost)
|
|
9008
|
+
eventTargets.push(hostSet.$firstHost);
|
|
9009
|
+
} else if (selector === "$lastHost") {
|
|
9010
|
+
if (hostSet.$lastHost)
|
|
9011
|
+
eventTargets.push(hostSet.$lastHost);
|
|
9012
|
+
} else if (selector === "$firstAppHost") {
|
|
9013
|
+
if (hostSet.$firstAppHost)
|
|
9014
|
+
eventTargets.push(hostSet.$firstAppHost);
|
|
9015
|
+
} else if (selector === "$lastAppHost") {
|
|
9016
|
+
if (hostSet.$lastAppHost)
|
|
9017
|
+
eventTargets.push(hostSet.$lastAppHost);
|
|
9018
|
+
} else if (selector === "$hosts") {
|
|
8847
9019
|
hostSet.$hosts.forEach((h) => eventTargets.push(h));
|
|
8848
|
-
} else if (
|
|
9020
|
+
} else if (selector === "$appHosts") {
|
|
8849
9021
|
hostSet.$appHosts.forEach((h) => eventTargets.push(h));
|
|
8850
|
-
} else if (
|
|
9022
|
+
} else if (selector === "$this" || !selector) {
|
|
8851
9023
|
eventTargets.push(this);
|
|
8852
9024
|
} else {
|
|
8853
9025
|
const r = fullOptions.root || "auto";
|
|
8854
9026
|
const searchRoots = [];
|
|
8855
|
-
if (r === "auto")
|
|
8856
|
-
|
|
8857
|
-
else if (r === "
|
|
9027
|
+
if (r === "auto")
|
|
9028
|
+
searchRoots.push(this.shadowRoot || this);
|
|
9029
|
+
else if (r === "light")
|
|
9030
|
+
searchRoots.push(this);
|
|
9031
|
+
else if (r === "shadow" && this.shadowRoot)
|
|
9032
|
+
searchRoots.push(this.shadowRoot);
|
|
8858
9033
|
else if (r === "all") {
|
|
8859
9034
|
searchRoots.push(this);
|
|
8860
|
-
if (this.shadowRoot)
|
|
9035
|
+
if (this.shadowRoot)
|
|
9036
|
+
searchRoots.push(this.shadowRoot);
|
|
8861
9037
|
}
|
|
8862
9038
|
searchRoots.forEach((sr) => {
|
|
8863
|
-
sr.querySelectorAll(
|
|
9039
|
+
sr.querySelectorAll(selector).forEach((el) => eventTargets.push(el));
|
|
8864
9040
|
});
|
|
8865
9041
|
}
|
|
8866
9042
|
eventTargets.forEach((t) => {
|
|
@@ -8884,20 +9060,8 @@ var getEmitCustomEventMetadataList = (target) => {
|
|
|
8884
9060
|
return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
8885
9061
|
};
|
|
8886
9062
|
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
9063
|
|
|
8900
|
-
// src/decorators/
|
|
9064
|
+
// src/decorators/changedAttribute.ts
|
|
8901
9065
|
var ON_ATTRIBUTE_CHANGED_METADATA_KEY = Symbol.for("simple-web-component:on-attribute-changed");
|
|
8902
9066
|
var convertValue = (val, type) => {
|
|
8903
9067
|
if (val === null || val === void 0) return val;
|
|
@@ -8905,7 +9069,7 @@ var convertValue = (val, type) => {
|
|
|
8905
9069
|
if (type === Boolean) return val === "false" || val === "0" ? false : true;
|
|
8906
9070
|
return val;
|
|
8907
9071
|
};
|
|
8908
|
-
function
|
|
9072
|
+
function changedAttribute(attributeName, options = {}) {
|
|
8909
9073
|
return (target, propertyKey) => {
|
|
8910
9074
|
const constructor = target.constructor;
|
|
8911
9075
|
let metaList = ReflectUtils.getOwnMetadata(ON_ATTRIBUTE_CHANGED_METADATA_KEY, constructor);
|
|
@@ -8945,150 +9109,106 @@ var convertAttributeValue = (val, type) => {
|
|
|
8945
9109
|
|
|
8946
9110
|
// src/decorators/query.ts
|
|
8947
9111
|
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
|
-
|
|
9112
|
+
function query(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9113
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9114
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9115
|
+
}
|
|
9116
|
+
if (typeof selectorOrTarget === "string") {
|
|
9117
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9118
|
+
if (descriptor2 !== void 0) {
|
|
9119
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9120
|
+
}
|
|
9121
|
+
const constructor = targetObj.constructor;
|
|
9122
|
+
let queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
|
|
9123
|
+
if (!queries) {
|
|
9124
|
+
queries = [];
|
|
9125
|
+
ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);
|
|
9126
|
+
}
|
|
9127
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9128
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9129
|
+
get() {
|
|
9130
|
+
ensureInit(this);
|
|
9131
|
+
const selector = selectorOrTarget;
|
|
9132
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9133
|
+
const applyRoot = (t) => {
|
|
9134
|
+
if (!t || !(t instanceof HTMLElement))
|
|
9135
|
+
return t;
|
|
9136
|
+
if (r === "auto")
|
|
9137
|
+
return t.shadowRoot || t;
|
|
9138
|
+
if (r === "shadow")
|
|
9139
|
+
return t.shadowRoot;
|
|
9140
|
+
if (r === "light")
|
|
9141
|
+
return t;
|
|
9142
|
+
if (r === "all")
|
|
9143
|
+
return t.shadowRoot || t;
|
|
8967
9144
|
return t;
|
|
8968
|
-
|
|
8969
|
-
|
|
9145
|
+
};
|
|
9146
|
+
const hostSet = SwcUtils.getHostSet(this);
|
|
9147
|
+
if (selector === "$this")
|
|
9148
|
+
return applyRoot(this);
|
|
9149
|
+
if (selector === "$host")
|
|
9150
|
+
return applyRoot(hostSet.$host);
|
|
9151
|
+
if (selector === "$parentHost")
|
|
9152
|
+
return applyRoot(hostSet.$parentHost);
|
|
9153
|
+
if (selector === "$appHost")
|
|
9154
|
+
return applyRoot(hostSet.$appHost);
|
|
9155
|
+
if (selector === "$firstHost")
|
|
9156
|
+
return applyRoot(hostSet.$firstHost);
|
|
9157
|
+
if (selector === "$lastHost")
|
|
9158
|
+
return applyRoot(hostSet.$lastHost);
|
|
9159
|
+
if (selector === "$firstAppHost")
|
|
9160
|
+
return applyRoot(hostSet.$firstAppHost);
|
|
9161
|
+
if (selector === "$lastAppHost")
|
|
9162
|
+
return applyRoot(hostSet.$lastAppHost);
|
|
9163
|
+
const config = getElementConfig(this);
|
|
9164
|
+
const win = config?.window || window;
|
|
9165
|
+
if (selector === "$window")
|
|
9166
|
+
return win;
|
|
9167
|
+
if (selector === "$document")
|
|
9168
|
+
return win.document;
|
|
8970
9169
|
if (r === "shadow")
|
|
8971
|
-
return
|
|
9170
|
+
return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
8972
9171
|
if (r === "light")
|
|
8973
|
-
return
|
|
8974
|
-
if (r === "all")
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
};
|
|
8978
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
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));
|
|
9030
|
-
} else {
|
|
9031
|
-
const el = (this.shadowRoot || this).querySelector(selector);
|
|
9032
|
-
if (el)
|
|
9033
|
-
targets.push(el);
|
|
9172
|
+
return this.querySelector(selector);
|
|
9173
|
+
if (r === "all") {
|
|
9174
|
+
const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9175
|
+
return shadowMatch || this.querySelector(selector);
|
|
9034
9176
|
}
|
|
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
|
-
return query("$document", targetOrOptions);
|
|
9069
|
-
} else {
|
|
9070
|
-
return query("$document", {});
|
|
9071
|
-
}
|
|
9072
|
-
}
|
|
9073
|
-
function queryHost(targetOrOptions, propertyKey) {
|
|
9074
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9075
|
-
return query("$host", {})(targetOrOptions, propertyKey);
|
|
9076
|
-
}
|
|
9077
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9078
|
-
return query("$host", targetOrOptions);
|
|
9079
|
-
} else {
|
|
9080
|
-
return query("$host", {});
|
|
9081
|
-
}
|
|
9082
|
-
}
|
|
9083
|
-
function queryAppHost(targetOrOptions, propertyKey) {
|
|
9084
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9085
|
-
return query("$appHost", {})(targetOrOptions, propertyKey);
|
|
9086
|
-
}
|
|
9087
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9088
|
-
return query("$appHost", targetOrOptions);
|
|
9089
|
-
} else {
|
|
9090
|
-
return query("$appHost", {});
|
|
9177
|
+
return (this.shadowRoot || this).querySelector(selector);
|
|
9178
|
+
},
|
|
9179
|
+
set(nv) {
|
|
9180
|
+
ensureInit(this);
|
|
9181
|
+
if (nv === null || nv === void 0) {
|
|
9182
|
+
const selector = selectorOrTarget;
|
|
9183
|
+
if (selector.startsWith("$") && selector !== "$this")
|
|
9184
|
+
return;
|
|
9185
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9186
|
+
const targets = [];
|
|
9187
|
+
if (r === "shadow") {
|
|
9188
|
+
if (this.shadowRoot?.querySelector(selector))
|
|
9189
|
+
targets.push(this.shadowRoot.querySelector(selector));
|
|
9190
|
+
} else if (r === "light") {
|
|
9191
|
+
if (this.querySelector(selector))
|
|
9192
|
+
targets.push(this.querySelector(selector));
|
|
9193
|
+
} else if (r === "all") {
|
|
9194
|
+
if (this.shadowRoot?.querySelector(selector))
|
|
9195
|
+
targets.push(this.shadowRoot.querySelector(selector));
|
|
9196
|
+
if (this.querySelector(selector))
|
|
9197
|
+
targets.push(this.querySelector(selector));
|
|
9198
|
+
} else {
|
|
9199
|
+
const el = (this.shadowRoot || this).querySelector(selector);
|
|
9200
|
+
if (el)
|
|
9201
|
+
targets.push(el);
|
|
9202
|
+
}
|
|
9203
|
+
targets.forEach((t) => t.remove());
|
|
9204
|
+
}
|
|
9205
|
+
},
|
|
9206
|
+
enumerable: true,
|
|
9207
|
+
configurable: true
|
|
9208
|
+
});
|
|
9209
|
+
};
|
|
9091
9210
|
}
|
|
9211
|
+
return query("$this", selectorOrTarget);
|
|
9092
9212
|
}
|
|
9093
9213
|
var getQueryMetadata = (target) => {
|
|
9094
9214
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9097,139 +9217,115 @@ var getQueryMetadata = (target) => {
|
|
|
9097
9217
|
|
|
9098
9218
|
// src/decorators/queryAll.ts
|
|
9099
9219
|
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
|
-
return [];
|
|
9120
|
-
const items = Array.isArray(t) ? t : [t];
|
|
9121
|
-
const results = [];
|
|
9122
|
-
items.forEach((it) => {
|
|
9123
|
-
if (!(it instanceof HTMLElement)) {
|
|
9124
|
-
results.push(it);
|
|
9125
|
-
return;
|
|
9126
|
-
}
|
|
9127
|
-
if (r === "auto")
|
|
9128
|
-
results.push(it.shadowRoot || it);
|
|
9129
|
-
else {
|
|
9130
|
-
if (r === "light" || r === "all")
|
|
9131
|
-
results.push(it);
|
|
9132
|
-
if ((r === "shadow" || r === "all") && it.shadowRoot)
|
|
9133
|
-
results.push(it.shadowRoot);
|
|
9134
|
-
}
|
|
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) {
|
|
9220
|
+
function queryAll(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9221
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9222
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9223
|
+
}
|
|
9224
|
+
if (typeof selectorOrTarget === "string") {
|
|
9225
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9226
|
+
if (descriptor2 !== void 0) {
|
|
9227
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9228
|
+
}
|
|
9229
|
+
const constructor = targetObj.constructor;
|
|
9230
|
+
let queries = ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
|
|
9231
|
+
if (!queries) {
|
|
9232
|
+
queries = [];
|
|
9233
|
+
ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);
|
|
9234
|
+
}
|
|
9235
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9236
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9237
|
+
get() {
|
|
9238
|
+
ensureInit(this);
|
|
9180
9239
|
const selector = selectorOrTarget;
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9240
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9241
|
+
const applyRoot = (t) => {
|
|
9242
|
+
if (!t)
|
|
9243
|
+
return [];
|
|
9244
|
+
const items = Array.isArray(t) ? t : [t];
|
|
9245
|
+
const results = [];
|
|
9246
|
+
items.forEach((it) => {
|
|
9247
|
+
if (!(it instanceof HTMLElement)) {
|
|
9248
|
+
results.push(it);
|
|
9249
|
+
return;
|
|
9250
|
+
}
|
|
9251
|
+
if (r === "auto")
|
|
9252
|
+
results.push(it.shadowRoot || it);
|
|
9253
|
+
else {
|
|
9254
|
+
if (r === "light" || r === "all")
|
|
9255
|
+
results.push(it);
|
|
9256
|
+
if ((r === "shadow" || r === "all") && it.shadowRoot)
|
|
9257
|
+
results.push(it.shadowRoot);
|
|
9258
|
+
}
|
|
9259
|
+
});
|
|
9260
|
+
return results;
|
|
9261
|
+
};
|
|
9262
|
+
const hostSet = SwcUtils.getHostSet(this);
|
|
9263
|
+
if (selector === "$hosts")
|
|
9264
|
+
return applyRoot(hostSet.$hosts);
|
|
9265
|
+
if (selector === "$appHosts")
|
|
9266
|
+
return applyRoot(hostSet.$appHosts);
|
|
9267
|
+
if (selector === "$host")
|
|
9268
|
+
return applyRoot(hostSet.$host);
|
|
9269
|
+
if (selector === "$parentHost")
|
|
9270
|
+
return applyRoot(hostSet.$parentHost);
|
|
9271
|
+
if (selector === "$appHost")
|
|
9272
|
+
return applyRoot(hostSet.$appHost);
|
|
9273
|
+
if (selector === "$firstHost")
|
|
9274
|
+
return applyRoot(hostSet.$firstHost);
|
|
9275
|
+
if (selector === "$lastHost")
|
|
9276
|
+
return applyRoot(hostSet.$lastHost);
|
|
9277
|
+
if (selector === "$firstAppHost")
|
|
9278
|
+
return applyRoot(hostSet.$firstAppHost);
|
|
9279
|
+
if (selector === "$lastAppHost")
|
|
9280
|
+
return applyRoot(hostSet.$lastAppHost);
|
|
9281
|
+
const config = getElementConfig(this);
|
|
9282
|
+
const win = config?.window || window;
|
|
9283
|
+
if (selector === "$window")
|
|
9284
|
+
return [win];
|
|
9285
|
+
if (selector === "$document")
|
|
9286
|
+
return [win.document];
|
|
9287
|
+
if (selector === "$this")
|
|
9288
|
+
return applyRoot(this);
|
|
9185
9289
|
if (r === "shadow")
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9290
|
+
return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9291
|
+
if (r === "light")
|
|
9292
|
+
return Array.from(this.querySelectorAll(selector));
|
|
9293
|
+
if (r === "all") {
|
|
9190
9294
|
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9191
9295
|
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9192
|
-
|
|
9193
|
-
} else {
|
|
9194
|
-
targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
|
|
9296
|
+
return [...sNodes, ...lNodes];
|
|
9195
9297
|
}
|
|
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
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9226
|
-
return queryAll("$appHost", {})(targetOrOptions, propertyKey);
|
|
9227
|
-
}
|
|
9228
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9229
|
-
return queryAll("$appHost", targetOrOptions);
|
|
9230
|
-
} else {
|
|
9231
|
-
return queryAll("$appHost", {});
|
|
9298
|
+
const root = this.shadowRoot || this;
|
|
9299
|
+
return Array.from(root.querySelectorAll(selector));
|
|
9300
|
+
},
|
|
9301
|
+
set(nv) {
|
|
9302
|
+
ensureInit(this);
|
|
9303
|
+
if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
|
|
9304
|
+
const selector = selectorOrTarget;
|
|
9305
|
+
if (selector.startsWith("$") && selector !== "$this")
|
|
9306
|
+
return;
|
|
9307
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9308
|
+
let targets = [];
|
|
9309
|
+
if (r === "shadow")
|
|
9310
|
+
targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9311
|
+
else if (r === "light")
|
|
9312
|
+
targets = Array.from(this.querySelectorAll(selector));
|
|
9313
|
+
else if (r === "all") {
|
|
9314
|
+
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9315
|
+
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9316
|
+
targets = [...sNodes, ...lNodes];
|
|
9317
|
+
} else {
|
|
9318
|
+
targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
|
|
9319
|
+
}
|
|
9320
|
+
targets.forEach((t) => t.remove());
|
|
9321
|
+
}
|
|
9322
|
+
},
|
|
9323
|
+
enumerable: true,
|
|
9324
|
+
configurable: true
|
|
9325
|
+
});
|
|
9326
|
+
};
|
|
9232
9327
|
}
|
|
9328
|
+
return queryAll("$this", selectorOrTarget);
|
|
9233
9329
|
}
|
|
9234
9330
|
var getQueryAllMetadata = (target) => {
|
|
9235
9331
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9557,35 +9653,20 @@ function applyProperty(selector, targetPropertyKeyOrOptions, options) {
|
|
|
9557
9653
|
});
|
|
9558
9654
|
};
|
|
9559
9655
|
}
|
|
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);
|
|
9656
|
+
function property(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor) {
|
|
9657
|
+
if (optionsOrDescriptor !== void 0 && (typeof targetPropertyKeyOrOptions === "string" || typeof targetPropertyKeyOrOptions === "symbol")) {
|
|
9658
|
+
return applyProperty("$this", void 0, {})(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9566
9659
|
}
|
|
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, {});
|
|
9660
|
+
if (typeof selectorOrTarget === "string") {
|
|
9661
|
+
return applyProperty(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9573
9662
|
}
|
|
9663
|
+
return applyProperty("$this", void 0, selectorOrTarget);
|
|
9574
9664
|
}
|
|
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, {});
|
|
9665
|
+
function setProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined) {
|
|
9666
|
+
if (typeof selectorOrOptions === "string") {
|
|
9667
|
+
return applyProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined);
|
|
9588
9668
|
}
|
|
9669
|
+
return applyProperty("$this", void 0, selectorOrOptions);
|
|
9589
9670
|
}
|
|
9590
9671
|
var findAllPropertyMetadata = (target) => {
|
|
9591
9672
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -10010,8 +10091,32 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10010
10091
|
const args = { event: event2, ...currentHostSet, $el: t, $root: t };
|
|
10011
10092
|
await this[meta.propertyKey](event2, { currentHostSet, $$matchedElement: event2.currentTarget }, args);
|
|
10012
10093
|
};
|
|
10013
|
-
|
|
10014
|
-
|
|
10094
|
+
const eventSubject = new Subject();
|
|
10095
|
+
let eventStream = eventSubject;
|
|
10096
|
+
if (options.debounceTime !== void 0 && options.debounceTime > 0) {
|
|
10097
|
+
eventStream = eventStream.pipe(debounceTime(options.debounceTime));
|
|
10098
|
+
}
|
|
10099
|
+
if (options.throttleTime !== void 0 && options.throttleTime > 0) {
|
|
10100
|
+
eventStream = eventStream.pipe(throttleTime(options.throttleTime));
|
|
10101
|
+
}
|
|
10102
|
+
if (options.distinctUntilChanged !== void 0 && options.distinctUntilChanged !== false) {
|
|
10103
|
+
if (typeof options.distinctUntilChanged === "function") {
|
|
10104
|
+
eventStream = eventStream.pipe(distinctUntilChanged(options.distinctUntilChanged));
|
|
10105
|
+
} else {
|
|
10106
|
+
eventStream = eventStream.pipe(distinctUntilChanged());
|
|
10107
|
+
}
|
|
10108
|
+
}
|
|
10109
|
+
const subscription = eventStream.subscribe({
|
|
10110
|
+
next: (event2) => {
|
|
10111
|
+
handler(event2).catch((err) => console.error("Event handler error:", err));
|
|
10112
|
+
},
|
|
10113
|
+
error: (err) => console.error("Event stream error:", err)
|
|
10114
|
+
});
|
|
10115
|
+
const wrappedHandler = (event2) => {
|
|
10116
|
+
eventSubject.next(event2);
|
|
10117
|
+
};
|
|
10118
|
+
t.addEventListener(type, wrappedHandler, opts);
|
|
10119
|
+
this._boundListeners.push({ target: t, type, handler: wrappedHandler, options: opts, subscription });
|
|
10015
10120
|
});
|
|
10016
10121
|
});
|
|
10017
10122
|
if (originalConnected) await originalConnected.apply(this);
|
|
@@ -10051,7 +10156,12 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10051
10156
|
const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);
|
|
10052
10157
|
for (const m of bMethods) this._invokeLifecycleMethod(m.propertyKey, helperHostSet);
|
|
10053
10158
|
if (this._boundListeners) {
|
|
10054
|
-
this._boundListeners.forEach((l) =>
|
|
10159
|
+
this._boundListeners.forEach((l) => {
|
|
10160
|
+
l.target.removeEventListener(l.type, l.handler, l.options);
|
|
10161
|
+
if (l.subscription && typeof l.subscription.unsubscribe === "function") {
|
|
10162
|
+
l.subscription.unsubscribe();
|
|
10163
|
+
}
|
|
10164
|
+
});
|
|
10055
10165
|
this._boundListeners = [];
|
|
10056
10166
|
}
|
|
10057
10167
|
new ElementApply(this, { id: this._swcId }).removeAllEventListener();
|
|
@@ -10134,6 +10244,13 @@ var elementDefine = (name, config = {}) => (constructor) => {
|
|
|
10134
10244
|
|
|
10135
10245
|
// src/decorators/applyAttribute.ts
|
|
10136
10246
|
var ATTRIBUTE_METADATA_KEY = Symbol.for("simple-web-component:attribute");
|
|
10247
|
+
var isCssSelector = (str) => {
|
|
10248
|
+
if (!str) return false;
|
|
10249
|
+
if (str.startsWith("$")) return true;
|
|
10250
|
+
if (/^[#.\[\:>+~]/.test(str)) return true;
|
|
10251
|
+
if (/[>+~:\[\]]/.test(str)) return true;
|
|
10252
|
+
return false;
|
|
10253
|
+
};
|
|
10137
10254
|
var convertValue2 = (val, type) => {
|
|
10138
10255
|
if (val === null || val === void 0) return val;
|
|
10139
10256
|
if (type === Number) return Number(val);
|
|
@@ -10304,35 +10421,32 @@ function applyAttribute(selector, targetAttributeNameOrOptions, options) {
|
|
|
10304
10421
|
});
|
|
10305
10422
|
};
|
|
10306
10423
|
}
|
|
10307
|
-
function attribute(
|
|
10308
|
-
|
|
10309
|
-
}
|
|
10310
|
-
|
|
10311
|
-
if (typeof
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
return applyAttribute("$this", void 0, {});
|
|
10424
|
+
function attribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor) {
|
|
10425
|
+
if (optionsOrDescriptor !== void 0 && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
|
|
10426
|
+
return applyAttribute("$this", void 0, {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10427
|
+
}
|
|
10428
|
+
if (typeof selectorOrAttributeOrTarget === "string") {
|
|
10429
|
+
const isSelector = isCssSelector(selectorOrAttributeOrTarget);
|
|
10430
|
+
if (isSelector) {
|
|
10431
|
+
return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10432
|
+
} else {
|
|
10433
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10434
|
+
return applyAttribute("$this", selectorOrAttributeOrTarget, options);
|
|
10435
|
+
}
|
|
10320
10436
|
}
|
|
10437
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrTarget);
|
|
10321
10438
|
}
|
|
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, {});
|
|
10439
|
+
function setAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined) {
|
|
10440
|
+
if (typeof selectorOrAttributeOrOptions === "string") {
|
|
10441
|
+
const isSelector = isCssSelector(selectorOrAttributeOrOptions);
|
|
10442
|
+
if (isSelector) {
|
|
10443
|
+
return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
|
|
10444
|
+
} else {
|
|
10445
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10446
|
+
return applyAttribute("$this", selectorOrAttributeOrOptions, options);
|
|
10447
|
+
}
|
|
10335
10448
|
}
|
|
10449
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrOptions);
|
|
10336
10450
|
}
|
|
10337
10451
|
var findAllAttributeMetadata = (target) => {
|
|
10338
10452
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -10350,6 +10464,10 @@ var findAllAttributeApplyMetadata = (target) => {
|
|
|
10350
10464
|
var APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
|
|
10351
10465
|
var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
10352
10466
|
if (!targetEl) return;
|
|
10467
|
+
if (pos === "clearChildren") {
|
|
10468
|
+
targetEl.replaceChildren();
|
|
10469
|
+
return [];
|
|
10470
|
+
}
|
|
10353
10471
|
const doc = win.document;
|
|
10354
10472
|
const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
|
|
10355
10473
|
const id = currentThis._swcId;
|
|
@@ -10385,7 +10503,16 @@ var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
|
10385
10503
|
new ElementApply(targetEl, { id }).apply({ target: "noInitialized", context: stateContext, bind: currentThis });
|
|
10386
10504
|
return nodes;
|
|
10387
10505
|
};
|
|
10388
|
-
function applyNode(
|
|
10506
|
+
function applyNode(selectorOrOptions, maybeOptions) {
|
|
10507
|
+
let selector;
|
|
10508
|
+
let options;
|
|
10509
|
+
if (typeof selectorOrOptions === "string") {
|
|
10510
|
+
selector = selectorOrOptions;
|
|
10511
|
+
options = maybeOptions || { position: "replaceChildren" };
|
|
10512
|
+
} else {
|
|
10513
|
+
selector = "$this";
|
|
10514
|
+
options = selectorOrOptions || { position: "replaceChildren" };
|
|
10515
|
+
}
|
|
10389
10516
|
return (targetObj, propertyKey, descriptor) => {
|
|
10390
10517
|
const constructor = targetObj.constructor;
|
|
10391
10518
|
let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor);
|
|
@@ -10456,92 +10583,141 @@ function applyNode(selector, options = { position: "replaceChildren" }) {
|
|
|
10456
10583
|
};
|
|
10457
10584
|
};
|
|
10458
10585
|
}
|
|
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 });
|
|
10586
|
+
function replaceChildren(selectorOrOptions, maybeOptions, descriptor) {
|
|
10587
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10588
|
+
return applyNode({ position: "replaceChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10589
|
+
}
|
|
10590
|
+
if (typeof selectorOrOptions === "string") {
|
|
10591
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren" });
|
|
10592
|
+
}
|
|
10593
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren" });
|
|
10482
10594
|
}
|
|
10483
|
-
function
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10595
|
+
function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
|
|
10596
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10597
|
+
return applyNode({ position: "clearChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10598
|
+
}
|
|
10599
|
+
if (typeof selectorOrOptions === "string") {
|
|
10600
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren" });
|
|
10601
|
+
}
|
|
10602
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren" });
|
|
10488
10603
|
}
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
if (
|
|
10492
|
-
|
|
10493
|
-
|
|
10604
|
+
var clearNode = clearChildrenNode;
|
|
10605
|
+
function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
|
|
10606
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10607
|
+
return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10608
|
+
}
|
|
10609
|
+
if (typeof selectorOrOptions === "string") {
|
|
10610
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml" });
|
|
10611
|
+
}
|
|
10612
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml" });
|
|
10494
10613
|
}
|
|
10495
|
-
function
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10614
|
+
function innerHtmlLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10615
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10616
|
+
return applyNode({ position: "innerHtml", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10617
|
+
}
|
|
10618
|
+
if (typeof selectorOrOptions === "string") {
|
|
10619
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "light" });
|
|
10620
|
+
}
|
|
10621
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "light" });
|
|
10500
10622
|
}
|
|
10501
|
-
function
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10623
|
+
function innerHtmlShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10624
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10625
|
+
return applyNode({ position: "innerHtml", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10626
|
+
}
|
|
10627
|
+
if (typeof selectorOrOptions === "string") {
|
|
10628
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "shadow" });
|
|
10629
|
+
}
|
|
10630
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "shadow" });
|
|
10506
10631
|
}
|
|
10507
|
-
function
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10632
|
+
function innerText(selectorOrOptions, maybeOptions, descriptor) {
|
|
10633
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10634
|
+
return applyNode({ position: "innerText" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10635
|
+
}
|
|
10636
|
+
if (typeof selectorOrOptions === "string") {
|
|
10637
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText" });
|
|
10638
|
+
}
|
|
10639
|
+
return applyNode({ ...selectorOrOptions, position: "innerText" });
|
|
10512
10640
|
}
|
|
10513
|
-
function
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10641
|
+
function innerTextLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10642
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10643
|
+
return applyNode({ position: "innerText", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10644
|
+
}
|
|
10645
|
+
if (typeof selectorOrOptions === "string") {
|
|
10646
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "light" });
|
|
10647
|
+
}
|
|
10648
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "light" });
|
|
10518
10649
|
}
|
|
10519
|
-
function
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10650
|
+
function innerTextShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10651
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10652
|
+
return applyNode({ position: "innerText", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10653
|
+
}
|
|
10654
|
+
if (typeof selectorOrOptions === "string") {
|
|
10655
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "shadow" });
|
|
10656
|
+
}
|
|
10657
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "shadow" });
|
|
10524
10658
|
}
|
|
10525
|
-
function
|
|
10526
|
-
|
|
10659
|
+
function insertBeforeEnd(selectorOrOptions, maybeOptions, descriptor) {
|
|
10660
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10661
|
+
return applyNode({ position: "beforeEnd" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10662
|
+
}
|
|
10663
|
+
if (typeof selectorOrOptions === "string") {
|
|
10664
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd" });
|
|
10665
|
+
}
|
|
10666
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd" });
|
|
10527
10667
|
}
|
|
10528
|
-
function
|
|
10529
|
-
|
|
10668
|
+
function insertBeforeEndLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10669
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10670
|
+
return applyNode({ position: "beforeEnd", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10671
|
+
}
|
|
10672
|
+
if (typeof selectorOrOptions === "string") {
|
|
10673
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "light" });
|
|
10674
|
+
}
|
|
10675
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "light" });
|
|
10530
10676
|
}
|
|
10531
|
-
function
|
|
10532
|
-
|
|
10677
|
+
function insertBeforeEndShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10678
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10679
|
+
return applyNode({ position: "beforeEnd", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10680
|
+
}
|
|
10681
|
+
if (typeof selectorOrOptions === "string") {
|
|
10682
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "shadow" });
|
|
10683
|
+
}
|
|
10684
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "shadow" });
|
|
10533
10685
|
}
|
|
10534
|
-
function
|
|
10535
|
-
|
|
10686
|
+
function insertAfterBegin(selectorOrOptions, maybeOptions, descriptor) {
|
|
10687
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10688
|
+
return applyNode({ position: "afterBegin" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10689
|
+
}
|
|
10690
|
+
if (typeof selectorOrOptions === "string") {
|
|
10691
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin" });
|
|
10692
|
+
}
|
|
10693
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin" });
|
|
10536
10694
|
}
|
|
10537
|
-
function
|
|
10538
|
-
|
|
10695
|
+
function insertAfterBeginLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10696
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10697
|
+
return applyNode({ position: "afterBegin", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10698
|
+
}
|
|
10699
|
+
if (typeof selectorOrOptions === "string") {
|
|
10700
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin", root: "light" });
|
|
10701
|
+
}
|
|
10702
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin", root: "light" });
|
|
10539
10703
|
}
|
|
10540
|
-
function
|
|
10541
|
-
|
|
10704
|
+
function replaceChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10705
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10706
|
+
return applyNode({ position: "replaceChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10707
|
+
}
|
|
10708
|
+
if (typeof selectorOrOptions === "string") {
|
|
10709
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren", root: "light" });
|
|
10710
|
+
}
|
|
10711
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren", root: "light" });
|
|
10542
10712
|
}
|
|
10543
|
-
function
|
|
10544
|
-
|
|
10713
|
+
function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10714
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10715
|
+
return applyNode({ position: "clearChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10716
|
+
}
|
|
10717
|
+
if (typeof selectorOrOptions === "string") {
|
|
10718
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren", root: "light" });
|
|
10719
|
+
}
|
|
10720
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren", root: "light" });
|
|
10545
10721
|
}
|
|
10546
10722
|
var findAllApplyNodeMetadata = (target) => {
|
|
10547
10723
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -10672,22 +10848,64 @@ function createClassDecorator(action) {
|
|
|
10672
10848
|
};
|
|
10673
10849
|
};
|
|
10674
10850
|
}
|
|
10675
|
-
function applyClass(
|
|
10676
|
-
|
|
10677
|
-
}
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10851
|
+
function applyClass(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
10852
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
10853
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
10854
|
+
}
|
|
10855
|
+
if (typeof selectorOrTarget === "string") {
|
|
10856
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
10857
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
10858
|
+
return createClassDecorator(action2)(selectorOrTarget, options2);
|
|
10859
|
+
}
|
|
10860
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
10861
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
10684
10862
|
return createClassDecorator(action)("$this", options);
|
|
10685
10863
|
}
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10864
|
+
function setClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
10865
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
10866
|
+
return createClassDecorator("set")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10867
|
+
}
|
|
10868
|
+
if (typeof selectorOrTarget === "string") {
|
|
10869
|
+
return createClassDecorator("set")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10870
|
+
}
|
|
10871
|
+
return createClassDecorator("set")("$this", selectorOrTarget);
|
|
10872
|
+
}
|
|
10873
|
+
function updateClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
10874
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
10875
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10876
|
+
}
|
|
10877
|
+
if (typeof selectorOrTarget === "string") {
|
|
10878
|
+
return createClassDecorator("update")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10879
|
+
}
|
|
10880
|
+
return createClassDecorator("update")("$this", selectorOrTarget);
|
|
10881
|
+
}
|
|
10882
|
+
function addClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
10883
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
10884
|
+
return createClassDecorator("add")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10885
|
+
}
|
|
10886
|
+
if (typeof selectorOrTarget === "string") {
|
|
10887
|
+
return createClassDecorator("add")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10888
|
+
}
|
|
10889
|
+
return createClassDecorator("add")("$this", selectorOrTarget);
|
|
10890
|
+
}
|
|
10891
|
+
function removeClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
10892
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
10893
|
+
return createClassDecorator("remove")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10894
|
+
}
|
|
10895
|
+
if (typeof selectorOrTarget === "string") {
|
|
10896
|
+
return createClassDecorator("remove")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10897
|
+
}
|
|
10898
|
+
return createClassDecorator("remove")("$this", selectorOrTarget);
|
|
10899
|
+
}
|
|
10900
|
+
function toggleClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
10901
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
10902
|
+
return createClassDecorator("toggle")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10903
|
+
}
|
|
10904
|
+
if (typeof selectorOrTarget === "string") {
|
|
10905
|
+
return createClassDecorator("toggle")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
10906
|
+
}
|
|
10907
|
+
return createClassDecorator("toggle")("$this", selectorOrTarget);
|
|
10908
|
+
}
|
|
10691
10909
|
var findAllClassMetadata = (target) => {
|
|
10692
10910
|
const result = /* @__PURE__ */ new Map();
|
|
10693
10911
|
const maps = ReflectUtils.findAllMetadata(CLASS_METADATA_KEY, target);
|
|
@@ -10796,18 +11014,46 @@ function createStyleDecorator(action) {
|
|
|
10796
11014
|
};
|
|
10797
11015
|
};
|
|
10798
11016
|
}
|
|
10799
|
-
function applyStyle(
|
|
10800
|
-
|
|
10801
|
-
}
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
11017
|
+
function applyStyle(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
11018
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
11019
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
11020
|
+
}
|
|
11021
|
+
if (typeof selectorOrTarget === "string") {
|
|
11022
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
11023
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
11024
|
+
return createStyleDecorator(action2)(selectorOrTarget, options2);
|
|
11025
|
+
}
|
|
11026
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
11027
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
10806
11028
|
return createStyleDecorator(action)("$this", options);
|
|
10807
11029
|
}
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
11030
|
+
function setStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11031
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11032
|
+
return createStyleDecorator("set")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11033
|
+
}
|
|
11034
|
+
if (typeof selectorOrTarget === "string") {
|
|
11035
|
+
return createStyleDecorator("set")(selectorOrTarget, optionsOrPropertyKey);
|
|
11036
|
+
}
|
|
11037
|
+
return createStyleDecorator("set")("$this", selectorOrTarget);
|
|
11038
|
+
}
|
|
11039
|
+
function updateStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11040
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11041
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11042
|
+
}
|
|
11043
|
+
if (typeof selectorOrTarget === "string") {
|
|
11044
|
+
return createStyleDecorator("update")(selectorOrTarget, optionsOrPropertyKey);
|
|
11045
|
+
}
|
|
11046
|
+
return createStyleDecorator("update")("$this", selectorOrTarget);
|
|
11047
|
+
}
|
|
11048
|
+
function removeStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11049
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11050
|
+
return createStyleDecorator("remove")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11051
|
+
}
|
|
11052
|
+
if (typeof selectorOrTarget === "string") {
|
|
11053
|
+
return createStyleDecorator("remove")(selectorOrTarget, optionsOrPropertyKey);
|
|
11054
|
+
}
|
|
11055
|
+
return createStyleDecorator("remove")("$this", selectorOrTarget);
|
|
11056
|
+
}
|
|
10811
11057
|
var findAllStyleMetadata = (target) => {
|
|
10812
11058
|
const result = /* @__PURE__ */ new Map();
|
|
10813
11059
|
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
@@ -10855,6 +11101,7 @@ function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOr
|
|
|
10855
11101
|
}
|
|
10856
11102
|
return createSubscribeSwcAppRouteChangeWhileConnected(options);
|
|
10857
11103
|
}
|
|
11104
|
+
var changedRoute = subscribeSwcAppRouteChangeWhileConnected;
|
|
10858
11105
|
var getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
|
|
10859
11106
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10860
11107
|
const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -10895,6 +11142,7 @@ function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions, opti
|
|
|
10895
11142
|
}
|
|
10896
11143
|
return createSubscribeSwcAppMessageWhileConnected(options, messageType);
|
|
10897
11144
|
}
|
|
11145
|
+
var receiveMessage = subscribeSwcAppMessageWhileConnected;
|
|
10898
11146
|
var getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
|
|
10899
11147
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10900
11148
|
return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -10924,7 +11172,7 @@ function createPublishSwcAppMessage(messageType, options) {
|
|
|
10924
11172
|
}
|
|
10925
11173
|
return v;
|
|
10926
11174
|
};
|
|
10927
|
-
const
|
|
11175
|
+
const publishMessage2 = (data) => {
|
|
10928
11176
|
const appHost = SwcUtils.getAppHost(this);
|
|
10929
11177
|
if (appHost) {
|
|
10930
11178
|
appHost.publishMessage({
|
|
@@ -10937,13 +11185,13 @@ function createPublishSwcAppMessage(messageType, options) {
|
|
|
10937
11185
|
if (result instanceof Promise) {
|
|
10938
11186
|
result.then((data) => {
|
|
10939
11187
|
const extracted = extractValue(data);
|
|
10940
|
-
|
|
11188
|
+
publishMessage2(extracted);
|
|
10941
11189
|
}).catch((err) => {
|
|
10942
11190
|
console.warn("publishSwcAppMessage async error:", err);
|
|
10943
11191
|
});
|
|
10944
11192
|
} else {
|
|
10945
11193
|
const extracted = extractValue(result);
|
|
10946
|
-
|
|
11194
|
+
publishMessage2(extracted);
|
|
10947
11195
|
}
|
|
10948
11196
|
return result;
|
|
10949
11197
|
};
|
|
@@ -10968,7 +11216,7 @@ function publishSwcAppMessage(targetOrMessageTypeOrOptions, propertyKeyOrOptions
|
|
|
10968
11216
|
}
|
|
10969
11217
|
return createPublishSwcAppMessage(messageType, options);
|
|
10970
11218
|
}
|
|
10971
|
-
var
|
|
11219
|
+
var publishMessage = publishSwcAppMessage;
|
|
10972
11220
|
var getPublishSwcAppMessageMetadata = (target) => {
|
|
10973
11221
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
10974
11222
|
return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
@@ -13085,6 +13333,10 @@ var ElementRouter = class extends Router {
|
|
|
13085
13333
|
super(config);
|
|
13086
13334
|
__publicField(this, "_history", []);
|
|
13087
13335
|
__publicField(this, "_currentIndex", -1);
|
|
13336
|
+
if (config.firstUrl) {
|
|
13337
|
+
this._history.push({ url: config.firstUrl, data: null, title: void 0 });
|
|
13338
|
+
this._currentIndex = 0;
|
|
13339
|
+
}
|
|
13088
13340
|
}
|
|
13089
13341
|
// Override pushState to manage internal history
|
|
13090
13342
|
pushState(data, title, path, config) {
|
|
@@ -13256,7 +13508,9 @@ var SwcAppEngine = class {
|
|
|
13256
13508
|
if (this.router) otherInstanceSim.set(Router, this.router);
|
|
13257
13509
|
this.simpleApplication.run(otherInstanceSim);
|
|
13258
13510
|
if (this._config.onStartedLazyDefineComponent) {
|
|
13259
|
-
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) =>
|
|
13511
|
+
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) => {
|
|
13512
|
+
it(this._config.window);
|
|
13513
|
+
}));
|
|
13260
13514
|
}
|
|
13261
13515
|
if (this._config.onEngineStarted) {
|
|
13262
13516
|
await this._config.onEngineStarted(this.simpleApplication, this.host);
|
|
@@ -13333,6 +13587,13 @@ function SwcAppMixin(Base) {
|
|
|
13333
13587
|
const methodName = metadata.propertyKey;
|
|
13334
13588
|
let pathPattern = metadata.options?.path;
|
|
13335
13589
|
const filter = metadata.options?.filter;
|
|
13590
|
+
const extractValue = (v) => {
|
|
13591
|
+
const keyToUse = metadata.options?.valueKey ?? SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;
|
|
13592
|
+
if (v && typeof v === "object" && keyToUse in v) {
|
|
13593
|
+
return v[keyToUse];
|
|
13594
|
+
}
|
|
13595
|
+
return v;
|
|
13596
|
+
};
|
|
13336
13597
|
if (typeof pathPattern === "function") {
|
|
13337
13598
|
pathPattern = pathPattern(instance);
|
|
13338
13599
|
}
|
|
@@ -13357,7 +13618,7 @@ function SwcAppMixin(Base) {
|
|
|
13357
13618
|
const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);
|
|
13358
13619
|
const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
|
|
13359
13620
|
if (pathMatched && filterPassed && instance[methodName]) {
|
|
13360
|
-
const result = await instance[methodName]({ ...re, pathData });
|
|
13621
|
+
const result = extractValue(await instance[methodName]({ ...re, pathData }));
|
|
13361
13622
|
if (result !== void 0 && result !== null) {
|
|
13362
13623
|
break;
|
|
13363
13624
|
}
|
|
@@ -13472,7 +13733,15 @@ function SwcAppMixin(Base) {
|
|
|
13472
13733
|
context: this,
|
|
13473
13734
|
args: SwcUtils.getHelperAndHostSet(win, this)
|
|
13474
13735
|
});
|
|
13475
|
-
|
|
13736
|
+
if (userConfig instanceof Promise) {
|
|
13737
|
+
userConfig.then((resolvedConfig) => {
|
|
13738
|
+
this.connect(resolvedConfig);
|
|
13739
|
+
}).catch((e) => {
|
|
13740
|
+
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13741
|
+
});
|
|
13742
|
+
} else {
|
|
13743
|
+
this.connect(userConfig);
|
|
13744
|
+
}
|
|
13476
13745
|
} catch (e) {
|
|
13477
13746
|
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13478
13747
|
}
|
|
@@ -13745,6 +14014,7 @@ export {
|
|
|
13745
14014
|
SwcAppAside,
|
|
13746
14015
|
SwcAppBody,
|
|
13747
14016
|
SwcAppDiv,
|
|
14017
|
+
SwcAppEngine,
|
|
13748
14018
|
SwcAppFooter,
|
|
13749
14019
|
SwcAppHeader,
|
|
13750
14020
|
SwcAppMain,
|
|
@@ -13753,7 +14023,6 @@ export {
|
|
|
13753
14023
|
SwcAppSection,
|
|
13754
14024
|
SwcUtils,
|
|
13755
14025
|
addClass,
|
|
13756
|
-
addClassThis,
|
|
13757
14026
|
addEventListener,
|
|
13758
14027
|
addEventListenerAppHost,
|
|
13759
14028
|
addEventListenerDelegate,
|
|
@@ -13763,28 +14032,21 @@ export {
|
|
|
13763
14032
|
addEventListenerDocument,
|
|
13764
14033
|
addEventListenerThis,
|
|
13765
14034
|
addEventListenerWindow,
|
|
13766
|
-
afterBeginLightNodeThis,
|
|
13767
|
-
afterBeginNodeThis,
|
|
13768
|
-
allAppHost,
|
|
13769
|
-
allParentHost,
|
|
13770
14035
|
appendHtmlSlot,
|
|
13771
14036
|
appendSlot,
|
|
13772
14037
|
appendTextSlot,
|
|
13773
14038
|
applyAttribute,
|
|
13774
14039
|
applyClass,
|
|
13775
|
-
applyClassThis,
|
|
13776
14040
|
applyNode,
|
|
13777
|
-
applyNodeThis,
|
|
13778
14041
|
applyProperty,
|
|
13779
14042
|
applySlot,
|
|
13780
14043
|
applyStyle,
|
|
13781
|
-
applyStyleThis,
|
|
13782
14044
|
attribute,
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
14045
|
+
changedAttribute,
|
|
14046
|
+
changedRoute,
|
|
14047
|
+
clearChildrenLight,
|
|
14048
|
+
clearChildrenNode,
|
|
14049
|
+
clearNode,
|
|
13788
14050
|
clearSlot,
|
|
13789
14051
|
commentNode,
|
|
13790
14052
|
convertAttributeValue,
|
|
@@ -13804,7 +14066,6 @@ export {
|
|
|
13804
14066
|
elementDefine,
|
|
13805
14067
|
emit,
|
|
13806
14068
|
emitCustomEvent,
|
|
13807
|
-
emitCustomEventThis,
|
|
13808
14069
|
ensureInit,
|
|
13809
14070
|
event,
|
|
13810
14071
|
eventDelegate,
|
|
@@ -13847,15 +14108,17 @@ export {
|
|
|
13847
14108
|
htmlSectionElement,
|
|
13848
14109
|
htmlSpanElement,
|
|
13849
14110
|
htmlUlElement,
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
14111
|
+
innerHtml,
|
|
14112
|
+
innerHtmlLight,
|
|
14113
|
+
innerHtmlShadow,
|
|
14114
|
+
innerText,
|
|
14115
|
+
innerTextLight,
|
|
14116
|
+
innerTextShadow,
|
|
14117
|
+
insertAfterBegin,
|
|
14118
|
+
insertAfterBeginLight,
|
|
14119
|
+
insertBeforeEnd,
|
|
14120
|
+
insertBeforeEndLight,
|
|
14121
|
+
insertBeforeEndShadow,
|
|
13859
14122
|
isSSR,
|
|
13860
14123
|
onAdopted,
|
|
13861
14124
|
onAdoptedAfter,
|
|
@@ -13875,39 +14138,26 @@ export {
|
|
|
13875
14138
|
prependSlot,
|
|
13876
14139
|
prependTextSlot,
|
|
13877
14140
|
property,
|
|
13878
|
-
|
|
13879
|
-
publish,
|
|
14141
|
+
publishMessage,
|
|
13880
14142
|
publishSwcAppMessage,
|
|
13881
14143
|
query,
|
|
13882
14144
|
queryAll,
|
|
13883
|
-
|
|
13884
|
-
queryAppHost,
|
|
13885
|
-
queryDocument,
|
|
13886
|
-
queryHost,
|
|
13887
|
-
queryThis,
|
|
13888
|
-
queryWindow,
|
|
14145
|
+
receiveMessage,
|
|
13889
14146
|
removeClass,
|
|
13890
|
-
removeClassThis,
|
|
13891
14147
|
removeSSRAttribute,
|
|
13892
14148
|
removeStyle,
|
|
13893
|
-
|
|
14149
|
+
replaceChildren,
|
|
13894
14150
|
replaceChildrenHtmlSlot,
|
|
13895
|
-
|
|
13896
|
-
replaceChildrenNode,
|
|
13897
|
-
replaceChildrenNodeThis,
|
|
14151
|
+
replaceChildrenLight,
|
|
13898
14152
|
replaceChildrenSlot,
|
|
13899
14153
|
replaceChildrenTextSlot,
|
|
13900
14154
|
resolveAttributeTargets,
|
|
13901
14155
|
resolvePropertyTargets,
|
|
13902
14156
|
setAttribute,
|
|
13903
|
-
setAttributeThis,
|
|
13904
14157
|
setClass,
|
|
13905
|
-
setClassThis,
|
|
13906
14158
|
setProperty,
|
|
13907
|
-
setPropertyThis,
|
|
13908
14159
|
setSSRAttribute,
|
|
13909
14160
|
setStyle,
|
|
13910
|
-
setStyleThis,
|
|
13911
14161
|
state,
|
|
13912
14162
|
subscribeSwcAppMessageWhileConnected,
|
|
13913
14163
|
subscribeSwcAppRouteChangeWhileConnected,
|
|
@@ -13924,11 +14174,8 @@ export {
|
|
|
13924
14174
|
swcAppTagName,
|
|
13925
14175
|
textNode,
|
|
13926
14176
|
toggleClass,
|
|
13927
|
-
toggleClassThis,
|
|
13928
14177
|
updateClass,
|
|
13929
|
-
|
|
13930
|
-
updateStyle,
|
|
13931
|
-
updateStyleThis
|
|
14178
|
+
updateStyle
|
|
13932
14179
|
};
|
|
13933
14180
|
/*! Bundled license information:
|
|
13934
14181
|
|