@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
|
@@ -1158,6 +1158,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1158
1158
|
SwcAppAside: () => SwcAppAside,
|
|
1159
1159
|
SwcAppBody: () => SwcAppBody,
|
|
1160
1160
|
SwcAppDiv: () => SwcAppDiv,
|
|
1161
|
+
SwcAppEngine: () => SwcAppEngine,
|
|
1161
1162
|
SwcAppFooter: () => SwcAppFooter,
|
|
1162
1163
|
SwcAppHeader: () => SwcAppHeader,
|
|
1163
1164
|
SwcAppMain: () => SwcAppMain,
|
|
@@ -1166,7 +1167,6 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1166
1167
|
SwcAppSection: () => SwcAppSection,
|
|
1167
1168
|
SwcUtils: () => SwcUtils,
|
|
1168
1169
|
addClass: () => addClass,
|
|
1169
|
-
addClassThis: () => addClassThis,
|
|
1170
1170
|
addEventListener: () => addEventListener,
|
|
1171
1171
|
addEventListenerAppHost: () => addEventListenerAppHost,
|
|
1172
1172
|
addEventListenerDelegate: () => addEventListenerDelegate,
|
|
@@ -1176,28 +1176,21 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1176
1176
|
addEventListenerDocument: () => addEventListenerDocument,
|
|
1177
1177
|
addEventListenerThis: () => addEventListenerThis,
|
|
1178
1178
|
addEventListenerWindow: () => addEventListenerWindow,
|
|
1179
|
-
afterBeginLightNodeThis: () => afterBeginLightNodeThis,
|
|
1180
|
-
afterBeginNodeThis: () => afterBeginNodeThis,
|
|
1181
|
-
allAppHost: () => allAppHost,
|
|
1182
|
-
allParentHost: () => allParentHost,
|
|
1183
1179
|
appendHtmlSlot: () => appendHtmlSlot,
|
|
1184
1180
|
appendSlot: () => appendSlot,
|
|
1185
1181
|
appendTextSlot: () => appendTextSlot,
|
|
1186
1182
|
applyAttribute: () => applyAttribute,
|
|
1187
1183
|
applyClass: () => applyClass,
|
|
1188
|
-
applyClassThis: () => applyClassThis,
|
|
1189
1184
|
applyNode: () => applyNode,
|
|
1190
|
-
applyNodeThis: () => applyNodeThis,
|
|
1191
1185
|
applyProperty: () => applyProperty,
|
|
1192
1186
|
applySlot: () => applySlot,
|
|
1193
1187
|
applyStyle: () => applyStyle,
|
|
1194
|
-
applyStyleThis: () => applyStyleThis,
|
|
1195
1188
|
attribute: () => attribute,
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1189
|
+
changedAttribute: () => changedAttribute,
|
|
1190
|
+
changedRoute: () => changedRoute,
|
|
1191
|
+
clearChildrenLight: () => clearChildrenLight,
|
|
1192
|
+
clearChildrenNode: () => clearChildrenNode,
|
|
1193
|
+
clearNode: () => clearNode,
|
|
1201
1194
|
clearSlot: () => clearSlot,
|
|
1202
1195
|
commentNode: () => commentNode,
|
|
1203
1196
|
convertAttributeValue: () => convertAttributeValue,
|
|
@@ -1217,7 +1210,6 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1217
1210
|
elementDefine: () => elementDefine,
|
|
1218
1211
|
emit: () => emit,
|
|
1219
1212
|
emitCustomEvent: () => emitCustomEvent,
|
|
1220
|
-
emitCustomEventThis: () => emitCustomEventThis,
|
|
1221
1213
|
ensureInit: () => ensureInit,
|
|
1222
1214
|
event: () => event,
|
|
1223
1215
|
eventDelegate: () => eventDelegate,
|
|
@@ -1260,15 +1252,17 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1260
1252
|
htmlSectionElement: () => htmlSectionElement,
|
|
1261
1253
|
htmlSpanElement: () => htmlSpanElement,
|
|
1262
1254
|
htmlUlElement: () => htmlUlElement,
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1255
|
+
innerHtml: () => innerHtml,
|
|
1256
|
+
innerHtmlLight: () => innerHtmlLight,
|
|
1257
|
+
innerHtmlShadow: () => innerHtmlShadow,
|
|
1258
|
+
innerText: () => innerText,
|
|
1259
|
+
innerTextLight: () => innerTextLight,
|
|
1260
|
+
innerTextShadow: () => innerTextShadow,
|
|
1261
|
+
insertAfterBegin: () => insertAfterBegin,
|
|
1262
|
+
insertAfterBeginLight: () => insertAfterBeginLight,
|
|
1263
|
+
insertBeforeEnd: () => insertBeforeEnd,
|
|
1264
|
+
insertBeforeEndLight: () => insertBeforeEndLight,
|
|
1265
|
+
insertBeforeEndShadow: () => insertBeforeEndShadow,
|
|
1272
1266
|
isSSR: () => isSSR,
|
|
1273
1267
|
onAdopted: () => onAdopted,
|
|
1274
1268
|
onAdoptedAfter: () => onAdoptedAfter,
|
|
@@ -1288,39 +1282,26 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1288
1282
|
prependSlot: () => prependSlot,
|
|
1289
1283
|
prependTextSlot: () => prependTextSlot,
|
|
1290
1284
|
property: () => property,
|
|
1291
|
-
|
|
1292
|
-
publish: () => publish,
|
|
1285
|
+
publishMessage: () => publishMessage,
|
|
1293
1286
|
publishSwcAppMessage: () => publishSwcAppMessage,
|
|
1294
1287
|
query: () => query,
|
|
1295
1288
|
queryAll: () => queryAll,
|
|
1296
|
-
|
|
1297
|
-
queryAppHost: () => queryAppHost,
|
|
1298
|
-
queryDocument: () => queryDocument,
|
|
1299
|
-
queryHost: () => queryHost,
|
|
1300
|
-
queryThis: () => queryThis,
|
|
1301
|
-
queryWindow: () => queryWindow,
|
|
1289
|
+
receiveMessage: () => receiveMessage,
|
|
1302
1290
|
removeClass: () => removeClass,
|
|
1303
|
-
removeClassThis: () => removeClassThis,
|
|
1304
1291
|
removeSSRAttribute: () => removeSSRAttribute,
|
|
1305
1292
|
removeStyle: () => removeStyle,
|
|
1306
|
-
|
|
1293
|
+
replaceChildren: () => replaceChildren,
|
|
1307
1294
|
replaceChildrenHtmlSlot: () => replaceChildrenHtmlSlot,
|
|
1308
|
-
|
|
1309
|
-
replaceChildrenNode: () => replaceChildrenNode,
|
|
1310
|
-
replaceChildrenNodeThis: () => replaceChildrenNodeThis,
|
|
1295
|
+
replaceChildrenLight: () => replaceChildrenLight,
|
|
1311
1296
|
replaceChildrenSlot: () => replaceChildrenSlot,
|
|
1312
1297
|
replaceChildrenTextSlot: () => replaceChildrenTextSlot,
|
|
1313
1298
|
resolveAttributeTargets: () => resolveAttributeTargets,
|
|
1314
1299
|
resolvePropertyTargets: () => resolvePropertyTargets,
|
|
1315
1300
|
setAttribute: () => setAttribute,
|
|
1316
|
-
setAttributeThis: () => setAttributeThis,
|
|
1317
1301
|
setClass: () => setClass,
|
|
1318
|
-
setClassThis: () => setClassThis,
|
|
1319
1302
|
setProperty: () => setProperty,
|
|
1320
|
-
setPropertyThis: () => setPropertyThis,
|
|
1321
1303
|
setSSRAttribute: () => setSSRAttribute,
|
|
1322
1304
|
setStyle: () => setStyle,
|
|
1323
|
-
setStyleThis: () => setStyleThis,
|
|
1324
1305
|
state: () => state,
|
|
1325
1306
|
subscribeSwcAppMessageWhileConnected: () => subscribeSwcAppMessageWhileConnected,
|
|
1326
1307
|
subscribeSwcAppRouteChangeWhileConnected: () => subscribeSwcAppRouteChangeWhileConnected,
|
|
@@ -1337,11 +1318,8 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1337
1318
|
swcAppTagName: () => swcAppTagName,
|
|
1338
1319
|
textNode: () => textNode,
|
|
1339
1320
|
toggleClass: () => toggleClass,
|
|
1340
|
-
toggleClassThis: () => toggleClassThis,
|
|
1341
1321
|
updateClass: () => updateClass,
|
|
1342
|
-
|
|
1343
|
-
updateStyle: () => updateStyle,
|
|
1344
|
-
updateStyleThis: () => updateStyleThis
|
|
1322
|
+
updateStyle: () => updateStyle
|
|
1345
1323
|
});
|
|
1346
1324
|
var import_reflect_metadata3 = __toESM(require_Reflect(), 1);
|
|
1347
1325
|
|
|
@@ -6573,6 +6551,155 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6573
6551
|
return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
|
|
6574
6552
|
};
|
|
6575
6553
|
|
|
6554
|
+
// ../core/dist/esm/message/operators/debounceTime.js
|
|
6555
|
+
function debounceTime(duration, config) {
|
|
6556
|
+
return (source) => {
|
|
6557
|
+
return new Observable((subscriber) => {
|
|
6558
|
+
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
6559
|
+
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
6560
|
+
let timeoutId = null;
|
|
6561
|
+
let lastValue;
|
|
6562
|
+
let hasValue = false;
|
|
6563
|
+
const subscription = source.subscribe({
|
|
6564
|
+
next: (value) => {
|
|
6565
|
+
clearTimeoutFn(timeoutId);
|
|
6566
|
+
lastValue = value;
|
|
6567
|
+
hasValue = true;
|
|
6568
|
+
timeoutId = setTimeoutFn(() => {
|
|
6569
|
+
if (hasValue) {
|
|
6570
|
+
subscriber.next(lastValue);
|
|
6571
|
+
hasValue = false;
|
|
6572
|
+
}
|
|
6573
|
+
}, duration);
|
|
6574
|
+
},
|
|
6575
|
+
error: (err) => {
|
|
6576
|
+
clearTimeoutFn(timeoutId);
|
|
6577
|
+
subscriber.error(err);
|
|
6578
|
+
},
|
|
6579
|
+
complete: () => {
|
|
6580
|
+
clearTimeoutFn(timeoutId);
|
|
6581
|
+
if (hasValue) {
|
|
6582
|
+
subscriber.next(lastValue);
|
|
6583
|
+
}
|
|
6584
|
+
subscriber.complete();
|
|
6585
|
+
}
|
|
6586
|
+
});
|
|
6587
|
+
return subscription;
|
|
6588
|
+
});
|
|
6589
|
+
};
|
|
6590
|
+
}
|
|
6591
|
+
|
|
6592
|
+
// ../core/dist/esm/message/operators/distinctUntilChanged.js
|
|
6593
|
+
function distinctUntilChanged(comparator) {
|
|
6594
|
+
return (source) => {
|
|
6595
|
+
return new Observable((subscriber) => {
|
|
6596
|
+
let hasValue = false;
|
|
6597
|
+
let previousValue;
|
|
6598
|
+
const subscription = source.subscribe({
|
|
6599
|
+
next: (value) => {
|
|
6600
|
+
const areEqual = hasValue ? comparator ? comparator(previousValue, value) : previousValue === value : false;
|
|
6601
|
+
if (!areEqual) {
|
|
6602
|
+
hasValue = true;
|
|
6603
|
+
previousValue = value;
|
|
6604
|
+
subscriber.next(value);
|
|
6605
|
+
}
|
|
6606
|
+
},
|
|
6607
|
+
error: (err) => {
|
|
6608
|
+
subscriber.error(err);
|
|
6609
|
+
},
|
|
6610
|
+
complete: () => {
|
|
6611
|
+
subscriber.complete();
|
|
6612
|
+
}
|
|
6613
|
+
});
|
|
6614
|
+
return subscription;
|
|
6615
|
+
});
|
|
6616
|
+
};
|
|
6617
|
+
}
|
|
6618
|
+
|
|
6619
|
+
// ../core/dist/esm/message/operators/throttleTime.js
|
|
6620
|
+
function throttleTime(duration, config) {
|
|
6621
|
+
const leading = config?.leading ?? true;
|
|
6622
|
+
const trailing = config?.trailing ?? false;
|
|
6623
|
+
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
6624
|
+
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
6625
|
+
return (source) => {
|
|
6626
|
+
return new Observable((subscriber) => {
|
|
6627
|
+
let throttled = false;
|
|
6628
|
+
let trailingValue;
|
|
6629
|
+
let hasTrailingValue = false;
|
|
6630
|
+
let timeoutId = null;
|
|
6631
|
+
const endThrottle = () => {
|
|
6632
|
+
if (timeoutId !== null) {
|
|
6633
|
+
clearTimeoutFn(timeoutId);
|
|
6634
|
+
timeoutId = null;
|
|
6635
|
+
}
|
|
6636
|
+
throttled = false;
|
|
6637
|
+
if (trailing && hasTrailingValue) {
|
|
6638
|
+
const valueToEmit = trailingValue;
|
|
6639
|
+
hasTrailingValue = false;
|
|
6640
|
+
trailingValue = void 0;
|
|
6641
|
+
Promise.resolve().then(() => {
|
|
6642
|
+
if (!subscriber.closed) {
|
|
6643
|
+
subscriber.next(valueToEmit);
|
|
6644
|
+
startThrottle();
|
|
6645
|
+
}
|
|
6646
|
+
});
|
|
6647
|
+
}
|
|
6648
|
+
};
|
|
6649
|
+
const startThrottle = () => {
|
|
6650
|
+
if (throttled) {
|
|
6651
|
+
return;
|
|
6652
|
+
}
|
|
6653
|
+
throttled = true;
|
|
6654
|
+
timeoutId = setTimeoutFn(() => {
|
|
6655
|
+
endThrottle();
|
|
6656
|
+
}, duration);
|
|
6657
|
+
};
|
|
6658
|
+
const subscription = source.subscribe({
|
|
6659
|
+
next: (value) => {
|
|
6660
|
+
if (!throttled) {
|
|
6661
|
+
if (leading) {
|
|
6662
|
+
subscriber.next(value);
|
|
6663
|
+
} else if (trailing) {
|
|
6664
|
+
trailingValue = value;
|
|
6665
|
+
hasTrailingValue = true;
|
|
6666
|
+
}
|
|
6667
|
+
startThrottle();
|
|
6668
|
+
} else if (trailing) {
|
|
6669
|
+
trailingValue = value;
|
|
6670
|
+
hasTrailingValue = true;
|
|
6671
|
+
}
|
|
6672
|
+
},
|
|
6673
|
+
error: (err) => {
|
|
6674
|
+
if (timeoutId !== null) {
|
|
6675
|
+
clearTimeoutFn(timeoutId);
|
|
6676
|
+
timeoutId = null;
|
|
6677
|
+
}
|
|
6678
|
+
throttled = false;
|
|
6679
|
+
subscriber.error(err);
|
|
6680
|
+
},
|
|
6681
|
+
complete: () => {
|
|
6682
|
+
if (timeoutId !== null) {
|
|
6683
|
+
clearTimeoutFn(timeoutId);
|
|
6684
|
+
timeoutId = null;
|
|
6685
|
+
}
|
|
6686
|
+
if (trailing && hasTrailingValue) {
|
|
6687
|
+
subscriber.next(trailingValue);
|
|
6688
|
+
}
|
|
6689
|
+
subscriber.complete();
|
|
6690
|
+
}
|
|
6691
|
+
});
|
|
6692
|
+
return () => {
|
|
6693
|
+
subscription.unsubscribe();
|
|
6694
|
+
if (timeoutId !== null) {
|
|
6695
|
+
clearTimeoutFn(timeoutId);
|
|
6696
|
+
timeoutId = null;
|
|
6697
|
+
}
|
|
6698
|
+
};
|
|
6699
|
+
});
|
|
6700
|
+
};
|
|
6701
|
+
}
|
|
6702
|
+
|
|
6576
6703
|
// src/decorators/lifecycles.ts
|
|
6577
6704
|
var ON_INITIALIZE_METADATA_KEY = Symbol.for("simple-web-component:on-constructor");
|
|
6578
6705
|
var ON_BEFORE_CONNECTED_METADATA_KEY = Symbol.for("simple-web-component:on-before-connected");
|
|
@@ -7077,7 +7204,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
7077
7204
|
if (!config?.targetVariableName || config?.targetVariableName && tit.variables.find((v) => v === config?.targetVariableName)) {
|
|
7078
7205
|
const data = new Function("ctx", `
|
|
7079
7206
|
with(ctx) {
|
|
7080
|
-
return function(){
|
|
7207
|
+
return function(event){
|
|
7081
7208
|
return (${this.stripWrap(tit.script)});
|
|
7082
7209
|
}
|
|
7083
7210
|
}
|
|
@@ -9031,18 +9158,32 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9031
9158
|
|
|
9032
9159
|
// src/decorators/emitCustomEvent.ts
|
|
9033
9160
|
var EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for("simple-web-component:emit-custom-event");
|
|
9034
|
-
function emitCustomEvent(selectorOrTarget,
|
|
9161
|
+
function emitCustomEvent(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor) {
|
|
9162
|
+
if (typeof selectorOrTarget === "object" && typeof typeOrPropertyKey === "string" && typeof optionsOrDescriptor === "object" && "value" in optionsOrDescriptor) {
|
|
9163
|
+
throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);
|
|
9164
|
+
}
|
|
9165
|
+
if (typeof selectorOrTarget === "string" && typeof typeOrPropertyKey === "string") {
|
|
9166
|
+
return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor);
|
|
9167
|
+
}
|
|
9168
|
+
if (typeof selectorOrTarget === "string" && typeOrPropertyKey !== "string") {
|
|
9169
|
+
return createEmitDecorator("$this", selectorOrTarget, typeOrPropertyKey);
|
|
9170
|
+
}
|
|
9171
|
+
throw new Error("Invalid @emitCustomEvent usage");
|
|
9172
|
+
}
|
|
9173
|
+
function createEmitDecorator(selector, type, options) {
|
|
9035
9174
|
return (targetObj, propertyKey, descriptor) => {
|
|
9036
9175
|
const constructor = targetObj.constructor;
|
|
9037
|
-
const fullOptions = { ...options, type };
|
|
9038
|
-
if (fullOptions.bubbles === void 0)
|
|
9039
|
-
|
|
9176
|
+
const fullOptions = { ...options || {}, type };
|
|
9177
|
+
if (fullOptions.bubbles === void 0)
|
|
9178
|
+
fullOptions.bubbles = true;
|
|
9179
|
+
if (fullOptions.composed === void 0)
|
|
9180
|
+
fullOptions.composed = true;
|
|
9040
9181
|
let list = ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
9041
9182
|
if (!list) {
|
|
9042
9183
|
list = [];
|
|
9043
9184
|
ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);
|
|
9044
9185
|
}
|
|
9045
|
-
list.push({ propertyKey, selector
|
|
9186
|
+
list.push({ propertyKey, selector, type, options: fullOptions });
|
|
9046
9187
|
const original = descriptor.value;
|
|
9047
9188
|
descriptor.value = function(...args) {
|
|
9048
9189
|
ensureInit(this);
|
|
@@ -9058,40 +9199,53 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9058
9199
|
const conf = getElementConfig(this);
|
|
9059
9200
|
const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
|
|
9060
9201
|
const eventTargets = [];
|
|
9061
|
-
if (
|
|
9062
|
-
|
|
9063
|
-
else if (
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
if (hostSet.$
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
} else if (
|
|
9072
|
-
if (hostSet.$
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
} else if (
|
|
9202
|
+
if (selector === "$window")
|
|
9203
|
+
eventTargets.push(currentWin);
|
|
9204
|
+
else if (selector === "$document")
|
|
9205
|
+
eventTargets.push(currentWin.document);
|
|
9206
|
+
else if (selector === "$host") {
|
|
9207
|
+
if (hostSet.$host)
|
|
9208
|
+
eventTargets.push(hostSet.$host);
|
|
9209
|
+
} else if (selector === "$parentHost") {
|
|
9210
|
+
if (hostSet.$parentHost)
|
|
9211
|
+
eventTargets.push(hostSet.$parentHost);
|
|
9212
|
+
} else if (selector === "$appHost") {
|
|
9213
|
+
if (hostSet.$appHost)
|
|
9214
|
+
eventTargets.push(hostSet.$appHost);
|
|
9215
|
+
} else if (selector === "$firstHost") {
|
|
9216
|
+
if (hostSet.$firstHost)
|
|
9217
|
+
eventTargets.push(hostSet.$firstHost);
|
|
9218
|
+
} else if (selector === "$lastHost") {
|
|
9219
|
+
if (hostSet.$lastHost)
|
|
9220
|
+
eventTargets.push(hostSet.$lastHost);
|
|
9221
|
+
} else if (selector === "$firstAppHost") {
|
|
9222
|
+
if (hostSet.$firstAppHost)
|
|
9223
|
+
eventTargets.push(hostSet.$firstAppHost);
|
|
9224
|
+
} else if (selector === "$lastAppHost") {
|
|
9225
|
+
if (hostSet.$lastAppHost)
|
|
9226
|
+
eventTargets.push(hostSet.$lastAppHost);
|
|
9227
|
+
} else if (selector === "$hosts") {
|
|
9078
9228
|
hostSet.$hosts.forEach((h) => eventTargets.push(h));
|
|
9079
|
-
} else if (
|
|
9229
|
+
} else if (selector === "$appHosts") {
|
|
9080
9230
|
hostSet.$appHosts.forEach((h) => eventTargets.push(h));
|
|
9081
|
-
} else if (
|
|
9231
|
+
} else if (selector === "$this" || !selector) {
|
|
9082
9232
|
eventTargets.push(this);
|
|
9083
9233
|
} else {
|
|
9084
9234
|
const r = fullOptions.root || "auto";
|
|
9085
9235
|
const searchRoots = [];
|
|
9086
|
-
if (r === "auto")
|
|
9087
|
-
|
|
9088
|
-
else if (r === "
|
|
9236
|
+
if (r === "auto")
|
|
9237
|
+
searchRoots.push(this.shadowRoot || this);
|
|
9238
|
+
else if (r === "light")
|
|
9239
|
+
searchRoots.push(this);
|
|
9240
|
+
else if (r === "shadow" && this.shadowRoot)
|
|
9241
|
+
searchRoots.push(this.shadowRoot);
|
|
9089
9242
|
else if (r === "all") {
|
|
9090
9243
|
searchRoots.push(this);
|
|
9091
|
-
if (this.shadowRoot)
|
|
9244
|
+
if (this.shadowRoot)
|
|
9245
|
+
searchRoots.push(this.shadowRoot);
|
|
9092
9246
|
}
|
|
9093
9247
|
searchRoots.forEach((sr) => {
|
|
9094
|
-
sr.querySelectorAll(
|
|
9248
|
+
sr.querySelectorAll(selector).forEach((el) => eventTargets.push(el));
|
|
9095
9249
|
});
|
|
9096
9250
|
}
|
|
9097
9251
|
eventTargets.forEach((t) => {
|
|
@@ -9115,20 +9269,8 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9115
9269
|
return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
|
|
9116
9270
|
};
|
|
9117
9271
|
var emit = emitCustomEvent;
|
|
9118
|
-
function emitCustomEventThis(type, optionsOrAttributeaName) {
|
|
9119
|
-
if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "string") {
|
|
9120
|
-
return emitCustomEventThis(type, { attributeName: optionsOrAttributeaName });
|
|
9121
|
-
} else if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "object") {
|
|
9122
|
-
if (!optionsOrAttributeaName.attributeName) {
|
|
9123
|
-
optionsOrAttributeaName.attributeName = `on-emit-${type}`;
|
|
9124
|
-
}
|
|
9125
|
-
return emitCustomEvent("$this", type, optionsOrAttributeaName);
|
|
9126
|
-
} else {
|
|
9127
|
-
return emitCustomEvent("$this", type, { attributeName: `on-emit-${type}` });
|
|
9128
|
-
}
|
|
9129
|
-
}
|
|
9130
9272
|
|
|
9131
|
-
// src/decorators/
|
|
9273
|
+
// src/decorators/changedAttribute.ts
|
|
9132
9274
|
var ON_ATTRIBUTE_CHANGED_METADATA_KEY = Symbol.for("simple-web-component:on-attribute-changed");
|
|
9133
9275
|
var convertValue = (val, type) => {
|
|
9134
9276
|
if (val === null || val === void 0) return val;
|
|
@@ -9136,7 +9278,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9136
9278
|
if (type === Boolean) return val === "false" || val === "0" ? false : true;
|
|
9137
9279
|
return val;
|
|
9138
9280
|
};
|
|
9139
|
-
function
|
|
9281
|
+
function changedAttribute(attributeName, options = {}) {
|
|
9140
9282
|
return (target, propertyKey) => {
|
|
9141
9283
|
const constructor = target.constructor;
|
|
9142
9284
|
let metaList = ReflectUtils.getOwnMetadata(ON_ATTRIBUTE_CHANGED_METADATA_KEY, constructor);
|
|
@@ -9176,150 +9318,106 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9176
9318
|
|
|
9177
9319
|
// src/decorators/query.ts
|
|
9178
9320
|
var QUERY_METADATA_KEY = Symbol.for("simple-web-component:query");
|
|
9179
|
-
function query(selectorOrTarget,
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9321
|
+
function query(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9322
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9323
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9324
|
+
}
|
|
9325
|
+
if (typeof selectorOrTarget === "string") {
|
|
9326
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9327
|
+
if (descriptor2 !== void 0) {
|
|
9328
|
+
throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9329
|
+
}
|
|
9330
|
+
const constructor = targetObj.constructor;
|
|
9331
|
+
let queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
|
|
9332
|
+
if (!queries) {
|
|
9333
|
+
queries = [];
|
|
9334
|
+
ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);
|
|
9335
|
+
}
|
|
9336
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9337
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9338
|
+
get() {
|
|
9339
|
+
ensureInit(this);
|
|
9340
|
+
const selector = selectorOrTarget;
|
|
9341
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9342
|
+
const applyRoot = (t) => {
|
|
9343
|
+
if (!t || !(t instanceof HTMLElement))
|
|
9344
|
+
return t;
|
|
9345
|
+
if (r === "auto")
|
|
9346
|
+
return t.shadowRoot || t;
|
|
9347
|
+
if (r === "shadow")
|
|
9348
|
+
return t.shadowRoot;
|
|
9349
|
+
if (r === "light")
|
|
9350
|
+
return t;
|
|
9351
|
+
if (r === "all")
|
|
9352
|
+
return t.shadowRoot || t;
|
|
9198
9353
|
return t;
|
|
9199
|
-
|
|
9200
|
-
|
|
9354
|
+
};
|
|
9355
|
+
const hostSet = SwcUtils.getHostSet(this);
|
|
9356
|
+
if (selector === "$this")
|
|
9357
|
+
return applyRoot(this);
|
|
9358
|
+
if (selector === "$host")
|
|
9359
|
+
return applyRoot(hostSet.$host);
|
|
9360
|
+
if (selector === "$parentHost")
|
|
9361
|
+
return applyRoot(hostSet.$parentHost);
|
|
9362
|
+
if (selector === "$appHost")
|
|
9363
|
+
return applyRoot(hostSet.$appHost);
|
|
9364
|
+
if (selector === "$firstHost")
|
|
9365
|
+
return applyRoot(hostSet.$firstHost);
|
|
9366
|
+
if (selector === "$lastHost")
|
|
9367
|
+
return applyRoot(hostSet.$lastHost);
|
|
9368
|
+
if (selector === "$firstAppHost")
|
|
9369
|
+
return applyRoot(hostSet.$firstAppHost);
|
|
9370
|
+
if (selector === "$lastAppHost")
|
|
9371
|
+
return applyRoot(hostSet.$lastAppHost);
|
|
9372
|
+
const config = getElementConfig(this);
|
|
9373
|
+
const win = config?.window || window;
|
|
9374
|
+
if (selector === "$window")
|
|
9375
|
+
return win;
|
|
9376
|
+
if (selector === "$document")
|
|
9377
|
+
return win.document;
|
|
9201
9378
|
if (r === "shadow")
|
|
9202
|
-
return
|
|
9379
|
+
return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9203
9380
|
if (r === "light")
|
|
9204
|
-
return
|
|
9205
|
-
if (r === "all")
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
};
|
|
9209
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
9210
|
-
if (selector === "$this")
|
|
9211
|
-
return applyRoot(this);
|
|
9212
|
-
if (selector === "$host")
|
|
9213
|
-
return applyRoot(hostSet.$host);
|
|
9214
|
-
if (selector === "$parentHost")
|
|
9215
|
-
return applyRoot(hostSet.$parentHost);
|
|
9216
|
-
if (selector === "$appHost")
|
|
9217
|
-
return applyRoot(hostSet.$appHost);
|
|
9218
|
-
if (selector === "$firstHost")
|
|
9219
|
-
return applyRoot(hostSet.$firstHost);
|
|
9220
|
-
if (selector === "$lastHost")
|
|
9221
|
-
return applyRoot(hostSet.$lastHost);
|
|
9222
|
-
if (selector === "$firstAppHost")
|
|
9223
|
-
return applyRoot(hostSet.$firstAppHost);
|
|
9224
|
-
if (selector === "$lastAppHost")
|
|
9225
|
-
return applyRoot(hostSet.$lastAppHost);
|
|
9226
|
-
const config = getElementConfig(this);
|
|
9227
|
-
const win = config?.window || window;
|
|
9228
|
-
if (selector === "$window")
|
|
9229
|
-
return win;
|
|
9230
|
-
if (selector === "$document")
|
|
9231
|
-
return win.document;
|
|
9232
|
-
if (r === "shadow")
|
|
9233
|
-
return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9234
|
-
if (r === "light")
|
|
9235
|
-
return this.querySelector(selector);
|
|
9236
|
-
if (r === "all") {
|
|
9237
|
-
const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9238
|
-
return shadowMatch || this.querySelector(selector);
|
|
9239
|
-
}
|
|
9240
|
-
return (this.shadowRoot || this).querySelector(selector);
|
|
9241
|
-
},
|
|
9242
|
-
set(nv) {
|
|
9243
|
-
ensureInit(this);
|
|
9244
|
-
if (nv === null || nv === void 0) {
|
|
9245
|
-
const selector = selectorOrTarget;
|
|
9246
|
-
if (selector.startsWith("$") && selector !== "$this")
|
|
9247
|
-
return;
|
|
9248
|
-
const r = options.root || "auto";
|
|
9249
|
-
const targets = [];
|
|
9250
|
-
if (r === "shadow") {
|
|
9251
|
-
if (this.shadowRoot?.querySelector(selector))
|
|
9252
|
-
targets.push(this.shadowRoot.querySelector(selector));
|
|
9253
|
-
} else if (r === "light") {
|
|
9254
|
-
if (this.querySelector(selector))
|
|
9255
|
-
targets.push(this.querySelector(selector));
|
|
9256
|
-
} else if (r === "all") {
|
|
9257
|
-
if (this.shadowRoot?.querySelector(selector))
|
|
9258
|
-
targets.push(this.shadowRoot.querySelector(selector));
|
|
9259
|
-
if (this.querySelector(selector))
|
|
9260
|
-
targets.push(this.querySelector(selector));
|
|
9261
|
-
} else {
|
|
9262
|
-
const el = (this.shadowRoot || this).querySelector(selector);
|
|
9263
|
-
if (el)
|
|
9264
|
-
targets.push(el);
|
|
9381
|
+
return this.querySelector(selector);
|
|
9382
|
+
if (r === "all") {
|
|
9383
|
+
const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
|
|
9384
|
+
return shadowMatch || this.querySelector(selector);
|
|
9265
9385
|
}
|
|
9266
|
-
|
|
9267
|
-
}
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
return query("$document", targetOrOptions);
|
|
9300
|
-
} else {
|
|
9301
|
-
return query("$document", {});
|
|
9302
|
-
}
|
|
9303
|
-
}
|
|
9304
|
-
function queryHost(targetOrOptions, propertyKey) {
|
|
9305
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9306
|
-
return query("$host", {})(targetOrOptions, propertyKey);
|
|
9307
|
-
}
|
|
9308
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9309
|
-
return query("$host", targetOrOptions);
|
|
9310
|
-
} else {
|
|
9311
|
-
return query("$host", {});
|
|
9312
|
-
}
|
|
9313
|
-
}
|
|
9314
|
-
function queryAppHost(targetOrOptions, propertyKey) {
|
|
9315
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9316
|
-
return query("$appHost", {})(targetOrOptions, propertyKey);
|
|
9317
|
-
}
|
|
9318
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9319
|
-
return query("$appHost", targetOrOptions);
|
|
9320
|
-
} else {
|
|
9321
|
-
return query("$appHost", {});
|
|
9386
|
+
return (this.shadowRoot || this).querySelector(selector);
|
|
9387
|
+
},
|
|
9388
|
+
set(nv) {
|
|
9389
|
+
ensureInit(this);
|
|
9390
|
+
if (nv === null || nv === void 0) {
|
|
9391
|
+
const selector = selectorOrTarget;
|
|
9392
|
+
if (selector.startsWith("$") && selector !== "$this")
|
|
9393
|
+
return;
|
|
9394
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9395
|
+
const targets = [];
|
|
9396
|
+
if (r === "shadow") {
|
|
9397
|
+
if (this.shadowRoot?.querySelector(selector))
|
|
9398
|
+
targets.push(this.shadowRoot.querySelector(selector));
|
|
9399
|
+
} else if (r === "light") {
|
|
9400
|
+
if (this.querySelector(selector))
|
|
9401
|
+
targets.push(this.querySelector(selector));
|
|
9402
|
+
} else if (r === "all") {
|
|
9403
|
+
if (this.shadowRoot?.querySelector(selector))
|
|
9404
|
+
targets.push(this.shadowRoot.querySelector(selector));
|
|
9405
|
+
if (this.querySelector(selector))
|
|
9406
|
+
targets.push(this.querySelector(selector));
|
|
9407
|
+
} else {
|
|
9408
|
+
const el = (this.shadowRoot || this).querySelector(selector);
|
|
9409
|
+
if (el)
|
|
9410
|
+
targets.push(el);
|
|
9411
|
+
}
|
|
9412
|
+
targets.forEach((t) => t.remove());
|
|
9413
|
+
}
|
|
9414
|
+
},
|
|
9415
|
+
enumerable: true,
|
|
9416
|
+
configurable: true
|
|
9417
|
+
});
|
|
9418
|
+
};
|
|
9322
9419
|
}
|
|
9420
|
+
return query("$this", selectorOrTarget);
|
|
9323
9421
|
}
|
|
9324
9422
|
var getQueryMetadata = (target) => {
|
|
9325
9423
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9328,139 +9426,115 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9328
9426
|
|
|
9329
9427
|
// src/decorators/queryAll.ts
|
|
9330
9428
|
var QUERY_ALL_METADATA_KEY = Symbol.for("simple-web-component:query-all");
|
|
9331
|
-
function queryAll(selectorOrTarget,
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
return [];
|
|
9351
|
-
const items = Array.isArray(t) ? t : [t];
|
|
9352
|
-
const results = [];
|
|
9353
|
-
items.forEach((it) => {
|
|
9354
|
-
if (!(it instanceof HTMLElement)) {
|
|
9355
|
-
results.push(it);
|
|
9356
|
-
return;
|
|
9357
|
-
}
|
|
9358
|
-
if (r === "auto")
|
|
9359
|
-
results.push(it.shadowRoot || it);
|
|
9360
|
-
else {
|
|
9361
|
-
if (r === "light" || r === "all")
|
|
9362
|
-
results.push(it);
|
|
9363
|
-
if ((r === "shadow" || r === "all") && it.shadowRoot)
|
|
9364
|
-
results.push(it.shadowRoot);
|
|
9365
|
-
}
|
|
9366
|
-
});
|
|
9367
|
-
return results;
|
|
9368
|
-
};
|
|
9369
|
-
const hostSet = SwcUtils.getHostSet(this);
|
|
9370
|
-
if (selector === "$hosts")
|
|
9371
|
-
return applyRoot(hostSet.$hosts);
|
|
9372
|
-
if (selector === "$appHosts")
|
|
9373
|
-
return applyRoot(hostSet.$appHosts);
|
|
9374
|
-
if (selector === "$host")
|
|
9375
|
-
return applyRoot(hostSet.$host);
|
|
9376
|
-
if (selector === "$parentHost")
|
|
9377
|
-
return applyRoot(hostSet.$parentHost);
|
|
9378
|
-
if (selector === "$appHost")
|
|
9379
|
-
return applyRoot(hostSet.$appHost);
|
|
9380
|
-
if (selector === "$firstHost")
|
|
9381
|
-
return applyRoot(hostSet.$firstHost);
|
|
9382
|
-
if (selector === "$lastHost")
|
|
9383
|
-
return applyRoot(hostSet.$lastHost);
|
|
9384
|
-
if (selector === "$firstAppHost")
|
|
9385
|
-
return applyRoot(hostSet.$firstAppHost);
|
|
9386
|
-
if (selector === "$lastAppHost")
|
|
9387
|
-
return applyRoot(hostSet.$lastAppHost);
|
|
9388
|
-
const config = getElementConfig(this);
|
|
9389
|
-
const win = config?.window || window;
|
|
9390
|
-
if (selector === "$window")
|
|
9391
|
-
return [win];
|
|
9392
|
-
if (selector === "$document")
|
|
9393
|
-
return [win.document];
|
|
9394
|
-
if (selector === "$this")
|
|
9395
|
-
return applyRoot(this);
|
|
9396
|
-
if (r === "shadow")
|
|
9397
|
-
return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9398
|
-
if (r === "light")
|
|
9399
|
-
return Array.from(this.querySelectorAll(selector));
|
|
9400
|
-
if (r === "all") {
|
|
9401
|
-
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9402
|
-
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9403
|
-
return [...sNodes, ...lNodes];
|
|
9404
|
-
}
|
|
9405
|
-
const root = this.shadowRoot || this;
|
|
9406
|
-
return Array.from(root.querySelectorAll(selector));
|
|
9407
|
-
},
|
|
9408
|
-
set(nv) {
|
|
9409
|
-
ensureInit(this);
|
|
9410
|
-
if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
|
|
9429
|
+
function queryAll(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
9430
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
9431
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
|
|
9432
|
+
}
|
|
9433
|
+
if (typeof selectorOrTarget === "string") {
|
|
9434
|
+
return (targetObj, propertyKey, descriptor2) => {
|
|
9435
|
+
if (descriptor2 !== void 0) {
|
|
9436
|
+
throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
|
|
9437
|
+
}
|
|
9438
|
+
const constructor = targetObj.constructor;
|
|
9439
|
+
let queries = ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
|
|
9440
|
+
if (!queries) {
|
|
9441
|
+
queries = [];
|
|
9442
|
+
ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);
|
|
9443
|
+
}
|
|
9444
|
+
queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
|
|
9445
|
+
Object.defineProperty(targetObj, propertyKey, {
|
|
9446
|
+
get() {
|
|
9447
|
+
ensureInit(this);
|
|
9411
9448
|
const selector = selectorOrTarget;
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9449
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9450
|
+
const applyRoot = (t) => {
|
|
9451
|
+
if (!t)
|
|
9452
|
+
return [];
|
|
9453
|
+
const items = Array.isArray(t) ? t : [t];
|
|
9454
|
+
const results = [];
|
|
9455
|
+
items.forEach((it) => {
|
|
9456
|
+
if (!(it instanceof HTMLElement)) {
|
|
9457
|
+
results.push(it);
|
|
9458
|
+
return;
|
|
9459
|
+
}
|
|
9460
|
+
if (r === "auto")
|
|
9461
|
+
results.push(it.shadowRoot || it);
|
|
9462
|
+
else {
|
|
9463
|
+
if (r === "light" || r === "all")
|
|
9464
|
+
results.push(it);
|
|
9465
|
+
if ((r === "shadow" || r === "all") && it.shadowRoot)
|
|
9466
|
+
results.push(it.shadowRoot);
|
|
9467
|
+
}
|
|
9468
|
+
});
|
|
9469
|
+
return results;
|
|
9470
|
+
};
|
|
9471
|
+
const hostSet = SwcUtils.getHostSet(this);
|
|
9472
|
+
if (selector === "$hosts")
|
|
9473
|
+
return applyRoot(hostSet.$hosts);
|
|
9474
|
+
if (selector === "$appHosts")
|
|
9475
|
+
return applyRoot(hostSet.$appHosts);
|
|
9476
|
+
if (selector === "$host")
|
|
9477
|
+
return applyRoot(hostSet.$host);
|
|
9478
|
+
if (selector === "$parentHost")
|
|
9479
|
+
return applyRoot(hostSet.$parentHost);
|
|
9480
|
+
if (selector === "$appHost")
|
|
9481
|
+
return applyRoot(hostSet.$appHost);
|
|
9482
|
+
if (selector === "$firstHost")
|
|
9483
|
+
return applyRoot(hostSet.$firstHost);
|
|
9484
|
+
if (selector === "$lastHost")
|
|
9485
|
+
return applyRoot(hostSet.$lastHost);
|
|
9486
|
+
if (selector === "$firstAppHost")
|
|
9487
|
+
return applyRoot(hostSet.$firstAppHost);
|
|
9488
|
+
if (selector === "$lastAppHost")
|
|
9489
|
+
return applyRoot(hostSet.$lastAppHost);
|
|
9490
|
+
const config = getElementConfig(this);
|
|
9491
|
+
const win = config?.window || window;
|
|
9492
|
+
if (selector === "$window")
|
|
9493
|
+
return [win];
|
|
9494
|
+
if (selector === "$document")
|
|
9495
|
+
return [win.document];
|
|
9496
|
+
if (selector === "$this")
|
|
9497
|
+
return applyRoot(this);
|
|
9416
9498
|
if (r === "shadow")
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9499
|
+
return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9500
|
+
if (r === "light")
|
|
9501
|
+
return Array.from(this.querySelectorAll(selector));
|
|
9502
|
+
if (r === "all") {
|
|
9421
9503
|
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9422
9504
|
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9423
|
-
|
|
9424
|
-
} else {
|
|
9425
|
-
targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
|
|
9505
|
+
return [...sNodes, ...lNodes];
|
|
9426
9506
|
}
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
9457
|
-
return queryAll("$appHost", {})(targetOrOptions, propertyKey);
|
|
9458
|
-
}
|
|
9459
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
9460
|
-
return queryAll("$appHost", targetOrOptions);
|
|
9461
|
-
} else {
|
|
9462
|
-
return queryAll("$appHost", {});
|
|
9507
|
+
const root = this.shadowRoot || this;
|
|
9508
|
+
return Array.from(root.querySelectorAll(selector));
|
|
9509
|
+
},
|
|
9510
|
+
set(nv) {
|
|
9511
|
+
ensureInit(this);
|
|
9512
|
+
if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
|
|
9513
|
+
const selector = selectorOrTarget;
|
|
9514
|
+
if (selector.startsWith("$") && selector !== "$this")
|
|
9515
|
+
return;
|
|
9516
|
+
const r = optionsOrPropertyKey?.root || "auto";
|
|
9517
|
+
let targets = [];
|
|
9518
|
+
if (r === "shadow")
|
|
9519
|
+
targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9520
|
+
else if (r === "light")
|
|
9521
|
+
targets = Array.from(this.querySelectorAll(selector));
|
|
9522
|
+
else if (r === "all") {
|
|
9523
|
+
const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
|
|
9524
|
+
const lNodes = Array.from(this.querySelectorAll(selector));
|
|
9525
|
+
targets = [...sNodes, ...lNodes];
|
|
9526
|
+
} else {
|
|
9527
|
+
targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
|
|
9528
|
+
}
|
|
9529
|
+
targets.forEach((t) => t.remove());
|
|
9530
|
+
}
|
|
9531
|
+
},
|
|
9532
|
+
enumerable: true,
|
|
9533
|
+
configurable: true
|
|
9534
|
+
});
|
|
9535
|
+
};
|
|
9463
9536
|
}
|
|
9537
|
+
return queryAll("$this", selectorOrTarget);
|
|
9464
9538
|
}
|
|
9465
9539
|
var getQueryAllMetadata = (target) => {
|
|
9466
9540
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
@@ -9788,35 +9862,20 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
9788
9862
|
});
|
|
9789
9863
|
};
|
|
9790
9864
|
}
|
|
9791
|
-
function property(
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
function propertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
|
|
9795
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
|
|
9796
|
-
return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
|
|
9865
|
+
function property(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor) {
|
|
9866
|
+
if (optionsOrDescriptor !== void 0 && (typeof targetPropertyKeyOrOptions === "string" || typeof targetPropertyKeyOrOptions === "symbol")) {
|
|
9867
|
+
return applyProperty("$this", void 0, {})(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9797
9868
|
}
|
|
9798
|
-
if (typeof
|
|
9799
|
-
return applyProperty(
|
|
9800
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
9801
|
-
return applyProperty("$this", void 0, targetOrOptions);
|
|
9802
|
-
} else {
|
|
9803
|
-
return applyProperty("$this", void 0, {});
|
|
9869
|
+
if (typeof selectorOrTarget === "string") {
|
|
9870
|
+
return applyProperty(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
|
|
9804
9871
|
}
|
|
9872
|
+
return applyProperty("$this", void 0, selectorOrTarget);
|
|
9805
9873
|
}
|
|
9806
|
-
function setProperty(
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
function setPropertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
|
|
9810
|
-
if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
|
|
9811
|
-
return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
|
|
9812
|
-
}
|
|
9813
|
-
if (typeof targetOrOptions === "string" || typeof targetOrOptions === "symbol") {
|
|
9814
|
-
return applyProperty("$this", targetOrOptions, propertyKeyOrOptions);
|
|
9815
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
9816
|
-
return applyProperty("$this", void 0, targetOrOptions);
|
|
9817
|
-
} else {
|
|
9818
|
-
return applyProperty("$this", void 0, {});
|
|
9874
|
+
function setProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined) {
|
|
9875
|
+
if (typeof selectorOrOptions === "string") {
|
|
9876
|
+
return applyProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined);
|
|
9819
9877
|
}
|
|
9878
|
+
return applyProperty("$this", void 0, selectorOrOptions);
|
|
9820
9879
|
}
|
|
9821
9880
|
var findAllPropertyMetadata = (target) => {
|
|
9822
9881
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -10241,8 +10300,32 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10241
10300
|
const args = { event: event2, ...currentHostSet, $el: t, $root: t };
|
|
10242
10301
|
await this[meta.propertyKey](event2, { currentHostSet, $$matchedElement: event2.currentTarget }, args);
|
|
10243
10302
|
};
|
|
10244
|
-
|
|
10245
|
-
|
|
10303
|
+
const eventSubject = new Subject();
|
|
10304
|
+
let eventStream = eventSubject;
|
|
10305
|
+
if (options.debounceTime !== void 0 && options.debounceTime > 0) {
|
|
10306
|
+
eventStream = eventStream.pipe(debounceTime(options.debounceTime));
|
|
10307
|
+
}
|
|
10308
|
+
if (options.throttleTime !== void 0 && options.throttleTime > 0) {
|
|
10309
|
+
eventStream = eventStream.pipe(throttleTime(options.throttleTime));
|
|
10310
|
+
}
|
|
10311
|
+
if (options.distinctUntilChanged !== void 0 && options.distinctUntilChanged !== false) {
|
|
10312
|
+
if (typeof options.distinctUntilChanged === "function") {
|
|
10313
|
+
eventStream = eventStream.pipe(distinctUntilChanged(options.distinctUntilChanged));
|
|
10314
|
+
} else {
|
|
10315
|
+
eventStream = eventStream.pipe(distinctUntilChanged());
|
|
10316
|
+
}
|
|
10317
|
+
}
|
|
10318
|
+
const subscription = eventStream.subscribe({
|
|
10319
|
+
next: (event2) => {
|
|
10320
|
+
handler(event2).catch((err) => console.error("Event handler error:", err));
|
|
10321
|
+
},
|
|
10322
|
+
error: (err) => console.error("Event stream error:", err)
|
|
10323
|
+
});
|
|
10324
|
+
const wrappedHandler = (event2) => {
|
|
10325
|
+
eventSubject.next(event2);
|
|
10326
|
+
};
|
|
10327
|
+
t.addEventListener(type, wrappedHandler, opts);
|
|
10328
|
+
this._boundListeners.push({ target: t, type, handler: wrappedHandler, options: opts, subscription });
|
|
10246
10329
|
});
|
|
10247
10330
|
});
|
|
10248
10331
|
if (originalConnected) await originalConnected.apply(this);
|
|
@@ -10282,7 +10365,12 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10282
10365
|
const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);
|
|
10283
10366
|
for (const m of bMethods) this._invokeLifecycleMethod(m.propertyKey, helperHostSet);
|
|
10284
10367
|
if (this._boundListeners) {
|
|
10285
|
-
this._boundListeners.forEach((l) =>
|
|
10368
|
+
this._boundListeners.forEach((l) => {
|
|
10369
|
+
l.target.removeEventListener(l.type, l.handler, l.options);
|
|
10370
|
+
if (l.subscription && typeof l.subscription.unsubscribe === "function") {
|
|
10371
|
+
l.subscription.unsubscribe();
|
|
10372
|
+
}
|
|
10373
|
+
});
|
|
10286
10374
|
this._boundListeners = [];
|
|
10287
10375
|
}
|
|
10288
10376
|
new ElementApply(this, { id: this._swcId }).removeAllEventListener();
|
|
@@ -10365,6 +10453,13 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10365
10453
|
|
|
10366
10454
|
// src/decorators/applyAttribute.ts
|
|
10367
10455
|
var ATTRIBUTE_METADATA_KEY = Symbol.for("simple-web-component:attribute");
|
|
10456
|
+
var isCssSelector = (str) => {
|
|
10457
|
+
if (!str) return false;
|
|
10458
|
+
if (str.startsWith("$")) return true;
|
|
10459
|
+
if (/^[#.\[\:>+~]/.test(str)) return true;
|
|
10460
|
+
if (/[>+~:\[\]]/.test(str)) return true;
|
|
10461
|
+
return false;
|
|
10462
|
+
};
|
|
10368
10463
|
var convertValue2 = (val, type) => {
|
|
10369
10464
|
if (val === null || val === void 0) return val;
|
|
10370
10465
|
if (type === Number) return Number(val);
|
|
@@ -10535,35 +10630,32 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10535
10630
|
});
|
|
10536
10631
|
};
|
|
10537
10632
|
}
|
|
10538
|
-
function attribute(
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
if (typeof
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
return applyAttribute("$this", void 0, {});
|
|
10633
|
+
function attribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor) {
|
|
10634
|
+
if (optionsOrDescriptor !== void 0 && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
|
|
10635
|
+
return applyAttribute("$this", void 0, {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10636
|
+
}
|
|
10637
|
+
if (typeof selectorOrAttributeOrTarget === "string") {
|
|
10638
|
+
const isSelector = isCssSelector(selectorOrAttributeOrTarget);
|
|
10639
|
+
if (isSelector) {
|
|
10640
|
+
return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
|
|
10641
|
+
} else {
|
|
10642
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10643
|
+
return applyAttribute("$this", selectorOrAttributeOrTarget, options);
|
|
10644
|
+
}
|
|
10551
10645
|
}
|
|
10646
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrTarget);
|
|
10552
10647
|
}
|
|
10553
|
-
function setAttribute(
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
10563
|
-
return applyAttribute("$this", void 0, targetOrOptions);
|
|
10564
|
-
} else {
|
|
10565
|
-
return applyAttribute("$this", void 0, {});
|
|
10648
|
+
function setAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined) {
|
|
10649
|
+
if (typeof selectorOrAttributeOrOptions === "string") {
|
|
10650
|
+
const isSelector = isCssSelector(selectorOrAttributeOrOptions);
|
|
10651
|
+
if (isSelector) {
|
|
10652
|
+
return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
|
|
10653
|
+
} else {
|
|
10654
|
+
const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
|
|
10655
|
+
return applyAttribute("$this", selectorOrAttributeOrOptions, options);
|
|
10656
|
+
}
|
|
10566
10657
|
}
|
|
10658
|
+
return applyAttribute("$this", void 0, selectorOrAttributeOrOptions);
|
|
10567
10659
|
}
|
|
10568
10660
|
var findAllAttributeMetadata = (target) => {
|
|
10569
10661
|
const actualTarget = target instanceof Function ? target : target.constructor;
|
|
@@ -10581,6 +10673,10 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10581
10673
|
var APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
|
|
10582
10674
|
var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
|
|
10583
10675
|
if (!targetEl) return;
|
|
10676
|
+
if (pos === "clearChildren") {
|
|
10677
|
+
targetEl.replaceChildren();
|
|
10678
|
+
return [];
|
|
10679
|
+
}
|
|
10584
10680
|
const doc = win.document;
|
|
10585
10681
|
const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
|
|
10586
10682
|
const id = currentThis._swcId;
|
|
@@ -10616,7 +10712,16 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10616
10712
|
new ElementApply(targetEl, { id }).apply({ target: "noInitialized", context: stateContext, bind: currentThis });
|
|
10617
10713
|
return nodes;
|
|
10618
10714
|
};
|
|
10619
|
-
function applyNode(
|
|
10715
|
+
function applyNode(selectorOrOptions, maybeOptions) {
|
|
10716
|
+
let selector;
|
|
10717
|
+
let options;
|
|
10718
|
+
if (typeof selectorOrOptions === "string") {
|
|
10719
|
+
selector = selectorOrOptions;
|
|
10720
|
+
options = maybeOptions || { position: "replaceChildren" };
|
|
10721
|
+
} else {
|
|
10722
|
+
selector = "$this";
|
|
10723
|
+
options = selectorOrOptions || { position: "replaceChildren" };
|
|
10724
|
+
}
|
|
10620
10725
|
return (targetObj, propertyKey, descriptor) => {
|
|
10621
10726
|
const constructor = targetObj.constructor;
|
|
10622
10727
|
let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor);
|
|
@@ -10687,92 +10792,141 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10687
10792
|
};
|
|
10688
10793
|
};
|
|
10689
10794
|
}
|
|
10690
|
-
function
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
|
|
10699
|
-
const opt = targetOrOptions || {};
|
|
10700
|
-
return applyNode("$this", { ...opt, ...option });
|
|
10701
|
-
}
|
|
10702
|
-
function beforeEndNodeThis(targetOrOptions, propertyKey, descriptor) {
|
|
10703
|
-
const options = { position: "beforeEnd" };
|
|
10704
|
-
if (propertyKey !== void 0) return applyNode("$this", options)(targetOrOptions, propertyKey, descriptor);
|
|
10705
|
-
const opt = targetOrOptions || {};
|
|
10706
|
-
return applyNode("$this", { ...opt, ...options });
|
|
10707
|
-
}
|
|
10708
|
-
function beforeEndLightNodeThis(targetOrOptions, propertyKey, descriptor) {
|
|
10709
|
-
const option = { position: "beforeEnd", root: "light" };
|
|
10710
|
-
if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
|
|
10711
|
-
const opt = targetOrOptions || {};
|
|
10712
|
-
return applyNode("$this", { ...opt, ...option });
|
|
10795
|
+
function replaceChildren(selectorOrOptions, maybeOptions, descriptor) {
|
|
10796
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10797
|
+
return applyNode({ position: "replaceChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10798
|
+
}
|
|
10799
|
+
if (typeof selectorOrOptions === "string") {
|
|
10800
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren" });
|
|
10801
|
+
}
|
|
10802
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren" });
|
|
10713
10803
|
}
|
|
10714
|
-
function
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10804
|
+
function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
|
|
10805
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10806
|
+
return applyNode({ position: "clearChildren" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10807
|
+
}
|
|
10808
|
+
if (typeof selectorOrOptions === "string") {
|
|
10809
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren" });
|
|
10810
|
+
}
|
|
10811
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren" });
|
|
10719
10812
|
}
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
if (
|
|
10723
|
-
|
|
10724
|
-
|
|
10813
|
+
var clearNode = clearChildrenNode;
|
|
10814
|
+
function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
|
|
10815
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10816
|
+
return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10817
|
+
}
|
|
10818
|
+
if (typeof selectorOrOptions === "string") {
|
|
10819
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml" });
|
|
10820
|
+
}
|
|
10821
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml" });
|
|
10725
10822
|
}
|
|
10726
|
-
function
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10823
|
+
function innerHtmlLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10824
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10825
|
+
return applyNode({ position: "innerHtml", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10826
|
+
}
|
|
10827
|
+
if (typeof selectorOrOptions === "string") {
|
|
10828
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "light" });
|
|
10829
|
+
}
|
|
10830
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "light" });
|
|
10731
10831
|
}
|
|
10732
|
-
function
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10832
|
+
function innerHtmlShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10833
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10834
|
+
return applyNode({ position: "innerHtml", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10835
|
+
}
|
|
10836
|
+
if (typeof selectorOrOptions === "string") {
|
|
10837
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "shadow" });
|
|
10838
|
+
}
|
|
10839
|
+
return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "shadow" });
|
|
10737
10840
|
}
|
|
10738
|
-
function
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10841
|
+
function innerText(selectorOrOptions, maybeOptions, descriptor) {
|
|
10842
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10843
|
+
return applyNode({ position: "innerText" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10844
|
+
}
|
|
10845
|
+
if (typeof selectorOrOptions === "string") {
|
|
10846
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText" });
|
|
10847
|
+
}
|
|
10848
|
+
return applyNode({ ...selectorOrOptions, position: "innerText" });
|
|
10743
10849
|
}
|
|
10744
|
-
function
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10850
|
+
function innerTextLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10851
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10852
|
+
return applyNode({ position: "innerText", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10853
|
+
}
|
|
10854
|
+
if (typeof selectorOrOptions === "string") {
|
|
10855
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "light" });
|
|
10856
|
+
}
|
|
10857
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "light" });
|
|
10749
10858
|
}
|
|
10750
|
-
function
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10859
|
+
function innerTextShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10860
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10861
|
+
return applyNode({ position: "innerText", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10862
|
+
}
|
|
10863
|
+
if (typeof selectorOrOptions === "string") {
|
|
10864
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "shadow" });
|
|
10865
|
+
}
|
|
10866
|
+
return applyNode({ ...selectorOrOptions, position: "innerText", root: "shadow" });
|
|
10755
10867
|
}
|
|
10756
|
-
function
|
|
10757
|
-
|
|
10868
|
+
function insertBeforeEnd(selectorOrOptions, maybeOptions, descriptor) {
|
|
10869
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10870
|
+
return applyNode({ position: "beforeEnd" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10871
|
+
}
|
|
10872
|
+
if (typeof selectorOrOptions === "string") {
|
|
10873
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd" });
|
|
10874
|
+
}
|
|
10875
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd" });
|
|
10758
10876
|
}
|
|
10759
|
-
function
|
|
10760
|
-
|
|
10877
|
+
function insertBeforeEndLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10878
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10879
|
+
return applyNode({ position: "beforeEnd", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10880
|
+
}
|
|
10881
|
+
if (typeof selectorOrOptions === "string") {
|
|
10882
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "light" });
|
|
10883
|
+
}
|
|
10884
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "light" });
|
|
10761
10885
|
}
|
|
10762
|
-
function
|
|
10763
|
-
|
|
10886
|
+
function insertBeforeEndShadow(selectorOrOptions, maybeOptions, descriptor) {
|
|
10887
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10888
|
+
return applyNode({ position: "beforeEnd", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10889
|
+
}
|
|
10890
|
+
if (typeof selectorOrOptions === "string") {
|
|
10891
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "shadow" });
|
|
10892
|
+
}
|
|
10893
|
+
return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "shadow" });
|
|
10764
10894
|
}
|
|
10765
|
-
function
|
|
10766
|
-
|
|
10895
|
+
function insertAfterBegin(selectorOrOptions, maybeOptions, descriptor) {
|
|
10896
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10897
|
+
return applyNode({ position: "afterBegin" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10898
|
+
}
|
|
10899
|
+
if (typeof selectorOrOptions === "string") {
|
|
10900
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin" });
|
|
10901
|
+
}
|
|
10902
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin" });
|
|
10767
10903
|
}
|
|
10768
|
-
function
|
|
10769
|
-
|
|
10904
|
+
function insertAfterBeginLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10905
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10906
|
+
return applyNode({ position: "afterBegin", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10907
|
+
}
|
|
10908
|
+
if (typeof selectorOrOptions === "string") {
|
|
10909
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin", root: "light" });
|
|
10910
|
+
}
|
|
10911
|
+
return applyNode({ ...selectorOrOptions, position: "afterBegin", root: "light" });
|
|
10770
10912
|
}
|
|
10771
|
-
function
|
|
10772
|
-
|
|
10913
|
+
function replaceChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10914
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10915
|
+
return applyNode({ position: "replaceChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10916
|
+
}
|
|
10917
|
+
if (typeof selectorOrOptions === "string") {
|
|
10918
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren", root: "light" });
|
|
10919
|
+
}
|
|
10920
|
+
return applyNode({ ...selectorOrOptions, position: "replaceChildren", root: "light" });
|
|
10773
10921
|
}
|
|
10774
|
-
function
|
|
10775
|
-
|
|
10922
|
+
function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
|
|
10923
|
+
if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
|
|
10924
|
+
return applyNode({ position: "clearChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
|
|
10925
|
+
}
|
|
10926
|
+
if (typeof selectorOrOptions === "string") {
|
|
10927
|
+
return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren", root: "light" });
|
|
10928
|
+
}
|
|
10929
|
+
return applyNode({ ...selectorOrOptions, position: "clearChildren", root: "light" });
|
|
10776
10930
|
}
|
|
10777
10931
|
var findAllApplyNodeMetadata = (target) => {
|
|
10778
10932
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -10903,22 +11057,64 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10903
11057
|
};
|
|
10904
11058
|
};
|
|
10905
11059
|
}
|
|
10906
|
-
function applyClass(
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
11060
|
+
function applyClass(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
11061
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
11062
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
11063
|
+
}
|
|
11064
|
+
if (typeof selectorOrTarget === "string") {
|
|
11065
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
11066
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
11067
|
+
return createClassDecorator(action2)(selectorOrTarget, options2);
|
|
11068
|
+
}
|
|
11069
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
11070
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
10915
11071
|
return createClassDecorator(action)("$this", options);
|
|
10916
11072
|
}
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
11073
|
+
function setClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11074
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11075
|
+
return createClassDecorator("set")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11076
|
+
}
|
|
11077
|
+
if (typeof selectorOrTarget === "string") {
|
|
11078
|
+
return createClassDecorator("set")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11079
|
+
}
|
|
11080
|
+
return createClassDecorator("set")("$this", selectorOrTarget);
|
|
11081
|
+
}
|
|
11082
|
+
function updateClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11083
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11084
|
+
return createClassDecorator("update")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11085
|
+
}
|
|
11086
|
+
if (typeof selectorOrTarget === "string") {
|
|
11087
|
+
return createClassDecorator("update")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11088
|
+
}
|
|
11089
|
+
return createClassDecorator("update")("$this", selectorOrTarget);
|
|
11090
|
+
}
|
|
11091
|
+
function addClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11092
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11093
|
+
return createClassDecorator("add")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11094
|
+
}
|
|
11095
|
+
if (typeof selectorOrTarget === "string") {
|
|
11096
|
+
return createClassDecorator("add")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11097
|
+
}
|
|
11098
|
+
return createClassDecorator("add")("$this", selectorOrTarget);
|
|
11099
|
+
}
|
|
11100
|
+
function removeClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11101
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11102
|
+
return createClassDecorator("remove")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11103
|
+
}
|
|
11104
|
+
if (typeof selectorOrTarget === "string") {
|
|
11105
|
+
return createClassDecorator("remove")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11106
|
+
}
|
|
11107
|
+
return createClassDecorator("remove")("$this", selectorOrTarget);
|
|
11108
|
+
}
|
|
11109
|
+
function toggleClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
|
|
11110
|
+
if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
|
|
11111
|
+
return createClassDecorator("toggle")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11112
|
+
}
|
|
11113
|
+
if (typeof selectorOrTarget === "string") {
|
|
11114
|
+
return createClassDecorator("toggle")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
|
|
11115
|
+
}
|
|
11116
|
+
return createClassDecorator("toggle")("$this", selectorOrTarget);
|
|
11117
|
+
}
|
|
10922
11118
|
var findAllClassMetadata = (target) => {
|
|
10923
11119
|
const result = /* @__PURE__ */ new Map();
|
|
10924
11120
|
const maps = ReflectUtils.findAllMetadata(CLASS_METADATA_KEY, target);
|
|
@@ -11027,18 +11223,46 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11027
11223
|
};
|
|
11028
11224
|
};
|
|
11029
11225
|
}
|
|
11030
|
-
function applyStyle(
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11226
|
+
function applyStyle(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
|
|
11227
|
+
if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
|
|
11228
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
|
|
11229
|
+
}
|
|
11230
|
+
if (typeof selectorOrTarget === "string") {
|
|
11231
|
+
const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
|
|
11232
|
+
const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
|
|
11233
|
+
return createStyleDecorator(action2)(selectorOrTarget, options2);
|
|
11234
|
+
}
|
|
11235
|
+
const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
|
|
11236
|
+
const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
|
|
11037
11237
|
return createStyleDecorator(action)("$this", options);
|
|
11038
11238
|
}
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11239
|
+
function setStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11240
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11241
|
+
return createStyleDecorator("set")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11242
|
+
}
|
|
11243
|
+
if (typeof selectorOrTarget === "string") {
|
|
11244
|
+
return createStyleDecorator("set")(selectorOrTarget, optionsOrPropertyKey);
|
|
11245
|
+
}
|
|
11246
|
+
return createStyleDecorator("set")("$this", selectorOrTarget);
|
|
11247
|
+
}
|
|
11248
|
+
function updateStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11249
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11250
|
+
return createStyleDecorator("update")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11251
|
+
}
|
|
11252
|
+
if (typeof selectorOrTarget === "string") {
|
|
11253
|
+
return createStyleDecorator("update")(selectorOrTarget, optionsOrPropertyKey);
|
|
11254
|
+
}
|
|
11255
|
+
return createStyleDecorator("update")("$this", selectorOrTarget);
|
|
11256
|
+
}
|
|
11257
|
+
function removeStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
|
|
11258
|
+
if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
|
|
11259
|
+
return createStyleDecorator("remove")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
|
|
11260
|
+
}
|
|
11261
|
+
if (typeof selectorOrTarget === "string") {
|
|
11262
|
+
return createStyleDecorator("remove")(selectorOrTarget, optionsOrPropertyKey);
|
|
11263
|
+
}
|
|
11264
|
+
return createStyleDecorator("remove")("$this", selectorOrTarget);
|
|
11265
|
+
}
|
|
11042
11266
|
var findAllStyleMetadata = (target) => {
|
|
11043
11267
|
const result = /* @__PURE__ */ new Map();
|
|
11044
11268
|
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
@@ -11086,6 +11310,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11086
11310
|
}
|
|
11087
11311
|
return createSubscribeSwcAppRouteChangeWhileConnected(options);
|
|
11088
11312
|
}
|
|
11313
|
+
var changedRoute = subscribeSwcAppRouteChangeWhileConnected;
|
|
11089
11314
|
var getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
|
|
11090
11315
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
11091
11316
|
const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -11126,6 +11351,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11126
11351
|
}
|
|
11127
11352
|
return createSubscribeSwcAppMessageWhileConnected(options, messageType);
|
|
11128
11353
|
}
|
|
11354
|
+
var receiveMessage = subscribeSwcAppMessageWhileConnected;
|
|
11129
11355
|
var getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
|
|
11130
11356
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
11131
11357
|
return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
@@ -11155,7 +11381,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11155
11381
|
}
|
|
11156
11382
|
return v;
|
|
11157
11383
|
};
|
|
11158
|
-
const
|
|
11384
|
+
const publishMessage2 = (data) => {
|
|
11159
11385
|
const appHost = SwcUtils.getAppHost(this);
|
|
11160
11386
|
if (appHost) {
|
|
11161
11387
|
appHost.publishMessage({
|
|
@@ -11168,13 +11394,13 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11168
11394
|
if (result instanceof Promise) {
|
|
11169
11395
|
result.then((data) => {
|
|
11170
11396
|
const extracted = extractValue(data);
|
|
11171
|
-
|
|
11397
|
+
publishMessage2(extracted);
|
|
11172
11398
|
}).catch((err) => {
|
|
11173
11399
|
console.warn("publishSwcAppMessage async error:", err);
|
|
11174
11400
|
});
|
|
11175
11401
|
} else {
|
|
11176
11402
|
const extracted = extractValue(result);
|
|
11177
|
-
|
|
11403
|
+
publishMessage2(extracted);
|
|
11178
11404
|
}
|
|
11179
11405
|
return result;
|
|
11180
11406
|
};
|
|
@@ -11199,7 +11425,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
11199
11425
|
}
|
|
11200
11426
|
return createPublishSwcAppMessage(messageType, options);
|
|
11201
11427
|
}
|
|
11202
|
-
var
|
|
11428
|
+
var publishMessage = publishSwcAppMessage;
|
|
11203
11429
|
var getPublishSwcAppMessageMetadata = (target) => {
|
|
11204
11430
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
11205
11431
|
return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
@@ -13316,6 +13542,10 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13316
13542
|
super(config);
|
|
13317
13543
|
__publicField(this, "_history", []);
|
|
13318
13544
|
__publicField(this, "_currentIndex", -1);
|
|
13545
|
+
if (config.firstUrl) {
|
|
13546
|
+
this._history.push({ url: config.firstUrl, data: null, title: void 0 });
|
|
13547
|
+
this._currentIndex = 0;
|
|
13548
|
+
}
|
|
13319
13549
|
}
|
|
13320
13550
|
// Override pushState to manage internal history
|
|
13321
13551
|
pushState(data, title, path, config) {
|
|
@@ -13487,7 +13717,9 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13487
13717
|
if (this.router) otherInstanceSim.set(Router, this.router);
|
|
13488
13718
|
this.simpleApplication.run(otherInstanceSim);
|
|
13489
13719
|
if (this._config.onStartedLazyDefineComponent) {
|
|
13490
|
-
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) =>
|
|
13720
|
+
await Promise.all(this._config.onStartedLazyDefineComponent.map((it) => {
|
|
13721
|
+
it(this._config.window);
|
|
13722
|
+
}));
|
|
13491
13723
|
}
|
|
13492
13724
|
if (this._config.onEngineStarted) {
|
|
13493
13725
|
await this._config.onEngineStarted(this.simpleApplication, this.host);
|
|
@@ -13564,6 +13796,13 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13564
13796
|
const methodName = metadata.propertyKey;
|
|
13565
13797
|
let pathPattern = metadata.options?.path;
|
|
13566
13798
|
const filter = metadata.options?.filter;
|
|
13799
|
+
const extractValue = (v) => {
|
|
13800
|
+
const keyToUse = metadata.options?.valueKey ?? SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;
|
|
13801
|
+
if (v && typeof v === "object" && keyToUse in v) {
|
|
13802
|
+
return v[keyToUse];
|
|
13803
|
+
}
|
|
13804
|
+
return v;
|
|
13805
|
+
};
|
|
13567
13806
|
if (typeof pathPattern === "function") {
|
|
13568
13807
|
pathPattern = pathPattern(instance);
|
|
13569
13808
|
}
|
|
@@ -13588,7 +13827,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13588
13827
|
const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);
|
|
13589
13828
|
const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
|
|
13590
13829
|
if (pathMatched && filterPassed && instance[methodName]) {
|
|
13591
|
-
const result = await instance[methodName]({ ...re, pathData });
|
|
13830
|
+
const result = extractValue(await instance[methodName]({ ...re, pathData }));
|
|
13592
13831
|
if (result !== void 0 && result !== null) {
|
|
13593
13832
|
break;
|
|
13594
13833
|
}
|
|
@@ -13703,7 +13942,15 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13703
13942
|
context: this,
|
|
13704
13943
|
args: SwcUtils.getHelperAndHostSet(win, this)
|
|
13705
13944
|
});
|
|
13706
|
-
|
|
13945
|
+
if (userConfig instanceof Promise) {
|
|
13946
|
+
userConfig.then((resolvedConfig) => {
|
|
13947
|
+
this.connect(resolvedConfig);
|
|
13948
|
+
}).catch((e) => {
|
|
13949
|
+
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13950
|
+
});
|
|
13951
|
+
} else {
|
|
13952
|
+
this.connect(userConfig);
|
|
13953
|
+
}
|
|
13707
13954
|
} catch (e) {
|
|
13708
13955
|
console.error("[SWC-MIXIN] Script execution failed:", e);
|
|
13709
13956
|
}
|