@dooboostore/simple-web-component 1.0.31 → 1.0.32
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/dist/cjs/decorators/applyStyle.js +1 -1
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/attribute.js +17 -1
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +26 -9
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/elements/SwcAppMixin.js +1 -1
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/elements/SwcAsync.js +69 -57
- package/dist/cjs/elements/SwcAsync.js.map +2 -2
- package/dist/cjs/elements/SwcChoose.js +66 -60
- package/dist/cjs/elements/SwcChoose.js.map +2 -2
- package/dist/cjs/elements/SwcIf.js +51 -66
- package/dist/cjs/elements/SwcIf.js.map +2 -2
- package/dist/cjs/elements/SwcLoop.js +58 -78
- package/dist/cjs/elements/SwcLoop.js.map +2 -2
- package/dist/cjs/elements/register.js +310 -335
- package/dist/cjs/elements/register.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/Utils.js +7 -13
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +1 -1
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/attribute.js +18 -2
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +24 -7
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/elements/SwcAppMixin.js +1 -1
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/elements/SwcAsync.js +70 -58
- package/dist/esm/elements/SwcAsync.js.map +2 -2
- package/dist/esm/elements/SwcChoose.js +67 -61
- package/dist/esm/elements/SwcChoose.js.map +2 -2
- package/dist/esm/elements/SwcIf.js +52 -67
- package/dist/esm/elements/SwcIf.js.map +2 -2
- package/dist/esm/elements/SwcLoop.js +59 -79
- package/dist/esm/elements/SwcLoop.js.map +2 -2
- package/dist/esm/elements/register.js +239 -264
- package/dist/esm/elements/register.js.map +2 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/Utils.js +7 -13
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +2623 -2422
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/elements/register.d.ts.map +1 -1
- package/dist/types/types.d.ts +8 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +2623 -2422
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +1 -1
- package/src/decorators/applyStyle.ts +1 -1
- package/src/decorators/attribute.ts +35 -30
- package/src/decorators/elementDefine.ts +26 -7
- package/src/elements/SwcAppMixin.ts +1 -1
- package/src/elements/SwcAsync.ts +75 -69
- package/src/elements/SwcChoose.ts +67 -80
- package/src/elements/SwcIf.ts +51 -76
- package/src/elements/SwcLoop.ts +56 -87
- package/src/elements/register.ts +235 -307
- package/src/types.ts +6 -1
- package/src/utils/Utils.ts +11 -17
|
@@ -20,11 +20,11 @@ __export(register_exports, {
|
|
|
20
20
|
registerAllElements: () => registerAllElements
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(register_exports);
|
|
23
|
-
var
|
|
23
|
+
var import_decorators = require("../decorators");
|
|
24
24
|
var import_SwcAppMixin = require("./SwcAppMixin");
|
|
25
25
|
var import_Utils = require("../utils/Utils");
|
|
26
26
|
var import_core = require("@dooboostore/core");
|
|
27
|
-
var
|
|
27
|
+
var import_core_web = require("@dooboostore/core-web");
|
|
28
28
|
var __decorate = function(decorators, target, key, desc) {
|
|
29
29
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
30
30
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -100,305 +100,273 @@ const registerAllElements = (w) => {
|
|
|
100
100
|
let SwcLoading = class SwcLoading extends HTMLTemplateElement {
|
|
101
101
|
};
|
|
102
102
|
SwcLoading = __decorate([
|
|
103
|
-
(0,
|
|
103
|
+
(0, import_decorators.elementDefine)("swc-loading", { extends: "template", window: w })
|
|
104
104
|
], SwcLoading);
|
|
105
105
|
let SwcError = class SwcError extends HTMLTemplateElement {
|
|
106
106
|
};
|
|
107
107
|
SwcError = __decorate([
|
|
108
|
-
(0,
|
|
108
|
+
(0, import_decorators.elementDefine)("swc-error", { extends: "template", window: w })
|
|
109
109
|
], SwcError);
|
|
110
110
|
let SwcSuccess = class SwcSuccess extends HTMLTemplateElement {
|
|
111
111
|
};
|
|
112
112
|
SwcSuccess = __decorate([
|
|
113
|
-
(0,
|
|
113
|
+
(0, import_decorators.elementDefine)("swc-success", { extends: "template", window: w })
|
|
114
114
|
], SwcSuccess);
|
|
115
115
|
let SwcWhen = class SwcWhen extends HTMLTemplateElement {
|
|
116
116
|
};
|
|
117
117
|
SwcWhen = __decorate([
|
|
118
|
-
(0,
|
|
118
|
+
(0, import_decorators.elementDefine)("swc-when", { extends: "template", window: w })
|
|
119
119
|
], SwcWhen);
|
|
120
120
|
let SwcOtherwise = class SwcOtherwise extends HTMLTemplateElement {
|
|
121
121
|
};
|
|
122
122
|
SwcOtherwise = __decorate([
|
|
123
|
-
(0,
|
|
123
|
+
(0, import_decorators.elementDefine)("swc-otherwise", { extends: "template", window: w })
|
|
124
124
|
], SwcOtherwise);
|
|
125
125
|
let SwcDefault = class SwcDefault extends HTMLTemplateElement {
|
|
126
126
|
};
|
|
127
127
|
SwcDefault = __decorate([
|
|
128
|
-
(0,
|
|
128
|
+
(0, import_decorators.elementDefine)("swc-default", { extends: "template", window: w })
|
|
129
129
|
], SwcDefault);
|
|
130
130
|
let SwcApp = class SwcApp extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLElement) {
|
|
131
131
|
};
|
|
132
132
|
SwcApp = __decorate([
|
|
133
|
-
(0,
|
|
133
|
+
(0, import_decorators.elementDefine)("swc-app", { window: w })
|
|
134
134
|
], SwcApp);
|
|
135
135
|
let SwcIf = class SwcIf extends HTMLTemplateElement {
|
|
136
136
|
constructor() {
|
|
137
137
|
super(...arguments);
|
|
138
|
-
this._value = false;
|
|
139
138
|
this._nodes = [];
|
|
140
139
|
}
|
|
141
140
|
get value() {
|
|
142
141
|
return this._value;
|
|
143
142
|
}
|
|
144
143
|
set value(nv) {
|
|
145
|
-
this.
|
|
146
|
-
this.render();
|
|
144
|
+
this.refresh(nv);
|
|
147
145
|
}
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
script,
|
|
165
|
-
context: this,
|
|
166
|
-
args: import_Utils.SwcUtils.getHelperAndHostSet(win, this)
|
|
167
|
-
});
|
|
168
|
-
this.value = result;
|
|
169
|
-
} else {
|
|
170
|
-
this.value = Boolean(valueAttr);
|
|
146
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
147
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
148
|
+
const ae = new import_core.ActionExpression(html, config);
|
|
149
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
150
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
151
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
152
|
+
try {
|
|
153
|
+
const value = import_core.FunctionUtils.executeReturn({
|
|
154
|
+
script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
155
|
+
context,
|
|
156
|
+
args: groupArgs
|
|
157
|
+
});
|
|
158
|
+
ae.replace(expr, String(value));
|
|
159
|
+
} catch (e) {
|
|
160
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
161
|
+
}
|
|
171
162
|
}
|
|
163
|
+
return ae.getUnprocessedTemplate();
|
|
164
|
+
}
|
|
165
|
+
setValue(valueAttr) {
|
|
166
|
+
this.refresh();
|
|
172
167
|
}
|
|
173
|
-
|
|
168
|
+
setReplaceWrap(replaceWrapAttr) {
|
|
169
|
+
this.refresh();
|
|
170
|
+
}
|
|
171
|
+
refresh(value = this._value) {
|
|
174
172
|
this.cleanup();
|
|
175
173
|
const portal = this.parentElement;
|
|
176
|
-
if (!portal)
|
|
174
|
+
if (!portal || !value)
|
|
177
175
|
return;
|
|
178
176
|
const win = this.ownerDocument?.defaultView || window;
|
|
179
177
|
const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
|
|
180
|
-
let
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (targetTpl === this) {
|
|
189
|
-
clone.querySelectorAll('template[is^="swc-"]').forEach((t) => t.remove());
|
|
190
|
-
}
|
|
191
|
-
this._nodes = Array.from(clone.childNodes);
|
|
192
|
-
const elements = this._nodes.filter((n) => n.nodeType === 1);
|
|
193
|
-
const groupArgs = { ...helperSet, $value: this._value, $nodes: this._nodes, $elements: elements, $firstElement: elements[0] };
|
|
194
|
-
this._nodes.forEach((node, nodeIdx) => {
|
|
195
|
-
this._executeCloneCallback("on-clone-node", { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });
|
|
196
|
-
if (node instanceof HTMLElement) {
|
|
197
|
-
Array.from(node.attributes).forEach((attr) => {
|
|
198
|
-
const value = attr.value || "";
|
|
199
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
200
|
-
const script = value.slice(2, -2).trim();
|
|
201
|
-
const result = import_core.FunctionUtils.executeReturn({
|
|
202
|
-
script,
|
|
203
|
-
context: node,
|
|
204
|
-
args: { ...groupArgs, $value: this._value }
|
|
205
|
-
});
|
|
206
|
-
node.setAttribute(attr.name, String(result));
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
212
|
-
portal.insertBefore(clone, this.nextSibling);
|
|
213
|
-
}
|
|
178
|
+
let htmlString = this.innerHTML;
|
|
179
|
+
const groupArgs = { ...helperSet, $value: value };
|
|
180
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
181
|
+
const result = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
182
|
+
result.innerHTML = htmlString;
|
|
183
|
+
const processedFragment = result.content;
|
|
184
|
+
this._nodes = Array.from(processedFragment.childNodes);
|
|
185
|
+
portal.insertBefore(processedFragment, this.nextSibling);
|
|
214
186
|
}
|
|
215
187
|
cleanup() {
|
|
216
188
|
this._nodes.forEach((n) => n.parentElement?.removeChild(n));
|
|
217
189
|
this._nodes = [];
|
|
218
190
|
}
|
|
219
|
-
connectedCallback() {
|
|
220
|
-
this.refreshValue();
|
|
221
|
-
}
|
|
222
191
|
disconnectedCallback() {
|
|
223
192
|
this.cleanup();
|
|
224
193
|
}
|
|
225
194
|
};
|
|
226
195
|
__decorate([
|
|
227
|
-
(0,
|
|
196
|
+
(0, import_decorators.attributeHost)("value"),
|
|
197
|
+
__metadata("design:type", Object)
|
|
198
|
+
], SwcIf.prototype, "_value", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, import_decorators.attributeHost)("replace-wrap"),
|
|
201
|
+
__metadata("design:type", String)
|
|
202
|
+
], SwcIf.prototype, "_replaceWrap", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, import_decorators.changedAttributeHost)("value"),
|
|
205
|
+
__metadata("design:type", Function),
|
|
206
|
+
__metadata("design:paramtypes", [String]),
|
|
207
|
+
__metadata("design:returntype", void 0)
|
|
208
|
+
], SwcIf.prototype, "setValue", null);
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, import_decorators.changedAttributeHost)("replace-wrap"),
|
|
228
211
|
__metadata("design:type", Function),
|
|
229
212
|
__metadata("design:paramtypes", [String]),
|
|
230
213
|
__metadata("design:returntype", void 0)
|
|
231
|
-
], SwcIf.prototype, "
|
|
214
|
+
], SwcIf.prototype, "setReplaceWrap", null);
|
|
232
215
|
SwcIf = __decorate([
|
|
233
|
-
(0,
|
|
216
|
+
(0, import_decorators.elementDefine)("swc-if", { extends: "template", window: w })
|
|
234
217
|
], SwcIf);
|
|
235
218
|
let SwcLoop = class SwcLoop extends HTMLTemplateElement {
|
|
236
219
|
constructor() {
|
|
237
220
|
super(...arguments);
|
|
238
|
-
this._value = [];
|
|
239
221
|
this._nodeGroups = [];
|
|
240
222
|
}
|
|
241
223
|
get value() {
|
|
242
224
|
return this._value;
|
|
243
225
|
}
|
|
244
226
|
set value(nv) {
|
|
245
|
-
this.
|
|
246
|
-
this.render();
|
|
227
|
+
this.refresh(nv);
|
|
247
228
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (!script)
|
|
251
|
-
return;
|
|
252
|
-
import_core.FunctionUtils.execute({ script, context: this, args });
|
|
229
|
+
setValue() {
|
|
230
|
+
this.refresh();
|
|
253
231
|
}
|
|
254
|
-
|
|
255
|
-
this.
|
|
256
|
-
this._nodeGroups = [];
|
|
232
|
+
setReplaceWrap() {
|
|
233
|
+
this.refresh();
|
|
257
234
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
if (script.startsWith("{{") && script.endsWith("}}")) {
|
|
265
|
-
script = script.slice(2, -2).trim();
|
|
266
|
-
}
|
|
235
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
236
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
237
|
+
const ae = new import_core.ActionExpression(html, config);
|
|
238
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
267
239
|
const win = this.ownerDocument?.defaultView || window;
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
240
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
241
|
+
try {
|
|
242
|
+
const value = import_core.FunctionUtils.executeReturn({
|
|
243
|
+
script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
244
|
+
context,
|
|
245
|
+
args: groupArgs
|
|
246
|
+
});
|
|
247
|
+
ae.replace(expr, String(value));
|
|
248
|
+
} catch (e) {
|
|
249
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
250
|
+
}
|
|
277
251
|
}
|
|
252
|
+
return ae.getUnprocessedTemplate();
|
|
278
253
|
}
|
|
279
|
-
|
|
280
|
-
this.
|
|
254
|
+
refresh(value = this._value) {
|
|
255
|
+
this.cleanup();
|
|
256
|
+
if (value?.length <= 0)
|
|
257
|
+
return;
|
|
281
258
|
const portal = this.parentElement;
|
|
282
259
|
if (!portal)
|
|
283
260
|
return;
|
|
284
261
|
const win = this.ownerDocument?.defaultView || window;
|
|
285
262
|
const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
|
|
286
263
|
const fragment = win.document.createDocumentFragment();
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
subTemplates.forEach((t) => t.remove());
|
|
300
|
-
const nodes = Array.from(clone.childNodes);
|
|
301
|
-
const elements = nodes.filter((n) => n.nodeType === 1);
|
|
302
|
-
const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value, $nodes: nodes, $elements: elements, $firstElement: elements[0] };
|
|
303
|
-
nodes.forEach((node, nodeIdx) => {
|
|
304
|
-
this._executeCloneCallback("on-clone-node", { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });
|
|
305
|
-
if (node instanceof HTMLElement) {
|
|
306
|
-
Array.from(node.attributes).forEach((attr) => {
|
|
307
|
-
const value = attr.value || "";
|
|
308
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
309
|
-
const script = value.slice(2, -2).trim();
|
|
310
|
-
const result = import_core.FunctionUtils.executeReturn({
|
|
311
|
-
script,
|
|
312
|
-
context: node,
|
|
313
|
-
args: groupArgs
|
|
314
|
-
});
|
|
315
|
-
node.setAttribute(attr.name, String(result));
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
321
|
-
this._nodeGroups.push(nodes);
|
|
322
|
-
fragment.appendChild(clone);
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
if (portal === this.parentElement) {
|
|
326
|
-
portal.insertBefore(fragment, this.nextSibling);
|
|
327
|
-
} else {
|
|
328
|
-
portal.appendChild(fragment);
|
|
329
|
-
}
|
|
264
|
+
value.forEach((item, index) => {
|
|
265
|
+
let htmlString = this.innerHTML;
|
|
266
|
+
const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };
|
|
267
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
268
|
+
const temp = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
269
|
+
temp.innerHTML = htmlString;
|
|
270
|
+
const content = temp.content;
|
|
271
|
+
const nodes = Array.from(content.childNodes);
|
|
272
|
+
this._nodeGroups.push(nodes);
|
|
273
|
+
fragment.appendChild(content);
|
|
274
|
+
});
|
|
275
|
+
portal.insertBefore(fragment, this.nextSibling);
|
|
330
276
|
}
|
|
331
|
-
|
|
332
|
-
this.
|
|
277
|
+
cleanup() {
|
|
278
|
+
this._nodeGroups.forEach((nodes) => nodes.forEach((n) => n.parentElement?.removeChild(n)));
|
|
279
|
+
this._nodeGroups = [];
|
|
333
280
|
}
|
|
334
281
|
disconnectedCallback() {
|
|
335
|
-
this.
|
|
282
|
+
this.cleanup();
|
|
336
283
|
}
|
|
337
284
|
};
|
|
338
285
|
__decorate([
|
|
339
|
-
(0,
|
|
286
|
+
(0, import_decorators.attributeHost)("value"),
|
|
287
|
+
__metadata("design:type", Array)
|
|
288
|
+
], SwcLoop.prototype, "_value", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
(0, import_decorators.attributeHost)("replace-wrap"),
|
|
291
|
+
__metadata("design:type", String)
|
|
292
|
+
], SwcLoop.prototype, "_replaceWrap", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
(0, import_decorators.changedAttributeHost)("value"),
|
|
340
295
|
__metadata("design:type", Function),
|
|
341
296
|
__metadata("design:paramtypes", []),
|
|
342
297
|
__metadata("design:returntype", void 0)
|
|
343
|
-
], SwcLoop.prototype, "
|
|
298
|
+
], SwcLoop.prototype, "setValue", null);
|
|
299
|
+
__decorate([
|
|
300
|
+
(0, import_decorators.changedAttributeHost)("replace-wrap"),
|
|
301
|
+
__metadata("design:type", Function),
|
|
302
|
+
__metadata("design:paramtypes", []),
|
|
303
|
+
__metadata("design:returntype", void 0)
|
|
304
|
+
], SwcLoop.prototype, "setReplaceWrap", null);
|
|
344
305
|
SwcLoop = __decorate([
|
|
345
|
-
(0,
|
|
306
|
+
(0, import_decorators.elementDefine)("swc-loop", { extends: "template", window: w })
|
|
346
307
|
], SwcLoop);
|
|
347
308
|
let SwcChoose = class SwcChoose extends HTMLTemplateElement {
|
|
348
309
|
constructor() {
|
|
349
310
|
super(...arguments);
|
|
350
311
|
this._nodes = [];
|
|
351
|
-
this._value = null;
|
|
352
312
|
this._previousTemplate = null;
|
|
353
313
|
}
|
|
354
314
|
get value() {
|
|
355
315
|
return this._value;
|
|
356
316
|
}
|
|
357
317
|
set value(nv) {
|
|
358
|
-
this.
|
|
359
|
-
this.render();
|
|
318
|
+
this.refresh(nv);
|
|
360
319
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (!script)
|
|
364
|
-
return;
|
|
365
|
-
import_core.FunctionUtils.execute({ script, context: this, args });
|
|
320
|
+
setValue() {
|
|
321
|
+
this.refresh();
|
|
366
322
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
323
|
+
setReplaceWrap(replaceWrapAttr) {
|
|
324
|
+
this.refresh();
|
|
325
|
+
}
|
|
326
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
327
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
328
|
+
const ae = new import_core.ActionExpression(html, config);
|
|
329
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
330
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
331
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
332
|
+
try {
|
|
333
|
+
const value = import_core.FunctionUtils.executeReturn({
|
|
334
|
+
script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
335
|
+
context,
|
|
336
|
+
args: groupArgs
|
|
337
|
+
});
|
|
338
|
+
ae.replace(expr, String(value));
|
|
339
|
+
} catch (e) {
|
|
340
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
341
|
+
}
|
|
381
342
|
}
|
|
343
|
+
return ae.getUnprocessedTemplate();
|
|
382
344
|
}
|
|
383
|
-
|
|
345
|
+
refresh(value = this._value) {
|
|
346
|
+
const portal = this.parentElement;
|
|
347
|
+
if (!portal)
|
|
348
|
+
return;
|
|
384
349
|
const win = this.ownerDocument?.defaultView || window;
|
|
385
350
|
const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
|
|
351
|
+
const groupArgs = { ...helperSet, $value: value };
|
|
386
352
|
const templates = Array.from(this.content.querySelectorAll("template"));
|
|
387
353
|
let selected = null;
|
|
388
354
|
for (const t of templates) {
|
|
389
355
|
if (t.getAttribute("is") === "swc-when") {
|
|
356
|
+
const attrVal = t.getAttribute("value") || "";
|
|
390
357
|
let matches = false;
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
358
|
+
const ae = new import_core.ActionExpression(attrVal);
|
|
359
|
+
const expr = ae.getFirstExpression("replace");
|
|
360
|
+
if (expr) {
|
|
361
|
+
const decodedScript = import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document);
|
|
394
362
|
const result = import_core.FunctionUtils.executeReturn({
|
|
395
|
-
script,
|
|
363
|
+
script: decodedScript,
|
|
396
364
|
context: t,
|
|
397
|
-
args:
|
|
365
|
+
args: groupArgs
|
|
398
366
|
});
|
|
399
|
-
matches = result
|
|
367
|
+
matches = !!result;
|
|
400
368
|
} else {
|
|
401
|
-
matches = String(
|
|
369
|
+
matches = String(attrVal) === String(value);
|
|
402
370
|
}
|
|
403
371
|
if (matches) {
|
|
404
372
|
selected = t;
|
|
@@ -407,103 +375,114 @@ const registerAllElements = (w) => {
|
|
|
407
375
|
}
|
|
408
376
|
}
|
|
409
377
|
const target = selected || this.content.querySelector('template[is="swc-otherwise"]');
|
|
410
|
-
const
|
|
411
|
-
const
|
|
412
|
-
|
|
378
|
+
const skipValue = target?.getAttribute?.("skip-if-same");
|
|
379
|
+
const skipValue2 = this._previousTemplate?.getAttribute?.("skip-if-same");
|
|
380
|
+
const hasSkipIfSame = target?.hasAttribute?.("skip-if-same");
|
|
381
|
+
const isSame = this._previousTemplate === target;
|
|
382
|
+
if (hasSkipIfSame && isSame) {
|
|
413
383
|
return;
|
|
414
384
|
}
|
|
415
385
|
this.cleanup();
|
|
416
386
|
this._previousTemplate = target;
|
|
417
387
|
if (target) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
Array.from(n.attributes).forEach((attr) => {
|
|
426
|
-
const value = attr.value || "";
|
|
427
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
428
|
-
const script = value.slice(2, -2).trim();
|
|
429
|
-
const result = import_core.FunctionUtils.executeReturn({
|
|
430
|
-
script,
|
|
431
|
-
context: n,
|
|
432
|
-
args: { ...groupArgs, $value: this._value }
|
|
433
|
-
});
|
|
434
|
-
n.setAttribute(attr.name, String(result));
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
440
|
-
this.parentElement?.insertBefore(clone, this.nextSibling);
|
|
388
|
+
let htmlString = target.innerHTML;
|
|
389
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
390
|
+
const result = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
391
|
+
result.innerHTML = htmlString;
|
|
392
|
+
const processedFragment = result.content;
|
|
393
|
+
this._nodes = Array.from(processedFragment.childNodes);
|
|
394
|
+
portal.insertBefore(processedFragment, this.nextSibling);
|
|
441
395
|
}
|
|
442
396
|
}
|
|
443
397
|
cleanup() {
|
|
444
398
|
this._nodes.forEach((n) => n.parentElement?.removeChild(n));
|
|
445
399
|
this._nodes = [];
|
|
446
400
|
}
|
|
447
|
-
connectedCallback() {
|
|
448
|
-
this.refresh();
|
|
449
|
-
}
|
|
450
401
|
disconnectedCallback() {
|
|
451
402
|
this.cleanup();
|
|
452
403
|
}
|
|
453
404
|
};
|
|
454
405
|
__decorate([
|
|
455
|
-
(0,
|
|
406
|
+
(0, import_decorators.attributeHost)("value"),
|
|
407
|
+
__metadata("design:type", Object)
|
|
408
|
+
], SwcChoose.prototype, "_value", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
(0, import_decorators.attributeHost)("replace-wrap"),
|
|
411
|
+
__metadata("design:type", String)
|
|
412
|
+
], SwcChoose.prototype, "_replaceWrap", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
(0, import_decorators.changedAttributeHost)("value"),
|
|
415
|
+
__metadata("design:type", Function),
|
|
416
|
+
__metadata("design:paramtypes", []),
|
|
417
|
+
__metadata("design:returntype", void 0)
|
|
418
|
+
], SwcChoose.prototype, "setValue", null);
|
|
419
|
+
__decorate([
|
|
420
|
+
(0, import_decorators.changedAttributeHost)("replace-wrap"),
|
|
456
421
|
__metadata("design:type", Function),
|
|
457
422
|
__metadata("design:paramtypes", [String]),
|
|
458
423
|
__metadata("design:returntype", void 0)
|
|
459
|
-
], SwcChoose.prototype, "
|
|
424
|
+
], SwcChoose.prototype, "setReplaceWrap", null);
|
|
460
425
|
SwcChoose = __decorate([
|
|
461
|
-
(0,
|
|
426
|
+
(0, import_decorators.elementDefine)("swc-choose", { extends: "template", window: w })
|
|
462
427
|
], SwcChoose);
|
|
463
428
|
let SwcAsync = class SwcAsync extends HTMLTemplateElement {
|
|
464
429
|
constructor() {
|
|
465
430
|
super(...arguments);
|
|
466
431
|
this._nodes = [];
|
|
467
|
-
this._value = null;
|
|
468
432
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
433
|
+
get value() {
|
|
434
|
+
return this._value;
|
|
435
|
+
}
|
|
436
|
+
set value(nv) {
|
|
437
|
+
this.executeAsync(nv);
|
|
438
|
+
}
|
|
439
|
+
setValue(valueAttr) {
|
|
440
|
+
this.executeAsync(this._value);
|
|
474
441
|
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
442
|
+
setReplaceWrap() {
|
|
443
|
+
this.executeAsync(this._value);
|
|
444
|
+
}
|
|
445
|
+
executeAsync(result = this._value) {
|
|
446
|
+
if (result === void 0 || result === null) {
|
|
447
|
+
this.refresh("default");
|
|
479
448
|
return;
|
|
480
449
|
}
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
450
|
+
if (result instanceof Promise) {
|
|
451
|
+
this.refresh("loading");
|
|
452
|
+
result.then((v) => {
|
|
453
|
+
this.resultValue = v;
|
|
454
|
+
this.refresh("success");
|
|
455
|
+
}).catch((e) => {
|
|
456
|
+
console.error("[SWC-ASYNC] Promise rejected:", e);
|
|
457
|
+
this.resultValue = e;
|
|
458
|
+
this.refresh("error");
|
|
488
459
|
});
|
|
489
|
-
this.executeAsync(result);
|
|
490
460
|
} else {
|
|
491
|
-
this.
|
|
461
|
+
this.resultValue = result;
|
|
462
|
+
this.refresh("success");
|
|
492
463
|
}
|
|
493
464
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
465
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
466
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
467
|
+
const ae = new import_core.ActionExpression(html, config);
|
|
468
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
469
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
470
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
471
|
+
try {
|
|
472
|
+
const value = import_core.FunctionUtils.executeReturn({
|
|
473
|
+
script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
474
|
+
context,
|
|
475
|
+
args: groupArgs
|
|
476
|
+
});
|
|
477
|
+
ae.replace(expr, String(value));
|
|
478
|
+
} catch (e) {
|
|
479
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
480
|
+
}
|
|
504
481
|
}
|
|
482
|
+
return ae.getUnprocessedTemplate();
|
|
505
483
|
}
|
|
506
|
-
|
|
484
|
+
refresh(state = "default") {
|
|
485
|
+
console.log("rrrrrrrrrrrrrrrrr", state);
|
|
507
486
|
this.cleanup();
|
|
508
487
|
const portal = this.parentElement;
|
|
509
488
|
if (!portal)
|
|
@@ -512,335 +491,331 @@ const registerAllElements = (w) => {
|
|
|
512
491
|
const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
|
|
513
492
|
const t = this.content.querySelector(`template[is="swc-${state}"]`);
|
|
514
493
|
if (t) {
|
|
515
|
-
|
|
516
|
-
this.
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
const value = attr.value || "";
|
|
524
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
525
|
-
const script = value.slice(2, -2).trim();
|
|
526
|
-
const result = import_core.FunctionUtils.executeReturn({
|
|
527
|
-
script,
|
|
528
|
-
context: n,
|
|
529
|
-
args: groupArgs
|
|
530
|
-
});
|
|
531
|
-
n.setAttribute(attr.name, String(result));
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
537
|
-
portal.insertBefore(clone, this.nextSibling);
|
|
494
|
+
let htmlString = t.innerHTML;
|
|
495
|
+
const groupArgs = { ...helperSet, $value: this._value, $state: state };
|
|
496
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
497
|
+
const temp = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
498
|
+
temp.innerHTML = htmlString;
|
|
499
|
+
const content = temp.content;
|
|
500
|
+
this._nodes = Array.from(content.childNodes);
|
|
501
|
+
portal.insertBefore(content, this.nextSibling);
|
|
538
502
|
}
|
|
539
503
|
}
|
|
540
504
|
cleanup() {
|
|
541
505
|
this._nodes.forEach((n) => n.parentElement?.removeChild(n));
|
|
542
506
|
this._nodes = [];
|
|
543
507
|
}
|
|
544
|
-
connectedCallback() {
|
|
545
|
-
this.refresh();
|
|
546
|
-
}
|
|
547
508
|
disconnectedCallback() {
|
|
548
509
|
this.cleanup();
|
|
549
510
|
}
|
|
550
511
|
};
|
|
551
512
|
__decorate([
|
|
552
|
-
(0,
|
|
513
|
+
(0, import_decorators.attributeHost)("value"),
|
|
514
|
+
__metadata("design:type", Object)
|
|
515
|
+
], SwcAsync.prototype, "_value", void 0);
|
|
516
|
+
__decorate([
|
|
517
|
+
(0, import_decorators.attributeHost)("replace-wrap"),
|
|
518
|
+
__metadata("design:type", String)
|
|
519
|
+
], SwcAsync.prototype, "_replaceWrap", void 0);
|
|
520
|
+
__decorate([
|
|
521
|
+
(0, import_decorators.changedAttributeHost)("value"),
|
|
553
522
|
__metadata("design:type", Function),
|
|
554
523
|
__metadata("design:paramtypes", [String]),
|
|
555
524
|
__metadata("design:returntype", void 0)
|
|
556
|
-
], SwcAsync.prototype, "
|
|
525
|
+
], SwcAsync.prototype, "setValue", null);
|
|
526
|
+
__decorate([
|
|
527
|
+
(0, import_decorators.changedAttributeHost)("replace-wrap"),
|
|
528
|
+
__metadata("design:type", Function),
|
|
529
|
+
__metadata("design:paramtypes", []),
|
|
530
|
+
__metadata("design:returntype", void 0)
|
|
531
|
+
], SwcAsync.prototype, "setReplaceWrap", null);
|
|
557
532
|
SwcAsync = __decorate([
|
|
558
|
-
(0,
|
|
533
|
+
(0, import_decorators.elementDefine)("swc-async", { extends: "template", window: w })
|
|
559
534
|
], SwcAsync);
|
|
560
535
|
let SwcAppAnchor = class SwcAppAnchor extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLAnchorElement) {
|
|
561
536
|
};
|
|
562
537
|
SwcAppAnchor = __decorate([
|
|
563
|
-
(0,
|
|
538
|
+
(0, import_decorators.elementDefine)("swc-app-a", { extends: "a", window: w })
|
|
564
539
|
], SwcAppAnchor);
|
|
565
540
|
let SwcAppArea = class SwcAppArea extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLAreaElement) {
|
|
566
541
|
};
|
|
567
542
|
SwcAppArea = __decorate([
|
|
568
|
-
(0,
|
|
543
|
+
(0, import_decorators.elementDefine)("swc-app-area", { extends: "area", window: w })
|
|
569
544
|
], SwcAppArea);
|
|
570
545
|
let SwcAppAudio = class SwcAppAudio extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLAudioElement) {
|
|
571
546
|
};
|
|
572
547
|
SwcAppAudio = __decorate([
|
|
573
|
-
(0,
|
|
548
|
+
(0, import_decorators.elementDefine)("swc-app-audio", { extends: "audio", window: w })
|
|
574
549
|
], SwcAppAudio);
|
|
575
550
|
let SwcAppBase = class SwcAppBase extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLBaseElement) {
|
|
576
551
|
};
|
|
577
552
|
SwcAppBase = __decorate([
|
|
578
|
-
(0,
|
|
553
|
+
(0, import_decorators.elementDefine)("swc-app-base", { extends: "base", window: w })
|
|
579
554
|
], SwcAppBase);
|
|
580
555
|
let SwcAppButton = class SwcAppButton extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLButtonElement) {
|
|
581
556
|
};
|
|
582
557
|
SwcAppButton = __decorate([
|
|
583
|
-
(0,
|
|
558
|
+
(0, import_decorators.elementDefine)("swc-app-button", { extends: "button", window: w })
|
|
584
559
|
], SwcAppButton);
|
|
585
560
|
let SwcAppCanvas = class SwcAppCanvas extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLCanvasElement) {
|
|
586
561
|
};
|
|
587
562
|
SwcAppCanvas = __decorate([
|
|
588
|
-
(0,
|
|
563
|
+
(0, import_decorators.elementDefine)("swc-app-canvas", { extends: "canvas", window: w })
|
|
589
564
|
], SwcAppCanvas);
|
|
590
565
|
let SwcAppData = class SwcAppData extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDataElement) {
|
|
591
566
|
};
|
|
592
567
|
SwcAppData = __decorate([
|
|
593
|
-
(0,
|
|
568
|
+
(0, import_decorators.elementDefine)("swc-app-data", { extends: "data", window: w })
|
|
594
569
|
], SwcAppData);
|
|
595
570
|
let SwcAppDataList = class SwcAppDataList extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDataListElement) {
|
|
596
571
|
};
|
|
597
572
|
SwcAppDataList = __decorate([
|
|
598
|
-
(0,
|
|
573
|
+
(0, import_decorators.elementDefine)("swc-app-datalist", { extends: "datalist", window: w })
|
|
599
574
|
], SwcAppDataList);
|
|
600
575
|
let SwcAppDetails = class SwcAppDetails extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDetailsElement) {
|
|
601
576
|
};
|
|
602
577
|
SwcAppDetails = __decorate([
|
|
603
|
-
(0,
|
|
578
|
+
(0, import_decorators.elementDefine)("swc-app-details", { extends: "details", window: w })
|
|
604
579
|
], SwcAppDetails);
|
|
605
580
|
let SwcAppDialog = class SwcAppDialog extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDialogElement) {
|
|
606
581
|
};
|
|
607
582
|
SwcAppDialog = __decorate([
|
|
608
|
-
(0,
|
|
583
|
+
(0, import_decorators.elementDefine)("swc-app-dialog", { extends: "dialog", window: w })
|
|
609
584
|
], SwcAppDialog);
|
|
610
585
|
let SwcAppDiv = class SwcAppDiv extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDivElement) {
|
|
611
586
|
};
|
|
612
587
|
SwcAppDiv = __decorate([
|
|
613
|
-
(0,
|
|
588
|
+
(0, import_decorators.elementDefine)("swc-app-div", { extends: "div", window: w })
|
|
614
589
|
], SwcAppDiv);
|
|
615
590
|
let SwcAppDList = class SwcAppDList extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLDListElement) {
|
|
616
591
|
};
|
|
617
592
|
SwcAppDList = __decorate([
|
|
618
|
-
(0,
|
|
593
|
+
(0, import_decorators.elementDefine)("swc-app-dl", { extends: "dl", window: w })
|
|
619
594
|
], SwcAppDList);
|
|
620
595
|
let SwcAppEmbed = class SwcAppEmbed extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLEmbedElement) {
|
|
621
596
|
};
|
|
622
597
|
SwcAppEmbed = __decorate([
|
|
623
|
-
(0,
|
|
598
|
+
(0, import_decorators.elementDefine)("swc-app-embed", { extends: "embed", window: w })
|
|
624
599
|
], SwcAppEmbed);
|
|
625
600
|
let SwcAppFieldSet = class SwcAppFieldSet extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLFieldSetElement) {
|
|
626
601
|
};
|
|
627
602
|
SwcAppFieldSet = __decorate([
|
|
628
|
-
(0,
|
|
603
|
+
(0, import_decorators.elementDefine)("swc-app-fieldset", { extends: "fieldset", window: w })
|
|
629
604
|
], SwcAppFieldSet);
|
|
630
605
|
let SwcAppForm = class SwcAppForm extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLFormElement) {
|
|
631
606
|
};
|
|
632
607
|
SwcAppForm = __decorate([
|
|
633
|
-
(0,
|
|
608
|
+
(0, import_decorators.elementDefine)("swc-app-form", { extends: "form", window: w })
|
|
634
609
|
], SwcAppForm);
|
|
635
610
|
let SwcAppHR = class SwcAppHR extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLHRElement) {
|
|
636
611
|
};
|
|
637
612
|
SwcAppHR = __decorate([
|
|
638
|
-
(0,
|
|
613
|
+
(0, import_decorators.elementDefine)("swc-app-hr", { extends: "hr", window: w })
|
|
639
614
|
], SwcAppHR);
|
|
640
615
|
let SwcAppIFrame = class SwcAppIFrame extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLIFrameElement) {
|
|
641
616
|
};
|
|
642
617
|
SwcAppIFrame = __decorate([
|
|
643
|
-
(0,
|
|
618
|
+
(0, import_decorators.elementDefine)("swc-app-iframe", { extends: "iframe", window: w })
|
|
644
619
|
], SwcAppIFrame);
|
|
645
620
|
let SwcAppImage = class SwcAppImage extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLImageElement) {
|
|
646
621
|
};
|
|
647
622
|
SwcAppImage = __decorate([
|
|
648
|
-
(0,
|
|
623
|
+
(0, import_decorators.elementDefine)("swc-app-img", { extends: "img", window: w })
|
|
649
624
|
], SwcAppImage);
|
|
650
625
|
let SwcAppInput = class SwcAppInput extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLInputElement) {
|
|
651
626
|
};
|
|
652
627
|
SwcAppInput = __decorate([
|
|
653
|
-
(0,
|
|
628
|
+
(0, import_decorators.elementDefine)("swc-app-input", { extends: "input", window: w })
|
|
654
629
|
], SwcAppInput);
|
|
655
630
|
let SwcAppLabel = class SwcAppLabel extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLLabelElement) {
|
|
656
631
|
};
|
|
657
632
|
SwcAppLabel = __decorate([
|
|
658
|
-
(0,
|
|
633
|
+
(0, import_decorators.elementDefine)("swc-app-label", { extends: "label", window: w })
|
|
659
634
|
], SwcAppLabel);
|
|
660
635
|
let SwcAppLegend = class SwcAppLegend extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLLegendElement) {
|
|
661
636
|
};
|
|
662
637
|
SwcAppLegend = __decorate([
|
|
663
|
-
(0,
|
|
638
|
+
(0, import_decorators.elementDefine)("swc-app-legend", { extends: "legend", window: w })
|
|
664
639
|
], SwcAppLegend);
|
|
665
640
|
let SwcAppLI = class SwcAppLI extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLLIElement) {
|
|
666
641
|
};
|
|
667
642
|
SwcAppLI = __decorate([
|
|
668
|
-
(0,
|
|
643
|
+
(0, import_decorators.elementDefine)("swc-app-li", { extends: "li", window: w })
|
|
669
644
|
], SwcAppLI);
|
|
670
645
|
let SwcAppLink = class SwcAppLink extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLLinkElement) {
|
|
671
646
|
};
|
|
672
647
|
SwcAppLink = __decorate([
|
|
673
|
-
(0,
|
|
648
|
+
(0, import_decorators.elementDefine)("swc-app-link", { extends: "link", window: w })
|
|
674
649
|
], SwcAppLink);
|
|
675
650
|
let SwcAppMap = class SwcAppMap extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLMapElement) {
|
|
676
651
|
};
|
|
677
652
|
SwcAppMap = __decorate([
|
|
678
|
-
(0,
|
|
653
|
+
(0, import_decorators.elementDefine)("swc-app-map", { extends: "map", window: w })
|
|
679
654
|
], SwcAppMap);
|
|
680
655
|
let SwcAppMeta = class SwcAppMeta extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLMetaElement) {
|
|
681
656
|
};
|
|
682
657
|
SwcAppMeta = __decorate([
|
|
683
|
-
(0,
|
|
658
|
+
(0, import_decorators.elementDefine)("swc-app-meta", { extends: "meta", window: w })
|
|
684
659
|
], SwcAppMeta);
|
|
685
660
|
let SwcAppMeter = class SwcAppMeter extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLMeterElement) {
|
|
686
661
|
};
|
|
687
662
|
SwcAppMeter = __decorate([
|
|
688
|
-
(0,
|
|
663
|
+
(0, import_decorators.elementDefine)("swc-app-meter", { extends: "meter", window: w })
|
|
689
664
|
], SwcAppMeter);
|
|
690
665
|
let SwcAppMod = class SwcAppMod extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLModElement) {
|
|
691
666
|
};
|
|
692
667
|
SwcAppMod = __decorate([
|
|
693
|
-
(0,
|
|
668
|
+
(0, import_decorators.elementDefine)("swc-app-del", { extends: "del", window: w })
|
|
694
669
|
], SwcAppMod);
|
|
695
670
|
let SwcAppObject = class SwcAppObject extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLObjectElement) {
|
|
696
671
|
};
|
|
697
672
|
SwcAppObject = __decorate([
|
|
698
|
-
(0,
|
|
673
|
+
(0, import_decorators.elementDefine)("swc-app-object", { extends: "object", window: w })
|
|
699
674
|
], SwcAppObject);
|
|
700
675
|
let SwcAppOList = class SwcAppOList extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLOListElement) {
|
|
701
676
|
};
|
|
702
677
|
SwcAppOList = __decorate([
|
|
703
|
-
(0,
|
|
678
|
+
(0, import_decorators.elementDefine)("swc-app-ol", { extends: "ol", window: w })
|
|
704
679
|
], SwcAppOList);
|
|
705
680
|
let SwcAppOptGroup = class SwcAppOptGroup extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLOptGroupElement) {
|
|
706
681
|
};
|
|
707
682
|
SwcAppOptGroup = __decorate([
|
|
708
|
-
(0,
|
|
683
|
+
(0, import_decorators.elementDefine)("swc-app-optgroup", { extends: "optgroup", window: w })
|
|
709
684
|
], SwcAppOptGroup);
|
|
710
685
|
let SwcAppOption = class SwcAppOption extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLOptionElement) {
|
|
711
686
|
};
|
|
712
687
|
SwcAppOption = __decorate([
|
|
713
|
-
(0,
|
|
688
|
+
(0, import_decorators.elementDefine)("swc-app-option", { extends: "option", window: w })
|
|
714
689
|
], SwcAppOption);
|
|
715
690
|
let SwcAppOutput = class SwcAppOutput extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLOutputElement) {
|
|
716
691
|
};
|
|
717
692
|
SwcAppOutput = __decorate([
|
|
718
|
-
(0,
|
|
693
|
+
(0, import_decorators.elementDefine)("swc-app-output", { extends: "output", window: w })
|
|
719
694
|
], SwcAppOutput);
|
|
720
695
|
let SwcAppParagraph = class SwcAppParagraph extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLParagraphElement) {
|
|
721
696
|
};
|
|
722
697
|
SwcAppParagraph = __decorate([
|
|
723
|
-
(0,
|
|
698
|
+
(0, import_decorators.elementDefine)("swc-app-p", { extends: "p", window: w })
|
|
724
699
|
], SwcAppParagraph);
|
|
725
700
|
let SwcAppParam = class SwcAppParam extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLParamElement) {
|
|
726
701
|
};
|
|
727
702
|
SwcAppParam = __decorate([
|
|
728
|
-
(0,
|
|
703
|
+
(0, import_decorators.elementDefine)("swc-app-param", { extends: "param", window: w })
|
|
729
704
|
], SwcAppParam);
|
|
730
705
|
let SwcAppPicture = class SwcAppPicture extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLPictureElement) {
|
|
731
706
|
};
|
|
732
707
|
SwcAppPicture = __decorate([
|
|
733
|
-
(0,
|
|
708
|
+
(0, import_decorators.elementDefine)("swc-app-picture", { extends: "picture", window: w })
|
|
734
709
|
], SwcAppPicture);
|
|
735
710
|
let SwcAppPre = class SwcAppPre extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLPreElement) {
|
|
736
711
|
};
|
|
737
712
|
SwcAppPre = __decorate([
|
|
738
|
-
(0,
|
|
713
|
+
(0, import_decorators.elementDefine)("swc-app-pre", { extends: "pre", window: w })
|
|
739
714
|
], SwcAppPre);
|
|
740
715
|
let SwcAppProgress = class SwcAppProgress extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLProgressElement) {
|
|
741
716
|
};
|
|
742
717
|
SwcAppProgress = __decorate([
|
|
743
|
-
(0,
|
|
718
|
+
(0, import_decorators.elementDefine)("swc-app-progress", { extends: "progress", window: w })
|
|
744
719
|
], SwcAppProgress);
|
|
745
720
|
let SwcAppQuote = class SwcAppQuote extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLQuoteElement) {
|
|
746
721
|
};
|
|
747
722
|
SwcAppQuote = __decorate([
|
|
748
|
-
(0,
|
|
723
|
+
(0, import_decorators.elementDefine)("swc-app-blockquote", { extends: "blockquote", window: w })
|
|
749
724
|
], SwcAppQuote);
|
|
750
725
|
let SwcAppScript = class SwcAppScript extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLScriptElement) {
|
|
751
726
|
};
|
|
752
727
|
SwcAppScript = __decorate([
|
|
753
|
-
(0,
|
|
728
|
+
(0, import_decorators.elementDefine)("swc-app-script", { extends: "script", window: w })
|
|
754
729
|
], SwcAppScript);
|
|
755
730
|
let SwcAppSelect = class SwcAppSelect extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLSelectElement) {
|
|
756
731
|
};
|
|
757
732
|
SwcAppSelect = __decorate([
|
|
758
|
-
(0,
|
|
733
|
+
(0, import_decorators.elementDefine)("swc-app-select", { extends: "select", window: w })
|
|
759
734
|
], SwcAppSelect);
|
|
760
735
|
let SwcAppSlot = class SwcAppSlot extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLSlotElement) {
|
|
761
736
|
};
|
|
762
737
|
SwcAppSlot = __decorate([
|
|
763
|
-
(0,
|
|
738
|
+
(0, import_decorators.elementDefine)("swc-app-slot", { extends: "slot", window: w })
|
|
764
739
|
], SwcAppSlot);
|
|
765
740
|
let SwcAppSource = class SwcAppSource extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLSourceElement) {
|
|
766
741
|
};
|
|
767
742
|
SwcAppSource = __decorate([
|
|
768
|
-
(0,
|
|
743
|
+
(0, import_decorators.elementDefine)("swc-app-source", { extends: "source", window: w })
|
|
769
744
|
], SwcAppSource);
|
|
770
745
|
let SwcAppSpan = class SwcAppSpan extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLSpanElement) {
|
|
771
746
|
};
|
|
772
747
|
SwcAppSpan = __decorate([
|
|
773
|
-
(0,
|
|
748
|
+
(0, import_decorators.elementDefine)("swc-app-span", { extends: "span", window: w })
|
|
774
749
|
], SwcAppSpan);
|
|
775
750
|
let SwcAppStyle = class SwcAppStyle extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLStyleElement) {
|
|
776
751
|
};
|
|
777
752
|
SwcAppStyle = __decorate([
|
|
778
|
-
(0,
|
|
753
|
+
(0, import_decorators.elementDefine)("swc-app-style", { extends: "style", window: w })
|
|
779
754
|
], SwcAppStyle);
|
|
780
755
|
let SwcAppTable = class SwcAppTable extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTableElement) {
|
|
781
756
|
};
|
|
782
757
|
SwcAppTable = __decorate([
|
|
783
|
-
(0,
|
|
758
|
+
(0, import_decorators.elementDefine)("swc-app-table", { extends: "table", window: w })
|
|
784
759
|
], SwcAppTable);
|
|
785
760
|
let SwcAppTableSection = class SwcAppTableSection extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTableSectionElement) {
|
|
786
761
|
};
|
|
787
762
|
SwcAppTableSection = __decorate([
|
|
788
|
-
(0,
|
|
763
|
+
(0, import_decorators.elementDefine)("swc-app-tbody", { extends: "tbody", window: w })
|
|
789
764
|
], SwcAppTableSection);
|
|
790
765
|
let SwcAppTableCell = class SwcAppTableCell extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTableCellElement) {
|
|
791
766
|
};
|
|
792
767
|
SwcAppTableCell = __decorate([
|
|
793
|
-
(0,
|
|
768
|
+
(0, import_decorators.elementDefine)("swc-app-td", { extends: "td", window: w })
|
|
794
769
|
], SwcAppTableCell);
|
|
795
770
|
let SwcAppTemplate = class SwcAppTemplate extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTemplateElement) {
|
|
796
771
|
};
|
|
797
772
|
SwcAppTemplate = __decorate([
|
|
798
|
-
(0,
|
|
773
|
+
(0, import_decorators.elementDefine)("swc-app-template", { extends: "template", window: w })
|
|
799
774
|
], SwcAppTemplate);
|
|
800
775
|
let SwcAppTextArea = class SwcAppTextArea extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTextAreaElement) {
|
|
801
776
|
};
|
|
802
777
|
SwcAppTextArea = __decorate([
|
|
803
|
-
(0,
|
|
778
|
+
(0, import_decorators.elementDefine)("swc-app-textarea", { extends: "textarea", window: w })
|
|
804
779
|
], SwcAppTextArea);
|
|
805
780
|
let SwcAppTime = class SwcAppTime extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTimeElement) {
|
|
806
781
|
};
|
|
807
782
|
SwcAppTime = __decorate([
|
|
808
|
-
(0,
|
|
783
|
+
(0, import_decorators.elementDefine)("swc-app-time", { extends: "time", window: w })
|
|
809
784
|
], SwcAppTime);
|
|
810
785
|
let SwcAppTitle = class SwcAppTitle extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTitleElement) {
|
|
811
786
|
};
|
|
812
787
|
SwcAppTitle = __decorate([
|
|
813
|
-
(0,
|
|
788
|
+
(0, import_decorators.elementDefine)("swc-app-title", { extends: "title", window: w })
|
|
814
789
|
], SwcAppTitle);
|
|
815
790
|
let SwcAppTableRow = class SwcAppTableRow extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTableRowElement) {
|
|
816
791
|
};
|
|
817
792
|
SwcAppTableRow = __decorate([
|
|
818
|
-
(0,
|
|
793
|
+
(0, import_decorators.elementDefine)("swc-app-tr", { extends: "tr", window: w })
|
|
819
794
|
], SwcAppTableRow);
|
|
820
795
|
let SwcAppTrack = class SwcAppTrack extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLTrackElement) {
|
|
821
796
|
};
|
|
822
797
|
SwcAppTrack = __decorate([
|
|
823
|
-
(0,
|
|
798
|
+
(0, import_decorators.elementDefine)("swc-app-track", { extends: "track", window: w })
|
|
824
799
|
], SwcAppTrack);
|
|
825
800
|
let SwcAppUList = class SwcAppUList extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLUListElement) {
|
|
826
801
|
};
|
|
827
802
|
SwcAppUList = __decorate([
|
|
828
|
-
(0,
|
|
803
|
+
(0, import_decorators.elementDefine)("swc-app-ul", { extends: "ul", window: w })
|
|
829
804
|
], SwcAppUList);
|
|
830
805
|
let SwcAppVideo = class SwcAppVideo extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLVideoElement) {
|
|
831
806
|
};
|
|
832
807
|
SwcAppVideo = __decorate([
|
|
833
|
-
(0,
|
|
808
|
+
(0, import_decorators.elementDefine)("swc-app-video", { extends: "video", window: w })
|
|
834
809
|
], SwcAppVideo);
|
|
835
810
|
let SwcAppHeading = class SwcAppHeading extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLHeadingElement) {
|
|
836
811
|
};
|
|
837
812
|
SwcAppHeading = __decorate([
|
|
838
|
-
(0,
|
|
813
|
+
(0, import_decorators.elementDefine)("swc-app-h1", { extends: "h1", window: w })
|
|
839
814
|
], SwcAppHeading);
|
|
840
815
|
let SwcAppBody = class SwcAppBody extends (0, import_SwcAppMixin.SwcAppMixin)(HTMLBodyElement) {
|
|
841
816
|
};
|
|
842
817
|
SwcAppBody = __decorate([
|
|
843
|
-
(0,
|
|
818
|
+
(0, import_decorators.elementDefine)("swc-app-body", { extends: "body", window: w })
|
|
844
819
|
], SwcAppBody);
|
|
845
820
|
return {
|
|
846
821
|
// Sub Templates
|