@dooboostore/simple-web-component 1.0.23 → 1.0.24
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 +238 -44
- package/dist/cjs/decorators/applyNode.js +129 -34
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/attribute.js +21 -2
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/changedAttributeHost.js.map +2 -2
- package/dist/cjs/decorators/classList.js +60 -17
- package/dist/cjs/decorators/classList.js.map +2 -2
- package/dist/cjs/decorators/query.js +77 -2
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +77 -2
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/decorators/setAttribute.js +4 -4
- package/dist/cjs/decorators/setAttribute.js.map +2 -2
- package/dist/cjs/decorators/style.js +46 -15
- package/dist/cjs/decorators/style.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/utils/Utils.js +140 -1
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +129 -34
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/attribute.js +21 -2
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/changedAttributeHost.js.map +2 -2
- package/dist/esm/decorators/classList.js +60 -17
- package/dist/esm/decorators/classList.js.map +2 -2
- package/dist/esm/decorators/query.js +77 -2
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +77 -2
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/decorators/setAttribute.js +4 -4
- package/dist/esm/decorators/setAttribute.js.map +2 -2
- package/dist/esm/decorators/style.js +46 -15
- package/dist/esm/decorators/style.js.map +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/utils/Utils.js +140 -1
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +542 -155
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/applyNode.d.ts +49 -27
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/attribute.d.ts +11 -4
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/classList.d.ts +15 -5
- package/dist/types/decorators/classList.d.ts.map +1 -1
- package/dist/types/decorators/query.d.ts +68 -4
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +70 -1
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/setAttribute.d.ts.map +1 -1
- package/dist/types/decorators/style.d.ts +17 -8
- package/dist/types/decorators/style.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +49 -0
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +542 -155
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +3 -3
- package/src/decorators/applyNode.ts +179 -60
- package/src/decorators/attribute.ts +43 -10
- package/src/decorators/changedAttributeHost.ts +1 -1
- package/src/decorators/classList.ts +79 -17
- package/src/decorators/query.ts +147 -5
- package/src/decorators/queryAll.ts +148 -2
- package/src/decorators/setAttribute.ts +6 -5
- package/src/decorators/style.ts +67 -22
- package/src/index.ts +6 -6
- package/src/utils/Utils.ts +144 -0
- package/dist/cjs/utils/TemplateUtils.js +0 -109
- package/dist/cjs/utils/TemplateUtils.js.map +0 -7
- package/dist/esm/utils/TemplateUtils.js +0 -90
- package/dist/esm/utils/TemplateUtils.js.map +0 -7
- package/dist/types/utils/TemplateUtils.d.ts +0 -59
- package/dist/types/utils/TemplateUtils.d.ts.map +0 -1
- package/src/utils/TemplateUtils.ts +0 -92
|
@@ -1145,11 +1145,18 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1145
1145
|
STYLE_METADATA_KEY: () => STYLE_METADATA_KEY,
|
|
1146
1146
|
SWC_NOT_FOUND: () => SWC_NOT_FOUND,
|
|
1147
1147
|
SwcUtils: () => SwcUtils,
|
|
1148
|
-
TemplateUtils: () => TemplateUtils,
|
|
1149
1148
|
addClassList: () => addClassList,
|
|
1150
1149
|
addClassListHost: () => addClassListHost,
|
|
1151
1150
|
addEventListener: () => addEventListener,
|
|
1152
1151
|
addEventListenerHost: () => addEventListenerHost,
|
|
1152
|
+
allAppHost: () => allAppHost,
|
|
1153
|
+
allFirstAppHost: () => allFirstAppHost,
|
|
1154
|
+
allFirstHost: () => allFirstHost,
|
|
1155
|
+
allHost: () => allHost,
|
|
1156
|
+
allLastAppHost: () => allLastAppHost,
|
|
1157
|
+
allLastHost: () => allLastHost,
|
|
1158
|
+
allParentHost: () => allParentHost,
|
|
1159
|
+
appHost: () => appHost,
|
|
1153
1160
|
applyAfterBeginNode: () => applyAfterBeginNode,
|
|
1154
1161
|
applyAfterBeginNodeHost: () => applyAfterBeginNodeHost,
|
|
1155
1162
|
applyAfterEndNode: () => applyAfterEndNode,
|
|
@@ -1186,6 +1193,8 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1186
1193
|
findAllLifecycleMetadata: () => findAllLifecycleMetadata,
|
|
1187
1194
|
findAllSetAttributeMetadata: () => findAllSetAttributeMetadata,
|
|
1188
1195
|
findAllStyleMetadata: () => findAllStyleMetadata,
|
|
1196
|
+
firstAppHost: () => firstAppHost,
|
|
1197
|
+
firstHost: () => firstHost,
|
|
1189
1198
|
getAddEventListenerMetadata: () => getAddEventListenerMetadata,
|
|
1190
1199
|
getChangedAttributeMetadata: () => getChangedAttributeMetadata,
|
|
1191
1200
|
getElementConfig: () => getElementConfig,
|
|
@@ -1194,23 +1203,20 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1194
1203
|
getQueryAllMetadata: () => getQueryAllMetadata,
|
|
1195
1204
|
getQueryMetadata: () => getQueryMetadata,
|
|
1196
1205
|
getSetAttributeMetadata: () => getSetAttributeMetadata,
|
|
1206
|
+
host: () => host,
|
|
1197
1207
|
htmlAElement: () => htmlAElement,
|
|
1198
1208
|
htmlArticleElement: () => htmlArticleElement,
|
|
1199
1209
|
htmlButtonElement: () => htmlButtonElement,
|
|
1200
1210
|
htmlDivElement: () => htmlDivElement,
|
|
1201
1211
|
htmlFragment: () => htmlFragment,
|
|
1202
|
-
|
|
1203
|
-
htmlH2Element: () => htmlH2Element,
|
|
1204
|
-
htmlH3Element: () => htmlH3Element,
|
|
1205
|
-
htmlH4Element: () => htmlH4Element,
|
|
1206
|
-
htmlH5Element: () => htmlH5Element,
|
|
1207
|
-
htmlH6Element: () => htmlH6Element,
|
|
1208
|
-
htmlInputElement: () => htmlInputElement,
|
|
1212
|
+
htmlHeadingElement: () => htmlHeadingElement,
|
|
1209
1213
|
htmlLiElement: () => htmlLiElement,
|
|
1210
1214
|
htmlPElement: () => htmlPElement,
|
|
1211
1215
|
htmlSectionElement: () => htmlSectionElement,
|
|
1212
1216
|
htmlSpanElement: () => htmlSpanElement,
|
|
1213
1217
|
htmlUlElement: () => htmlUlElement,
|
|
1218
|
+
lastAppHost: () => lastAppHost,
|
|
1219
|
+
lastHost: () => lastHost,
|
|
1214
1220
|
onAddEventListener: () => onAddEventListener,
|
|
1215
1221
|
onAdopted: () => onAdopted,
|
|
1216
1222
|
onAfterAdopted: () => onAfterAdopted,
|
|
@@ -1223,6 +1229,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1223
1229
|
onConnectedInnerHtml: () => onConnectedInnerHtml,
|
|
1224
1230
|
onConstructor: () => onConstructor,
|
|
1225
1231
|
onDisconnected: () => onDisconnected,
|
|
1232
|
+
parentHost: () => parentHost,
|
|
1226
1233
|
query: () => query,
|
|
1227
1234
|
queryAll: () => queryAll,
|
|
1228
1235
|
queryAllHost: () => queryAllHost,
|
|
@@ -6060,8 +6067,27 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6060
6067
|
var findAllAttributeMetadata = (target) => {
|
|
6061
6068
|
return ReflectUtils.findAllMetadata(ATTRIBUTE_METADATA_KEY, target).flat();
|
|
6062
6069
|
};
|
|
6063
|
-
function attributeHost(
|
|
6064
|
-
|
|
6070
|
+
function attributeHost(targetOrAttrOrOptions, propertyKeyOrOptions) {
|
|
6071
|
+
if (propertyKeyOrOptions !== void 0 && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
|
|
6072
|
+
const fieldName = String(propertyKeyOrOptions);
|
|
6073
|
+
return attribute(":host", { name: fieldName })(targetOrAttrOrOptions, propertyKeyOrOptions);
|
|
6074
|
+
}
|
|
6075
|
+
if (typeof targetOrAttrOrOptions === "string") {
|
|
6076
|
+
const attrName = targetOrAttrOrOptions;
|
|
6077
|
+
const options = typeof propertyKeyOrOptions === "object" ? propertyKeyOrOptions : {};
|
|
6078
|
+
return attribute(":host", { ...options, name: attrName });
|
|
6079
|
+
} else if (typeof targetOrAttrOrOptions === "object") {
|
|
6080
|
+
const options = targetOrAttrOrOptions;
|
|
6081
|
+
return (target, propertyKey) => {
|
|
6082
|
+
const fieldName = String(propertyKey);
|
|
6083
|
+
return attribute(":host", { ...options, name: fieldName })(target, propertyKey);
|
|
6084
|
+
};
|
|
6085
|
+
} else {
|
|
6086
|
+
return (target, propertyKey) => {
|
|
6087
|
+
const fieldName = String(propertyKey);
|
|
6088
|
+
return attribute(":host", { name: fieldName })(target, propertyKey);
|
|
6089
|
+
};
|
|
6090
|
+
}
|
|
6065
6091
|
}
|
|
6066
6092
|
|
|
6067
6093
|
// src/decorators/changedAttributeHost.ts
|
|
@@ -6115,11 +6141,11 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6115
6141
|
const applyRoot = (t) => {
|
|
6116
6142
|
if (!t) return;
|
|
6117
6143
|
if (r === "auto") {
|
|
6118
|
-
targetEls.push(t
|
|
6119
|
-
|
|
6144
|
+
targetEls.push(t);
|
|
6145
|
+
} else {
|
|
6146
|
+
if (r === "light" || r === "all") targetEls.push(t);
|
|
6147
|
+
if ((r === "shadow" || r === "all") && t.shadowRoot) targetEls.push(t.shadowRoot);
|
|
6120
6148
|
}
|
|
6121
|
-
if (r === "light" || r === "all") targetEls.push(t);
|
|
6122
|
-
if ((r === "shadow" || r === "all") && t.shadowRoot) targetEls.push(t.shadowRoot);
|
|
6123
6149
|
};
|
|
6124
6150
|
if (selector === ":window") targetEls.push(currentWin);
|
|
6125
6151
|
else if (selector === ":document") targetEls.push(currentWin.document);
|
|
@@ -6203,15 +6229,20 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6203
6229
|
const currentDoc = currentWin.document;
|
|
6204
6230
|
const pos = options.position || "beforeEnd";
|
|
6205
6231
|
const r = options.root || "auto";
|
|
6206
|
-
const
|
|
6232
|
+
const applyRoot = (t) => {
|
|
6233
|
+
if (!t || !(t instanceof HTMLElement))
|
|
6234
|
+
return t;
|
|
6235
|
+
if (r === "auto")
|
|
6236
|
+
return t.shadowRoot || t;
|
|
6207
6237
|
if (r === "shadow")
|
|
6208
|
-
return
|
|
6238
|
+
return t.shadowRoot;
|
|
6209
6239
|
if (r === "light")
|
|
6210
|
-
return
|
|
6240
|
+
return t;
|
|
6211
6241
|
if (r === "all")
|
|
6212
|
-
return
|
|
6213
|
-
return
|
|
6242
|
+
return t.shadowRoot || t;
|
|
6243
|
+
return t;
|
|
6214
6244
|
};
|
|
6245
|
+
const hostSet = SwcUtils.getHostSet(this);
|
|
6215
6246
|
if (pos === "remove") {
|
|
6216
6247
|
if (res) {
|
|
6217
6248
|
if (selector === ":host" || !selector) {
|
|
@@ -6221,7 +6252,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6221
6252
|
this.remove();
|
|
6222
6253
|
}
|
|
6223
6254
|
} else {
|
|
6224
|
-
const targetRoot =
|
|
6255
|
+
const targetRoot = applyRoot(this);
|
|
6225
6256
|
if (targetRoot) {
|
|
6226
6257
|
const targets = targetRoot.querySelectorAll(selector);
|
|
6227
6258
|
targets.forEach((el) => el.remove());
|
|
@@ -6230,14 +6261,22 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6230
6261
|
}
|
|
6231
6262
|
} else {
|
|
6232
6263
|
let targetEl = null;
|
|
6233
|
-
if (selector === ":host"
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6264
|
+
if (selector === ":host") {
|
|
6265
|
+
targetEl = applyRoot(this);
|
|
6266
|
+
} else if (selector === ":parentHost") {
|
|
6267
|
+
targetEl = applyRoot(hostSet.$parentHost);
|
|
6268
|
+
} else if (selector === ":appHost") {
|
|
6269
|
+
targetEl = applyRoot(hostSet.$appHost);
|
|
6270
|
+
} else if (selector === ":firstHost") {
|
|
6271
|
+
targetEl = applyRoot(hostSet.$firstHost);
|
|
6272
|
+
} else if (selector === ":lastHost") {
|
|
6273
|
+
targetEl = applyRoot(hostSet.$lastHost);
|
|
6274
|
+
} else if (selector === ":firstAppHost") {
|
|
6275
|
+
targetEl = applyRoot(hostSet.$firstHost);
|
|
6276
|
+
} else if (selector === ":lastAppHost") {
|
|
6277
|
+
targetEl = applyRoot(hostSet.$lastAppHost);
|
|
6239
6278
|
} else {
|
|
6240
|
-
const targetRoot =
|
|
6279
|
+
const targetRoot = applyRoot(this);
|
|
6241
6280
|
targetEl = targetRoot ? targetRoot.querySelector(selector) : null;
|
|
6242
6281
|
}
|
|
6243
6282
|
if (targetEl) {
|
|
@@ -6282,27 +6321,108 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6282
6321
|
});
|
|
6283
6322
|
return result;
|
|
6284
6323
|
};
|
|
6285
|
-
function applyNodeHost(
|
|
6286
|
-
|
|
6324
|
+
function applyNodeHost(targetOrOptions, propertyKey, descriptor) {
|
|
6325
|
+
console.log("vvvvv");
|
|
6326
|
+
if (propertyKey !== void 0 && typeof propertyKey === "string" || typeof propertyKey === "symbol") {
|
|
6327
|
+
return applyNode(":host", { position: "beforeEnd" })(targetOrOptions, propertyKey, descriptor);
|
|
6328
|
+
}
|
|
6329
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6330
|
+
const options = targetOrOptions;
|
|
6331
|
+
return applyNode(":host", { ...options, position: options.position || "beforeEnd" });
|
|
6332
|
+
} else {
|
|
6333
|
+
return applyNode(":host", { position: "beforeEnd" });
|
|
6334
|
+
}
|
|
6335
|
+
}
|
|
6336
|
+
function applyBeforeBeginNode(selector, options) {
|
|
6337
|
+
return applyNode(selector, { ...options, position: "beforeBegin" });
|
|
6338
|
+
}
|
|
6339
|
+
function applyAfterBeginNode(selector, options) {
|
|
6340
|
+
return applyNode(selector, { ...options, position: "afterBegin" });
|
|
6341
|
+
}
|
|
6342
|
+
function applyBeforeEndNode(selector, options) {
|
|
6343
|
+
return applyNode(selector, { ...options, position: "beforeEnd" });
|
|
6344
|
+
}
|
|
6345
|
+
function applyAfterEndNode(selector, options) {
|
|
6346
|
+
return applyNode(selector, { ...options, position: "afterEnd" });
|
|
6347
|
+
}
|
|
6348
|
+
function applyReplaceNode(selector, options) {
|
|
6349
|
+
return applyNode(selector, { ...options, position: "replace" });
|
|
6350
|
+
}
|
|
6351
|
+
function applyReplaceChildrenNode(selector, options) {
|
|
6352
|
+
return applyNode(selector, { ...options, position: "replaceChildren" });
|
|
6353
|
+
}
|
|
6354
|
+
function applyInnerHtmlNode(selector, options) {
|
|
6355
|
+
return applyNode(selector, { ...options, position: "innerHtml" });
|
|
6356
|
+
}
|
|
6357
|
+
function applyInnerTextNode(selector, options) {
|
|
6358
|
+
return applyNode(selector, { ...options, position: "innerText" });
|
|
6359
|
+
}
|
|
6360
|
+
function applyRemoveNode(selector, options) {
|
|
6361
|
+
return applyNode(selector, { ...options, position: "remove" });
|
|
6362
|
+
}
|
|
6363
|
+
function applyBeforeBeginNodeHost(targetOrOptions, propertyKey, descriptor) {
|
|
6364
|
+
if (propertyKey !== void 0) {
|
|
6365
|
+
const decorator = applyNode(":host", { position: "beforeBegin" });
|
|
6366
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6367
|
+
}
|
|
6368
|
+
return applyNode(":host", { ...targetOrOptions || {}, position: "beforeBegin" });
|
|
6369
|
+
}
|
|
6370
|
+
function applyAfterBeginNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6371
|
+
if (propertyKey !== void 0) {
|
|
6372
|
+
const decorator = applyNode(":host", { position: "afterBegin" });
|
|
6373
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6374
|
+
}
|
|
6375
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "afterBegin" });
|
|
6376
|
+
}
|
|
6377
|
+
function applyBeforeEndNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6378
|
+
if (propertyKey !== void 0) {
|
|
6379
|
+
const decorator = applyNode(":host", { position: "beforeEnd" });
|
|
6380
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6381
|
+
}
|
|
6382
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "beforeEnd" });
|
|
6383
|
+
}
|
|
6384
|
+
function applyAfterEndNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6385
|
+
if (propertyKey !== void 0) {
|
|
6386
|
+
const decorator = applyNode(":host", { position: "afterEnd" });
|
|
6387
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6388
|
+
}
|
|
6389
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "afterEnd" });
|
|
6390
|
+
}
|
|
6391
|
+
function applyReplaceNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6392
|
+
if (propertyKey !== void 0) {
|
|
6393
|
+
const decorator = applyNode(":host", { position: "replace" });
|
|
6394
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6395
|
+
}
|
|
6396
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "replace" });
|
|
6397
|
+
}
|
|
6398
|
+
function applyReplaceChildrenNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6399
|
+
if (propertyKey !== void 0) {
|
|
6400
|
+
const decorator = applyNode(":host", { position: "replaceChildren" });
|
|
6401
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6402
|
+
}
|
|
6403
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "replaceChildren" });
|
|
6404
|
+
}
|
|
6405
|
+
function applyInnerHtmlNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6406
|
+
if (propertyKey !== void 0) {
|
|
6407
|
+
const decorator = applyNode(":host", { position: "innerHtml" });
|
|
6408
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6409
|
+
}
|
|
6410
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "innerHtml" });
|
|
6411
|
+
}
|
|
6412
|
+
function applyInnerTextNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6413
|
+
if (propertyKey !== void 0) {
|
|
6414
|
+
const decorator = applyNode(":host", { position: "innerText" });
|
|
6415
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6416
|
+
}
|
|
6417
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "innerText" });
|
|
6418
|
+
}
|
|
6419
|
+
function applyRemoveNodeHost(optionsOrTarget, propertyKey, descriptor) {
|
|
6420
|
+
if (propertyKey !== void 0) {
|
|
6421
|
+
const decorator = applyNode(":host", { position: "remove" });
|
|
6422
|
+
return decorator(optionsOrTarget, propertyKey, descriptor);
|
|
6423
|
+
}
|
|
6424
|
+
return applyNode(":host", { ...optionsOrTarget || {}, position: "remove" });
|
|
6287
6425
|
}
|
|
6288
|
-
var applyBeforeBeginNode = (selector, options = {}) => applyNode(selector, { ...options, position: "beforeBegin" });
|
|
6289
|
-
var applyAfterBeginNode = (selector, options = {}) => applyNode(selector, { ...options, position: "afterBegin" });
|
|
6290
|
-
var applyBeforeEndNode = (selector, options = {}) => applyNode(selector, { ...options, position: "beforeEnd" });
|
|
6291
|
-
var applyAfterEndNode = (selector, options = {}) => applyNode(selector, { ...options, position: "afterEnd" });
|
|
6292
|
-
var applyReplaceNode = (selector, options = {}) => applyNode(selector, { ...options, position: "replace" });
|
|
6293
|
-
var applyReplaceChildrenNode = (selector, options = {}) => applyNode(selector, { ...options, position: "replaceChildren" });
|
|
6294
|
-
var applyInnerHtmlNode = (selector, options = {}) => applyNode(selector, { ...options, position: "innerHtml" });
|
|
6295
|
-
var applyInnerTextNode = (selector, options = {}) => applyNode(selector, { ...options, position: "innerText" });
|
|
6296
|
-
var applyRemoveNode = (selector, options = {}) => applyNode(selector, { ...options, position: "remove" });
|
|
6297
|
-
var applyBeforeBeginNodeHost = (options = {}) => applyNode(":host", { ...options, position: "beforeBegin" });
|
|
6298
|
-
var applyAfterBeginNodeHost = (options = {}) => applyNode(":host", { ...options, position: "afterBegin" });
|
|
6299
|
-
var applyBeforeEndNodeHost = (options = {}) => applyNode(":host", { ...options, position: "beforeEnd" });
|
|
6300
|
-
var applyAfterEndNodeHost = (options = {}) => applyNode(":host", { ...options, position: "afterEnd" });
|
|
6301
|
-
var applyReplaceNodeHost = (options = {}) => applyNode(":host", { ...options, position: "replace" });
|
|
6302
|
-
var applyReplaceChildrenNodeHost = (options = {}) => applyNode(":host", { ...options, position: "replaceChildren" });
|
|
6303
|
-
var applyInnerHtmlNodeHost = (options = {}) => applyNode(":host", { ...options, position: "innerHtml" });
|
|
6304
|
-
var applyInnerTextNodeHost = (options = {}) => applyNode(":host", { ...options, position: "innerText" });
|
|
6305
|
-
var applyRemoveNodeHost = (options = {}) => applyNode(":host", { ...options, position: "remove" });
|
|
6306
6426
|
|
|
6307
6427
|
// src/decorators/query.ts
|
|
6308
6428
|
var QUERY_METADATA_KEY = Symbol("simple-web-component:query");
|
|
@@ -6403,8 +6523,76 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6403
6523
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
6404
6524
|
return ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
|
|
6405
6525
|
};
|
|
6406
|
-
function queryHost(
|
|
6407
|
-
|
|
6526
|
+
function queryHost(targetOrOptions, propertyKey) {
|
|
6527
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6528
|
+
return query(":host", {})(targetOrOptions, propertyKey);
|
|
6529
|
+
}
|
|
6530
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6531
|
+
return query(":host", targetOrOptions);
|
|
6532
|
+
} else {
|
|
6533
|
+
return query(":host", {});
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
var host = queryHost;
|
|
6537
|
+
function parentHost(targetOrOptions, propertyKey) {
|
|
6538
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6539
|
+
return query(":parentHost", {})(targetOrOptions, propertyKey);
|
|
6540
|
+
}
|
|
6541
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6542
|
+
return query(":parentHost", targetOrOptions);
|
|
6543
|
+
} else {
|
|
6544
|
+
return query(":parentHost", {});
|
|
6545
|
+
}
|
|
6546
|
+
}
|
|
6547
|
+
function appHost(targetOrOptions, propertyKey) {
|
|
6548
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6549
|
+
return query(":appHost", {})(targetOrOptions, propertyKey);
|
|
6550
|
+
}
|
|
6551
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6552
|
+
return query(":appHost", targetOrOptions);
|
|
6553
|
+
} else {
|
|
6554
|
+
return query(":appHost", {});
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
function firstHost(targetOrOptions, propertyKey) {
|
|
6558
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6559
|
+
return query(":firstHost", {})(targetOrOptions, propertyKey);
|
|
6560
|
+
}
|
|
6561
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6562
|
+
return query(":firstHost", targetOrOptions);
|
|
6563
|
+
} else {
|
|
6564
|
+
return query(":firstHost", {});
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
function lastHost(targetOrOptions, propertyKey) {
|
|
6568
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6569
|
+
return query(":lastHost", {})(targetOrOptions, propertyKey);
|
|
6570
|
+
}
|
|
6571
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6572
|
+
return query(":lastHost", targetOrOptions);
|
|
6573
|
+
} else {
|
|
6574
|
+
return query(":lastHost", {});
|
|
6575
|
+
}
|
|
6576
|
+
}
|
|
6577
|
+
function firstAppHost(targetOrOptions, propertyKey) {
|
|
6578
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6579
|
+
return query(":firstAppHost", {})(targetOrOptions, propertyKey);
|
|
6580
|
+
}
|
|
6581
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6582
|
+
return query(":firstAppHost", targetOrOptions);
|
|
6583
|
+
} else {
|
|
6584
|
+
return query(":firstAppHost", {});
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
function lastAppHost(targetOrOptions, propertyKey) {
|
|
6588
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6589
|
+
return query(":lastAppHost", {})(targetOrOptions, propertyKey);
|
|
6590
|
+
}
|
|
6591
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6592
|
+
return query(":lastAppHost", targetOrOptions);
|
|
6593
|
+
} else {
|
|
6594
|
+
return query(":lastAppHost", {});
|
|
6595
|
+
}
|
|
6408
6596
|
}
|
|
6409
6597
|
|
|
6410
6598
|
// src/decorators/queryAll.ts
|
|
@@ -6503,8 +6691,76 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6503
6691
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
6504
6692
|
return ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
|
|
6505
6693
|
};
|
|
6506
|
-
function queryAllHost(
|
|
6507
|
-
|
|
6694
|
+
function queryAllHost(targetOrOptions, propertyKey) {
|
|
6695
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6696
|
+
return queryAll(":host", {})(targetOrOptions, propertyKey);
|
|
6697
|
+
}
|
|
6698
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6699
|
+
return queryAll(":host", targetOrOptions);
|
|
6700
|
+
} else {
|
|
6701
|
+
return queryAll(":host", {});
|
|
6702
|
+
}
|
|
6703
|
+
}
|
|
6704
|
+
var allHost = queryAllHost;
|
|
6705
|
+
function allParentHost(targetOrOptions, propertyKey) {
|
|
6706
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6707
|
+
return queryAll(":parentHost", {})(targetOrOptions, propertyKey);
|
|
6708
|
+
}
|
|
6709
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6710
|
+
return queryAll(":parentHost", targetOrOptions);
|
|
6711
|
+
} else {
|
|
6712
|
+
return queryAll(":parentHost", {});
|
|
6713
|
+
}
|
|
6714
|
+
}
|
|
6715
|
+
function allAppHost(targetOrOptions, propertyKey) {
|
|
6716
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6717
|
+
return queryAll(":appHost", {})(targetOrOptions, propertyKey);
|
|
6718
|
+
}
|
|
6719
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6720
|
+
return queryAll(":appHost", targetOrOptions);
|
|
6721
|
+
} else {
|
|
6722
|
+
return queryAll(":appHost", {});
|
|
6723
|
+
}
|
|
6724
|
+
}
|
|
6725
|
+
function allFirstHost(targetOrOptions, propertyKey) {
|
|
6726
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6727
|
+
return queryAll(":firstHost", {})(targetOrOptions, propertyKey);
|
|
6728
|
+
}
|
|
6729
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6730
|
+
return queryAll(":firstHost", targetOrOptions);
|
|
6731
|
+
} else {
|
|
6732
|
+
return queryAll(":firstHost", {});
|
|
6733
|
+
}
|
|
6734
|
+
}
|
|
6735
|
+
function allLastHost(targetOrOptions, propertyKey) {
|
|
6736
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6737
|
+
return queryAll(":lastHost", {})(targetOrOptions, propertyKey);
|
|
6738
|
+
}
|
|
6739
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6740
|
+
return queryAll(":lastHost", targetOrOptions);
|
|
6741
|
+
} else {
|
|
6742
|
+
return queryAll(":lastHost", {});
|
|
6743
|
+
}
|
|
6744
|
+
}
|
|
6745
|
+
function allFirstAppHost(targetOrOptions, propertyKey) {
|
|
6746
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6747
|
+
return queryAll(":firstAppHost", {})(targetOrOptions, propertyKey);
|
|
6748
|
+
}
|
|
6749
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6750
|
+
return queryAll(":firstAppHost", targetOrOptions);
|
|
6751
|
+
} else {
|
|
6752
|
+
return queryAll(":firstAppHost", {});
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
function allLastAppHost(targetOrOptions, propertyKey) {
|
|
6756
|
+
if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
6757
|
+
return queryAll(":lastAppHost", {})(targetOrOptions, propertyKey);
|
|
6758
|
+
}
|
|
6759
|
+
if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
|
|
6760
|
+
return queryAll(":lastAppHost", targetOrOptions);
|
|
6761
|
+
} else {
|
|
6762
|
+
return queryAll(":lastAppHost", {});
|
|
6763
|
+
}
|
|
6508
6764
|
}
|
|
6509
6765
|
|
|
6510
6766
|
// src/decorators/classList.ts
|
|
@@ -6527,27 +6783,40 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6527
6783
|
const r = options.root || "auto";
|
|
6528
6784
|
const hostSet = SwcUtils.getHostSet(this);
|
|
6529
6785
|
const targetEls = [];
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6786
|
+
const applyRoot = (t) => {
|
|
6787
|
+
if (!t || !(t instanceof HTMLElement)) return;
|
|
6788
|
+
if (r === "auto") {
|
|
6789
|
+
targetEls.push(t);
|
|
6790
|
+
} else {
|
|
6791
|
+
if (r === "light" || r === "all") targetEls.push(t);
|
|
6792
|
+
if ((r === "shadow" || r === "all") && t.shadowRoot) {
|
|
6793
|
+
}
|
|
6794
|
+
}
|
|
6795
|
+
};
|
|
6796
|
+
if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
|
|
6797
|
+
else if (selector === ":appHost") applyRoot(hostSet.$appHost);
|
|
6798
|
+
else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
|
|
6799
|
+
else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
|
|
6800
|
+
else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
6801
|
+
else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
6802
|
+
else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
|
|
6803
|
+
else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
6804
|
+
else if (selector === ":host" || !selector) applyRoot(this);
|
|
6805
|
+
else {
|
|
6537
6806
|
if (r === "shadow") {
|
|
6538
6807
|
const found = this.shadowRoot?.querySelectorAll(selector);
|
|
6539
|
-
if (found) targetEls.push(...found);
|
|
6808
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6540
6809
|
} else if (r === "light") {
|
|
6541
6810
|
const found = this.querySelectorAll(selector);
|
|
6542
|
-
if (found) targetEls.push(...found);
|
|
6811
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6543
6812
|
} else if (r === "all") {
|
|
6544
6813
|
const sFound = this.shadowRoot?.querySelectorAll(selector);
|
|
6545
6814
|
const lFound = this.querySelectorAll(selector);
|
|
6546
|
-
if (sFound) targetEls.push(...sFound);
|
|
6547
|
-
if (lFound) targetEls.push(...lFound);
|
|
6815
|
+
if (sFound) targetEls.push(...Array.from(sFound));
|
|
6816
|
+
if (lFound) targetEls.push(...Array.from(lFound));
|
|
6548
6817
|
} else {
|
|
6549
6818
|
const found = (this.shadowRoot || this).querySelectorAll(selector);
|
|
6550
|
-
if (found) targetEls.push(...found);
|
|
6819
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6551
6820
|
}
|
|
6552
6821
|
}
|
|
6553
6822
|
targetEls.forEach((targetEl) => {
|
|
@@ -6590,11 +6859,41 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6590
6859
|
var addClassList = (selector, options = {}) => createClassListDecorator("add")(selector, options);
|
|
6591
6860
|
var removeClassList = (selector, options = {}) => createClassListDecorator("remove")(selector, options);
|
|
6592
6861
|
var toggleClassList = (selector, options = {}) => createClassListDecorator("toggle")(selector, options);
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6862
|
+
function setClassListHost(targetOrOptions, propertyKey, descriptor) {
|
|
6863
|
+
if (propertyKey !== void 0) {
|
|
6864
|
+
const decorator = createClassListDecorator("set")(":host", {});
|
|
6865
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6866
|
+
}
|
|
6867
|
+
return createClassListDecorator("set")(":host", targetOrOptions || {});
|
|
6868
|
+
}
|
|
6869
|
+
function updateClassListHost(targetOrOptions, propertyKey, descriptor) {
|
|
6870
|
+
if (propertyKey !== void 0) {
|
|
6871
|
+
const decorator = createClassListDecorator("update")(":host", {});
|
|
6872
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6873
|
+
}
|
|
6874
|
+
return createClassListDecorator("update")(":host", targetOrOptions || {});
|
|
6875
|
+
}
|
|
6876
|
+
function addClassListHost(targetOrOptions, propertyKey, descriptor) {
|
|
6877
|
+
if (propertyKey !== void 0) {
|
|
6878
|
+
const decorator = createClassListDecorator("add")(":host", {});
|
|
6879
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6880
|
+
}
|
|
6881
|
+
return createClassListDecorator("add")(":host", targetOrOptions || {});
|
|
6882
|
+
}
|
|
6883
|
+
function removeClassListHost(targetOrOptions, propertyKey, descriptor) {
|
|
6884
|
+
if (propertyKey !== void 0) {
|
|
6885
|
+
const decorator = createClassListDecorator("remove")(":host", {});
|
|
6886
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6887
|
+
}
|
|
6888
|
+
return createClassListDecorator("remove")(":host", targetOrOptions || {});
|
|
6889
|
+
}
|
|
6890
|
+
function toggleClassListHost(targetOrOptions, propertyKey, descriptor) {
|
|
6891
|
+
if (propertyKey !== void 0) {
|
|
6892
|
+
const decorator = createClassListDecorator("toggle")(":host", {});
|
|
6893
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6894
|
+
}
|
|
6895
|
+
return createClassListDecorator("toggle")(":host", targetOrOptions || {});
|
|
6896
|
+
}
|
|
6598
6897
|
var findAllClassListMetadata = (target) => {
|
|
6599
6898
|
const result = /* @__PURE__ */ new Map();
|
|
6600
6899
|
const maps = ReflectUtils.findAllMetadata(CLASS_LIST_METADATA_KEY, target);
|
|
@@ -6626,27 +6925,40 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6626
6925
|
const r = options.root || "auto";
|
|
6627
6926
|
const hostSet = SwcUtils.getHostSet(this);
|
|
6628
6927
|
const targetEls = [];
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6928
|
+
const applyRoot = (t) => {
|
|
6929
|
+
if (!t || !(t instanceof HTMLElement)) return;
|
|
6930
|
+
if (r === "auto") {
|
|
6931
|
+
targetEls.push(t);
|
|
6932
|
+
} else {
|
|
6933
|
+
if (r === "light" || r === "all") targetEls.push(t);
|
|
6934
|
+
if ((r === "shadow" || r === "all") && t.shadowRoot) {
|
|
6935
|
+
}
|
|
6936
|
+
}
|
|
6937
|
+
};
|
|
6938
|
+
if (selector === ":parentHost") applyRoot(hostSet.$parentHost);
|
|
6939
|
+
else if (selector === ":appHost") applyRoot(hostSet.$appHost);
|
|
6940
|
+
else if (selector === ":firstHost") applyRoot(hostSet.$firstHost);
|
|
6941
|
+
else if (selector === ":lastHost") applyRoot(hostSet.$lastHost);
|
|
6942
|
+
else if (selector === ":firstAppHost") applyRoot(hostSet.$firstAppHost);
|
|
6943
|
+
else if (selector === ":lastAppHost") applyRoot(hostSet.$lastAppHost);
|
|
6944
|
+
else if (selector === ":hosts") hostSet.$hosts.forEach(applyRoot);
|
|
6945
|
+
else if (selector === ":appHosts") hostSet.$appHosts.forEach(applyRoot);
|
|
6946
|
+
else if (selector === ":host" || !selector) applyRoot(this);
|
|
6947
|
+
else {
|
|
6636
6948
|
if (r === "shadow") {
|
|
6637
6949
|
const found = this.shadowRoot?.querySelectorAll(selector);
|
|
6638
|
-
if (found) targetEls.push(...found);
|
|
6950
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6639
6951
|
} else if (r === "light") {
|
|
6640
6952
|
const found = this.querySelectorAll(selector);
|
|
6641
|
-
if (found) targetEls.push(...found);
|
|
6953
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6642
6954
|
} else if (r === "all") {
|
|
6643
6955
|
const sFound = this.shadowRoot?.querySelectorAll(selector);
|
|
6644
6956
|
const lFound = this.querySelectorAll(selector);
|
|
6645
|
-
if (sFound) targetEls.push(...sFound);
|
|
6646
|
-
if (lFound) targetEls.push(...lFound);
|
|
6957
|
+
if (sFound) targetEls.push(...Array.from(sFound));
|
|
6958
|
+
if (lFound) targetEls.push(...Array.from(lFound));
|
|
6647
6959
|
} else {
|
|
6648
6960
|
const found = (this.shadowRoot || this).querySelectorAll(selector);
|
|
6649
|
-
if (found) targetEls.push(...found);
|
|
6961
|
+
if (found) targetEls.push(...Array.from(found));
|
|
6650
6962
|
}
|
|
6651
6963
|
}
|
|
6652
6964
|
targetEls.forEach((targetEl) => {
|
|
@@ -6673,11 +6985,29 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6673
6985
|
};
|
|
6674
6986
|
}
|
|
6675
6987
|
var setStyle = (selector, options = {}) => createStyleDecorator("set")(selector, options);
|
|
6676
|
-
|
|
6988
|
+
function setStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
6989
|
+
if (propertyKey !== void 0) {
|
|
6990
|
+
const decorator = createStyleDecorator("set")(":host", {});
|
|
6991
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
6992
|
+
}
|
|
6993
|
+
return createStyleDecorator("set")(":host", targetOrOptions || {});
|
|
6994
|
+
}
|
|
6677
6995
|
var updateStyle = (selector, options = {}) => createStyleDecorator("update")(selector, options);
|
|
6678
|
-
|
|
6996
|
+
function updateStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
6997
|
+
if (propertyKey !== void 0) {
|
|
6998
|
+
const decorator = createStyleDecorator("update")(":host", {});
|
|
6999
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
7000
|
+
}
|
|
7001
|
+
return createStyleDecorator("update")(":host", targetOrOptions || {});
|
|
7002
|
+
}
|
|
6679
7003
|
var removeStyle = (selector, options = {}) => createStyleDecorator("remove")(selector, options);
|
|
6680
|
-
|
|
7004
|
+
function removeStyleHost(targetOrOptions, propertyKey, descriptor) {
|
|
7005
|
+
if (propertyKey !== void 0) {
|
|
7006
|
+
const decorator = createStyleDecorator("remove")(":host", {});
|
|
7007
|
+
return decorator(targetOrOptions, propertyKey, descriptor);
|
|
7008
|
+
}
|
|
7009
|
+
return createStyleDecorator("remove")(":host", targetOrOptions || {});
|
|
7010
|
+
}
|
|
6681
7011
|
var findAllStyleMetadata = (target) => {
|
|
6682
7012
|
const result = /* @__PURE__ */ new Map();
|
|
6683
7013
|
const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
|
|
@@ -6691,6 +7021,131 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6691
7021
|
|
|
6692
7022
|
// src/utils/Utils.ts
|
|
6693
7023
|
var SWC_NOT_FOUND = Symbol("SWC_NOT_FOUND");
|
|
7024
|
+
var htmlFragment = (html, doc) => {
|
|
7025
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
7026
|
+
if (!d) throw new Error("Document is not available");
|
|
7027
|
+
const template = d.createElement("template");
|
|
7028
|
+
template.innerHTML = html.trim();
|
|
7029
|
+
return template.content;
|
|
7030
|
+
};
|
|
7031
|
+
var textNode = (text, doc) => {
|
|
7032
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
7033
|
+
if (!d) throw new Error("Document is not available");
|
|
7034
|
+
return d.createTextNode(text !== void 0 && text !== null ? String(text) : "");
|
|
7035
|
+
};
|
|
7036
|
+
var commentNode = (comment, doc) => {
|
|
7037
|
+
const d = doc || (typeof document !== "undefined" ? document : void 0);
|
|
7038
|
+
if (!d) throw new Error("Document is not available");
|
|
7039
|
+
return d.createComment(comment !== void 0 && comment !== null ? String(comment) : "");
|
|
7040
|
+
};
|
|
7041
|
+
var createElement = (tagName, options) => {
|
|
7042
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7043
|
+
if (!d) throw new Error("Document is not available");
|
|
7044
|
+
const el = d.createElement(tagName);
|
|
7045
|
+
if (options?.html) el.innerHTML = options.html;
|
|
7046
|
+
if (options?.attrs) {
|
|
7047
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7048
|
+
}
|
|
7049
|
+
return el;
|
|
7050
|
+
};
|
|
7051
|
+
var htmlDivElement = (html, options) => {
|
|
7052
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7053
|
+
if (!d) throw new Error("Document is not available");
|
|
7054
|
+
const el = d.createElement("div");
|
|
7055
|
+
el.innerHTML = html.trim();
|
|
7056
|
+
if (options?.attrs) {
|
|
7057
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7058
|
+
}
|
|
7059
|
+
return el;
|
|
7060
|
+
};
|
|
7061
|
+
var htmlSpanElement = (html, options) => {
|
|
7062
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7063
|
+
if (!d) throw new Error("Document is not available");
|
|
7064
|
+
const el = d.createElement("span");
|
|
7065
|
+
el.innerHTML = html.trim();
|
|
7066
|
+
if (options?.attrs) {
|
|
7067
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7068
|
+
}
|
|
7069
|
+
return el;
|
|
7070
|
+
};
|
|
7071
|
+
var htmlButtonElement = (html, options) => {
|
|
7072
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7073
|
+
if (!d) throw new Error("Document is not available");
|
|
7074
|
+
const el = d.createElement("button");
|
|
7075
|
+
el.innerHTML = html.trim();
|
|
7076
|
+
if (options?.attrs) {
|
|
7077
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7078
|
+
}
|
|
7079
|
+
return el;
|
|
7080
|
+
};
|
|
7081
|
+
var htmlUlElement = (options) => {
|
|
7082
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7083
|
+
if (!d) throw new Error("Document is not available");
|
|
7084
|
+
const el = d.createElement("ul");
|
|
7085
|
+
if (options?.attrs) {
|
|
7086
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7087
|
+
}
|
|
7088
|
+
return el;
|
|
7089
|
+
};
|
|
7090
|
+
var htmlLiElement = (html, options) => {
|
|
7091
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7092
|
+
if (!d) throw new Error("Document is not available");
|
|
7093
|
+
const el = d.createElement("li");
|
|
7094
|
+
el.innerHTML = html.trim();
|
|
7095
|
+
if (options?.attrs) {
|
|
7096
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7097
|
+
}
|
|
7098
|
+
return el;
|
|
7099
|
+
};
|
|
7100
|
+
var htmlAElement = (html, options) => {
|
|
7101
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7102
|
+
if (!d) throw new Error("Document is not available");
|
|
7103
|
+
const el = d.createElement("a");
|
|
7104
|
+
el.innerHTML = html.trim();
|
|
7105
|
+
if (options?.href) el.href = options.href;
|
|
7106
|
+
if (options?.attrs) {
|
|
7107
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7108
|
+
}
|
|
7109
|
+
return el;
|
|
7110
|
+
};
|
|
7111
|
+
var htmlPElement = (html, options) => {
|
|
7112
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7113
|
+
if (!d) throw new Error("Document is not available");
|
|
7114
|
+
const el = d.createElement("p");
|
|
7115
|
+
el.innerHTML = html.trim();
|
|
7116
|
+
if (options?.attrs) {
|
|
7117
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7118
|
+
}
|
|
7119
|
+
return el;
|
|
7120
|
+
};
|
|
7121
|
+
var htmlHeadingElement = (level, html, options) => {
|
|
7122
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7123
|
+
if (!d) throw new Error("Document is not available");
|
|
7124
|
+
const el = d.createElement(`h${level}`);
|
|
7125
|
+
el.innerHTML = html.trim();
|
|
7126
|
+
if (options?.attrs) {
|
|
7127
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7128
|
+
}
|
|
7129
|
+
return el;
|
|
7130
|
+
};
|
|
7131
|
+
var htmlSectionElement = (options) => {
|
|
7132
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7133
|
+
if (!d) throw new Error("Document is not available");
|
|
7134
|
+
const el = d.createElement("section");
|
|
7135
|
+
if (options?.attrs) {
|
|
7136
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7137
|
+
}
|
|
7138
|
+
return el;
|
|
7139
|
+
};
|
|
7140
|
+
var htmlArticleElement = (options) => {
|
|
7141
|
+
const d = options?.doc || (typeof document !== "undefined" ? document : void 0);
|
|
7142
|
+
if (!d) throw new Error("Document is not available");
|
|
7143
|
+
const el = d.createElement("article");
|
|
7144
|
+
if (options?.attrs) {
|
|
7145
|
+
Object.entries(options.attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
7146
|
+
}
|
|
7147
|
+
return el;
|
|
7148
|
+
};
|
|
6694
7149
|
var SwcUtils;
|
|
6695
7150
|
((SwcUtils2) => {
|
|
6696
7151
|
SwcUtils2.getHelperSet = (win) => {
|
|
@@ -6753,7 +7208,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
6753
7208
|
};
|
|
6754
7209
|
SwcUtils2.getAppHosts = (el) => {
|
|
6755
7210
|
const hosts = (0, SwcUtils2.getHosts)(el);
|
|
6756
|
-
return hosts.filter((
|
|
7211
|
+
return hosts.filter((host2) => host2.tagName.toLowerCase() === "swc-app" || host2.getAttribute("is")?.startsWith("swc-app-"));
|
|
6757
7212
|
};
|
|
6758
7213
|
SwcUtils2.getAppHost = (el) => {
|
|
6759
7214
|
const appHosts = (0, SwcUtils2.getAppHosts)(el);
|
|
@@ -7010,9 +7465,9 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
7010
7465
|
if (!(node instanceof HTMLElement)) continue;
|
|
7011
7466
|
const script = node.getAttribute?.(attrName);
|
|
7012
7467
|
if (script && !getElementConfig(node)) {
|
|
7013
|
-
const
|
|
7014
|
-
if (
|
|
7015
|
-
await
|
|
7468
|
+
const host2 = SwcUtils.findNearestSwcHost(node);
|
|
7469
|
+
if (host2 && host2.isConnected && typeof host2.__swc_executeAttributeEvent === "function") {
|
|
7470
|
+
await host2.__swc_executeAttributeEvent(node, attrName, script, event);
|
|
7016
7471
|
event.__swc_handled = true;
|
|
7017
7472
|
break;
|
|
7018
7473
|
}
|
|
@@ -8210,74 +8665,6 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
8210
8665
|
return /Mobi/i.test(targetWindow.navigator.userAgent);
|
|
8211
8666
|
};
|
|
8212
8667
|
})(ValidUtils2 || (ValidUtils2 = {}));
|
|
8213
|
-
|
|
8214
|
-
// src/utils/TemplateUtils.ts
|
|
8215
|
-
var TemplateUtils;
|
|
8216
|
-
((TemplateUtils2) => {
|
|
8217
|
-
TemplateUtils2.htmlFragment = (strings, ...values) => {
|
|
8218
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
8219
|
-
const template = document.createElement("template");
|
|
8220
|
-
template.innerHTML = raw.trim();
|
|
8221
|
-
return template.content;
|
|
8222
|
-
};
|
|
8223
|
-
TemplateUtils2.textNode = (strings, ...values) => {
|
|
8224
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
8225
|
-
return document.createTextNode(raw);
|
|
8226
|
-
};
|
|
8227
|
-
TemplateUtils2.commentNode = (strings, ...values) => {
|
|
8228
|
-
const raw = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
8229
|
-
return document.createComment(raw);
|
|
8230
|
-
};
|
|
8231
|
-
TemplateUtils2.createElement = (info, attrs = {}) => {
|
|
8232
|
-
const el = document.createElement(info.tagName);
|
|
8233
|
-
if (info.innerHtml !== void 0) el.innerHTML = info.innerHtml;
|
|
8234
|
-
Object.entries(attrs).forEach(([k, v]) => el.setAttribute(k, String(v)));
|
|
8235
|
-
return el;
|
|
8236
|
-
};
|
|
8237
|
-
const createTagFunction = (tagName) => {
|
|
8238
|
-
return (strings, ...values) => {
|
|
8239
|
-
const el = document.createElement(tagName);
|
|
8240
|
-
el.innerHTML = strings.reduce((acc, str, i) => acc + str + (values[i] !== void 0 ? values[i] : ""), "");
|
|
8241
|
-
return el;
|
|
8242
|
-
};
|
|
8243
|
-
};
|
|
8244
|
-
TemplateUtils2.htmlDivElement = createTagFunction("div");
|
|
8245
|
-
TemplateUtils2.htmlSpanElement = createTagFunction("span");
|
|
8246
|
-
TemplateUtils2.htmlButtonElement = createTagFunction("button");
|
|
8247
|
-
TemplateUtils2.htmlUlElement = createTagFunction("ul");
|
|
8248
|
-
TemplateUtils2.htmlLiElement = createTagFunction("li");
|
|
8249
|
-
TemplateUtils2.htmlInputElement = createTagFunction("input");
|
|
8250
|
-
TemplateUtils2.htmlAElement = createTagFunction("a");
|
|
8251
|
-
TemplateUtils2.htmlPElement = createTagFunction("p");
|
|
8252
|
-
TemplateUtils2.htmlH1Element = createTagFunction("h1");
|
|
8253
|
-
TemplateUtils2.htmlH2Element = createTagFunction("h2");
|
|
8254
|
-
TemplateUtils2.htmlH3Element = createTagFunction("h3");
|
|
8255
|
-
TemplateUtils2.htmlH4Element = createTagFunction("h4");
|
|
8256
|
-
TemplateUtils2.htmlH5Element = createTagFunction("h5");
|
|
8257
|
-
TemplateUtils2.htmlH6Element = createTagFunction("h6");
|
|
8258
|
-
TemplateUtils2.htmlSectionElement = createTagFunction("section");
|
|
8259
|
-
TemplateUtils2.htmlArticleElement = createTagFunction("article");
|
|
8260
|
-
})(TemplateUtils || (TemplateUtils = {}));
|
|
8261
|
-
var htmlFragment = TemplateUtils.htmlFragment;
|
|
8262
|
-
var textNode = TemplateUtils.textNode;
|
|
8263
|
-
var commentNode = TemplateUtils.commentNode;
|
|
8264
|
-
var createElement = TemplateUtils.createElement;
|
|
8265
|
-
var htmlDivElement = TemplateUtils.htmlDivElement;
|
|
8266
|
-
var htmlSpanElement = TemplateUtils.htmlSpanElement;
|
|
8267
|
-
var htmlButtonElement = TemplateUtils.htmlButtonElement;
|
|
8268
|
-
var htmlUlElement = TemplateUtils.htmlUlElement;
|
|
8269
|
-
var htmlLiElement = TemplateUtils.htmlLiElement;
|
|
8270
|
-
var htmlInputElement = TemplateUtils.htmlInputElement;
|
|
8271
|
-
var htmlAElement = TemplateUtils.htmlAElement;
|
|
8272
|
-
var htmlPElement = TemplateUtils.htmlPElement;
|
|
8273
|
-
var htmlH1Element = TemplateUtils.htmlH1Element;
|
|
8274
|
-
var htmlH2Element = TemplateUtils.htmlH2Element;
|
|
8275
|
-
var htmlH3Element = TemplateUtils.htmlH3Element;
|
|
8276
|
-
var htmlH4Element = TemplateUtils.htmlH4Element;
|
|
8277
|
-
var htmlH5Element = TemplateUtils.htmlH5Element;
|
|
8278
|
-
var htmlH6Element = TemplateUtils.htmlH6Element;
|
|
8279
|
-
var htmlSectionElement = TemplateUtils.htmlSectionElement;
|
|
8280
|
-
var htmlArticleElement = TemplateUtils.htmlArticleElement;
|
|
8281
8668
|
return __toCommonJS(bundle_entry_exports);
|
|
8282
8669
|
})();
|
|
8283
8670
|
/*! Bundled license information:
|