@webtides/element-js 1.0.0-alpha.1 → 1.0.0-alpha.11
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/docs/README.md +174 -0
- package/docs/concepts/classes.md +167 -0
- package/docs/concepts/hierarchy.md +61 -0
- package/docs/concepts/lifecycle.md +45 -0
- package/docs/concepts/reactivity.md +14 -0
- package/docs/features/computed-properties.md +28 -0
- package/docs/features/dependency-injection-context-protocol.md +132 -0
- package/docs/features/events.md +155 -0
- package/docs/features/global-styles.md +131 -0
- package/docs/features/methods.md +34 -0
- package/docs/features/properties.md +56 -0
- package/docs/features/refs.md +47 -0
- package/docs/features/renderless.md +70 -0
- package/docs/features/store.md +143 -0
- package/docs/features/styles.md +169 -0
- package/docs/features/templates.md +308 -0
- package/docs/features/watch.md +54 -0
- package/docs/getting-started/upgrade-to-v1.md +243 -0
- package/docs/guide/guide.md +112 -0
- package/index.js +9 -2
- package/package.json +15 -19
- package/src/BaseElement.js +206 -42
- package/src/StyledElement.js +67 -48
- package/src/TemplateElement.js +32 -7
- package/src/dom-parts/AttributePart.js +16 -9
- package/src/dom-parts/ChildNodePart.js +8 -22
- package/src/dom-parts/NodePart.js +1 -0
- package/src/dom-parts/TemplatePart.js +19 -25
- package/src/dom-parts/TemplateResult.js +46 -35
- package/src/dom-parts/directives.js +43 -16
- package/src/dom-parts/html.js +1 -1
- package/src/dom-parts/render.js +6 -1
- package/src/util/AttributeParser.js +54 -21
- package/src/util/DOMHelper.js +63 -14
- package/src/util/Directive.js +21 -1
- package/src/util/GlobalStylesStore.js +66 -0
- package/src/util/SerializeStateHelper.js +103 -0
- package/src/util/Store.js +111 -15
- package/src/util/defineElement.js +2 -2
- package/src/util/toString.js +2 -2
- package/dist/index.js +0 -1330
- package/dist/index.js.map +0 -7
- package/src/util/i18n.js +0 -20
package/dist/index.js
DELETED
|
@@ -1,1330 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// src/util/AttributeParser.js
|
|
9
|
-
function isObjectLike(value) {
|
|
10
|
-
return typeof value == "object" && value !== null;
|
|
11
|
-
}
|
|
12
|
-
function isJSON(str) {
|
|
13
|
-
try {
|
|
14
|
-
return JSON.parse(str) && !!str;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function isBoolean(value) {
|
|
20
|
-
return value === "true" || value === "false";
|
|
21
|
-
}
|
|
22
|
-
function parseBoolean(value) {
|
|
23
|
-
return value === "true";
|
|
24
|
-
}
|
|
25
|
-
function isString(value) {
|
|
26
|
-
return typeof value === "string" || !!value && typeof value === "object" && Object.prototype.toString.call(value) === "[object String]";
|
|
27
|
-
}
|
|
28
|
-
function isNumber(value) {
|
|
29
|
-
return new RegExp("^-?(0|0\\.\\d+|[1-9]\\d*(\\.\\d+)?)$").test(value);
|
|
30
|
-
}
|
|
31
|
-
function isNaN(value) {
|
|
32
|
-
return Number.isNaN(value);
|
|
33
|
-
}
|
|
34
|
-
function deepEquals(valueA, valueB) {
|
|
35
|
-
return JSON.stringify(valueA) === JSON.stringify(valueB);
|
|
36
|
-
}
|
|
37
|
-
function parseAttribute(value, options = {}) {
|
|
38
|
-
if (options.parse === false || !isString(value)) {
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
if (typeof options.parse === "function") {
|
|
42
|
-
return options.parse(value);
|
|
43
|
-
}
|
|
44
|
-
let parsedValue = value;
|
|
45
|
-
if (isJSON(value))
|
|
46
|
-
parsedValue = JSON.parse(value);
|
|
47
|
-
else if (isBoolean(value))
|
|
48
|
-
parsedValue = parseBoolean(value);
|
|
49
|
-
else if (isNumber(value))
|
|
50
|
-
parsedValue = parseFloat(value);
|
|
51
|
-
return parsedValue;
|
|
52
|
-
}
|
|
53
|
-
function dashToCamel(string) {
|
|
54
|
-
if (string.indexOf("-") === -1)
|
|
55
|
-
return string;
|
|
56
|
-
return string.replace(/-[a-z]/g, (matches) => matches[1].toUpperCase());
|
|
57
|
-
}
|
|
58
|
-
function camelToDash(string) {
|
|
59
|
-
return string.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
60
|
-
}
|
|
61
|
-
function encodeAttribute(attribute2) {
|
|
62
|
-
return `${attribute2}`.replace(/'/g, "'").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">").replace(/\r\n/g, "\n").replace(/[\r\n]/g, "\n");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/util/DOMHelper.js
|
|
66
|
-
var ELEMENT_NODE = 1;
|
|
67
|
-
var COMMENT_NODE = 8;
|
|
68
|
-
var getNodePath = (node) => {
|
|
69
|
-
const path = [];
|
|
70
|
-
let parentNode = node.parentNode;
|
|
71
|
-
while (parentNode) {
|
|
72
|
-
path.push([...parentNode.childNodes].indexOf(node));
|
|
73
|
-
node = parentNode;
|
|
74
|
-
parentNode = node.parentNode;
|
|
75
|
-
}
|
|
76
|
-
return path;
|
|
77
|
-
};
|
|
78
|
-
function getShadowParentOrBody(element) {
|
|
79
|
-
if (element instanceof ShadowRoot) {
|
|
80
|
-
return element;
|
|
81
|
-
}
|
|
82
|
-
while (element.parentNode && (element = element.parentNode)) {
|
|
83
|
-
if (element instanceof ShadowRoot) {
|
|
84
|
-
return element;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return document.body;
|
|
88
|
-
}
|
|
89
|
-
var supportsAdoptingStyleSheets = () => "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
90
|
-
var supportsAppendingStyleSheets = !window.ShadyDOM;
|
|
91
|
-
var convertStringToTemplate = (string) => {
|
|
92
|
-
var _a;
|
|
93
|
-
const template = (_a = globalThis.document) == null ? void 0 : _a.createElement("template");
|
|
94
|
-
template.innerHTML = string.trimStart().trimEnd();
|
|
95
|
-
return template.content;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/util/Store.js
|
|
99
|
-
var Store = class {
|
|
100
|
-
constructor(value) {
|
|
101
|
-
__publicField(this, "_observer", /* @__PURE__ */ new Set());
|
|
102
|
-
__publicField(this, "_singlePropertyMode", false);
|
|
103
|
-
__publicField(this, "_state", {});
|
|
104
|
-
this._singlePropertyMode = arguments.length > 0 && !isObjectLike(value);
|
|
105
|
-
const specificValues = this._singlePropertyMode ? { value } : value;
|
|
106
|
-
this._state = { ...!this._singlePropertyMode && this.properties(), ...specificValues };
|
|
107
|
-
Object.entries(this._state).map(([key, value2]) => {
|
|
108
|
-
Object.defineProperty(this, key, {
|
|
109
|
-
get: () => {
|
|
110
|
-
return this._state[key];
|
|
111
|
-
},
|
|
112
|
-
set: (newValue) => {
|
|
113
|
-
const oldValue = this._state[key];
|
|
114
|
-
this._state[key] = newValue;
|
|
115
|
-
if (!deepEquals(newValue, oldValue)) {
|
|
116
|
-
const watch = this.watch();
|
|
117
|
-
if (watch.hasOwnProperty(key) && typeof watch[key] === "function") {
|
|
118
|
-
watch[key](newValue, oldValue);
|
|
119
|
-
}
|
|
120
|
-
this.requestUpdate();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
properties() {
|
|
127
|
-
return {};
|
|
128
|
-
}
|
|
129
|
-
watch() {
|
|
130
|
-
return {};
|
|
131
|
-
}
|
|
132
|
-
valueOf() {
|
|
133
|
-
return this._singlePropertyMode ? this._state.value : this._state;
|
|
134
|
-
}
|
|
135
|
-
toString() {
|
|
136
|
-
return `${this._singlePropertyMode ? this._state.value : this._state}`;
|
|
137
|
-
}
|
|
138
|
-
subscribe(observer) {
|
|
139
|
-
this._observer.add(observer);
|
|
140
|
-
}
|
|
141
|
-
unsubscribe(observer) {
|
|
142
|
-
this._observer.delete(observer);
|
|
143
|
-
}
|
|
144
|
-
requestUpdate() {
|
|
145
|
-
this._observer.forEach(async (observer) => {
|
|
146
|
-
var _a, _b;
|
|
147
|
-
if (observer instanceof BaseElement) {
|
|
148
|
-
await observer.requestUpdate();
|
|
149
|
-
if (Object.keys((_a = observer.watch()) != null ? _a : {}).length > 0) {
|
|
150
|
-
const properties = observer.properties();
|
|
151
|
-
Object.keys((_b = observer.watch()) != null ? _b : {}).forEach((key) => {
|
|
152
|
-
if (observer._state[key] === this) {
|
|
153
|
-
observer.callPropertyWatcher(key, this, this);
|
|
154
|
-
observer.notifyPropertyChange(key, this);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
} else if (typeof observer === "function") {
|
|
159
|
-
observer();
|
|
160
|
-
} else {
|
|
161
|
-
console.error("Store: observer type is not supported.", observer);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/util/defineElement.js
|
|
168
|
-
function defineElement(name, constructor) {
|
|
169
|
-
try {
|
|
170
|
-
customElements.define(name, constructor);
|
|
171
|
-
} catch (e) {
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// src/util/toString.js
|
|
176
|
-
function toString(value) {
|
|
177
|
-
try {
|
|
178
|
-
return JSON.stringify(value);
|
|
179
|
-
} catch (e) {
|
|
180
|
-
return "";
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// src/BaseElement.js
|
|
185
|
-
var BaseElement = class extends HTMLElement {
|
|
186
|
-
constructor(options = {}) {
|
|
187
|
-
super();
|
|
188
|
-
this.$refs = {};
|
|
189
|
-
this._state = {};
|
|
190
|
-
this._mutationObserver = null;
|
|
191
|
-
this._registeredEvents = [];
|
|
192
|
-
this._batchUpdate = null;
|
|
193
|
-
this._requestedUpdates = [];
|
|
194
|
-
this._options = {
|
|
195
|
-
autoUpdate: true,
|
|
196
|
-
deferUpdate: true,
|
|
197
|
-
mutationObserverOptions: {
|
|
198
|
-
attributes: true,
|
|
199
|
-
childList: true,
|
|
200
|
-
subtree: false,
|
|
201
|
-
...options.mutationObserverOptions
|
|
202
|
-
},
|
|
203
|
-
propertyOptions: {},
|
|
204
|
-
...options
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
connectedCallback() {
|
|
208
|
-
this.defineAttributesAsProperties();
|
|
209
|
-
this.defineProperties();
|
|
210
|
-
this.definePropertyInjection();
|
|
211
|
-
this.defineObserver();
|
|
212
|
-
if (this.hasAttribute("defer-update") || this._options.deferUpdate) {
|
|
213
|
-
this.registerEventsAndRefs();
|
|
214
|
-
this.triggerHook("connected");
|
|
215
|
-
} else {
|
|
216
|
-
this.requestUpdate({ notify: false }).then(() => {
|
|
217
|
-
this.triggerHook("connected");
|
|
218
|
-
this.triggerHook("afterUpdate");
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
defineObserver() {
|
|
223
|
-
this._mutationObserver = new MutationObserver((mutations) => {
|
|
224
|
-
mutations.forEach((mutation) => {
|
|
225
|
-
if (mutation.type === "attributes" && mutation.target === this && this._state.hasOwnProperty(dashToCamel(mutation.attributeName))) {
|
|
226
|
-
this[dashToCamel(mutation.attributeName)] = parseAttribute(
|
|
227
|
-
this.getAttribute(mutation.attributeName),
|
|
228
|
-
this._options.propertyOptions[dashToCamel(mutation.attributeName)]
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
if (mutation.type === "attributes" && mutation.target !== this) {
|
|
232
|
-
this.requestUpdate();
|
|
233
|
-
}
|
|
234
|
-
if (mutation.type === "childList") {
|
|
235
|
-
this.requestUpdate();
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
this._mutationObserver.observe(this, {
|
|
240
|
-
attributes: true,
|
|
241
|
-
childList: true,
|
|
242
|
-
subtree: false,
|
|
243
|
-
...this._options.mutationObserverOptions
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
disconnectedCallback() {
|
|
247
|
-
this.removeEvents();
|
|
248
|
-
if (Object.keys(this.provideProperties()).length > 0) {
|
|
249
|
-
this.removeEventListener("request-context", this.onRequestContext);
|
|
250
|
-
}
|
|
251
|
-
if (this._mutationObserver)
|
|
252
|
-
this._mutationObserver.disconnect();
|
|
253
|
-
Object.values(this.properties()).forEach((property) => {
|
|
254
|
-
if (property instanceof Store) {
|
|
255
|
-
property.unsubscribe(this);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
this.triggerHook("disconnected");
|
|
259
|
-
}
|
|
260
|
-
requestUpdate(options = { notify: true }) {
|
|
261
|
-
if (options.notify === true) {
|
|
262
|
-
this.triggerHook("beforeUpdate");
|
|
263
|
-
}
|
|
264
|
-
if (this._batchUpdate) {
|
|
265
|
-
cancelAnimationFrame(this._batchUpdate);
|
|
266
|
-
this._batchUpdate = false;
|
|
267
|
-
}
|
|
268
|
-
return new Promise((resolve, reject) => {
|
|
269
|
-
this._requestedUpdates.push({ resolve, reject });
|
|
270
|
-
this._batchUpdate = requestAnimationFrame(() => {
|
|
271
|
-
try {
|
|
272
|
-
this.update(options);
|
|
273
|
-
this._requestedUpdates.forEach(({ resolve: resolve2, reject: reject2 }) => resolve2());
|
|
274
|
-
} catch (e) {
|
|
275
|
-
this._requestedUpdates.forEach(({ resolve: resolve2, reject: reject2 }) => reject2(e));
|
|
276
|
-
}
|
|
277
|
-
this._requestedUpdates = [];
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
update(options = { notify: true }) {
|
|
282
|
-
this.registerEventsAndRefs();
|
|
283
|
-
if (options.notify === true) {
|
|
284
|
-
this.triggerHook("afterUpdate");
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
registerEventsAndRefs() {
|
|
288
|
-
this.registerEvents();
|
|
289
|
-
this.registerRefs();
|
|
290
|
-
}
|
|
291
|
-
defineAttributesAsProperties() {
|
|
292
|
-
const ignoreAttributes = ["class", "style"];
|
|
293
|
-
Array.from(this.attributes).filter((attribute2) => {
|
|
294
|
-
return !ignoreAttributes.includes(attribute2.name);
|
|
295
|
-
}).forEach((attribute2) => {
|
|
296
|
-
const name = dashToCamel(attribute2.name);
|
|
297
|
-
const parseOptions = this._options.propertyOptions[name];
|
|
298
|
-
this.defineProperty(name, parseAttribute(attribute2.value, parseOptions), true);
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
properties() {
|
|
302
|
-
return {};
|
|
303
|
-
}
|
|
304
|
-
defineProperties() {
|
|
305
|
-
Object.keys({ ...this.injectProperties(), ...this.properties() }).forEach((prop) => {
|
|
306
|
-
const value = this[prop] || this.properties()[prop];
|
|
307
|
-
this.defineProperty(prop, value);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
defineProperty(property, value, reflectAttribute = false) {
|
|
311
|
-
var _a, _b;
|
|
312
|
-
if (value instanceof Store) {
|
|
313
|
-
value.subscribe(this);
|
|
314
|
-
}
|
|
315
|
-
if (this._state.hasOwnProperty(property)) {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (!reflectAttribute && ((_a = this._options.propertyOptions[property]) == null ? void 0 : _a.reflect)) {
|
|
319
|
-
this.reflectProperty({ property, newValue: value });
|
|
320
|
-
}
|
|
321
|
-
if (((_b = this._options.propertyOptions[property]) == null ? void 0 : _b.reflect) === false) {
|
|
322
|
-
this.removeAttribute(camelToDash(property));
|
|
323
|
-
}
|
|
324
|
-
this._state[property] = value;
|
|
325
|
-
Object.defineProperty(this, property, {
|
|
326
|
-
get: () => {
|
|
327
|
-
return this._state[property];
|
|
328
|
-
},
|
|
329
|
-
set: (newValue) => {
|
|
330
|
-
var _a2;
|
|
331
|
-
const oldValue = this._state[property];
|
|
332
|
-
const newValueString = JSON.stringify(newValue);
|
|
333
|
-
if (JSON.stringify(oldValue) !== newValueString) {
|
|
334
|
-
this._state[property] = newValue;
|
|
335
|
-
if (newValue instanceof Store) {
|
|
336
|
-
newValue.subscribe(this);
|
|
337
|
-
}
|
|
338
|
-
if (reflectAttribute || ((_a2 = this._options.propertyOptions[property]) == null ? void 0 : _a2.reflect)) {
|
|
339
|
-
this.reflectProperty({ property, newValue, newValueString });
|
|
340
|
-
}
|
|
341
|
-
if (this._options.autoUpdate) {
|
|
342
|
-
this.requestUpdate({
|
|
343
|
-
notify: true,
|
|
344
|
-
property,
|
|
345
|
-
newValue,
|
|
346
|
-
newValueString,
|
|
347
|
-
oldValue
|
|
348
|
-
}).finally(() => {
|
|
349
|
-
this.callPropertyWatcher(property, newValue, oldValue);
|
|
350
|
-
this.notifyPropertyChange(property, newValue);
|
|
351
|
-
});
|
|
352
|
-
} else {
|
|
353
|
-
this.callPropertyWatcher(property, newValue, oldValue);
|
|
354
|
-
this.notifyPropertyChange(property, newValue);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return this;
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
callPropertyWatcher(property, newValue, oldValue) {
|
|
362
|
-
const watch = this.watch();
|
|
363
|
-
if (property in watch) {
|
|
364
|
-
watch[property](newValue, oldValue);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
notifyPropertyChange(property, newValue) {
|
|
368
|
-
if (property in this._options["propertyOptions"] && this._options["propertyOptions"][property]["notify"] === true) {
|
|
369
|
-
this.dispatch(`${camelToDash(property)}-changed`, newValue, true);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
reflectProperty(options) {
|
|
373
|
-
var _a;
|
|
374
|
-
const { property, newValue } = options;
|
|
375
|
-
const newValueString = options.newValueString || JSON.stringify(newValue);
|
|
376
|
-
if (newValue === void 0 || newValue === null || isNaN(newValue)) {
|
|
377
|
-
this.setAttribute(camelToDash(property), "");
|
|
378
|
-
} else {
|
|
379
|
-
let attributeValue = isObjectLike(newValue) ? newValueString : newValue;
|
|
380
|
-
if (typeof ((_a = this._options.propertyOptions[property]) == null ? void 0 : _a.reflect) === "function") {
|
|
381
|
-
attributeValue = this._options.propertyOptions[property].reflect(newValue);
|
|
382
|
-
}
|
|
383
|
-
this.setAttribute(camelToDash(property), attributeValue);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
injectProperties() {
|
|
387
|
-
return {};
|
|
388
|
-
}
|
|
389
|
-
provideProperties() {
|
|
390
|
-
return {};
|
|
391
|
-
}
|
|
392
|
-
definePropertyInjection() {
|
|
393
|
-
Object.entries(this.injectProperties()).forEach(([key, value]) => {
|
|
394
|
-
this.requestContext(key, value);
|
|
395
|
-
});
|
|
396
|
-
if (Object.keys(this.provideProperties()).length > 0) {
|
|
397
|
-
this.addEventListener("request-context", this.onRequestContext);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
requestContext(propertyName, valueOrCallback) {
|
|
401
|
-
this.dispatch("request-context", { [propertyName]: valueOrCallback }, true);
|
|
402
|
-
}
|
|
403
|
-
onRequestContext(event) {
|
|
404
|
-
var _a;
|
|
405
|
-
const properties = this.properties();
|
|
406
|
-
const provideProperties = this.provideProperties();
|
|
407
|
-
Object.entries((_a = event.detail) != null ? _a : {}).forEach(([key, valueOrCallback]) => {
|
|
408
|
-
if (key in provideProperties) {
|
|
409
|
-
const providedValue = provideProperties[key];
|
|
410
|
-
event.stopPropagation();
|
|
411
|
-
if (typeof valueOrCallback === "function") {
|
|
412
|
-
valueOrCallback(providedValue);
|
|
413
|
-
} else {
|
|
414
|
-
event.target[key] = providedValue;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
connected() {
|
|
420
|
-
}
|
|
421
|
-
beforeUpdate() {
|
|
422
|
-
}
|
|
423
|
-
afterUpdate() {
|
|
424
|
-
}
|
|
425
|
-
disconnected() {
|
|
426
|
-
}
|
|
427
|
-
triggerHook(name) {
|
|
428
|
-
if (name in this) {
|
|
429
|
-
this[name]();
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
watch() {
|
|
433
|
-
return {};
|
|
434
|
-
}
|
|
435
|
-
events() {
|
|
436
|
-
return {};
|
|
437
|
-
}
|
|
438
|
-
registerEvents() {
|
|
439
|
-
this.removeEvents();
|
|
440
|
-
const eventDefinitions = this.events();
|
|
441
|
-
Object.keys(eventDefinitions).forEach((elementSelector) => {
|
|
442
|
-
const events = eventDefinitions[elementSelector];
|
|
443
|
-
const selectorWhiteList = { window, document, this: this.getRoot() };
|
|
444
|
-
const whiteListElement = selectorWhiteList[elementSelector];
|
|
445
|
-
const eventTargets = whiteListElement ? [whiteListElement] : this.getRoot().querySelectorAll(elementSelector);
|
|
446
|
-
eventTargets.forEach((eventTarget) => {
|
|
447
|
-
Object.keys(events).forEach((eventName) => {
|
|
448
|
-
var _a;
|
|
449
|
-
const notation = events[eventName];
|
|
450
|
-
if (typeof notation === "function") {
|
|
451
|
-
const callback = notation.bind(this);
|
|
452
|
-
eventTarget.addEventListener(eventName, callback);
|
|
453
|
-
this._registeredEvents.push({ eventTarget, eventName, callback });
|
|
454
|
-
} else if (typeof notation === "object" && typeof notation.listener === "function") {
|
|
455
|
-
const callback = notation.listener.bind(this);
|
|
456
|
-
eventTarget.addEventListener(eventName, callback, (_a = notation.options) != null ? _a : {});
|
|
457
|
-
this._registeredEvents.push({ eventTarget, eventName, callback });
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
removeEvents() {
|
|
464
|
-
this._registeredEvents.forEach(({ eventTarget, eventName, callback }) => {
|
|
465
|
-
if (eventTarget === window || eventTarget === document || this.getRoot().contains(eventTarget)) {
|
|
466
|
-
eventTarget.removeEventListener(eventName, callback);
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
this._registeredEvents = [];
|
|
470
|
-
}
|
|
471
|
-
registerRefs() {
|
|
472
|
-
const refsNodeList = this.getRoot().querySelectorAll("[ref]");
|
|
473
|
-
const refsArray = Array.from(refsNodeList);
|
|
474
|
-
const refsMap = {};
|
|
475
|
-
refsArray.forEach((refNode) => {
|
|
476
|
-
const refKey = refNode.getAttribute("ref");
|
|
477
|
-
const isListKey = refKey.endsWith("[]");
|
|
478
|
-
const cleanKey = isListKey ? refKey.slice(0, -2) : refKey;
|
|
479
|
-
const hasListRef = Array.isArray(refsMap[cleanKey]);
|
|
480
|
-
if (isListKey) {
|
|
481
|
-
if (!refsMap[cleanKey] || !hasListRef) {
|
|
482
|
-
refsMap[cleanKey] = [];
|
|
483
|
-
}
|
|
484
|
-
refsMap[cleanKey].push(refNode);
|
|
485
|
-
} else if (!hasListRef) {
|
|
486
|
-
refsMap[refKey] = refNode;
|
|
487
|
-
} else {
|
|
488
|
-
console.warn(
|
|
489
|
-
`Did not register singular ref ${refKey}, ${refNode} as a ref list is already registered under the same name.`
|
|
490
|
-
);
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
this.$refs = refsMap;
|
|
494
|
-
}
|
|
495
|
-
dispatch(name, data, bubble = false, cancelable = false, composed = false) {
|
|
496
|
-
const event = new CustomEvent(name, {
|
|
497
|
-
bubbles: bubble,
|
|
498
|
-
cancelable,
|
|
499
|
-
composed,
|
|
500
|
-
detail: data
|
|
501
|
-
});
|
|
502
|
-
this.dispatchEvent(event);
|
|
503
|
-
}
|
|
504
|
-
getRoot() {
|
|
505
|
-
return this;
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
// src/util/i18n.js
|
|
510
|
-
function i18n(key, fallback) {
|
|
511
|
-
try {
|
|
512
|
-
const translations = window.elementjs.i18n();
|
|
513
|
-
if (translations[key] === void 0) {
|
|
514
|
-
throw "Translation Missing";
|
|
515
|
-
}
|
|
516
|
-
return translations[key];
|
|
517
|
-
} catch (err) {
|
|
518
|
-
if (fallback)
|
|
519
|
-
return fallback;
|
|
520
|
-
else
|
|
521
|
-
return key;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
// src/StyledElement.js
|
|
526
|
-
var _StyledElement = class extends BaseElement {
|
|
527
|
-
static updateGlobalStyles() {
|
|
528
|
-
_StyledElement.globalStyles = document.getElementById("globalStyles");
|
|
529
|
-
if (_StyledElement.globalStyles && _StyledElement["globalStyleSheet"]) {
|
|
530
|
-
_StyledElement["globalStyleSheet"].replaceSync(_StyledElement.globalStyles.textContent);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
constructor(options) {
|
|
534
|
-
super({
|
|
535
|
-
deferUpdate: false,
|
|
536
|
-
shadowRender: false,
|
|
537
|
-
styles: [],
|
|
538
|
-
adoptGlobalStyles: true,
|
|
539
|
-
...options
|
|
540
|
-
});
|
|
541
|
-
this._styles = [...this._options.styles, ...this.styles()];
|
|
542
|
-
}
|
|
543
|
-
connectedCallback() {
|
|
544
|
-
super.connectedCallback();
|
|
545
|
-
if (supportsAdoptingStyleSheets() && this._options.shadowRender) {
|
|
546
|
-
this.adoptStyleSheets();
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
styles() {
|
|
550
|
-
return [];
|
|
551
|
-
}
|
|
552
|
-
update(options) {
|
|
553
|
-
var _a, _b;
|
|
554
|
-
if (!supportsAdoptingStyleSheets() || this._options.shadowRender === false) {
|
|
555
|
-
const appendableStyles = [...this._styles];
|
|
556
|
-
if (this._options.shadowRender && this._options.adoptGlobalStyles) {
|
|
557
|
-
appendableStyles.unshift((_b = (_a = _StyledElement.globalStyles) == null ? void 0 : _a.textContent) != null ? _b : "");
|
|
558
|
-
}
|
|
559
|
-
this.appendStyleSheets(appendableStyles);
|
|
560
|
-
}
|
|
561
|
-
super.update(options);
|
|
562
|
-
}
|
|
563
|
-
adoptStyleSheets() {
|
|
564
|
-
if (!this.constructor["cssStyleSheets"]) {
|
|
565
|
-
this.constructor["cssStyleSheets"] = this._styles.map((style) => {
|
|
566
|
-
const sheet = new CSSStyleSheet();
|
|
567
|
-
if (sheet && sheet.cssRules.length === 0) {
|
|
568
|
-
sheet.replaceSync(style);
|
|
569
|
-
}
|
|
570
|
-
return sheet;
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
if (_StyledElement.globalStyles && !_StyledElement["globalStyleSheet"]) {
|
|
574
|
-
_StyledElement["globalStyleSheet"] = new CSSStyleSheet();
|
|
575
|
-
_StyledElement["globalStyleSheet"].replaceSync(_StyledElement.globalStyles.textContent);
|
|
576
|
-
}
|
|
577
|
-
this.getRoot().adoptedStyleSheets = [
|
|
578
|
-
...this._options.shadowRender && this._options.adoptGlobalStyles && _StyledElement["globalStyleSheet"] ? [_StyledElement["globalStyleSheet"]] : [],
|
|
579
|
-
...this.constructor["cssStyleSheets"]
|
|
580
|
-
];
|
|
581
|
-
}
|
|
582
|
-
appendStyleSheets(styles) {
|
|
583
|
-
const parentDocument = getShadowParentOrBody(this.getRoot());
|
|
584
|
-
styles.forEach((style, index) => {
|
|
585
|
-
const identifier = this.tagName + index;
|
|
586
|
-
if (!parentDocument.querySelector(`#${identifier}`)) {
|
|
587
|
-
const styleElement = document.createElement("style");
|
|
588
|
-
styleElement.id = identifier;
|
|
589
|
-
styleElement.style.display = "none";
|
|
590
|
-
styleElement.textContent = style;
|
|
591
|
-
parentDocument.appendChild(styleElement);
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
var StyledElement = _StyledElement;
|
|
597
|
-
__publicField(StyledElement, "globalStyles", null);
|
|
598
|
-
StyledElement.updateGlobalStyles();
|
|
599
|
-
|
|
600
|
-
// src/dom-parts/Part.js
|
|
601
|
-
var Part = class {
|
|
602
|
-
constructor() {
|
|
603
|
-
__publicField(this, "processor");
|
|
604
|
-
}
|
|
605
|
-
update(value) {
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
// src/dom-parts/AttributePart.js
|
|
610
|
-
var processBooleanAttribute = (node, name, oldValue) => {
|
|
611
|
-
node.removeAttribute(`?${name}`);
|
|
612
|
-
return (newValue) => {
|
|
613
|
-
const value = !!(newValue == null ? void 0 : newValue.valueOf()) && newValue !== "false";
|
|
614
|
-
if (oldValue !== value) {
|
|
615
|
-
node.toggleAttribute(name, oldValue = !!value);
|
|
616
|
-
}
|
|
617
|
-
};
|
|
618
|
-
};
|
|
619
|
-
var processPropertyAttribute = (node, name) => {
|
|
620
|
-
node.removeAttribute(`.${name}`);
|
|
621
|
-
return (value) => {
|
|
622
|
-
node[name] = value;
|
|
623
|
-
};
|
|
624
|
-
};
|
|
625
|
-
var processEventAttribute = (node, name) => {
|
|
626
|
-
node.removeAttribute(name);
|
|
627
|
-
let oldValue = void 0;
|
|
628
|
-
let type = name.startsWith("@") ? name.slice(1) : name.toLowerCase().slice(2);
|
|
629
|
-
return (newValue) => {
|
|
630
|
-
if (oldValue !== newValue) {
|
|
631
|
-
if (oldValue)
|
|
632
|
-
node.removeEventListener(type, oldValue);
|
|
633
|
-
if (oldValue = newValue)
|
|
634
|
-
node.addEventListener(type, oldValue);
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
};
|
|
638
|
-
var processAttribute = (node, name) => {
|
|
639
|
-
var _a;
|
|
640
|
-
let oldValue, orphan = true;
|
|
641
|
-
const attributeNode = (_a = globalThis.document) == null ? void 0 : _a.createAttributeNS(null, name);
|
|
642
|
-
return (newValue) => {
|
|
643
|
-
const value = newValue == null ? void 0 : newValue.valueOf();
|
|
644
|
-
if (oldValue !== value) {
|
|
645
|
-
if ((oldValue = value) == null) {
|
|
646
|
-
if (!orphan) {
|
|
647
|
-
node.removeAttributeNode(attributeNode);
|
|
648
|
-
orphan = true;
|
|
649
|
-
}
|
|
650
|
-
} else {
|
|
651
|
-
attributeNode.value = value;
|
|
652
|
-
if (orphan) {
|
|
653
|
-
node.setAttributeNodeNS(attributeNode);
|
|
654
|
-
orphan = false;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
};
|
|
660
|
-
var processAttributePart = (node, name) => {
|
|
661
|
-
if (name.startsWith("?")) {
|
|
662
|
-
return processBooleanAttribute(node, name.slice(1), false);
|
|
663
|
-
}
|
|
664
|
-
if (name.startsWith(".")) {
|
|
665
|
-
return processPropertyAttribute(node, name.slice(1));
|
|
666
|
-
}
|
|
667
|
-
if (name.startsWith("@") || name.startsWith("on")) {
|
|
668
|
-
return processEventAttribute(node, name);
|
|
669
|
-
}
|
|
670
|
-
return processAttribute(node, name);
|
|
671
|
-
};
|
|
672
|
-
var AttributePart = class extends Part {
|
|
673
|
-
constructor(node, name, initialValue) {
|
|
674
|
-
super();
|
|
675
|
-
__publicField(this, "name");
|
|
676
|
-
__publicField(this, "interpolations", 1);
|
|
677
|
-
__publicField(this, "values", []);
|
|
678
|
-
__publicField(this, "currentValueIndex", 0);
|
|
679
|
-
__publicField(this, "initialValue");
|
|
680
|
-
this.name = name;
|
|
681
|
-
this.initialValue = initialValue;
|
|
682
|
-
this.processor = processAttributePart(node.nextElementSibling, this.name);
|
|
683
|
-
}
|
|
684
|
-
addNode(node) {
|
|
685
|
-
this.interpolations++;
|
|
686
|
-
}
|
|
687
|
-
update(value) {
|
|
688
|
-
if (this.initialValue === "") {
|
|
689
|
-
this.processor(value);
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
this.values[this.currentValueIndex++] = value;
|
|
693
|
-
if (this.interpolations === this.currentValueIndex) {
|
|
694
|
-
this.currentValueIndex = 0;
|
|
695
|
-
let replaceIndex = 0;
|
|
696
|
-
const parsedValue = this.initialValue.replace(/\x03/g, () => this.values[replaceIndex++]);
|
|
697
|
-
this.processor(parsedValue);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
// src/dom-parts/ChildNodePart.js
|
|
703
|
-
var removeChildNodes = (node) => {
|
|
704
|
-
var _a;
|
|
705
|
-
const range = (_a = globalThis.document) == null ? void 0 : _a.createRange();
|
|
706
|
-
const firstChild = Array.isArray(node) ? node[0] : node instanceof TemplatePart ? node.childNodes[0] : node.firstChild;
|
|
707
|
-
const lastChild = Array.isArray(node) ? node[node.length - 1] : node instanceof TemplatePart ? node.childNodes[node.childNodes.length - 1] : node.lastChild;
|
|
708
|
-
range.setStartAfter(firstChild);
|
|
709
|
-
range.setEndAfter(lastChild);
|
|
710
|
-
range.deleteContents();
|
|
711
|
-
return firstChild;
|
|
712
|
-
};
|
|
713
|
-
var removeNodesBetweenComments = (commentNode) => {
|
|
714
|
-
while (commentNode.previousSibling) {
|
|
715
|
-
if (commentNode.previousSibling.nodeType === COMMENT_NODE && commentNode.previousSibling.data === commentNode.data.replace("/", "")) {
|
|
716
|
-
break;
|
|
717
|
-
}
|
|
718
|
-
commentNode.parentNode.removeChild(commentNode.previousSibling);
|
|
719
|
-
}
|
|
720
|
-
};
|
|
721
|
-
var diffChildNodes = function(parentNode, domChildNodes, templateChildNodes, anchorNode) {
|
|
722
|
-
let length = Math.max(templateChildNodes.length, domChildNodes.length);
|
|
723
|
-
for (let index = 0; index < length; index++) {
|
|
724
|
-
let domChildNode = domChildNodes[index];
|
|
725
|
-
let templateChildNode = templateChildNodes[index];
|
|
726
|
-
if (!domChildNode) {
|
|
727
|
-
if (templateChildNode instanceof TemplatePart) {
|
|
728
|
-
anchorNode.before(...templateChildNode.childNodes);
|
|
729
|
-
} else if (typeof templateChildNode === "object" && "ELEMENT_NODE" in templateChildNode) {
|
|
730
|
-
parentNode.insertBefore(templateChildNode, anchorNode);
|
|
731
|
-
} else {
|
|
732
|
-
parentNode.insertBefore(document.createTextNode(templateChildNode), anchorNode);
|
|
733
|
-
}
|
|
734
|
-
continue;
|
|
735
|
-
}
|
|
736
|
-
if (!templateChildNode) {
|
|
737
|
-
parentNode.removeChild(removeChildNodes(domChildNode));
|
|
738
|
-
continue;
|
|
739
|
-
}
|
|
740
|
-
if (domChildNode === templateChildNode) {
|
|
741
|
-
continue;
|
|
742
|
-
}
|
|
743
|
-
if (templateChildNode.nodeType !== domChildNode.nodeType) {
|
|
744
|
-
parentNode.replaceChild(templateChildNode, domChildNode);
|
|
745
|
-
continue;
|
|
746
|
-
}
|
|
747
|
-
if (templateChildNode.nodeType === ELEMENT_NODE && templateChildNode.tagName !== domChildNode.tagName) {
|
|
748
|
-
parentNode.replaceChild(templateChildNode, domChildNode);
|
|
749
|
-
continue;
|
|
750
|
-
}
|
|
751
|
-
if (templateChildNode.nodeType === ELEMENT_NODE && templateChildNode.tagName === "SVG") {
|
|
752
|
-
parentNode.replaceChild(templateChildNode, domChildNode);
|
|
753
|
-
continue;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
return templateChildNodes;
|
|
757
|
-
};
|
|
758
|
-
var processNodePart = (comment, initialValue) => {
|
|
759
|
-
let nodes = [];
|
|
760
|
-
let oldValue = initialValue instanceof TemplatePart ? [...initialValue.childNodes] : initialValue;
|
|
761
|
-
let cachedTextNode = void 0;
|
|
762
|
-
const processNodeValue = (newValue) => {
|
|
763
|
-
var _a, _b;
|
|
764
|
-
switch (typeof newValue) {
|
|
765
|
-
case "string":
|
|
766
|
-
case "number":
|
|
767
|
-
case "boolean":
|
|
768
|
-
if (oldValue !== newValue) {
|
|
769
|
-
oldValue = newValue;
|
|
770
|
-
if (!cachedTextNode)
|
|
771
|
-
cachedTextNode = (_a = globalThis.document) == null ? void 0 : _a.createTextNode("");
|
|
772
|
-
cachedTextNode.data = newValue;
|
|
773
|
-
if (((_b = comment.previousSibling) == null ? void 0 : _b.data) === comment.data.replace("/", "")) {
|
|
774
|
-
comment.parentNode.insertBefore(cachedTextNode, comment);
|
|
775
|
-
} else {
|
|
776
|
-
comment.previousSibling.data = newValue;
|
|
777
|
-
}
|
|
778
|
-
nodes = [cachedTextNode];
|
|
779
|
-
}
|
|
780
|
-
break;
|
|
781
|
-
case "object":
|
|
782
|
-
case "undefined":
|
|
783
|
-
if (newValue === null || newValue === void 0) {
|
|
784
|
-
if (oldValue !== newValue) {
|
|
785
|
-
oldValue = newValue;
|
|
786
|
-
removeNodesBetweenComments(comment);
|
|
787
|
-
nodes = [];
|
|
788
|
-
}
|
|
789
|
-
break;
|
|
790
|
-
}
|
|
791
|
-
if (Array.isArray(newValue)) {
|
|
792
|
-
if (newValue.length === 0) {
|
|
793
|
-
removeNodesBetweenComments(comment);
|
|
794
|
-
nodes = [];
|
|
795
|
-
} else {
|
|
796
|
-
nodes = diffChildNodes(comment.parentNode, oldValue || [], newValue, comment);
|
|
797
|
-
}
|
|
798
|
-
oldValue = newValue;
|
|
799
|
-
break;
|
|
800
|
-
}
|
|
801
|
-
if (oldValue !== newValue) {
|
|
802
|
-
if ("ELEMENT_NODE" in newValue) {
|
|
803
|
-
oldValue = newValue;
|
|
804
|
-
nodes = diffChildNodes(comment.parentNode, nodes, [newValue], comment);
|
|
805
|
-
} else if (newValue instanceof TemplatePart) {
|
|
806
|
-
oldValue = newValue;
|
|
807
|
-
nodes = diffChildNodes(comment.parentNode, nodes, [...newValue.childNodes], comment);
|
|
808
|
-
} else {
|
|
809
|
-
console.warn("Could not process value", newValue);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
break;
|
|
813
|
-
case "function":
|
|
814
|
-
processNodeValue(newValue(comment));
|
|
815
|
-
break;
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
return processNodeValue;
|
|
819
|
-
};
|
|
820
|
-
var ChildNodePart = class extends Part {
|
|
821
|
-
constructor(startNode, value) {
|
|
822
|
-
var _a;
|
|
823
|
-
if (startNode && (startNode == null ? void 0 : startNode.nodeType) !== COMMENT_NODE) {
|
|
824
|
-
throw new Error("ChildNodePart: startNode is not a comment node");
|
|
825
|
-
}
|
|
826
|
-
super();
|
|
827
|
-
__publicField(this, "startNode");
|
|
828
|
-
__publicField(this, "endNode");
|
|
829
|
-
__publicField(this, "parts", []);
|
|
830
|
-
__publicField(this, "templatePart");
|
|
831
|
-
__publicField(this, "childNodes", []);
|
|
832
|
-
let serverSideRendered = false;
|
|
833
|
-
if (startNode) {
|
|
834
|
-
const placeholder = startNode.data;
|
|
835
|
-
const childNodes = [startNode];
|
|
836
|
-
let childNode = startNode.nextSibling;
|
|
837
|
-
while (childNode && childNode.data !== `/${placeholder}`) {
|
|
838
|
-
childNodes.push(childNode);
|
|
839
|
-
childNode = childNode.nextSibling;
|
|
840
|
-
}
|
|
841
|
-
const endNode = childNode;
|
|
842
|
-
childNodes.push(endNode);
|
|
843
|
-
if (childNodes.length > 2) {
|
|
844
|
-
serverSideRendered = true;
|
|
845
|
-
}
|
|
846
|
-
this.childNodes = childNodes;
|
|
847
|
-
this.startNode = startNode;
|
|
848
|
-
this.endNode = endNode;
|
|
849
|
-
}
|
|
850
|
-
const initialValue = this.parseValue(value);
|
|
851
|
-
if (this.endNode) {
|
|
852
|
-
this.processor = processNodePart(this.endNode, serverSideRendered ? initialValue : void 0);
|
|
853
|
-
}
|
|
854
|
-
if (!serverSideRendered) {
|
|
855
|
-
if (value instanceof TemplateResult || Array.isArray(value)) {
|
|
856
|
-
this.updateParts(value);
|
|
857
|
-
}
|
|
858
|
-
this.childNodes = [...this.childNodes];
|
|
859
|
-
(_a = this.processor) == null ? void 0 : _a.call(this, initialValue);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
update(value) {
|
|
863
|
-
var _a;
|
|
864
|
-
const parsedValue = this.parseValue(value);
|
|
865
|
-
if (value instanceof TemplateResult || Array.isArray(value)) {
|
|
866
|
-
this.updateParts(value);
|
|
867
|
-
}
|
|
868
|
-
(_a = this.processor) == null ? void 0 : _a.call(this, parsedValue);
|
|
869
|
-
}
|
|
870
|
-
updateParts(value) {
|
|
871
|
-
var _a;
|
|
872
|
-
if (value instanceof TemplateResult) {
|
|
873
|
-
this.templatePart.update(value);
|
|
874
|
-
}
|
|
875
|
-
if (Array.isArray(value)) {
|
|
876
|
-
for (let index = 0; index < value.length; index++) {
|
|
877
|
-
(_a = this.parts[index]) == null ? void 0 : _a.update(value[index]);
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
parseValue(value) {
|
|
882
|
-
var _a;
|
|
883
|
-
if (value instanceof TemplateResult) {
|
|
884
|
-
if (!this.templatePart) {
|
|
885
|
-
const templatePartCommentNodes = (_a = this.childNodes) == null ? void 0 : _a.filter(
|
|
886
|
-
(node) => node && node.nodeType === COMMENT_NODE && node.data === "template-part"
|
|
887
|
-
);
|
|
888
|
-
const startNode = templatePartCommentNodes[0];
|
|
889
|
-
this.templatePart = new TemplatePart(startNode, value);
|
|
890
|
-
}
|
|
891
|
-
return this.templatePart;
|
|
892
|
-
}
|
|
893
|
-
if (Array.isArray(value)) {
|
|
894
|
-
return this.parseArray(value);
|
|
895
|
-
}
|
|
896
|
-
return value;
|
|
897
|
-
}
|
|
898
|
-
parseArray(values) {
|
|
899
|
-
var _a, _b;
|
|
900
|
-
const parsedValues = [];
|
|
901
|
-
for (let index = 0; index < values.length; index++) {
|
|
902
|
-
let value = values[index];
|
|
903
|
-
if (value instanceof TemplateResult) {
|
|
904
|
-
let templatePart = this.parts[index];
|
|
905
|
-
if (!templatePart) {
|
|
906
|
-
const templatePartCommentNodes = (_a = this.childNodes) == null ? void 0 : _a.filter(
|
|
907
|
-
(node) => node && node.nodeType === COMMENT_NODE && node.data === "template-part"
|
|
908
|
-
);
|
|
909
|
-
const startNode = templatePartCommentNodes[index];
|
|
910
|
-
templatePart = new TemplatePart(startNode, value);
|
|
911
|
-
this.parts[index] = templatePart;
|
|
912
|
-
}
|
|
913
|
-
parsedValues[index] = templatePart;
|
|
914
|
-
} else if (Array.isArray(value)) {
|
|
915
|
-
let childNodePart = this.parts[index];
|
|
916
|
-
if (!childNodePart) {
|
|
917
|
-
const templatePartCommentNodes = (_b = this.childNodes) == null ? void 0 : _b.filter(
|
|
918
|
-
(node) => node && node.nodeType === COMMENT_NODE && node.data === "template-part"
|
|
919
|
-
);
|
|
920
|
-
const startNode = templatePartCommentNodes[index];
|
|
921
|
-
childNodePart = new ChildNodePart(startNode, value);
|
|
922
|
-
this.parts[index] = childNodePart;
|
|
923
|
-
}
|
|
924
|
-
parsedValues[index] = childNodePart;
|
|
925
|
-
} else {
|
|
926
|
-
parsedValues[index] = typeof value === "function" ? value() : value;
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
return parsedValues;
|
|
930
|
-
}
|
|
931
|
-
};
|
|
932
|
-
|
|
933
|
-
// src/dom-parts/NodePart.js
|
|
934
|
-
var NodePart = class extends Part {
|
|
935
|
-
constructor(node, initialValue) {
|
|
936
|
-
if (!isObjectLike(initialValue) && !initialValue.directiveClass) {
|
|
937
|
-
throw new Error(
|
|
938
|
-
"NodePart: value is not a wrapped directive function. You must wrap you custom directive class with the defineDirective function."
|
|
939
|
-
);
|
|
940
|
-
}
|
|
941
|
-
super();
|
|
942
|
-
__publicField(this, "node");
|
|
943
|
-
__publicField(this, "directive");
|
|
944
|
-
this.node = node.nextElementSibling;
|
|
945
|
-
const { directiveClass, values } = initialValue;
|
|
946
|
-
this.directive = new directiveClass(node.nextElementSibling);
|
|
947
|
-
}
|
|
948
|
-
update(value) {
|
|
949
|
-
const { directiveClass, values } = value;
|
|
950
|
-
this.directive.update(...values);
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
// src/dom-parts/TemplatePart.js
|
|
955
|
-
var partsCache = /* @__PURE__ */ new WeakMap();
|
|
956
|
-
var fragmentsCache = /* @__PURE__ */ new WeakMap();
|
|
957
|
-
var TemplatePart = class extends Part {
|
|
958
|
-
constructor(startNode, value) {
|
|
959
|
-
if (startNode && (startNode == null ? void 0 : startNode.nodeType) !== COMMENT_NODE) {
|
|
960
|
-
throw new Error("TemplatePart: startNode is not a comment node");
|
|
961
|
-
}
|
|
962
|
-
super();
|
|
963
|
-
__publicField(this, "parts", []);
|
|
964
|
-
__publicField(this, "strings");
|
|
965
|
-
__publicField(this, "childNodes", []);
|
|
966
|
-
let serverSideRendered = false;
|
|
967
|
-
if (startNode) {
|
|
968
|
-
const placeholder = startNode.data;
|
|
969
|
-
const childNodes = [startNode];
|
|
970
|
-
let childNode = startNode.nextSibling;
|
|
971
|
-
while (childNode && childNode.data !== `/${placeholder}`) {
|
|
972
|
-
childNodes.push(childNode);
|
|
973
|
-
childNode = childNode.nextSibling;
|
|
974
|
-
}
|
|
975
|
-
const endNode = childNode;
|
|
976
|
-
childNodes.push(endNode);
|
|
977
|
-
if (childNodes.length > 2) {
|
|
978
|
-
serverSideRendered = true;
|
|
979
|
-
this.childNodes = childNodes;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
this.parseValue(value);
|
|
983
|
-
if (!serverSideRendered) {
|
|
984
|
-
this.updateParts(value.values);
|
|
985
|
-
this.childNodes = [...this.childNodes];
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
update(value) {
|
|
989
|
-
this.parseValue(value);
|
|
990
|
-
this.updateParts(value.values);
|
|
991
|
-
}
|
|
992
|
-
updateParts(values) {
|
|
993
|
-
var _a;
|
|
994
|
-
for (let index = 0; index < values.length; index++) {
|
|
995
|
-
(_a = this.parts[index]) == null ? void 0 : _a.update(values[index]);
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
parseValue(templateResult) {
|
|
999
|
-
var _a;
|
|
1000
|
-
if (this.strings !== templateResult.strings) {
|
|
1001
|
-
if (this.childNodes.length === 0) {
|
|
1002
|
-
let fragment = fragmentsCache.get(templateResult.strings);
|
|
1003
|
-
if (!fragment) {
|
|
1004
|
-
fragment = this.parseFragment(templateResult);
|
|
1005
|
-
fragmentsCache.set(templateResult.strings, fragment);
|
|
1006
|
-
}
|
|
1007
|
-
const importedFragment = (_a = globalThis.document) == null ? void 0 : _a.importNode(fragment, true);
|
|
1008
|
-
this.childNodes = importedFragment.childNodes;
|
|
1009
|
-
}
|
|
1010
|
-
let parts = partsCache.get(templateResult.strings);
|
|
1011
|
-
if (!parts) {
|
|
1012
|
-
parts = templateResult.parseParts(this.childNodes);
|
|
1013
|
-
partsCache.set(templateResult.strings, parts);
|
|
1014
|
-
}
|
|
1015
|
-
let previousAttributePart = void 0;
|
|
1016
|
-
this.parts = parts.map((part, index) => {
|
|
1017
|
-
const node = part.path.reduceRight(({ childNodes }, i) => childNodes[i], this);
|
|
1018
|
-
if (part.type === "node") {
|
|
1019
|
-
return new ChildNodePart(node, templateResult.values[index]);
|
|
1020
|
-
}
|
|
1021
|
-
if (part.type === "attribute") {
|
|
1022
|
-
if (previousAttributePart && previousAttributePart.name === part.name) {
|
|
1023
|
-
previousAttributePart.addNode(node);
|
|
1024
|
-
return previousAttributePart;
|
|
1025
|
-
}
|
|
1026
|
-
return previousAttributePart = new AttributePart(node, part.name, part.initialValue);
|
|
1027
|
-
}
|
|
1028
|
-
if (part.type === "directive") {
|
|
1029
|
-
return new NodePart(node, templateResult.values[index]);
|
|
1030
|
-
}
|
|
1031
|
-
throw `cannot map part: ${part}`;
|
|
1032
|
-
});
|
|
1033
|
-
this.strings = templateResult.strings;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
parseFragment(templateResult) {
|
|
1037
|
-
const templateString = templateResult.templateString;
|
|
1038
|
-
return convertStringToTemplate(templateString);
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
|
-
// src/dom-parts/TemplateResult.js
|
|
1043
|
-
var voidElements = /^(?:area|base|br|col|embed|hr|img|input|link|meta|source|track|wbr)$/i;
|
|
1044
|
-
var elements = /<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/?)>/g;
|
|
1045
|
-
var attributes = /([^\s]*)=((?:")[^"]*(?:")|(?:')[^']*(?:')|[^\s\/>]*)|([^\s\/>]*)/g;
|
|
1046
|
-
var partPositions = /[\x01\x02]/g;
|
|
1047
|
-
var interpolation = new RegExp(`(<!--dom-part-(\\d+)--><!--/dom-part-(\\d+)-->|(\\S\\w+)="(")?|)`, "g");
|
|
1048
|
-
var createTemplateString = (templateStrings, attributePlaceholders = "") => {
|
|
1049
|
-
let partIndex = 0;
|
|
1050
|
-
let template = templateStrings.join("").trim();
|
|
1051
|
-
template = template.replace(elements, (_, name, attributesString, trailingSlash) => {
|
|
1052
|
-
let elementTagWithAttributes = name + attributesString.replaceAll("", attributePlaceholders).trimEnd();
|
|
1053
|
-
if (trailingSlash.length)
|
|
1054
|
-
elementTagWithAttributes += voidElements.test(name) ? " /" : "></" + name;
|
|
1055
|
-
const attributeParts = attributesString.replace(attributes, (attribute2, name2, valueWithQuotes, directive) => {
|
|
1056
|
-
if (directive) {
|
|
1057
|
-
return `<!--$-->`;
|
|
1058
|
-
}
|
|
1059
|
-
const value = (valueWithQuotes == null ? void 0 : valueWithQuotes.startsWith('"')) || (valueWithQuotes == null ? void 0 : valueWithQuotes.startsWith("'")) ? valueWithQuotes.slice(1, -1) : valueWithQuotes;
|
|
1060
|
-
const partsCount = (attribute2.match(/\x01/g) || []).length;
|
|
1061
|
-
const parts = [];
|
|
1062
|
-
for (let index = 0; index < partsCount; index++) {
|
|
1063
|
-
parts.push(`<!--:${name2}=${value.replaceAll("", "")}-->`);
|
|
1064
|
-
}
|
|
1065
|
-
return parts.join("");
|
|
1066
|
-
});
|
|
1067
|
-
return `
|
|
1068
|
-
${attributesString.includes("") ? attributeParts : ""}
|
|
1069
|
-
<${elementTagWithAttributes}>
|
|
1070
|
-
`;
|
|
1071
|
-
});
|
|
1072
|
-
template = template.replace(partPositions, (partPosition) => {
|
|
1073
|
-
if (partPosition === "") {
|
|
1074
|
-
return `<!--dom-part-${partIndex}--><!--/dom-part-${partIndex++}-->`;
|
|
1075
|
-
}
|
|
1076
|
-
if (partPosition === "") {
|
|
1077
|
-
return `dom-part-${partIndex++}`;
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
return `
|
|
1081
|
-
<!--template-part-->
|
|
1082
|
-
${template}
|
|
1083
|
-
<!--/template-part-->
|
|
1084
|
-
`;
|
|
1085
|
-
};
|
|
1086
|
-
var attribute = (name, value, isSingleValue = true) => {
|
|
1087
|
-
return ` ${name}="${encodeAttribute(isObjectLike(value) ? JSON.stringify(value) : value)}${isSingleValue ? '"' : ""}`;
|
|
1088
|
-
};
|
|
1089
|
-
var getValue = (value) => {
|
|
1090
|
-
switch (typeof value) {
|
|
1091
|
-
case "string":
|
|
1092
|
-
return encodeAttribute(value);
|
|
1093
|
-
case "boolean":
|
|
1094
|
-
case "number":
|
|
1095
|
-
return String(value);
|
|
1096
|
-
case "object":
|
|
1097
|
-
switch (true) {
|
|
1098
|
-
case Array.isArray(value):
|
|
1099
|
-
return value.map(getValue).join("");
|
|
1100
|
-
case value instanceof TemplateResult:
|
|
1101
|
-
return value.toString();
|
|
1102
|
-
}
|
|
1103
|
-
break;
|
|
1104
|
-
case "function":
|
|
1105
|
-
return getValue(value());
|
|
1106
|
-
}
|
|
1107
|
-
return value == null ? "" : encodeAttribute(String(value));
|
|
1108
|
-
};
|
|
1109
|
-
var parsedUpdates = /* @__PURE__ */ new WeakMap();
|
|
1110
|
-
var templateParts = /* @__PURE__ */ new WeakMap();
|
|
1111
|
-
var TemplateResult = class {
|
|
1112
|
-
constructor(strings, ...values) {
|
|
1113
|
-
this.strings = strings;
|
|
1114
|
-
this.values = values;
|
|
1115
|
-
}
|
|
1116
|
-
renderInto(domNode) {
|
|
1117
|
-
let serverSideRendered = false;
|
|
1118
|
-
let templatePart = templateParts.get(domNode);
|
|
1119
|
-
if (!templatePart) {
|
|
1120
|
-
const startNode = Array.from(domNode.childNodes).filter((node) => node.nodeType === COMMENT_NODE).find((node) => node.data === "template-part");
|
|
1121
|
-
serverSideRendered = startNode !== void 0;
|
|
1122
|
-
templatePart = new TemplatePart(startNode, this);
|
|
1123
|
-
templateParts.set(domNode, templatePart);
|
|
1124
|
-
if (!serverSideRendered) {
|
|
1125
|
-
domNode.replaceChildren(...templatePart.childNodes);
|
|
1126
|
-
}
|
|
1127
|
-
} else {
|
|
1128
|
-
templatePart.update(this);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
parse(strings) {
|
|
1132
|
-
const html2 = createTemplateString(strings, "");
|
|
1133
|
-
const parts = [];
|
|
1134
|
-
let i = 0;
|
|
1135
|
-
let match = null;
|
|
1136
|
-
while (match = interpolation.exec(html2)) {
|
|
1137
|
-
const pre = html2.slice(i, match.index);
|
|
1138
|
-
i = match.index + match[0].length;
|
|
1139
|
-
if (match[2]) {
|
|
1140
|
-
const index = match[2];
|
|
1141
|
-
parts.push((value) => `${pre}<!--dom-part-${index}-->${getValue(value)}<!--/dom-part-${index}-->`);
|
|
1142
|
-
} else if (match[4]) {
|
|
1143
|
-
const isSingleValue = match[5] !== void 0;
|
|
1144
|
-
let name = match[4];
|
|
1145
|
-
switch (true) {
|
|
1146
|
-
case name[0] === "?":
|
|
1147
|
-
const booleanName = name.slice(1).toLowerCase();
|
|
1148
|
-
parts.push((value) => {
|
|
1149
|
-
if (!value)
|
|
1150
|
-
return "";
|
|
1151
|
-
return `${pre} ${booleanName}=""`;
|
|
1152
|
-
});
|
|
1153
|
-
break;
|
|
1154
|
-
case name[0] === ".":
|
|
1155
|
-
const lower = name.slice(1).toLowerCase();
|
|
1156
|
-
parts.push((value) => {
|
|
1157
|
-
let result = pre;
|
|
1158
|
-
if (value === null || value === void 0 || value === "") {
|
|
1159
|
-
result += attribute(lower, "");
|
|
1160
|
-
} else {
|
|
1161
|
-
result += attribute(lower, value, isSingleValue);
|
|
1162
|
-
}
|
|
1163
|
-
return result;
|
|
1164
|
-
});
|
|
1165
|
-
break;
|
|
1166
|
-
case name[0] === "@":
|
|
1167
|
-
name = "on" + name.slice(1);
|
|
1168
|
-
case (name[0] === "o" && name[1] === "n"):
|
|
1169
|
-
parts.push((value) => {
|
|
1170
|
-
return pre;
|
|
1171
|
-
});
|
|
1172
|
-
break;
|
|
1173
|
-
default:
|
|
1174
|
-
parts.push((value) => {
|
|
1175
|
-
let result = pre;
|
|
1176
|
-
if (value != null) {
|
|
1177
|
-
result += attribute(name, value, isSingleValue);
|
|
1178
|
-
}
|
|
1179
|
-
return result;
|
|
1180
|
-
});
|
|
1181
|
-
break;
|
|
1182
|
-
}
|
|
1183
|
-
} else {
|
|
1184
|
-
parts.push((value) => {
|
|
1185
|
-
let result = pre;
|
|
1186
|
-
if (isObjectLike(value) && value.directiveClass) {
|
|
1187
|
-
} else if (value != null) {
|
|
1188
|
-
result += encodeAttribute(isObjectLike(value) ? JSON.stringify(value) : value);
|
|
1189
|
-
}
|
|
1190
|
-
return result;
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
if (parts.length !== strings.length - 1) {
|
|
1195
|
-
throw {
|
|
1196
|
-
name: "ParseTemplateError",
|
|
1197
|
-
message: "Could not parse parts from template correctly. Parts length has not the expected length.",
|
|
1198
|
-
strings,
|
|
1199
|
-
templateString: html2,
|
|
1200
|
-
parts
|
|
1201
|
-
};
|
|
1202
|
-
}
|
|
1203
|
-
if (parts.length) {
|
|
1204
|
-
const last = parts[parts.length - 1];
|
|
1205
|
-
const chunk = html2.slice(i);
|
|
1206
|
-
parts[parts.length - 1] = (value) => last(value) + chunk;
|
|
1207
|
-
} else {
|
|
1208
|
-
parts.push(() => html2);
|
|
1209
|
-
}
|
|
1210
|
-
return parts;
|
|
1211
|
-
}
|
|
1212
|
-
parseParts(childNodes) {
|
|
1213
|
-
var _a, _b;
|
|
1214
|
-
const range = (_a = globalThis.document) == null ? void 0 : _a.createRange();
|
|
1215
|
-
range.setStartBefore(childNodes[0]);
|
|
1216
|
-
range.setEndAfter(childNodes[childNodes.length - 1]);
|
|
1217
|
-
const template = range.cloneContents();
|
|
1218
|
-
const treeWalker = (_b = globalThis.document) == null ? void 0 : _b.createTreeWalker(template, 128);
|
|
1219
|
-
let node = treeWalker.currentNode;
|
|
1220
|
-
const getParts = () => {
|
|
1221
|
-
const parts2 = [];
|
|
1222
|
-
let currentPart = void 0;
|
|
1223
|
-
while (node = treeWalker.nextNode()) {
|
|
1224
|
-
if (/^template-part$/.test(node.data) && currentPart) {
|
|
1225
|
-
currentPart.parts = getParts();
|
|
1226
|
-
}
|
|
1227
|
-
if (/^\/template-part$/.test(node.data)) {
|
|
1228
|
-
return parts2;
|
|
1229
|
-
}
|
|
1230
|
-
if (/^dom-part-\d+$/.test(node.data)) {
|
|
1231
|
-
parts2.push(currentPart = { type: "node", path: getNodePath(node), parts: [] });
|
|
1232
|
-
}
|
|
1233
|
-
if (/^dom-part-\d+:/.test(node.data)) {
|
|
1234
|
-
const [_, attribute2] = node.data.split(":");
|
|
1235
|
-
const [name, initialValue] = attribute2.split("=");
|
|
1236
|
-
currentPart = void 0;
|
|
1237
|
-
parts2.push({ type: "attribute", path: getNodePath(node), name, initialValue });
|
|
1238
|
-
}
|
|
1239
|
-
if (/^dom-part-\d+\$/.test(node.data)) {
|
|
1240
|
-
currentPart = void 0;
|
|
1241
|
-
parts2.push({ type: "directive", path: getNodePath(node) });
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
return parts2;
|
|
1245
|
-
};
|
|
1246
|
-
const parts = getParts();
|
|
1247
|
-
if (parts.length !== this.strings.length - 1) {
|
|
1248
|
-
throw {
|
|
1249
|
-
name: "ParseTemplateError",
|
|
1250
|
-
message: "Could not parse parts from template correctly. Parts length has not the expected length. -> " + JSON.stringify({
|
|
1251
|
-
strings: this.strings,
|
|
1252
|
-
templateString: this.templateString,
|
|
1253
|
-
childNodes,
|
|
1254
|
-
template,
|
|
1255
|
-
parts
|
|
1256
|
-
})
|
|
1257
|
-
};
|
|
1258
|
-
}
|
|
1259
|
-
return parts;
|
|
1260
|
-
}
|
|
1261
|
-
get templateString() {
|
|
1262
|
-
return createTemplateString(this.strings);
|
|
1263
|
-
}
|
|
1264
|
-
toString() {
|
|
1265
|
-
let updates = parsedUpdates.get(this.strings);
|
|
1266
|
-
if (!updates) {
|
|
1267
|
-
updates = this.parse(this.strings);
|
|
1268
|
-
parsedUpdates.set(this.strings, updates);
|
|
1269
|
-
}
|
|
1270
|
-
return this.values.length ? this.values.map((value, index) => updates[index](value)).join("") : updates[0]();
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
|
|
1274
|
-
// src/dom-parts/html.js
|
|
1275
|
-
var html = function(strings, ...values) {
|
|
1276
|
-
return new TemplateResult(strings, ...values);
|
|
1277
|
-
};
|
|
1278
|
-
|
|
1279
|
-
// src/dom-parts/render.js
|
|
1280
|
-
var render = (template, domNode) => {
|
|
1281
|
-
template.renderInto(domNode);
|
|
1282
|
-
};
|
|
1283
|
-
|
|
1284
|
-
// src/TemplateElement.js
|
|
1285
|
-
var TemplateElement = class extends StyledElement {
|
|
1286
|
-
constructor(options) {
|
|
1287
|
-
super({
|
|
1288
|
-
deferUpdate: false,
|
|
1289
|
-
shadowRender: false,
|
|
1290
|
-
styles: [],
|
|
1291
|
-
adoptGlobalStyles: true,
|
|
1292
|
-
mutationObserverOptions: {
|
|
1293
|
-
childList: false
|
|
1294
|
-
},
|
|
1295
|
-
...options
|
|
1296
|
-
});
|
|
1297
|
-
this._template = this._options.template;
|
|
1298
|
-
if (this._options.shadowRender)
|
|
1299
|
-
this.attachShadow({ mode: "open" });
|
|
1300
|
-
}
|
|
1301
|
-
template() {
|
|
1302
|
-
return html``;
|
|
1303
|
-
}
|
|
1304
|
-
update(options) {
|
|
1305
|
-
this.renderTemplate();
|
|
1306
|
-
super.update(options);
|
|
1307
|
-
}
|
|
1308
|
-
renderTemplate() {
|
|
1309
|
-
const template = this._template || this.template();
|
|
1310
|
-
if (typeof template === "string") {
|
|
1311
|
-
this.getRoot().innerHTML = `${template}`;
|
|
1312
|
-
} else {
|
|
1313
|
-
render(template, this.getRoot());
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
getRoot() {
|
|
1317
|
-
return this.shadowRoot !== null ? this.shadowRoot : this;
|
|
1318
|
-
}
|
|
1319
|
-
};
|
|
1320
|
-
export {
|
|
1321
|
-
BaseElement,
|
|
1322
|
-
Store,
|
|
1323
|
-
StyledElement,
|
|
1324
|
-
TemplateElement,
|
|
1325
|
-
defineElement,
|
|
1326
|
-
html,
|
|
1327
|
-
i18n,
|
|
1328
|
-
toString
|
|
1329
|
-
};
|
|
1330
|
-
//# sourceMappingURL=index.js.map
|