@planningcenter/tapestry 0.6.0-rc.0 → 1.0.0-rc.0
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/components/page-header/index.js +5 -0
- package/dist/components/page-header/index.js.map +1 -0
- package/dist/ext/@stencil/core/internal/app-data/index.js +87 -0
- package/dist/ext/@stencil/core/internal/app-data/index.js.map +1 -0
- package/dist/ext/@stencil/core/internal/client/index.js +1724 -0
- package/dist/ext/@stencil/core/internal/client/index.js.map +1 -0
- package/dist/index.css +7 -8
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js +52 -0
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js.map +1 -0
- package/dist/unstable.css +6 -7
- package/dist/unstable.css.map +1 -1
- package/dist/webComponents.css +6 -7
- package/dist/webComponents.css.map +1 -1
- package/package.json +3 -3
- package/react-types/index.d.ts +22 -47
|
@@ -0,0 +1,1724 @@
|
|
|
1
|
+
import { BUILD, NAMESPACE } from '../app-data/index.js';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
|
|
5
|
+
*/
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/utils/constants.ts
|
|
13
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
14
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
15
|
+
|
|
16
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
17
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
20
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
21
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
22
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
23
|
+
const ogValue = instance[memberName];
|
|
24
|
+
const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
|
|
25
|
+
Object.defineProperty(instance, memberName, {
|
|
26
|
+
get() {
|
|
27
|
+
return ogDescriptor.get.call(this);
|
|
28
|
+
},
|
|
29
|
+
set(newValue) {
|
|
30
|
+
ogDescriptor.set.call(this, newValue);
|
|
31
|
+
},
|
|
32
|
+
configurable: true,
|
|
33
|
+
enumerable: true
|
|
34
|
+
});
|
|
35
|
+
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/client/client-host-ref.ts
|
|
41
|
+
var getHostRef = (ref) => {
|
|
42
|
+
if (ref.__stencil__getHostRef) {
|
|
43
|
+
return ref.__stencil__getHostRef();
|
|
44
|
+
}
|
|
45
|
+
return void 0;
|
|
46
|
+
};
|
|
47
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
48
|
+
const hostRef = {
|
|
49
|
+
$flags$: 0,
|
|
50
|
+
$hostElement$: hostElement,
|
|
51
|
+
$cmpMeta$: cmpMeta,
|
|
52
|
+
$instanceValues$: /* @__PURE__ */ new Map()
|
|
53
|
+
};
|
|
54
|
+
{
|
|
55
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
56
|
+
hostElement["s-p"] = [];
|
|
57
|
+
hostElement["s-rc"] = [];
|
|
58
|
+
}
|
|
59
|
+
const ref = hostRef;
|
|
60
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
61
|
+
if (BUILD.modernPropertyDecls && (BUILD.state)) {
|
|
62
|
+
reWireGetterSetter(hostElement, hostRef);
|
|
63
|
+
}
|
|
64
|
+
return ref;
|
|
65
|
+
};
|
|
66
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
67
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
68
|
+
|
|
69
|
+
// src/client/client-style.ts
|
|
70
|
+
var styles = /* @__PURE__ */ new Map();
|
|
71
|
+
var modeResolutionChain = [];
|
|
72
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
73
|
+
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
74
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
75
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
76
|
+
var H = win.HTMLElement || class {
|
|
77
|
+
};
|
|
78
|
+
var plt = {
|
|
79
|
+
$flags$: 0,
|
|
80
|
+
$resourcesUrl$: "",
|
|
81
|
+
jmp: (h2) => h2(),
|
|
82
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
83
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
84
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
85
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
86
|
+
};
|
|
87
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
88
|
+
var _a;
|
|
89
|
+
let supportsListenerOptions2 = false;
|
|
90
|
+
try {
|
|
91
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
92
|
+
"e",
|
|
93
|
+
null,
|
|
94
|
+
Object.defineProperty({}, "passive", {
|
|
95
|
+
get() {
|
|
96
|
+
supportsListenerOptions2 = true;
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
}
|
|
102
|
+
return supportsListenerOptions2;
|
|
103
|
+
})();
|
|
104
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
105
|
+
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
106
|
+
try {
|
|
107
|
+
new CSSStyleSheet();
|
|
108
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
109
|
+
} catch (e) {
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
})() ;
|
|
113
|
+
var queuePending = false;
|
|
114
|
+
var queueDomReads = [];
|
|
115
|
+
var queueDomWrites = [];
|
|
116
|
+
var queueTask = (queue, write) => (cb) => {
|
|
117
|
+
queue.push(cb);
|
|
118
|
+
if (!queuePending) {
|
|
119
|
+
queuePending = true;
|
|
120
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
121
|
+
nextTick(flush);
|
|
122
|
+
} else {
|
|
123
|
+
plt.raf(flush);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var consume = (queue) => {
|
|
128
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
129
|
+
try {
|
|
130
|
+
queue[i2](performance.now());
|
|
131
|
+
} catch (e) {
|
|
132
|
+
consoleError(e);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
queue.length = 0;
|
|
136
|
+
};
|
|
137
|
+
var flush = () => {
|
|
138
|
+
consume(queueDomReads);
|
|
139
|
+
{
|
|
140
|
+
consume(queueDomWrites);
|
|
141
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
142
|
+
plt.raf(flush);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
147
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
148
|
+
|
|
149
|
+
// src/utils/helpers.ts
|
|
150
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
151
|
+
var isComplexType = (o) => {
|
|
152
|
+
o = typeof o;
|
|
153
|
+
return o === "object" || o === "function";
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
157
|
+
function queryNonceMetaTagContent(doc) {
|
|
158
|
+
var _a, _b, _c;
|
|
159
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/utils/result.ts
|
|
163
|
+
var result_exports = {};
|
|
164
|
+
__export(result_exports, {
|
|
165
|
+
err: () => err,
|
|
166
|
+
map: () => map,
|
|
167
|
+
ok: () => ok,
|
|
168
|
+
unwrap: () => unwrap,
|
|
169
|
+
unwrapErr: () => unwrapErr
|
|
170
|
+
});
|
|
171
|
+
var ok = (value) => ({
|
|
172
|
+
isOk: true,
|
|
173
|
+
isErr: false,
|
|
174
|
+
value
|
|
175
|
+
});
|
|
176
|
+
var err = (value) => ({
|
|
177
|
+
isOk: false,
|
|
178
|
+
isErr: true,
|
|
179
|
+
value
|
|
180
|
+
});
|
|
181
|
+
function map(result, fn) {
|
|
182
|
+
if (result.isOk) {
|
|
183
|
+
const val = fn(result.value);
|
|
184
|
+
if (val instanceof Promise) {
|
|
185
|
+
return val.then((newVal) => ok(newVal));
|
|
186
|
+
} else {
|
|
187
|
+
return ok(val);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (result.isErr) {
|
|
191
|
+
const value = result.value;
|
|
192
|
+
return err(value);
|
|
193
|
+
}
|
|
194
|
+
throw "should never get here";
|
|
195
|
+
}
|
|
196
|
+
var unwrap = (result) => {
|
|
197
|
+
if (result.isOk) {
|
|
198
|
+
return result.value;
|
|
199
|
+
} else {
|
|
200
|
+
throw result.value;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
var unwrapErr = (result) => {
|
|
204
|
+
if (result.isErr) {
|
|
205
|
+
return result.value;
|
|
206
|
+
} else {
|
|
207
|
+
throw result.value;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
211
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
212
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
213
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
214
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
215
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
216
|
+
slotNode.hidden = true;
|
|
217
|
+
} else {
|
|
218
|
+
slotNode.hidden = false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
let i2 = 0;
|
|
224
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
225
|
+
const childNode = childNodes[i2];
|
|
226
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
227
|
+
updateFallbackSlotVisibility(childNode);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
232
|
+
const result = [];
|
|
233
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
234
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
235
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
236
|
+
result.push(slottedNode);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return result;
|
|
240
|
+
};
|
|
241
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
242
|
+
let i2 = 0;
|
|
243
|
+
let slottedNodes = [];
|
|
244
|
+
let childNode;
|
|
245
|
+
for (; i2 < childNodes.length; i2++) {
|
|
246
|
+
childNode = childNodes[i2];
|
|
247
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
248
|
+
slottedNodes.push(childNode);
|
|
249
|
+
}
|
|
250
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
251
|
+
}
|
|
252
|
+
return slottedNodes;
|
|
253
|
+
}
|
|
254
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
255
|
+
const childNodes = [];
|
|
256
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
257
|
+
let node = slot;
|
|
258
|
+
while (node = node.nextSibling) {
|
|
259
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
260
|
+
}
|
|
261
|
+
return childNodes;
|
|
262
|
+
};
|
|
263
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
264
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
265
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
return slotName === "";
|
|
277
|
+
};
|
|
278
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
279
|
+
function patchSlotNode(node) {
|
|
280
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
281
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
282
|
+
const toReturn = [];
|
|
283
|
+
const slotName = this["s-sn"];
|
|
284
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
285
|
+
console.error(`
|
|
286
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
287
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
288
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
289
|
+
`);
|
|
290
|
+
}
|
|
291
|
+
const parent = this["s-cr"].parentElement;
|
|
292
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
293
|
+
slottedNodes.forEach((n) => {
|
|
294
|
+
if (slotName === getSlotName(n)) {
|
|
295
|
+
toReturn.push(n);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
if (elementsOnly) {
|
|
299
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
300
|
+
}
|
|
301
|
+
return toReturn;
|
|
302
|
+
}).bind(node);
|
|
303
|
+
node.assignedElements = assignedFactory(true);
|
|
304
|
+
node.assignedNodes = assignedFactory(false);
|
|
305
|
+
}
|
|
306
|
+
function internalCall(node, method) {
|
|
307
|
+
if ("__" + method in node) {
|
|
308
|
+
const toReturn = node["__" + method];
|
|
309
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
310
|
+
return toReturn.bind(node);
|
|
311
|
+
} else {
|
|
312
|
+
if (typeof node[method] !== "function") return node[method];
|
|
313
|
+
return node[method].bind(node);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
var createTime = (fnName, tagName = "") => {
|
|
317
|
+
{
|
|
318
|
+
return () => {
|
|
319
|
+
return;
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
var h = (nodeName, vnodeData, ...children) => {
|
|
324
|
+
let child = null;
|
|
325
|
+
let key = null;
|
|
326
|
+
let slotName = null;
|
|
327
|
+
let simple = false;
|
|
328
|
+
let lastSimple = false;
|
|
329
|
+
const vNodeChildren = [];
|
|
330
|
+
const walk = (c) => {
|
|
331
|
+
for (let i2 = 0; i2 < c.length; i2++) {
|
|
332
|
+
child = c[i2];
|
|
333
|
+
if (Array.isArray(child)) {
|
|
334
|
+
walk(child);
|
|
335
|
+
} else if (child != null && typeof child !== "boolean") {
|
|
336
|
+
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
337
|
+
child = String(child);
|
|
338
|
+
}
|
|
339
|
+
if (simple && lastSimple) {
|
|
340
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
341
|
+
} else {
|
|
342
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
343
|
+
}
|
|
344
|
+
lastSimple = simple;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
walk(children);
|
|
349
|
+
if (vnodeData) {
|
|
350
|
+
if (vnodeData.key) {
|
|
351
|
+
key = vnodeData.key;
|
|
352
|
+
}
|
|
353
|
+
if (vnodeData.name) {
|
|
354
|
+
slotName = vnodeData.name;
|
|
355
|
+
}
|
|
356
|
+
{
|
|
357
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
358
|
+
if (classData) {
|
|
359
|
+
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (typeof nodeName === "function") {
|
|
364
|
+
return nodeName(
|
|
365
|
+
vnodeData === null ? {} : vnodeData,
|
|
366
|
+
vNodeChildren,
|
|
367
|
+
vdomFnUtils
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
const vnode = newVNode(nodeName, null);
|
|
371
|
+
vnode.$attrs$ = vnodeData;
|
|
372
|
+
if (vNodeChildren.length > 0) {
|
|
373
|
+
vnode.$children$ = vNodeChildren;
|
|
374
|
+
}
|
|
375
|
+
{
|
|
376
|
+
vnode.$key$ = key;
|
|
377
|
+
}
|
|
378
|
+
{
|
|
379
|
+
vnode.$name$ = slotName;
|
|
380
|
+
}
|
|
381
|
+
return vnode;
|
|
382
|
+
};
|
|
383
|
+
var newVNode = (tag, text) => {
|
|
384
|
+
const vnode = {
|
|
385
|
+
$flags$: 0,
|
|
386
|
+
$tag$: tag,
|
|
387
|
+
$text$: text,
|
|
388
|
+
$elm$: null,
|
|
389
|
+
$children$: null
|
|
390
|
+
};
|
|
391
|
+
{
|
|
392
|
+
vnode.$attrs$ = null;
|
|
393
|
+
}
|
|
394
|
+
{
|
|
395
|
+
vnode.$key$ = null;
|
|
396
|
+
}
|
|
397
|
+
{
|
|
398
|
+
vnode.$name$ = null;
|
|
399
|
+
}
|
|
400
|
+
return vnode;
|
|
401
|
+
};
|
|
402
|
+
var Host = {};
|
|
403
|
+
var isHost = (node) => node && node.$tag$ === Host;
|
|
404
|
+
var vdomFnUtils = {
|
|
405
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
406
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
407
|
+
};
|
|
408
|
+
var convertToPublic = (node) => ({
|
|
409
|
+
vattrs: node.$attrs$,
|
|
410
|
+
vchildren: node.$children$,
|
|
411
|
+
vkey: node.$key$,
|
|
412
|
+
vname: node.$name$,
|
|
413
|
+
vtag: node.$tag$,
|
|
414
|
+
vtext: node.$text$
|
|
415
|
+
});
|
|
416
|
+
var convertToPrivate = (node) => {
|
|
417
|
+
if (typeof node.vtag === "function") {
|
|
418
|
+
const vnodeData = { ...node.vattrs };
|
|
419
|
+
if (node.vkey) {
|
|
420
|
+
vnodeData.key = node.vkey;
|
|
421
|
+
}
|
|
422
|
+
if (node.vname) {
|
|
423
|
+
vnodeData.name = node.vname;
|
|
424
|
+
}
|
|
425
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
426
|
+
}
|
|
427
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
428
|
+
vnode.$attrs$ = node.vattrs;
|
|
429
|
+
vnode.$children$ = node.vchildren;
|
|
430
|
+
vnode.$key$ = node.vkey;
|
|
431
|
+
vnode.$name$ = node.vname;
|
|
432
|
+
return vnode;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
// src/runtime/mode.ts
|
|
436
|
+
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
437
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
438
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
439
|
+
if (propType & 4 /* Boolean */) {
|
|
440
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
441
|
+
}
|
|
442
|
+
if (propType & 2 /* Number */) {
|
|
443
|
+
return parseFloat(propValue);
|
|
444
|
+
}
|
|
445
|
+
if (propType & 1 /* String */) {
|
|
446
|
+
return String(propValue);
|
|
447
|
+
}
|
|
448
|
+
return propValue;
|
|
449
|
+
}
|
|
450
|
+
return propValue;
|
|
451
|
+
};
|
|
452
|
+
var emitEvent = (elm, name, opts) => {
|
|
453
|
+
const ev = plt.ce(name, opts);
|
|
454
|
+
elm.dispatchEvent(ev);
|
|
455
|
+
return ev;
|
|
456
|
+
};
|
|
457
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
458
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
459
|
+
let style = styles.get(scopeId2);
|
|
460
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
461
|
+
style = style || new CSSStyleSheet();
|
|
462
|
+
if (typeof style === "string") {
|
|
463
|
+
style = cssText;
|
|
464
|
+
} else {
|
|
465
|
+
style.replaceSync(cssText);
|
|
466
|
+
}
|
|
467
|
+
} else {
|
|
468
|
+
style = cssText;
|
|
469
|
+
}
|
|
470
|
+
styles.set(scopeId2, style);
|
|
471
|
+
};
|
|
472
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
473
|
+
var _a;
|
|
474
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
475
|
+
const style = styles.get(scopeId2);
|
|
476
|
+
if (!win.document) {
|
|
477
|
+
return scopeId2;
|
|
478
|
+
}
|
|
479
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
480
|
+
if (style) {
|
|
481
|
+
if (typeof style === "string") {
|
|
482
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
483
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
484
|
+
let styleElm;
|
|
485
|
+
if (!appliedStyles) {
|
|
486
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
487
|
+
}
|
|
488
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
489
|
+
{
|
|
490
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
491
|
+
styleElm.innerHTML = style;
|
|
492
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
493
|
+
if (nonce != null) {
|
|
494
|
+
styleElm.setAttribute("nonce", nonce);
|
|
495
|
+
}
|
|
496
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
497
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
498
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
499
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
500
|
+
styleContainerNode.insertBefore(
|
|
501
|
+
styleElm,
|
|
502
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
503
|
+
);
|
|
504
|
+
} else if ("host" in styleContainerNode) {
|
|
505
|
+
if (supportsConstructableStylesheets) {
|
|
506
|
+
const stylesheet = new CSSStyleSheet();
|
|
507
|
+
stylesheet.replaceSync(style);
|
|
508
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
509
|
+
} else {
|
|
510
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
511
|
+
if (existingStyleContainer) {
|
|
512
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
513
|
+
} else {
|
|
514
|
+
styleContainerNode.prepend(styleElm);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
} else {
|
|
518
|
+
styleContainerNode.append(styleElm);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
522
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
526
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
527
|
+
}
|
|
528
|
+
if (appliedStyles) {
|
|
529
|
+
appliedStyles.add(scopeId2);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
533
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return scopeId2;
|
|
537
|
+
};
|
|
538
|
+
var attachStyles = (hostRef) => {
|
|
539
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
540
|
+
const elm = hostRef.$hostElement$;
|
|
541
|
+
const flags = cmpMeta.$flags$;
|
|
542
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
543
|
+
const scopeId2 = addStyle(
|
|
544
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
545
|
+
cmpMeta,
|
|
546
|
+
hostRef.$modeName$
|
|
547
|
+
);
|
|
548
|
+
if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
|
|
549
|
+
elm["s-sc"] = scopeId2;
|
|
550
|
+
elm.classList.add(scopeId2 + "-h");
|
|
551
|
+
}
|
|
552
|
+
endAttachStyles();
|
|
553
|
+
};
|
|
554
|
+
var getScopeId = (cmp, mode) => "sc-" + (mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
555
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
556
|
+
if (oldValue === newValue) {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
560
|
+
let ln = memberName.toLowerCase();
|
|
561
|
+
if (memberName === "class") {
|
|
562
|
+
const classList = elm.classList;
|
|
563
|
+
const oldClasses = parseClassList(oldValue);
|
|
564
|
+
let newClasses = parseClassList(newValue);
|
|
565
|
+
{
|
|
566
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
567
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
568
|
+
}
|
|
569
|
+
} else if (memberName === "style") {
|
|
570
|
+
{
|
|
571
|
+
for (const prop in oldValue) {
|
|
572
|
+
if (!newValue || newValue[prop] == null) {
|
|
573
|
+
if (prop.includes("-")) {
|
|
574
|
+
elm.style.removeProperty(prop);
|
|
575
|
+
} else {
|
|
576
|
+
elm.style[prop] = "";
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
for (const prop in newValue) {
|
|
582
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
583
|
+
if (prop.includes("-")) {
|
|
584
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
585
|
+
} else {
|
|
586
|
+
elm.style[prop] = newValue[prop];
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
591
|
+
if (newValue) {
|
|
592
|
+
newValue(elm);
|
|
593
|
+
}
|
|
594
|
+
} else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
595
|
+
if (memberName[2] === "-") {
|
|
596
|
+
memberName = memberName.slice(3);
|
|
597
|
+
} else if (isMemberInElement(win, ln)) {
|
|
598
|
+
memberName = ln.slice(2);
|
|
599
|
+
} else {
|
|
600
|
+
memberName = ln[2] + memberName.slice(3);
|
|
601
|
+
}
|
|
602
|
+
if (oldValue || newValue) {
|
|
603
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
604
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
605
|
+
if (oldValue) {
|
|
606
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
607
|
+
}
|
|
608
|
+
if (newValue) {
|
|
609
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
} else {
|
|
613
|
+
const isComplex = isComplexType(newValue);
|
|
614
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
615
|
+
try {
|
|
616
|
+
if (!elm.tagName.includes("-")) {
|
|
617
|
+
const n = newValue == null ? "" : newValue;
|
|
618
|
+
if (memberName === "list") {
|
|
619
|
+
isProp = false;
|
|
620
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
621
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
622
|
+
elm[memberName] = n;
|
|
623
|
+
} else {
|
|
624
|
+
elm.setAttribute(memberName, n);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
} else if (elm[memberName] !== newValue) {
|
|
628
|
+
elm[memberName] = newValue;
|
|
629
|
+
}
|
|
630
|
+
} catch (e) {
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
let xlink = false;
|
|
634
|
+
{
|
|
635
|
+
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
636
|
+
memberName = ln;
|
|
637
|
+
xlink = true;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if (newValue == null || newValue === false) {
|
|
641
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
642
|
+
if (xlink) {
|
|
643
|
+
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
644
|
+
} else {
|
|
645
|
+
elm.removeAttribute(memberName);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
649
|
+
newValue = newValue === true ? "" : newValue;
|
|
650
|
+
if (xlink) {
|
|
651
|
+
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
652
|
+
} else {
|
|
653
|
+
elm.setAttribute(memberName, newValue);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
var parseClassListRegex = /\s/;
|
|
659
|
+
var parseClassList = (value) => {
|
|
660
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
661
|
+
value = value.baseVal;
|
|
662
|
+
}
|
|
663
|
+
if (!value || typeof value !== "string") {
|
|
664
|
+
return [];
|
|
665
|
+
}
|
|
666
|
+
return value.split(parseClassListRegex);
|
|
667
|
+
};
|
|
668
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
669
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
670
|
+
|
|
671
|
+
// src/runtime/vdom/update-element.ts
|
|
672
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
673
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
674
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
675
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
676
|
+
{
|
|
677
|
+
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
678
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
679
|
+
setAccessor(
|
|
680
|
+
elm,
|
|
681
|
+
memberName,
|
|
682
|
+
oldVnodeAttrs[memberName],
|
|
683
|
+
void 0,
|
|
684
|
+
isSvgMode2,
|
|
685
|
+
newVnode.$flags$);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
690
|
+
setAccessor(
|
|
691
|
+
elm,
|
|
692
|
+
memberName,
|
|
693
|
+
oldVnodeAttrs[memberName],
|
|
694
|
+
newVnodeAttrs[memberName],
|
|
695
|
+
isSvgMode2,
|
|
696
|
+
newVnode.$flags$);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
function sortedAttrNames(attrNames) {
|
|
700
|
+
return attrNames.includes("ref") ? (
|
|
701
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
702
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
703
|
+
) : (
|
|
704
|
+
// no need to sort, return the original array
|
|
705
|
+
attrNames
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// src/runtime/vdom/vdom-render.ts
|
|
710
|
+
var scopeId;
|
|
711
|
+
var contentRef;
|
|
712
|
+
var hostTagName;
|
|
713
|
+
var useNativeShadowDom = false;
|
|
714
|
+
var checkSlotFallbackVisibility = false;
|
|
715
|
+
var checkSlotRelocate = false;
|
|
716
|
+
var isSvgMode = false;
|
|
717
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
718
|
+
var _a;
|
|
719
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
720
|
+
let i2 = 0;
|
|
721
|
+
let elm;
|
|
722
|
+
let childNode;
|
|
723
|
+
let oldVNode;
|
|
724
|
+
if (!useNativeShadowDom) {
|
|
725
|
+
checkSlotRelocate = true;
|
|
726
|
+
if (newVNode2.$tag$ === "slot") {
|
|
727
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
728
|
+
// slot element has fallback content
|
|
729
|
+
// still create an element that "mocks" the slot element
|
|
730
|
+
2 /* isSlotFallback */
|
|
731
|
+
) : (
|
|
732
|
+
// slot element does not have fallback content
|
|
733
|
+
// create an html comment we'll use to always reference
|
|
734
|
+
// where actual slot content should sit next to
|
|
735
|
+
1 /* isSlotReference */
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (newVNode2.$text$ !== null) {
|
|
740
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
741
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
742
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
743
|
+
{
|
|
744
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
745
|
+
}
|
|
746
|
+
} else {
|
|
747
|
+
if (!isSvgMode) {
|
|
748
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
749
|
+
}
|
|
750
|
+
if (!win.document) {
|
|
751
|
+
throw new Error(
|
|
752
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
756
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
757
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
758
|
+
) ;
|
|
759
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
760
|
+
isSvgMode = false;
|
|
761
|
+
}
|
|
762
|
+
{
|
|
763
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
764
|
+
}
|
|
765
|
+
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
766
|
+
elm.classList.add(elm["s-si"] = scopeId);
|
|
767
|
+
}
|
|
768
|
+
if (newVNode2.$children$) {
|
|
769
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
770
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
771
|
+
if (childNode) {
|
|
772
|
+
elm.appendChild(childNode);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
{
|
|
777
|
+
if (newVNode2.$tag$ === "svg") {
|
|
778
|
+
isSvgMode = false;
|
|
779
|
+
} else if (elm.tagName === "foreignObject") {
|
|
780
|
+
isSvgMode = true;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
elm["s-hn"] = hostTagName;
|
|
785
|
+
{
|
|
786
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
787
|
+
elm["s-sr"] = true;
|
|
788
|
+
elm["s-cr"] = contentRef;
|
|
789
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
790
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
791
|
+
patchSlotNode(elm);
|
|
792
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
793
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
794
|
+
{
|
|
795
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
{
|
|
799
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
return elm;
|
|
804
|
+
};
|
|
805
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
806
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
807
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
808
|
+
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
809
|
+
let node = parentElm;
|
|
810
|
+
while (node = node.nextSibling) {
|
|
811
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
812
|
+
oldSlotChildNodes.push(node);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
817
|
+
const childNode = oldSlotChildNodes[i2];
|
|
818
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
819
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
820
|
+
childNode["s-ol"].remove();
|
|
821
|
+
childNode["s-ol"] = void 0;
|
|
822
|
+
childNode["s-sh"] = void 0;
|
|
823
|
+
checkSlotRelocate = true;
|
|
824
|
+
}
|
|
825
|
+
if (recursive) {
|
|
826
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
830
|
+
};
|
|
831
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
832
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
833
|
+
let childNode;
|
|
834
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
835
|
+
containerElm = containerElm.shadowRoot;
|
|
836
|
+
}
|
|
837
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
838
|
+
if (vnodes[startIdx]) {
|
|
839
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
840
|
+
if (childNode) {
|
|
841
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
842
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
848
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
849
|
+
const vnode = vnodes[index];
|
|
850
|
+
if (vnode) {
|
|
851
|
+
const elm = vnode.$elm$;
|
|
852
|
+
nullifyVNodeRefs(vnode);
|
|
853
|
+
if (elm) {
|
|
854
|
+
{
|
|
855
|
+
checkSlotFallbackVisibility = true;
|
|
856
|
+
if (elm["s-ol"]) {
|
|
857
|
+
elm["s-ol"].remove();
|
|
858
|
+
} else {
|
|
859
|
+
putBackInOriginalLocation(elm, true);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
elm.remove();
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
|
|
868
|
+
let oldStartIdx = 0;
|
|
869
|
+
let newStartIdx = 0;
|
|
870
|
+
let idxInOld = 0;
|
|
871
|
+
let i2 = 0;
|
|
872
|
+
let oldEndIdx = oldCh.length - 1;
|
|
873
|
+
let oldStartVnode = oldCh[0];
|
|
874
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
875
|
+
let newEndIdx = newCh.length - 1;
|
|
876
|
+
let newStartVnode = newCh[0];
|
|
877
|
+
let newEndVnode = newCh[newEndIdx];
|
|
878
|
+
let node;
|
|
879
|
+
let elmToMove;
|
|
880
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
881
|
+
if (oldStartVnode == null) {
|
|
882
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
883
|
+
} else if (oldEndVnode == null) {
|
|
884
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
885
|
+
} else if (newStartVnode == null) {
|
|
886
|
+
newStartVnode = newCh[++newStartIdx];
|
|
887
|
+
} else if (newEndVnode == null) {
|
|
888
|
+
newEndVnode = newCh[--newEndIdx];
|
|
889
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
890
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
891
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
892
|
+
newStartVnode = newCh[++newStartIdx];
|
|
893
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
894
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
895
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
896
|
+
newEndVnode = newCh[--newEndIdx];
|
|
897
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
898
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
899
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
900
|
+
}
|
|
901
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
902
|
+
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
903
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
904
|
+
newEndVnode = newCh[--newEndIdx];
|
|
905
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
906
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
907
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
908
|
+
}
|
|
909
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
910
|
+
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
911
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
912
|
+
newStartVnode = newCh[++newStartIdx];
|
|
913
|
+
} else {
|
|
914
|
+
idxInOld = -1;
|
|
915
|
+
{
|
|
916
|
+
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
917
|
+
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
918
|
+
idxInOld = i2;
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
if (idxInOld >= 0) {
|
|
924
|
+
elmToMove = oldCh[idxInOld];
|
|
925
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
926
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
927
|
+
} else {
|
|
928
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
929
|
+
oldCh[idxInOld] = void 0;
|
|
930
|
+
node = elmToMove.$elm$;
|
|
931
|
+
}
|
|
932
|
+
newStartVnode = newCh[++newStartIdx];
|
|
933
|
+
} else {
|
|
934
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
935
|
+
newStartVnode = newCh[++newStartIdx];
|
|
936
|
+
}
|
|
937
|
+
if (node) {
|
|
938
|
+
{
|
|
939
|
+
insertBefore(
|
|
940
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
941
|
+
node,
|
|
942
|
+
referenceNode(oldStartVnode.$elm$)
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
if (oldStartIdx > oldEndIdx) {
|
|
949
|
+
addVnodes(
|
|
950
|
+
parentElm,
|
|
951
|
+
newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
|
|
952
|
+
newVNode2,
|
|
953
|
+
newCh,
|
|
954
|
+
newStartIdx,
|
|
955
|
+
newEndIdx
|
|
956
|
+
);
|
|
957
|
+
} else if (newStartIdx > newEndIdx) {
|
|
958
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
962
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
963
|
+
if (leftVNode.$tag$ === "slot") {
|
|
964
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
965
|
+
}
|
|
966
|
+
if (!isInitialRender) {
|
|
967
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
968
|
+
}
|
|
969
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
970
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
971
|
+
}
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
return false;
|
|
975
|
+
};
|
|
976
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
977
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
978
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
979
|
+
const oldChildren = oldVNode.$children$;
|
|
980
|
+
const newChildren = newVNode2.$children$;
|
|
981
|
+
const tag = newVNode2.$tag$;
|
|
982
|
+
const text = newVNode2.$text$;
|
|
983
|
+
let defaultHolder;
|
|
984
|
+
if (text === null) {
|
|
985
|
+
{
|
|
986
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
987
|
+
}
|
|
988
|
+
{
|
|
989
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
990
|
+
}
|
|
991
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
992
|
+
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
993
|
+
} else if (newChildren !== null) {
|
|
994
|
+
if (oldVNode.$text$ !== null) {
|
|
995
|
+
elm.textContent = "";
|
|
996
|
+
}
|
|
997
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
998
|
+
} else if (
|
|
999
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1000
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1001
|
+
) {
|
|
1002
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1003
|
+
}
|
|
1004
|
+
if (isSvgMode && tag === "svg") {
|
|
1005
|
+
isSvgMode = false;
|
|
1006
|
+
}
|
|
1007
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1008
|
+
defaultHolder.parentNode.textContent = text;
|
|
1009
|
+
} else if (oldVNode.$text$ !== text) {
|
|
1010
|
+
elm.data = text;
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
var relocateNodes = [];
|
|
1014
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1015
|
+
let node;
|
|
1016
|
+
let hostContentNodes;
|
|
1017
|
+
let j;
|
|
1018
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1019
|
+
for (const childNode of children) {
|
|
1020
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1021
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1022
|
+
const slotName = childNode["s-sn"];
|
|
1023
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1024
|
+
node = hostContentNodes[j];
|
|
1025
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes)) {
|
|
1026
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1027
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1028
|
+
checkSlotFallbackVisibility = true;
|
|
1029
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1030
|
+
if (relocateNodeData) {
|
|
1031
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1032
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1033
|
+
} else {
|
|
1034
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1035
|
+
relocateNodes.push({
|
|
1036
|
+
$slotRefNode$: childNode,
|
|
1037
|
+
$nodeToRelocate$: node
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
if (node["s-sr"]) {
|
|
1041
|
+
relocateNodes.map((relocateNode) => {
|
|
1042
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1043
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1044
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1045
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1051
|
+
relocateNodes.push({
|
|
1052
|
+
$nodeToRelocate$: node
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1059
|
+
markSlotContentForRelocation(childNode);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
1064
|
+
{
|
|
1065
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1066
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
1070
|
+
if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1071
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1072
|
+
}
|
|
1073
|
+
{
|
|
1074
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1078
|
+
var _a, _b;
|
|
1079
|
+
let scopeId2;
|
|
1080
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1081
|
+
const scopeName = slotNode["s-sn"];
|
|
1082
|
+
const hostName = slotNode["s-hn"];
|
|
1083
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1084
|
+
if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + "-s"))) {
|
|
1085
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1086
|
+
let found = false;
|
|
1087
|
+
while (child) {
|
|
1088
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1089
|
+
found = true;
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1092
|
+
child = child.nextSibling;
|
|
1093
|
+
}
|
|
1094
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1099
|
+
var _a, _b, _c, _d, _e;
|
|
1100
|
+
const hostElm = hostRef.$hostElement$;
|
|
1101
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1102
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1103
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1104
|
+
hostTagName = hostElm.tagName;
|
|
1105
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1106
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1107
|
+
cmpMeta.$attrsToReflect$.map(
|
|
1108
|
+
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1112
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1113
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
1114
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
rootVnode.$tag$ = null;
|
|
1119
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1120
|
+
hostRef.$vnode$ = rootVnode;
|
|
1121
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1122
|
+
{
|
|
1123
|
+
scopeId = hostElm["s-sc"];
|
|
1124
|
+
}
|
|
1125
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
1126
|
+
{
|
|
1127
|
+
contentRef = hostElm["s-cr"];
|
|
1128
|
+
checkSlotFallbackVisibility = false;
|
|
1129
|
+
}
|
|
1130
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1131
|
+
{
|
|
1132
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1133
|
+
if (checkSlotRelocate) {
|
|
1134
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1135
|
+
for (const relocateData of relocateNodes) {
|
|
1136
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1137
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1138
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1139
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1140
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
for (const relocateData of relocateNodes) {
|
|
1144
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1145
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1146
|
+
if (slotRefNode) {
|
|
1147
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1148
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1149
|
+
{
|
|
1150
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1151
|
+
while (orgLocationNode) {
|
|
1152
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1153
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1154
|
+
refNode = refNode.nextSibling;
|
|
1155
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1156
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1157
|
+
}
|
|
1158
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1159
|
+
insertBeforeNode = refNode;
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1167
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1168
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1169
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1170
|
+
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1171
|
+
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1172
|
+
}
|
|
1173
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1174
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1175
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1180
|
+
} else {
|
|
1181
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1182
|
+
if (isInitialLoad) {
|
|
1183
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1184
|
+
}
|
|
1185
|
+
nodeToRelocate.hidden = true;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
if (checkSlotFallbackVisibility) {
|
|
1191
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1192
|
+
}
|
|
1193
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1194
|
+
relocateNodes.length = 0;
|
|
1195
|
+
}
|
|
1196
|
+
if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1197
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1198
|
+
for (const childNode of children) {
|
|
1199
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1200
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1201
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1202
|
+
}
|
|
1203
|
+
childNode.hidden = true;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
contentRef = void 0;
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
// src/runtime/update-component.ts
|
|
1211
|
+
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1212
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1213
|
+
const index = ancestorComponent["s-p"].push(
|
|
1214
|
+
new Promise(
|
|
1215
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1216
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1217
|
+
r();
|
|
1218
|
+
}
|
|
1219
|
+
)
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1224
|
+
{
|
|
1225
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1226
|
+
}
|
|
1227
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1228
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1232
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1233
|
+
return writeTask(dispatch) ;
|
|
1234
|
+
};
|
|
1235
|
+
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1236
|
+
const elm = hostRef.$hostElement$;
|
|
1237
|
+
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1238
|
+
const instance = elm;
|
|
1239
|
+
if (!instance) {
|
|
1240
|
+
throw new Error(
|
|
1241
|
+
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1244
|
+
let maybePromise;
|
|
1245
|
+
if (isInitialLoad) {
|
|
1246
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1247
|
+
} else {
|
|
1248
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1249
|
+
}
|
|
1250
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1251
|
+
endSchedule();
|
|
1252
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1253
|
+
};
|
|
1254
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
|
|
1255
|
+
console.error(err2);
|
|
1256
|
+
fn();
|
|
1257
|
+
}) : fn();
|
|
1258
|
+
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
1259
|
+
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1260
|
+
var _a;
|
|
1261
|
+
const elm = hostRef.$hostElement$;
|
|
1262
|
+
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1263
|
+
const rc = elm["s-rc"];
|
|
1264
|
+
if (isInitialLoad) {
|
|
1265
|
+
attachStyles(hostRef);
|
|
1266
|
+
}
|
|
1267
|
+
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1268
|
+
{
|
|
1269
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1270
|
+
}
|
|
1271
|
+
if (rc) {
|
|
1272
|
+
rc.map((cb) => cb());
|
|
1273
|
+
elm["s-rc"] = void 0;
|
|
1274
|
+
}
|
|
1275
|
+
endRender();
|
|
1276
|
+
endUpdate();
|
|
1277
|
+
{
|
|
1278
|
+
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1279
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1280
|
+
if (childrenPromises.length === 0) {
|
|
1281
|
+
postUpdate();
|
|
1282
|
+
} else {
|
|
1283
|
+
Promise.all(childrenPromises).then(postUpdate);
|
|
1284
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1285
|
+
childrenPromises.length = 0;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
var renderingRef = null;
|
|
1290
|
+
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1291
|
+
const allRenderFn = false;
|
|
1292
|
+
const lazyLoad = false;
|
|
1293
|
+
const taskQueue = true ;
|
|
1294
|
+
const updatable = true ;
|
|
1295
|
+
try {
|
|
1296
|
+
renderingRef = instance;
|
|
1297
|
+
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
1298
|
+
if (updatable && taskQueue) {
|
|
1299
|
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1300
|
+
}
|
|
1301
|
+
if (updatable || lazyLoad) {
|
|
1302
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1303
|
+
}
|
|
1304
|
+
if (BUILD.hasRenderFn || BUILD.reflect) {
|
|
1305
|
+
if (BUILD.vdomRender || BUILD.reflect) {
|
|
1306
|
+
if (BUILD.hydrateServerSide) ; else {
|
|
1307
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
} catch (e) {
|
|
1312
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1313
|
+
}
|
|
1314
|
+
renderingRef = null;
|
|
1315
|
+
return null;
|
|
1316
|
+
};
|
|
1317
|
+
var postUpdateComponent = (hostRef) => {
|
|
1318
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1319
|
+
const elm = hostRef.$hostElement$;
|
|
1320
|
+
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1321
|
+
const instance = elm;
|
|
1322
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1323
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1324
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1325
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1326
|
+
{
|
|
1327
|
+
addHydratedFlag(elm);
|
|
1328
|
+
}
|
|
1329
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1330
|
+
endPostUpdate();
|
|
1331
|
+
{
|
|
1332
|
+
hostRef.$onReadyResolve$(elm);
|
|
1333
|
+
if (!ancestorComponent) {
|
|
1334
|
+
appDidLoad();
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
} else {
|
|
1338
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1339
|
+
endPostUpdate();
|
|
1340
|
+
}
|
|
1341
|
+
{
|
|
1342
|
+
if (hostRef.$onRenderResolve$) {
|
|
1343
|
+
hostRef.$onRenderResolve$();
|
|
1344
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1345
|
+
}
|
|
1346
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1347
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1348
|
+
}
|
|
1349
|
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
var appDidLoad = (who) => {
|
|
1353
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1354
|
+
};
|
|
1355
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1356
|
+
if (instance && instance[method]) {
|
|
1357
|
+
try {
|
|
1358
|
+
return instance[method](arg);
|
|
1359
|
+
} catch (e) {
|
|
1360
|
+
consoleError(e, elm);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
return void 0;
|
|
1364
|
+
};
|
|
1365
|
+
var addHydratedFlag = (elm) => {
|
|
1366
|
+
var _a;
|
|
1367
|
+
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
1368
|
+
};
|
|
1369
|
+
|
|
1370
|
+
// src/runtime/set-value.ts
|
|
1371
|
+
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1372
|
+
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1373
|
+
const hostRef = getHostRef(ref);
|
|
1374
|
+
const elm = ref;
|
|
1375
|
+
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1376
|
+
const flags = hostRef.$flags$;
|
|
1377
|
+
const instance = elm;
|
|
1378
|
+
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1379
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1380
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1381
|
+
if (didValueChange) {
|
|
1382
|
+
hostRef.$instanceValues$.set(propName, newVal);
|
|
1383
|
+
{
|
|
1384
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1385
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1386
|
+
if (watchMethods) {
|
|
1387
|
+
watchMethods.map((watchMethodName) => {
|
|
1388
|
+
try {
|
|
1389
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1390
|
+
} catch (e) {
|
|
1391
|
+
consoleError(e, elm);
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1397
|
+
if (instance.componentShouldUpdate) {
|
|
1398
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
scheduleUpdate(hostRef, false);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
// src/runtime/proxy-component.ts
|
|
1409
|
+
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1410
|
+
var _a, _b;
|
|
1411
|
+
const prototype = Cstr.prototype;
|
|
1412
|
+
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
1413
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1414
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1415
|
+
}
|
|
1416
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1417
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
1418
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
1419
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1420
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1421
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1422
|
+
{
|
|
1423
|
+
Object.defineProperty(prototype, memberName, {
|
|
1424
|
+
get() {
|
|
1425
|
+
{
|
|
1426
|
+
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
configurable: true,
|
|
1430
|
+
enumerable: true
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
Object.defineProperty(prototype, memberName, {
|
|
1434
|
+
set(newValue) {
|
|
1435
|
+
const ref = getHostRef(this);
|
|
1436
|
+
if (origSetter) {
|
|
1437
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1438
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1439
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1440
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1441
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1442
|
+
}
|
|
1443
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1444
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1445
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1446
|
+
return;
|
|
1447
|
+
}
|
|
1448
|
+
{
|
|
1449
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
});
|
|
1456
|
+
{
|
|
1457
|
+
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
1458
|
+
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
1459
|
+
plt.jmp(() => {
|
|
1460
|
+
var _a2;
|
|
1461
|
+
const propName = attrNameToPropName.get(attrName);
|
|
1462
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1463
|
+
newValue = this[propName];
|
|
1464
|
+
delete this[propName];
|
|
1465
|
+
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1466
|
+
this[propName] == newValue) {
|
|
1467
|
+
return;
|
|
1468
|
+
} else if (propName == null) {
|
|
1469
|
+
const hostRef = getHostRef(this);
|
|
1470
|
+
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1471
|
+
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1472
|
+
const elm = this;
|
|
1473
|
+
const instance = elm;
|
|
1474
|
+
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1475
|
+
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
1476
|
+
if (instance[callbackName] != null) {
|
|
1477
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1484
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1485
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1486
|
+
this[propName] = newValue;
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
};
|
|
1490
|
+
Cstr.observedAttributes = Array.from(
|
|
1491
|
+
/* @__PURE__ */ new Set([
|
|
1492
|
+
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1493
|
+
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
|
|
1494
|
+
var _a2;
|
|
1495
|
+
const attrName = m[1] || propName;
|
|
1496
|
+
attrNameToPropName.set(attrName, propName);
|
|
1497
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1498
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1499
|
+
}
|
|
1500
|
+
return attrName;
|
|
1501
|
+
})
|
|
1502
|
+
])
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
return Cstr;
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
// src/runtime/initialize-component.ts
|
|
1510
|
+
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1511
|
+
let Cstr;
|
|
1512
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1513
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1514
|
+
cmpMeta.$lazyBundleId$;
|
|
1515
|
+
{
|
|
1516
|
+
Cstr = elm.constructor;
|
|
1517
|
+
const cmpTag = elm.localName;
|
|
1518
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1519
|
+
}
|
|
1520
|
+
if (Cstr && Cstr.style) {
|
|
1521
|
+
let style;
|
|
1522
|
+
if (typeof Cstr.style === "string") {
|
|
1523
|
+
style = Cstr.style;
|
|
1524
|
+
} else if (typeof Cstr.style !== "string") {
|
|
1525
|
+
hostRef.$modeName$ = computeMode(elm);
|
|
1526
|
+
if (hostRef.$modeName$) {
|
|
1527
|
+
style = Cstr.style[hostRef.$modeName$];
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
1531
|
+
if (!styles.has(scopeId2)) {
|
|
1532
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
1533
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1534
|
+
endRegisterStyles();
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1539
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1540
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1541
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
1542
|
+
} else {
|
|
1543
|
+
schedule();
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
// src/runtime/connected-callback.ts
|
|
1550
|
+
var connectedCallback = (elm) => {
|
|
1551
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1552
|
+
const hostRef = getHostRef(elm);
|
|
1553
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1554
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1555
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1556
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1557
|
+
{
|
|
1558
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1559
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1560
|
+
setContentReference(elm);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
{
|
|
1564
|
+
let ancestorComponent = elm;
|
|
1565
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1566
|
+
if (ancestorComponent["s-p"]) {
|
|
1567
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1568
|
+
break;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if (cmpMeta.$members$) {
|
|
1573
|
+
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1574
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1575
|
+
const value = elm[memberName];
|
|
1576
|
+
delete elm[memberName];
|
|
1577
|
+
elm[memberName] = value;
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
{
|
|
1582
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
1583
|
+
}
|
|
1584
|
+
} else {
|
|
1585
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1586
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1587
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1588
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1589
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
endConnected();
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
var setContentReference = (elm) => {
|
|
1596
|
+
if (!win.document) {
|
|
1597
|
+
return;
|
|
1598
|
+
}
|
|
1599
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1600
|
+
""
|
|
1601
|
+
);
|
|
1602
|
+
contentRefElm["s-cn"] = true;
|
|
1603
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1604
|
+
};
|
|
1605
|
+
var disconnectedCallback = async (elm) => {
|
|
1606
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1607
|
+
const hostRef = getHostRef(elm);
|
|
1608
|
+
{
|
|
1609
|
+
if (hostRef.$rmListeners$) {
|
|
1610
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1611
|
+
hostRef.$rmListeners$ = void 0;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1616
|
+
rootAppliedStyles.delete(elm);
|
|
1617
|
+
}
|
|
1618
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1619
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
1623
|
+
const cmpMeta = {
|
|
1624
|
+
$flags$: compactMeta[0],
|
|
1625
|
+
$tagName$: compactMeta[1]
|
|
1626
|
+
};
|
|
1627
|
+
{
|
|
1628
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1629
|
+
}
|
|
1630
|
+
{
|
|
1631
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1632
|
+
}
|
|
1633
|
+
{
|
|
1634
|
+
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
1635
|
+
}
|
|
1636
|
+
{
|
|
1637
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1638
|
+
}
|
|
1639
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1640
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1641
|
+
Object.assign(Cstr.prototype, {
|
|
1642
|
+
__hasHostListenerAttached: false,
|
|
1643
|
+
__registerHost() {
|
|
1644
|
+
registerHost(this, cmpMeta);
|
|
1645
|
+
},
|
|
1646
|
+
connectedCallback() {
|
|
1647
|
+
if (!this.__hasHostListenerAttached) {
|
|
1648
|
+
const hostRef = getHostRef(this);
|
|
1649
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1650
|
+
this.__hasHostListenerAttached = true;
|
|
1651
|
+
}
|
|
1652
|
+
connectedCallback(this);
|
|
1653
|
+
if (originalConnectedCallback) {
|
|
1654
|
+
originalConnectedCallback.call(this);
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
disconnectedCallback() {
|
|
1658
|
+
disconnectedCallback(this);
|
|
1659
|
+
if (originalDisconnectedCallback) {
|
|
1660
|
+
originalDisconnectedCallback.call(this);
|
|
1661
|
+
}
|
|
1662
|
+
},
|
|
1663
|
+
__attachShadow() {
|
|
1664
|
+
{
|
|
1665
|
+
if (!this.shadowRoot) {
|
|
1666
|
+
{
|
|
1667
|
+
this.attachShadow({
|
|
1668
|
+
mode: "open",
|
|
1669
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
} else {
|
|
1673
|
+
if (this.shadowRoot.mode !== "open") {
|
|
1674
|
+
throw new Error(
|
|
1675
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
1676
|
+
);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
});
|
|
1682
|
+
Cstr.is = cmpMeta.$tagName$;
|
|
1683
|
+
return proxyComponent(Cstr, cmpMeta);
|
|
1684
|
+
};
|
|
1685
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1686
|
+
if (listeners && win.document) {
|
|
1687
|
+
listeners.map(([flags, name, method]) => {
|
|
1688
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1689
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1690
|
+
const opts = hostListenerOpts(flags);
|
|
1691
|
+
plt.ael(target, name, handler, opts);
|
|
1692
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1697
|
+
var _a;
|
|
1698
|
+
try {
|
|
1699
|
+
if (BUILD.lazyLoad) ; else {
|
|
1700
|
+
hostRef.$hostElement$[methodName](ev);
|
|
1701
|
+
}
|
|
1702
|
+
} catch (e) {
|
|
1703
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1704
|
+
}
|
|
1705
|
+
};
|
|
1706
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1707
|
+
if (flags & 4 /* TargetDocument */) {
|
|
1708
|
+
return doc;
|
|
1709
|
+
}
|
|
1710
|
+
if (flags & 8 /* TargetWindow */) {
|
|
1711
|
+
return win;
|
|
1712
|
+
}
|
|
1713
|
+
if (flags & 16 /* TargetBody */) {
|
|
1714
|
+
return doc.body;
|
|
1715
|
+
}
|
|
1716
|
+
return elm;
|
|
1717
|
+
};
|
|
1718
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1719
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1720
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1721
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1722
|
+
|
|
1723
|
+
export { BUILD, H, H as HTMLElement, Host, NAMESPACE, addHostEventListeners, connectedCallback, consoleError, disconnectedCallback, getHostRef, getValue, h, isMemberInElement, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, registerHost, renderVdom, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, win, writeTask };
|
|
1724
|
+
//# sourceMappingURL=index.js.map
|