@stencil/core 4.22.3 → 4.23.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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +1610 -30
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +1213 -1019
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +1213 -1019
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +41 -35
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +13 -0
- package/internal/stencil-public-docs.d.ts +8 -0
- package/internal/testing/index.js +1215 -1021
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +15 -9
- package/mock-doc/index.js +15 -9
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +13 -13
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +11 -3
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.
|
|
2
|
+
Stencil Client Platform v4.23.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -104,6 +104,7 @@ var CONTENT_REF_ID = "r";
|
|
|
104
104
|
var ORG_LOCATION_ID = "o";
|
|
105
105
|
var SLOT_NODE_ID = "s";
|
|
106
106
|
var TEXT_NODE_ID = "t";
|
|
107
|
+
var COMMENT_NODE_ID = "c";
|
|
107
108
|
var HYDRATE_ID = "s-id";
|
|
108
109
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
109
110
|
var HYDRATE_CHILD_ID = "c-id";
|
|
@@ -321,99 +322,19 @@ var unwrapErr = (result) => {
|
|
|
321
322
|
};
|
|
322
323
|
|
|
323
324
|
// src/runtime/connected-callback.ts
|
|
324
|
-
import { BUILD as
|
|
325
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
325
326
|
|
|
326
327
|
// src/runtime/client-hydrate.ts
|
|
327
|
-
import { BUILD as
|
|
328
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
328
329
|
|
|
329
|
-
// src/runtime/
|
|
330
|
-
import { BUILD as
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
335
|
-
performance.mark(key);
|
|
336
|
-
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
337
|
-
} else {
|
|
338
|
-
return () => {
|
|
339
|
-
return;
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
var uniqueTime = (key, measureText) => {
|
|
344
|
-
if (BUILD7.profile && performance.mark) {
|
|
345
|
-
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
346
|
-
performance.mark(key);
|
|
347
|
-
}
|
|
348
|
-
return () => {
|
|
349
|
-
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
350
|
-
performance.measure(measureText, key);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
} else {
|
|
354
|
-
return () => {
|
|
355
|
-
return;
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
var inspect = (ref) => {
|
|
360
|
-
const hostRef = getHostRef(ref);
|
|
361
|
-
if (!hostRef) {
|
|
362
|
-
return void 0;
|
|
363
|
-
}
|
|
364
|
-
const flags = hostRef.$flags$;
|
|
365
|
-
const hostElement = hostRef.$hostElement$;
|
|
366
|
-
return {
|
|
367
|
-
renderCount: hostRef.$renderCount$,
|
|
368
|
-
flags: {
|
|
369
|
-
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
370
|
-
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
371
|
-
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
372
|
-
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
373
|
-
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
374
|
-
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
375
|
-
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
376
|
-
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
377
|
-
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
378
|
-
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
379
|
-
},
|
|
380
|
-
instanceValues: hostRef.$instanceValues$,
|
|
381
|
-
ancestorComponent: hostRef.$ancestorComponent$,
|
|
382
|
-
hostElement,
|
|
383
|
-
lazyInstance: hostRef.$lazyInstance$,
|
|
384
|
-
vnode: hostRef.$vnode$,
|
|
385
|
-
modeName: hostRef.$modeName$,
|
|
386
|
-
onReadyPromise: hostRef.$onReadyPromise$,
|
|
387
|
-
onReadyResolve: hostRef.$onReadyResolve$,
|
|
388
|
-
onInstancePromise: hostRef.$onInstancePromise$,
|
|
389
|
-
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
390
|
-
onRenderResolve: hostRef.$onRenderResolve$,
|
|
391
|
-
queuedListeners: hostRef.$queuedListeners$,
|
|
392
|
-
rmListeners: hostRef.$rmListeners$,
|
|
393
|
-
["s-id"]: hostElement["s-id"],
|
|
394
|
-
["s-cr"]: hostElement["s-cr"],
|
|
395
|
-
["s-lr"]: hostElement["s-lr"],
|
|
396
|
-
["s-p"]: hostElement["s-p"],
|
|
397
|
-
["s-rc"]: hostElement["s-rc"],
|
|
398
|
-
["s-sc"]: hostElement["s-sc"]
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
var installDevTools = () => {
|
|
402
|
-
if (BUILD7.devTools) {
|
|
403
|
-
const stencil = win.stencil = win.stencil || {};
|
|
404
|
-
const originalInspect = stencil.inspect;
|
|
405
|
-
stencil.inspect = (ref) => {
|
|
406
|
-
let result = inspect(ref);
|
|
407
|
-
if (!result && typeof originalInspect === "function") {
|
|
408
|
-
result = originalInspect(ref);
|
|
409
|
-
}
|
|
410
|
-
return result;
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
};
|
|
330
|
+
// src/runtime/dom-extras.ts
|
|
331
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
332
|
+
|
|
333
|
+
// src/runtime/vdom/vdom-render.ts
|
|
334
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
414
335
|
|
|
415
336
|
// src/runtime/vdom/h.ts
|
|
416
|
-
import { BUILD as
|
|
337
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
417
338
|
var h = (nodeName, vnodeData, ...children) => {
|
|
418
339
|
let child = null;
|
|
419
340
|
let key = null;
|
|
@@ -429,7 +350,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
429
350
|
} else if (child != null && typeof child !== "boolean") {
|
|
430
351
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
431
352
|
child = String(child);
|
|
432
|
-
} else if (
|
|
353
|
+
} else if (BUILD7.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
433
354
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
434
355
|
Make sure it's using the correct h() function.
|
|
435
356
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -445,28 +366,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
445
366
|
};
|
|
446
367
|
walk(children);
|
|
447
368
|
if (vnodeData) {
|
|
448
|
-
if (
|
|
369
|
+
if (BUILD7.isDev && nodeName === "input") {
|
|
449
370
|
validateInputProperties(vnodeData);
|
|
450
371
|
}
|
|
451
|
-
if (
|
|
372
|
+
if (BUILD7.vdomKey && vnodeData.key) {
|
|
452
373
|
key = vnodeData.key;
|
|
453
374
|
}
|
|
454
|
-
if (
|
|
375
|
+
if (BUILD7.slotRelocation && vnodeData.name) {
|
|
455
376
|
slotName = vnodeData.name;
|
|
456
377
|
}
|
|
457
|
-
if (
|
|
378
|
+
if (BUILD7.vdomClass) {
|
|
458
379
|
const classData = vnodeData.className || vnodeData.class;
|
|
459
380
|
if (classData) {
|
|
460
381
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
461
382
|
}
|
|
462
383
|
}
|
|
463
384
|
}
|
|
464
|
-
if (
|
|
385
|
+
if (BUILD7.isDev && vNodeChildren.some(isHost)) {
|
|
465
386
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
466
387
|
- You are NOT using hostData() and <Host> in the same component.
|
|
467
388
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
468
389
|
}
|
|
469
|
-
if (
|
|
390
|
+
if (BUILD7.vdomFunctional && typeof nodeName === "function") {
|
|
470
391
|
return nodeName(
|
|
471
392
|
vnodeData === null ? {} : vnodeData,
|
|
472
393
|
vNodeChildren,
|
|
@@ -478,10 +399,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
478
399
|
if (vNodeChildren.length > 0) {
|
|
479
400
|
vnode.$children$ = vNodeChildren;
|
|
480
401
|
}
|
|
481
|
-
if (
|
|
402
|
+
if (BUILD7.vdomKey) {
|
|
482
403
|
vnode.$key$ = key;
|
|
483
404
|
}
|
|
484
|
-
if (
|
|
405
|
+
if (BUILD7.slotRelocation) {
|
|
485
406
|
vnode.$name$ = slotName;
|
|
486
407
|
}
|
|
487
408
|
return vnode;
|
|
@@ -494,13 +415,13 @@ var newVNode = (tag, text) => {
|
|
|
494
415
|
$elm$: null,
|
|
495
416
|
$children$: null
|
|
496
417
|
};
|
|
497
|
-
if (
|
|
418
|
+
if (BUILD7.vdomAttribute) {
|
|
498
419
|
vnode.$attrs$ = null;
|
|
499
420
|
}
|
|
500
|
-
if (
|
|
421
|
+
if (BUILD7.vdomKey) {
|
|
501
422
|
vnode.$key$ = null;
|
|
502
423
|
}
|
|
503
|
-
if (
|
|
424
|
+
if (BUILD7.slotRelocation) {
|
|
504
425
|
vnode.$name$ = null;
|
|
505
426
|
}
|
|
506
427
|
return vnode;
|
|
@@ -552,416 +473,51 @@ var validateInputProperties = (inputElm) => {
|
|
|
552
473
|
}
|
|
553
474
|
};
|
|
554
475
|
|
|
555
|
-
// src/runtime/
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const orgLocationId = c.$hostId$ + "." + c.$nodeId$;
|
|
571
|
-
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
572
|
-
const node = c.$elm$;
|
|
573
|
-
if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") {
|
|
574
|
-
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
575
|
-
}
|
|
576
|
-
if (!shadowRoot) {
|
|
577
|
-
node["s-hn"] = tagName;
|
|
578
|
-
if (orgLocationNode) {
|
|
579
|
-
node["s-ol"] = orgLocationNode;
|
|
580
|
-
node["s-ol"]["s-nr"] = node;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
584
|
-
});
|
|
585
|
-
if (BUILD9.shadowDom && shadowRoot) {
|
|
586
|
-
shadowRootNodes.map((shadowRootNode) => {
|
|
587
|
-
if (shadowRootNode) {
|
|
588
|
-
shadowRoot.appendChild(shadowRootNode);
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
endHydrate();
|
|
593
|
-
};
|
|
594
|
-
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
|
|
595
|
-
let childNodeType;
|
|
596
|
-
let childIdSplt;
|
|
597
|
-
let childVNode;
|
|
598
|
-
let i2;
|
|
599
|
-
if (node.nodeType === 1 /* ElementNode */) {
|
|
600
|
-
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
601
|
-
if (childNodeType) {
|
|
602
|
-
childIdSplt = childNodeType.split(".");
|
|
603
|
-
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
604
|
-
childVNode = {
|
|
605
|
-
$flags$: 0,
|
|
606
|
-
$hostId$: childIdSplt[0],
|
|
607
|
-
$nodeId$: childIdSplt[1],
|
|
608
|
-
$depth$: childIdSplt[2],
|
|
609
|
-
$index$: childIdSplt[3],
|
|
610
|
-
$tag$: node.tagName.toLowerCase(),
|
|
611
|
-
$elm$: node,
|
|
612
|
-
$attrs$: null,
|
|
613
|
-
$children$: null,
|
|
614
|
-
$key$: null,
|
|
615
|
-
$name$: null,
|
|
616
|
-
$text$: null
|
|
617
|
-
};
|
|
618
|
-
childRenderNodes.push(childVNode);
|
|
619
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
620
|
-
if (!parentVNode.$children$) {
|
|
621
|
-
parentVNode.$children$ = [];
|
|
622
|
-
}
|
|
623
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
624
|
-
parentVNode = childVNode;
|
|
625
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
626
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
if (node.shadowRoot) {
|
|
631
|
-
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
632
|
-
clientHydrate(
|
|
633
|
-
parentVNode,
|
|
634
|
-
childRenderNodes,
|
|
635
|
-
slotNodes,
|
|
636
|
-
shadowRootNodes,
|
|
637
|
-
hostElm,
|
|
638
|
-
node.shadowRoot.childNodes[i2],
|
|
639
|
-
hostId
|
|
640
|
-
);
|
|
476
|
+
// src/runtime/vdom/update-element.ts
|
|
477
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
478
|
+
|
|
479
|
+
// src/runtime/vdom/set-accessor.ts
|
|
480
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
481
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
482
|
+
if (oldValue !== newValue) {
|
|
483
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
484
|
+
let ln = memberName.toLowerCase();
|
|
485
|
+
if (BUILD8.vdomClass && memberName === "class") {
|
|
486
|
+
const classList = elm.classList;
|
|
487
|
+
const oldClasses = parseClassList(oldValue);
|
|
488
|
+
const newClasses = parseClassList(newValue);
|
|
489
|
+
if (elm["s-si"] && newClasses.indexOf(elm["s-si"]) < 0) {
|
|
490
|
+
newClasses.push(elm["s-si"]);
|
|
641
491
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
655
|
-
childIdSplt = node.nodeValue.split(".");
|
|
656
|
-
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
657
|
-
childNodeType = childIdSplt[0];
|
|
658
|
-
childVNode = {
|
|
659
|
-
$flags$: 0,
|
|
660
|
-
$hostId$: childIdSplt[1],
|
|
661
|
-
$nodeId$: childIdSplt[2],
|
|
662
|
-
$depth$: childIdSplt[3],
|
|
663
|
-
$index$: childIdSplt[4],
|
|
664
|
-
$elm$: node,
|
|
665
|
-
$attrs$: null,
|
|
666
|
-
$children$: null,
|
|
667
|
-
$key$: null,
|
|
668
|
-
$name$: null,
|
|
669
|
-
$tag$: null,
|
|
670
|
-
$text$: null
|
|
671
|
-
};
|
|
672
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
673
|
-
childVNode.$elm$ = node.nextSibling;
|
|
674
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
675
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
676
|
-
childRenderNodes.push(childVNode);
|
|
677
|
-
node.remove();
|
|
678
|
-
if (!parentVNode.$children$) {
|
|
679
|
-
parentVNode.$children$ = [];
|
|
680
|
-
}
|
|
681
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
682
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
683
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
492
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
493
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
494
|
+
} else if (BUILD8.vdomStyle && memberName === "style") {
|
|
495
|
+
if (BUILD8.updatable) {
|
|
496
|
+
for (const prop in oldValue) {
|
|
497
|
+
if (!newValue || newValue[prop] == null) {
|
|
498
|
+
if (!BUILD8.hydrateServerSide && prop.includes("-")) {
|
|
499
|
+
elm.style.removeProperty(prop);
|
|
500
|
+
} else {
|
|
501
|
+
elm.style[prop] = "";
|
|
502
|
+
}
|
|
684
503
|
}
|
|
685
504
|
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
if (
|
|
690
|
-
|
|
505
|
+
}
|
|
506
|
+
for (const prop in newValue) {
|
|
507
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
508
|
+
if (!BUILD8.hydrateServerSide && prop.includes("-")) {
|
|
509
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
691
510
|
} else {
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
node["s-sr"] = true;
|
|
695
|
-
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
696
|
-
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
697
|
-
if (childVNode.$name$) {
|
|
698
|
-
childVNode.$elm$.setAttribute("name", childVNode.$name$);
|
|
699
|
-
}
|
|
700
|
-
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
701
|
-
node.remove();
|
|
702
|
-
if (childVNode.$depth$ === "0") {
|
|
703
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
slotNodes.push(childVNode);
|
|
707
|
-
if (!parentVNode.$children$) {
|
|
708
|
-
parentVNode.$children$ = [];
|
|
709
|
-
}
|
|
710
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
711
|
-
} else if (childNodeType === CONTENT_REF_ID) {
|
|
712
|
-
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
713
|
-
node.remove();
|
|
714
|
-
} else if (BUILD9.slotRelocation) {
|
|
715
|
-
hostElm["s-cr"] = node;
|
|
716
|
-
node["s-cn"] = true;
|
|
511
|
+
elm.style[prop] = newValue[prop];
|
|
717
512
|
}
|
|
718
513
|
}
|
|
719
514
|
}
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
vnode.$index$ = "0";
|
|
725
|
-
parentVNode.$children$ = [vnode];
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
729
|
-
if (node.nodeType === 1 /* ElementNode */) {
|
|
730
|
-
let i2 = 0;
|
|
731
|
-
if (node.shadowRoot) {
|
|
732
|
-
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
733
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
515
|
+
} else if (BUILD8.vdomKey && memberName === "key") {
|
|
516
|
+
} else if (BUILD8.vdomRef && memberName === "ref") {
|
|
517
|
+
if (newValue) {
|
|
518
|
+
newValue(elm);
|
|
734
519
|
}
|
|
735
|
-
}
|
|
736
|
-
for (i2 = 0; i2 < node.childNodes.length; i2++) {
|
|
737
|
-
initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
|
|
738
|
-
}
|
|
739
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
740
|
-
const childIdSplt = node.nodeValue.split(".");
|
|
741
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
742
|
-
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
743
|
-
node.nodeValue = "";
|
|
744
|
-
node["s-en"] = childIdSplt[3];
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
// src/runtime/initialize-component.ts
|
|
750
|
-
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
751
|
-
|
|
752
|
-
// src/runtime/mode.ts
|
|
753
|
-
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
754
|
-
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
755
|
-
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
756
|
-
|
|
757
|
-
// src/runtime/proxy-component.ts
|
|
758
|
-
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
759
|
-
|
|
760
|
-
// src/runtime/set-value.ts
|
|
761
|
-
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
762
|
-
|
|
763
|
-
// src/runtime/parse-property-value.ts
|
|
764
|
-
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
765
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
766
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
767
|
-
if (BUILD10.propBoolean && propType & 4 /* Boolean */) {
|
|
768
|
-
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
769
|
-
}
|
|
770
|
-
if (BUILD10.propNumber && propType & 2 /* Number */) {
|
|
771
|
-
return parseFloat(propValue);
|
|
772
|
-
}
|
|
773
|
-
if (BUILD10.propString && propType & 1 /* String */) {
|
|
774
|
-
return String(propValue);
|
|
775
|
-
}
|
|
776
|
-
return propValue;
|
|
777
|
-
}
|
|
778
|
-
return propValue;
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
// src/runtime/update-component.ts
|
|
782
|
-
import { BUILD as BUILD17, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
783
|
-
|
|
784
|
-
// src/runtime/event-emitter.ts
|
|
785
|
-
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
786
|
-
|
|
787
|
-
// src/runtime/element.ts
|
|
788
|
-
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
789
|
-
var getElement = (ref) => BUILD11.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
790
|
-
|
|
791
|
-
// src/runtime/event-emitter.ts
|
|
792
|
-
var createEvent = (ref, name, flags) => {
|
|
793
|
-
const elm = getElement(ref);
|
|
794
|
-
return {
|
|
795
|
-
emit: (detail) => {
|
|
796
|
-
if (BUILD12.isDev && !elm.isConnected) {
|
|
797
|
-
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
798
|
-
}
|
|
799
|
-
return emitEvent(elm, name, {
|
|
800
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
801
|
-
composed: !!(flags & 2 /* Composed */),
|
|
802
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
803
|
-
detail
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
};
|
|
807
|
-
};
|
|
808
|
-
var emitEvent = (elm, name, opts) => {
|
|
809
|
-
const ev = plt.ce(name, opts);
|
|
810
|
-
elm.dispatchEvent(ev);
|
|
811
|
-
return ev;
|
|
812
|
-
};
|
|
813
|
-
|
|
814
|
-
// src/runtime/styles.ts
|
|
815
|
-
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
816
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
817
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
818
|
-
let style = styles.get(scopeId2);
|
|
819
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
820
|
-
style = style || new CSSStyleSheet();
|
|
821
|
-
if (typeof style === "string") {
|
|
822
|
-
style = cssText;
|
|
823
|
-
} else {
|
|
824
|
-
style.replaceSync(cssText);
|
|
825
|
-
}
|
|
826
|
-
} else {
|
|
827
|
-
style = cssText;
|
|
828
|
-
}
|
|
829
|
-
styles.set(scopeId2, style);
|
|
830
|
-
};
|
|
831
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
832
|
-
var _a;
|
|
833
|
-
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
834
|
-
const style = styles.get(scopeId2);
|
|
835
|
-
if (!BUILD13.attachStyles) {
|
|
836
|
-
return scopeId2;
|
|
837
|
-
}
|
|
838
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
839
|
-
if (style) {
|
|
840
|
-
if (typeof style === "string") {
|
|
841
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
842
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
843
|
-
let styleElm;
|
|
844
|
-
if (!appliedStyles) {
|
|
845
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
846
|
-
}
|
|
847
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
848
|
-
if (BUILD13.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
849
|
-
styleElm.innerHTML = style;
|
|
850
|
-
} else {
|
|
851
|
-
styleElm = doc.createElement("style");
|
|
852
|
-
styleElm.innerHTML = style;
|
|
853
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
854
|
-
if (nonce != null) {
|
|
855
|
-
styleElm.setAttribute("nonce", nonce);
|
|
856
|
-
}
|
|
857
|
-
if ((BUILD13.hydrateServerSide || BUILD13.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
858
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
859
|
-
}
|
|
860
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
861
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
862
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
863
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
864
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
865
|
-
} else if ("host" in styleContainerNode) {
|
|
866
|
-
if (supportsConstructableStylesheets) {
|
|
867
|
-
const stylesheet = new CSSStyleSheet();
|
|
868
|
-
stylesheet.replaceSync(style);
|
|
869
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
870
|
-
} else {
|
|
871
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
872
|
-
if (existingStyleContainer) {
|
|
873
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
874
|
-
} else {
|
|
875
|
-
styleContainerNode.prepend(styleElm);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
} else {
|
|
879
|
-
styleContainerNode.append(styleElm);
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
883
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
887
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
888
|
-
}
|
|
889
|
-
if (appliedStyles) {
|
|
890
|
-
appliedStyles.add(scopeId2);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
} else if (BUILD13.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
894
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
return scopeId2;
|
|
898
|
-
};
|
|
899
|
-
var attachStyles = (hostRef) => {
|
|
900
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
901
|
-
const elm = hostRef.$hostElement$;
|
|
902
|
-
const flags = cmpMeta.$flags$;
|
|
903
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
904
|
-
const scopeId2 = addStyle(
|
|
905
|
-
BUILD13.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
906
|
-
cmpMeta,
|
|
907
|
-
hostRef.$modeName$
|
|
908
|
-
);
|
|
909
|
-
if ((BUILD13.shadowDom || BUILD13.scoped) && BUILD13.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
910
|
-
elm["s-sc"] = scopeId2;
|
|
911
|
-
elm.classList.add(scopeId2 + "-h");
|
|
912
|
-
if (BUILD13.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
913
|
-
elm.classList.add(scopeId2 + "-s");
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
endAttachStyles();
|
|
917
|
-
};
|
|
918
|
-
var getScopeId = (cmp, mode) => "sc-" + (BUILD13.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
919
|
-
|
|
920
|
-
// src/runtime/vdom/vdom-render.ts
|
|
921
|
-
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
922
|
-
|
|
923
|
-
// src/runtime/vdom/update-element.ts
|
|
924
|
-
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
925
|
-
|
|
926
|
-
// src/runtime/vdom/set-accessor.ts
|
|
927
|
-
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
928
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
929
|
-
if (oldValue !== newValue) {
|
|
930
|
-
let isProp = isMemberInElement(elm, memberName);
|
|
931
|
-
let ln = memberName.toLowerCase();
|
|
932
|
-
if (BUILD14.vdomClass && memberName === "class") {
|
|
933
|
-
const classList = elm.classList;
|
|
934
|
-
const oldClasses = parseClassList(oldValue);
|
|
935
|
-
const newClasses = parseClassList(newValue);
|
|
936
|
-
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
937
|
-
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
938
|
-
} else if (BUILD14.vdomStyle && memberName === "style") {
|
|
939
|
-
if (BUILD14.updatable) {
|
|
940
|
-
for (const prop in oldValue) {
|
|
941
|
-
if (!newValue || newValue[prop] == null) {
|
|
942
|
-
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
943
|
-
elm.style.removeProperty(prop);
|
|
944
|
-
} else {
|
|
945
|
-
elm.style[prop] = "";
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
for (const prop in newValue) {
|
|
951
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
952
|
-
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
953
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
954
|
-
} else {
|
|
955
|
-
elm.style[prop] = newValue[prop];
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
} else if (BUILD14.vdomKey && memberName === "key") {
|
|
960
|
-
} else if (BUILD14.vdomRef && memberName === "ref") {
|
|
961
|
-
if (newValue) {
|
|
962
|
-
newValue(elm);
|
|
963
|
-
}
|
|
964
|
-
} else if (BUILD14.vdomListener && (BUILD14.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
520
|
+
} else if (BUILD8.vdomListener && (BUILD8.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
965
521
|
if (memberName[2] === "-") {
|
|
966
522
|
memberName = memberName.slice(3);
|
|
967
523
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -979,7 +535,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
979
535
|
plt.ael(elm, memberName, newValue, capture);
|
|
980
536
|
}
|
|
981
537
|
}
|
|
982
|
-
} else if (
|
|
538
|
+
} else if (BUILD8.vdomPropOrAttr) {
|
|
983
539
|
const isComplex = isComplexType(newValue);
|
|
984
540
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
985
541
|
try {
|
|
@@ -1001,7 +557,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1001
557
|
}
|
|
1002
558
|
}
|
|
1003
559
|
let xlink = false;
|
|
1004
|
-
if (
|
|
560
|
+
if (BUILD8.vdomXlink) {
|
|
1005
561
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1006
562
|
memberName = ln;
|
|
1007
563
|
xlink = true;
|
|
@@ -1009,7 +565,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1009
565
|
}
|
|
1010
566
|
if (newValue == null || newValue === false) {
|
|
1011
567
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1012
|
-
if (
|
|
568
|
+
if (BUILD8.vdomXlink && xlink) {
|
|
1013
569
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
1014
570
|
} else {
|
|
1015
571
|
elm.removeAttribute(memberName);
|
|
@@ -1017,7 +573,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1017
573
|
}
|
|
1018
574
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1019
575
|
newValue = newValue === true ? "" : newValue;
|
|
1020
|
-
if (
|
|
576
|
+
if (BUILD8.vdomXlink && xlink) {
|
|
1021
577
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1022
578
|
} else {
|
|
1023
579
|
elm.setAttribute(memberName, newValue);
|
|
@@ -1036,7 +592,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
1036
592
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1037
593
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
1038
594
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
1039
|
-
if (
|
|
595
|
+
if (BUILD9.updatable) {
|
|
1040
596
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1041
597
|
if (!(memberName in newVnodeAttrs)) {
|
|
1042
598
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -1072,7 +628,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1072
628
|
let elm;
|
|
1073
629
|
let childNode;
|
|
1074
630
|
let oldVNode;
|
|
1075
|
-
if (
|
|
631
|
+
if (BUILD10.slotRelocation && !useNativeShadowDom) {
|
|
1076
632
|
checkSlotRelocate = true;
|
|
1077
633
|
if (newVNode2.$tag$ === "slot") {
|
|
1078
634
|
if (scopeId) {
|
|
@@ -1090,37 +646,37 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1090
646
|
);
|
|
1091
647
|
}
|
|
1092
648
|
}
|
|
1093
|
-
if (
|
|
649
|
+
if (BUILD10.isDev && newVNode2.$elm$) {
|
|
1094
650
|
consoleDevError(
|
|
1095
651
|
`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
1096
652
|
);
|
|
1097
653
|
}
|
|
1098
|
-
if (
|
|
654
|
+
if (BUILD10.vdomText && newVNode2.$text$ !== null) {
|
|
1099
655
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1100
|
-
} else if (
|
|
1101
|
-
elm = newVNode2.$elm$ =
|
|
656
|
+
} else if (BUILD10.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
657
|
+
elm = newVNode2.$elm$ = BUILD10.isDebug || BUILD10.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
1102
658
|
} else {
|
|
1103
|
-
if (
|
|
659
|
+
if (BUILD10.svg && !isSvgMode) {
|
|
1104
660
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1105
661
|
}
|
|
1106
|
-
elm = newVNode2.$elm$ =
|
|
662
|
+
elm = newVNode2.$elm$ = BUILD10.svg ? doc.createElementNS(
|
|
1107
663
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1108
|
-
!useNativeShadowDom &&
|
|
664
|
+
!useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1109
665
|
) : doc.createElement(
|
|
1110
|
-
!useNativeShadowDom &&
|
|
666
|
+
!useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1111
667
|
);
|
|
1112
|
-
if (
|
|
668
|
+
if (BUILD10.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1113
669
|
isSvgMode = false;
|
|
1114
670
|
}
|
|
1115
|
-
if (
|
|
671
|
+
if (BUILD10.vdomAttribute) {
|
|
1116
672
|
updateElement(null, newVNode2, isSvgMode);
|
|
1117
673
|
}
|
|
1118
674
|
const rootNode = elm.getRootNode();
|
|
1119
675
|
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
1120
|
-
if (!isElementWithinShadowRoot &&
|
|
676
|
+
if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
1121
677
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
1122
678
|
}
|
|
1123
|
-
if (
|
|
679
|
+
if (BUILD10.scoped) {
|
|
1124
680
|
updateElementScopeIds(elm, parentElm);
|
|
1125
681
|
}
|
|
1126
682
|
if (newVNode2.$children$) {
|
|
@@ -1131,7 +687,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1131
687
|
}
|
|
1132
688
|
}
|
|
1133
689
|
}
|
|
1134
|
-
if (
|
|
690
|
+
if (BUILD10.svg) {
|
|
1135
691
|
if (newVNode2.$tag$ === "svg") {
|
|
1136
692
|
isSvgMode = false;
|
|
1137
693
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -1140,7 +696,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1140
696
|
}
|
|
1141
697
|
}
|
|
1142
698
|
elm["s-hn"] = hostTagName;
|
|
1143
|
-
if (
|
|
699
|
+
if (BUILD10.slotRelocation) {
|
|
1144
700
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1145
701
|
elm["s-sr"] = true;
|
|
1146
702
|
elm["s-cr"] = contentRef;
|
|
@@ -1148,7 +704,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1148
704
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1149
705
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1150
706
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1151
|
-
if (
|
|
707
|
+
if (BUILD10.experimentalSlotFixes) {
|
|
1152
708
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1153
709
|
} else {
|
|
1154
710
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
@@ -1162,8 +718,12 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1162
718
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1163
719
|
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1164
720
|
if (host != null) {
|
|
1165
|
-
const contentRefNode = Array.from(host.childNodes).find(
|
|
1166
|
-
|
|
721
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
722
|
+
(ref) => ref["s-cr"]
|
|
723
|
+
);
|
|
724
|
+
const childNodeArray = Array.from(
|
|
725
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
726
|
+
);
|
|
1167
727
|
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1168
728
|
if (childNode["s-sh"] != null) {
|
|
1169
729
|
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
@@ -1176,8 +736,8 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1176
736
|
};
|
|
1177
737
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1178
738
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1179
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
1180
|
-
if (parentElm["s-sr"] &&
|
|
739
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
740
|
+
if (parentElm["s-sr"] && BUILD10.experimentalSlotFixes) {
|
|
1181
741
|
let node = parentElm;
|
|
1182
742
|
while (node = node.nextSibling) {
|
|
1183
743
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1201,9 +761,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1201
761
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1202
762
|
};
|
|
1203
763
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1204
|
-
let containerElm =
|
|
764
|
+
let containerElm = BUILD10.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1205
765
|
let childNode;
|
|
1206
|
-
if (
|
|
766
|
+
if (BUILD10.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1207
767
|
containerElm = containerElm.shadowRoot;
|
|
1208
768
|
}
|
|
1209
769
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1211,7 +771,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
1211
771
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
1212
772
|
if (childNode) {
|
|
1213
773
|
vnodes[startIdx].$elm$ = childNode;
|
|
1214
|
-
insertBefore(containerElm, childNode,
|
|
774
|
+
insertBefore(containerElm, childNode, BUILD10.slotRelocation ? referenceNode(before) : before);
|
|
1215
775
|
}
|
|
1216
776
|
}
|
|
1217
777
|
}
|
|
@@ -1223,7 +783,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1223
783
|
const elm = vnode.$elm$;
|
|
1224
784
|
nullifyVNodeRefs(vnode);
|
|
1225
785
|
if (elm) {
|
|
1226
|
-
if (
|
|
786
|
+
if (BUILD10.slotRelocation) {
|
|
1227
787
|
checkSlotFallbackVisibility = true;
|
|
1228
788
|
if (elm["s-ol"]) {
|
|
1229
789
|
elm["s-ol"].remove();
|
|
@@ -1267,7 +827,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1267
827
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1268
828
|
newEndVnode = newCh[--newEndIdx];
|
|
1269
829
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1270
|
-
if (
|
|
830
|
+
if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1271
831
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1272
832
|
}
|
|
1273
833
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1275,7 +835,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1275
835
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1276
836
|
newEndVnode = newCh[--newEndIdx];
|
|
1277
837
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1278
|
-
if (
|
|
838
|
+
if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1279
839
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1280
840
|
}
|
|
1281
841
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1284,7 +844,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1284
844
|
newStartVnode = newCh[++newStartIdx];
|
|
1285
845
|
} else {
|
|
1286
846
|
idxInOld = -1;
|
|
1287
|
-
if (
|
|
847
|
+
if (BUILD10.vdomKey) {
|
|
1288
848
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1289
849
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1290
850
|
idxInOld = i2;
|
|
@@ -1292,7 +852,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1292
852
|
}
|
|
1293
853
|
}
|
|
1294
854
|
}
|
|
1295
|
-
if (
|
|
855
|
+
if (BUILD10.vdomKey && idxInOld >= 0) {
|
|
1296
856
|
elmToMove = oldCh[idxInOld];
|
|
1297
857
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1298
858
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
|
|
@@ -1307,7 +867,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1307
867
|
newStartVnode = newCh[++newStartIdx];
|
|
1308
868
|
}
|
|
1309
869
|
if (node) {
|
|
1310
|
-
if (
|
|
870
|
+
if (BUILD10.slotRelocation) {
|
|
1311
871
|
insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
|
|
1312
872
|
} else {
|
|
1313
873
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
@@ -1324,13 +884,13 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1324
884
|
newStartIdx,
|
|
1325
885
|
newEndIdx
|
|
1326
886
|
);
|
|
1327
|
-
} else if (
|
|
887
|
+
} else if (BUILD10.updatable && newStartIdx > newEndIdx) {
|
|
1328
888
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1329
889
|
}
|
|
1330
890
|
};
|
|
1331
891
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1332
892
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1333
|
-
if (
|
|
893
|
+
if (BUILD10.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1334
894
|
if (
|
|
1335
895
|
// The component gets hydrated and no VDOM has been initialized.
|
|
1336
896
|
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
@@ -1342,7 +902,7 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
1342
902
|
}
|
|
1343
903
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1344
904
|
}
|
|
1345
|
-
if (
|
|
905
|
+
if (BUILD10.vdomKey && !isInitialRender) {
|
|
1346
906
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1347
907
|
}
|
|
1348
908
|
return true;
|
|
@@ -1360,13 +920,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1360
920
|
const tag = newVNode2.$tag$;
|
|
1361
921
|
const text = newVNode2.$text$;
|
|
1362
922
|
let defaultHolder;
|
|
1363
|
-
if (!
|
|
1364
|
-
if (
|
|
923
|
+
if (!BUILD10.vdomText || text === null) {
|
|
924
|
+
if (BUILD10.svg) {
|
|
1365
925
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1366
926
|
}
|
|
1367
|
-
if (
|
|
1368
|
-
if (
|
|
1369
|
-
if (
|
|
927
|
+
if (BUILD10.vdomAttribute || BUILD10.reflect) {
|
|
928
|
+
if (BUILD10.slot && tag === "slot" && !useNativeShadowDom) {
|
|
929
|
+
if (BUILD10.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1370
930
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1371
931
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1372
932
|
}
|
|
@@ -1374,30 +934,30 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1374
934
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1375
935
|
}
|
|
1376
936
|
}
|
|
1377
|
-
if (
|
|
937
|
+
if (BUILD10.updatable && oldChildren !== null && newChildren !== null) {
|
|
1378
938
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1379
939
|
} else if (newChildren !== null) {
|
|
1380
|
-
if (
|
|
940
|
+
if (BUILD10.updatable && BUILD10.vdomText && oldVNode.$text$ !== null) {
|
|
1381
941
|
elm.textContent = "";
|
|
1382
942
|
}
|
|
1383
943
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1384
944
|
} else if (
|
|
1385
945
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1386
|
-
!isInitialRender &&
|
|
946
|
+
!isInitialRender && BUILD10.updatable && oldChildren !== null
|
|
1387
947
|
) {
|
|
1388
948
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1389
949
|
}
|
|
1390
|
-
if (
|
|
950
|
+
if (BUILD10.svg && isSvgMode && tag === "svg") {
|
|
1391
951
|
isSvgMode = false;
|
|
1392
952
|
}
|
|
1393
|
-
} else if (
|
|
953
|
+
} else if (BUILD10.vdomText && BUILD10.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1394
954
|
defaultHolder.parentNode.textContent = text;
|
|
1395
|
-
} else if (
|
|
955
|
+
} else if (BUILD10.vdomText && oldVNode.$text$ !== text) {
|
|
1396
956
|
elm.data = text;
|
|
1397
957
|
}
|
|
1398
958
|
};
|
|
1399
959
|
var updateFallbackSlotVisibility = (elm) => {
|
|
1400
|
-
const childNodes = elm.childNodes;
|
|
960
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
1401
961
|
for (const childNode of childNodes) {
|
|
1402
962
|
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1403
963
|
if (childNode["s-sr"]) {
|
|
@@ -1410,7 +970,7 @@ var updateFallbackSlotVisibility = (elm) => {
|
|
|
1410
970
|
childNode.hidden = true;
|
|
1411
971
|
break;
|
|
1412
972
|
}
|
|
1413
|
-
} else {
|
|
973
|
+
} else if (slotName === siblingNode["s-sn"]) {
|
|
1414
974
|
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1415
975
|
childNode.hidden = true;
|
|
1416
976
|
break;
|
|
@@ -1428,13 +988,14 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1428
988
|
let node;
|
|
1429
989
|
let hostContentNodes;
|
|
1430
990
|
let j;
|
|
1431
|
-
|
|
991
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
992
|
+
for (const childNode of children) {
|
|
1432
993
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1433
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
994
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1434
995
|
const slotName = childNode["s-sn"];
|
|
1435
996
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1436
997
|
node = hostContentNodes[j];
|
|
1437
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
998
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD10.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1438
999
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1439
1000
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1440
1001
|
checkSlotFallbackVisibility = true;
|
|
@@ -1488,14 +1049,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
1488
1049
|
return slotName === "";
|
|
1489
1050
|
};
|
|
1490
1051
|
var nullifyVNodeRefs = (vNode) => {
|
|
1491
|
-
if (
|
|
1052
|
+
if (BUILD10.vdomRef) {
|
|
1492
1053
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1493
1054
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1494
1055
|
}
|
|
1495
1056
|
};
|
|
1496
1057
|
var insertBefore = (parent, newNode, reference) => {
|
|
1497
1058
|
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1498
|
-
if (
|
|
1059
|
+
if (BUILD10.scoped) {
|
|
1499
1060
|
updateElementScopeIds(newNode, parent);
|
|
1500
1061
|
}
|
|
1501
1062
|
return inserted;
|
|
@@ -1519,7 +1080,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
|
1519
1080
|
if (scopeIds.size) {
|
|
1520
1081
|
(_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
|
|
1521
1082
|
if (element["s-ol"] || iterateChildNodes) {
|
|
1522
|
-
for (const childNode of Array.from(element.childNodes)) {
|
|
1083
|
+
for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
|
|
1523
1084
|
updateElementScopeIds(childNode, element, true);
|
|
1524
1085
|
}
|
|
1525
1086
|
}
|
|
@@ -1533,7 +1094,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1533
1094
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1534
1095
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1535
1096
|
hostTagName = hostElm.tagName;
|
|
1536
|
-
if (
|
|
1097
|
+
if (BUILD10.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1537
1098
|
throw new Error(`The <Host> must be the single root component.
|
|
1538
1099
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1539
1100
|
|
|
@@ -1547,7 +1108,7 @@ render() {
|
|
|
1547
1108
|
}
|
|
1548
1109
|
`);
|
|
1549
1110
|
}
|
|
1550
|
-
if (
|
|
1111
|
+
if (BUILD10.reflect && cmpMeta.$attrsToReflect$) {
|
|
1551
1112
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1552
1113
|
cmpMeta.$attrsToReflect$.map(
|
|
1553
1114
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1563,24 +1124,24 @@ render() {
|
|
|
1563
1124
|
rootVnode.$tag$ = null;
|
|
1564
1125
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1565
1126
|
hostRef.$vnode$ = rootVnode;
|
|
1566
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1567
|
-
if (
|
|
1127
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD10.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1128
|
+
if (BUILD10.scoped || BUILD10.shadowDom) {
|
|
1568
1129
|
scopeId = hostElm["s-sc"];
|
|
1569
1130
|
}
|
|
1570
1131
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1571
|
-
if (
|
|
1132
|
+
if (BUILD10.slotRelocation) {
|
|
1572
1133
|
contentRef = hostElm["s-cr"];
|
|
1573
1134
|
checkSlotFallbackVisibility = false;
|
|
1574
1135
|
}
|
|
1575
1136
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1576
|
-
if (
|
|
1137
|
+
if (BUILD10.slotRelocation) {
|
|
1577
1138
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1578
1139
|
if (checkSlotRelocate) {
|
|
1579
1140
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1580
1141
|
for (const relocateData of relocateNodes) {
|
|
1581
1142
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1582
1143
|
if (!nodeToRelocate["s-ol"]) {
|
|
1583
|
-
const orgLocationNode =
|
|
1144
|
+
const orgLocationNode = BUILD10.isDebug || BUILD10.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1584
1145
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1585
1146
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1586
1147
|
}
|
|
@@ -1591,7 +1152,7 @@ render() {
|
|
|
1591
1152
|
if (slotRefNode) {
|
|
1592
1153
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1593
1154
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1594
|
-
if (!
|
|
1155
|
+
if (!BUILD10.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
|
|
1595
1156
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1596
1157
|
while (orgLocationNode) {
|
|
1597
1158
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1610,7 +1171,7 @@ render() {
|
|
|
1610
1171
|
}
|
|
1611
1172
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1612
1173
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1613
|
-
if (!
|
|
1174
|
+
if (!BUILD10.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1614
1175
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1615
1176
|
}
|
|
1616
1177
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -1636,8 +1197,9 @@ render() {
|
|
|
1636
1197
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1637
1198
|
relocateNodes.length = 0;
|
|
1638
1199
|
}
|
|
1639
|
-
if (
|
|
1640
|
-
|
|
1200
|
+
if (BUILD10.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1201
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1202
|
+
for (const childNode of children) {
|
|
1641
1203
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1642
1204
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1643
1205
|
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
@@ -1646,37 +1208,926 @@ render() {
|
|
|
1646
1208
|
}
|
|
1647
1209
|
}
|
|
1648
1210
|
}
|
|
1649
|
-
contentRef = void 0;
|
|
1211
|
+
contentRef = void 0;
|
|
1212
|
+
};
|
|
1213
|
+
var slotReferenceDebugNode = (slotVNode) => doc.createComment(
|
|
1214
|
+
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1215
|
+
);
|
|
1216
|
+
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1217
|
+
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1218
|
+
);
|
|
1219
|
+
|
|
1220
|
+
// src/runtime/dom-extras.ts
|
|
1221
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
1222
|
+
patchCloneNode(hostElementPrototype);
|
|
1223
|
+
patchSlotAppendChild(hostElementPrototype);
|
|
1224
|
+
patchSlotAppend(hostElementPrototype);
|
|
1225
|
+
patchSlotPrepend(hostElementPrototype);
|
|
1226
|
+
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
1227
|
+
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
1228
|
+
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
1229
|
+
patchTextContent(hostElementPrototype);
|
|
1230
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
1231
|
+
patchSlotRemoveChild(hostElementPrototype);
|
|
1232
|
+
};
|
|
1233
|
+
var patchCloneNode = (HostElementPrototype) => {
|
|
1234
|
+
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1235
|
+
HostElementPrototype.cloneNode = function(deep) {
|
|
1236
|
+
const srcNode = this;
|
|
1237
|
+
const isShadowDom = BUILD11.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1238
|
+
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1239
|
+
if (BUILD11.slot && !isShadowDom && deep) {
|
|
1240
|
+
let i2 = 0;
|
|
1241
|
+
let slotted, nonStencilNode;
|
|
1242
|
+
const stencilPrivates = [
|
|
1243
|
+
"s-id",
|
|
1244
|
+
"s-cr",
|
|
1245
|
+
"s-lr",
|
|
1246
|
+
"s-rc",
|
|
1247
|
+
"s-sc",
|
|
1248
|
+
"s-p",
|
|
1249
|
+
"s-cn",
|
|
1250
|
+
"s-sr",
|
|
1251
|
+
"s-sn",
|
|
1252
|
+
"s-hn",
|
|
1253
|
+
"s-ol",
|
|
1254
|
+
"s-nr",
|
|
1255
|
+
"s-si",
|
|
1256
|
+
"s-rf",
|
|
1257
|
+
"s-scs"
|
|
1258
|
+
];
|
|
1259
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1260
|
+
for (; i2 < childNodes.length; i2++) {
|
|
1261
|
+
slotted = childNodes[i2]["s-nr"];
|
|
1262
|
+
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1263
|
+
if (slotted) {
|
|
1264
|
+
if (BUILD11.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1265
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1266
|
+
} else {
|
|
1267
|
+
clonedNode.appendChild(slotted.cloneNode(true));
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
if (nonStencilNode) {
|
|
1271
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
return clonedNode;
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
1279
|
+
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1280
|
+
HostElementPrototype.appendChild = function(newChild) {
|
|
1281
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1282
|
+
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
|
|
1283
|
+
if (slotNode) {
|
|
1284
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
1285
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1286
|
+
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
1287
|
+
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1288
|
+
updateFallbackSlotVisibility(this);
|
|
1289
|
+
return insertedNode;
|
|
1290
|
+
}
|
|
1291
|
+
return this.__appendChild(newChild);
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
1295
|
+
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
1296
|
+
ElementPrototype.removeChild = function(toRemove) {
|
|
1297
|
+
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1298
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1299
|
+
const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
|
|
1300
|
+
if (slotNode && toRemove.isConnected) {
|
|
1301
|
+
toRemove.remove();
|
|
1302
|
+
updateFallbackSlotVisibility(this);
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return this.__removeChild(toRemove);
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
var patchSlotPrepend = (HostElementPrototype) => {
|
|
1310
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
1311
|
+
HostElementPrototype.prepend = function(...newChildren) {
|
|
1312
|
+
newChildren.forEach((newChild) => {
|
|
1313
|
+
if (typeof newChild === "string") {
|
|
1314
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1315
|
+
}
|
|
1316
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1317
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1318
|
+
const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
|
|
1319
|
+
if (slotNode) {
|
|
1320
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
1321
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1322
|
+
const appendAfter = slotChildNodes[0];
|
|
1323
|
+
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1324
|
+
}
|
|
1325
|
+
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
1326
|
+
newChild.hidden = true;
|
|
1327
|
+
}
|
|
1328
|
+
return HostElementPrototype.__prepend(newChild);
|
|
1329
|
+
});
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
var patchSlotAppend = (HostElementPrototype) => {
|
|
1333
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
1334
|
+
HostElementPrototype.append = function(...newChildren) {
|
|
1335
|
+
newChildren.forEach((newChild) => {
|
|
1336
|
+
if (typeof newChild === "string") {
|
|
1337
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1338
|
+
}
|
|
1339
|
+
this.appendChild(newChild);
|
|
1340
|
+
});
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
1344
|
+
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
1345
|
+
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
1346
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1347
|
+
return originalInsertAdjacentHtml.call(this, position, text);
|
|
1348
|
+
}
|
|
1349
|
+
const container = this.ownerDocument.createElement("_");
|
|
1350
|
+
let node;
|
|
1351
|
+
container.innerHTML = text;
|
|
1352
|
+
if (position === "afterbegin") {
|
|
1353
|
+
while (node = container.firstChild) {
|
|
1354
|
+
this.prepend(node);
|
|
1355
|
+
}
|
|
1356
|
+
} else if (position === "beforeend") {
|
|
1357
|
+
while (node = container.firstChild) {
|
|
1358
|
+
this.append(node);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
};
|
|
1363
|
+
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
1364
|
+
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
1365
|
+
this.insertAdjacentHTML(position, text);
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1368
|
+
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
1369
|
+
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
1370
|
+
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
1371
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1372
|
+
return originalInsertAdjacentElement.call(this, position, element);
|
|
1373
|
+
}
|
|
1374
|
+
if (position === "afterbegin") {
|
|
1375
|
+
this.prepend(element);
|
|
1376
|
+
return element;
|
|
1377
|
+
} else if (position === "beforeend") {
|
|
1378
|
+
this.append(element);
|
|
1379
|
+
return element;
|
|
1380
|
+
}
|
|
1381
|
+
return element;
|
|
1382
|
+
};
|
|
1383
|
+
};
|
|
1384
|
+
var patchTextContent = (hostElementPrototype) => {
|
|
1385
|
+
let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
1386
|
+
if (!descriptor) {
|
|
1387
|
+
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
1388
|
+
}
|
|
1389
|
+
if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
1390
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
1391
|
+
get: function() {
|
|
1392
|
+
let text = "";
|
|
1393
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1394
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
1395
|
+
return text;
|
|
1396
|
+
},
|
|
1397
|
+
set: function(value) {
|
|
1398
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1399
|
+
childNodes.forEach((node) => {
|
|
1400
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
1401
|
+
node.remove();
|
|
1402
|
+
});
|
|
1403
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
};
|
|
1407
|
+
var patchChildSlotNodes = (elm) => {
|
|
1408
|
+
class FakeNodeList extends Array {
|
|
1409
|
+
item(n) {
|
|
1410
|
+
return this[n];
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
let childNodesFn = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
|
|
1414
|
+
if (!childNodesFn) {
|
|
1415
|
+
childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
|
|
1416
|
+
}
|
|
1417
|
+
if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
|
|
1418
|
+
let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
|
|
1419
|
+
if (!childrenFn) {
|
|
1420
|
+
childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
|
|
1421
|
+
}
|
|
1422
|
+
if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
|
|
1423
|
+
Object.defineProperty(elm, "children", {
|
|
1424
|
+
get() {
|
|
1425
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
1429
|
+
get() {
|
|
1430
|
+
return this.children.length;
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
if (!childNodesFn) return;
|
|
1434
|
+
Object.defineProperty(elm, "childNodes", {
|
|
1435
|
+
get() {
|
|
1436
|
+
var _a, _b;
|
|
1437
|
+
if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
|
|
1438
|
+
const result = new FakeNodeList();
|
|
1439
|
+
const nodes = getSlottedChildNodes(this.__childNodes);
|
|
1440
|
+
result.push(...nodes);
|
|
1441
|
+
return result;
|
|
1442
|
+
}
|
|
1443
|
+
return FakeNodeList.from(this.__childNodes);
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1447
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
1448
|
+
let slottedNodeLocation;
|
|
1449
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
1450
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
1451
|
+
} else {
|
|
1452
|
+
slottedNodeLocation = document.createTextNode("");
|
|
1453
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
1454
|
+
}
|
|
1455
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
1456
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
1457
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
1458
|
+
if (typeof position !== "undefined") {
|
|
1459
|
+
if (BUILD11.hydrateClientSide) {
|
|
1460
|
+
slottedNodeLocation["s-oo"] = position;
|
|
1461
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
1462
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
1463
|
+
childNodes.forEach((n) => {
|
|
1464
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
1465
|
+
});
|
|
1466
|
+
slotRelocateNodes.sort((a, b) => {
|
|
1467
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
1468
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
1469
|
+
return 0;
|
|
1470
|
+
});
|
|
1471
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
1472
|
+
}
|
|
1473
|
+
} else {
|
|
1474
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
1475
|
+
}
|
|
1476
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
1477
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
1478
|
+
};
|
|
1479
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
1480
|
+
const result = [];
|
|
1481
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
1482
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
1483
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
1484
|
+
result.push(slottedNode);
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return result;
|
|
1488
|
+
};
|
|
1489
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
1490
|
+
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
1491
|
+
let i2 = 0;
|
|
1492
|
+
let childNode;
|
|
1493
|
+
for (; i2 < childNodes.length; i2++) {
|
|
1494
|
+
childNode = childNodes[i2];
|
|
1495
|
+
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
1496
|
+
return childNode;
|
|
1497
|
+
}
|
|
1498
|
+
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
1499
|
+
if (childNode) {
|
|
1500
|
+
return childNode;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
return null;
|
|
1504
|
+
};
|
|
1505
|
+
var getHostSlotChildNodes = (n, slotName) => {
|
|
1506
|
+
const childNodes = [n];
|
|
1507
|
+
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
1508
|
+
childNodes.push(n);
|
|
1509
|
+
}
|
|
1510
|
+
return childNodes;
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
// src/runtime/profile.ts
|
|
1514
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1515
|
+
var i = 0;
|
|
1516
|
+
var createTime = (fnName, tagName = "") => {
|
|
1517
|
+
if (BUILD12.profile && performance.mark) {
|
|
1518
|
+
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1519
|
+
performance.mark(key);
|
|
1520
|
+
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
1521
|
+
} else {
|
|
1522
|
+
return () => {
|
|
1523
|
+
return;
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
var uniqueTime = (key, measureText) => {
|
|
1528
|
+
if (BUILD12.profile && performance.mark) {
|
|
1529
|
+
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1530
|
+
performance.mark(key);
|
|
1531
|
+
}
|
|
1532
|
+
return () => {
|
|
1533
|
+
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
1534
|
+
performance.measure(measureText, key);
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
} else {
|
|
1538
|
+
return () => {
|
|
1539
|
+
return;
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
};
|
|
1543
|
+
var inspect = (ref) => {
|
|
1544
|
+
const hostRef = getHostRef(ref);
|
|
1545
|
+
if (!hostRef) {
|
|
1546
|
+
return void 0;
|
|
1547
|
+
}
|
|
1548
|
+
const flags = hostRef.$flags$;
|
|
1549
|
+
const hostElement = hostRef.$hostElement$;
|
|
1550
|
+
return {
|
|
1551
|
+
renderCount: hostRef.$renderCount$,
|
|
1552
|
+
flags: {
|
|
1553
|
+
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
1554
|
+
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
1555
|
+
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
1556
|
+
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
1557
|
+
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
1558
|
+
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
1559
|
+
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
1560
|
+
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
1561
|
+
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
1562
|
+
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
1563
|
+
},
|
|
1564
|
+
instanceValues: hostRef.$instanceValues$,
|
|
1565
|
+
ancestorComponent: hostRef.$ancestorComponent$,
|
|
1566
|
+
hostElement,
|
|
1567
|
+
lazyInstance: hostRef.$lazyInstance$,
|
|
1568
|
+
vnode: hostRef.$vnode$,
|
|
1569
|
+
modeName: hostRef.$modeName$,
|
|
1570
|
+
onReadyPromise: hostRef.$onReadyPromise$,
|
|
1571
|
+
onReadyResolve: hostRef.$onReadyResolve$,
|
|
1572
|
+
onInstancePromise: hostRef.$onInstancePromise$,
|
|
1573
|
+
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
1574
|
+
onRenderResolve: hostRef.$onRenderResolve$,
|
|
1575
|
+
queuedListeners: hostRef.$queuedListeners$,
|
|
1576
|
+
rmListeners: hostRef.$rmListeners$,
|
|
1577
|
+
["s-id"]: hostElement["s-id"],
|
|
1578
|
+
["s-cr"]: hostElement["s-cr"],
|
|
1579
|
+
["s-lr"]: hostElement["s-lr"],
|
|
1580
|
+
["s-p"]: hostElement["s-p"],
|
|
1581
|
+
["s-rc"]: hostElement["s-rc"],
|
|
1582
|
+
["s-sc"]: hostElement["s-sc"]
|
|
1583
|
+
};
|
|
1584
|
+
};
|
|
1585
|
+
var installDevTools = () => {
|
|
1586
|
+
if (BUILD12.devTools) {
|
|
1587
|
+
const stencil = win.stencil = win.stencil || {};
|
|
1588
|
+
const originalInspect = stencil.inspect;
|
|
1589
|
+
stencil.inspect = (ref) => {
|
|
1590
|
+
let result = inspect(ref);
|
|
1591
|
+
if (!result && typeof originalInspect === "function") {
|
|
1592
|
+
result = originalInspect(ref);
|
|
1593
|
+
}
|
|
1594
|
+
return result;
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
// src/runtime/client-hydrate.ts
|
|
1600
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1601
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
1602
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
1603
|
+
const childRenderNodes = [];
|
|
1604
|
+
const slotNodes = [];
|
|
1605
|
+
const slottedNodes = [];
|
|
1606
|
+
const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
|
|
1607
|
+
const vnode = newVNode(tagName, null);
|
|
1608
|
+
vnode.$elm$ = hostElm;
|
|
1609
|
+
if (!plt.$orgLocNodes$) {
|
|
1610
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1611
|
+
}
|
|
1612
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
1613
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
1614
|
+
hostRef.$vnode$ = clientHydrate(
|
|
1615
|
+
vnode,
|
|
1616
|
+
childRenderNodes,
|
|
1617
|
+
slotNodes,
|
|
1618
|
+
shadowRootNodes,
|
|
1619
|
+
hostElm,
|
|
1620
|
+
hostElm,
|
|
1621
|
+
hostId,
|
|
1622
|
+
slottedNodes
|
|
1623
|
+
);
|
|
1624
|
+
let crIndex = 0;
|
|
1625
|
+
const crLength = childRenderNodes.length;
|
|
1626
|
+
let childRenderNode;
|
|
1627
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
1628
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
1629
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
1630
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1631
|
+
const node = childRenderNode.$elm$;
|
|
1632
|
+
if (!shadowRoot) {
|
|
1633
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
1634
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1635
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1639
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1640
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
1641
|
+
}
|
|
1642
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
1643
|
+
if (!shadowRoot) {
|
|
1644
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1648
|
+
}
|
|
1649
|
+
const hosts = [];
|
|
1650
|
+
let snIndex = 0;
|
|
1651
|
+
const snLen = slottedNodes.length;
|
|
1652
|
+
let slotGroup;
|
|
1653
|
+
let snGroupIdx;
|
|
1654
|
+
let snGroupLen;
|
|
1655
|
+
let slottedItem;
|
|
1656
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1657
|
+
slotGroup = slottedNodes[snIndex];
|
|
1658
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
1659
|
+
snGroupLen = slotGroup.length;
|
|
1660
|
+
snGroupIdx = 0;
|
|
1661
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
1662
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
1663
|
+
if (!hosts[slottedItem.hostId]) {
|
|
1664
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
1665
|
+
}
|
|
1666
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
1667
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
1668
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1669
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1670
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1671
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
1672
|
+
} else {
|
|
1673
|
+
const hostChildren = hostEle.__childNodes || hostEle.childNodes;
|
|
1674
|
+
slottedItem.slot["s-cr"] = hostChildren[0];
|
|
1675
|
+
}
|
|
1676
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1677
|
+
}
|
|
1678
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1679
|
+
hostEle.appendChild(slottedItem.node);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
if (BUILD13.shadowDom && shadowRoot) {
|
|
1684
|
+
let rnIdex = 0;
|
|
1685
|
+
const rnLen = shadowRootNodes.length;
|
|
1686
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
1687
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
1688
|
+
}
|
|
1689
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
1690
|
+
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
1691
|
+
node.parentNode.removeChild(node);
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1695
|
+
hostRef.$hostElement$ = hostElm;
|
|
1696
|
+
endHydrate();
|
|
1697
|
+
};
|
|
1698
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
1699
|
+
let childNodeType;
|
|
1700
|
+
let childIdSplt;
|
|
1701
|
+
let childVNode;
|
|
1702
|
+
let i2;
|
|
1703
|
+
const scopeId2 = hostElm["s-sc"];
|
|
1704
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1705
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
1706
|
+
if (childNodeType) {
|
|
1707
|
+
childIdSplt = childNodeType.split(".");
|
|
1708
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
1709
|
+
childVNode = createSimpleVNode({
|
|
1710
|
+
$flags$: 0,
|
|
1711
|
+
$hostId$: childIdSplt[0],
|
|
1712
|
+
$nodeId$: childIdSplt[1],
|
|
1713
|
+
$depth$: childIdSplt[2],
|
|
1714
|
+
$index$: childIdSplt[3],
|
|
1715
|
+
$tag$: node.tagName.toLowerCase(),
|
|
1716
|
+
$elm$: node,
|
|
1717
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` reconciliation will fail:
|
|
1718
|
+
// client side changes before componentDidLoad will be ignored, `set-accessor.ts` will just take the element's initial classes
|
|
1719
|
+
$attrs$: { class: node.className }
|
|
1720
|
+
});
|
|
1721
|
+
childRenderNodes.push(childVNode);
|
|
1722
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1723
|
+
if (!parentVNode.$children$) {
|
|
1724
|
+
parentVNode.$children$ = [];
|
|
1725
|
+
}
|
|
1726
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1727
|
+
if (typeof slotName === "string") {
|
|
1728
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
1729
|
+
addSlot(
|
|
1730
|
+
slotName,
|
|
1731
|
+
childIdSplt[2],
|
|
1732
|
+
childVNode,
|
|
1733
|
+
node,
|
|
1734
|
+
parentVNode,
|
|
1735
|
+
childRenderNodes,
|
|
1736
|
+
slotNodes,
|
|
1737
|
+
shadowRootNodes,
|
|
1738
|
+
slottedNodes
|
|
1739
|
+
);
|
|
1740
|
+
}
|
|
1741
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
1742
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
1743
|
+
}
|
|
1744
|
+
if (childVNode.$index$ !== void 0) {
|
|
1745
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1746
|
+
}
|
|
1747
|
+
if (scopeId2) node["s-si"] = scopeId2;
|
|
1748
|
+
parentVNode = childVNode;
|
|
1749
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1750
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
if (node.shadowRoot) {
|
|
1755
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
1756
|
+
clientHydrate(
|
|
1757
|
+
parentVNode,
|
|
1758
|
+
childRenderNodes,
|
|
1759
|
+
slotNodes,
|
|
1760
|
+
shadowRootNodes,
|
|
1761
|
+
hostElm,
|
|
1762
|
+
node.shadowRoot.childNodes[i2],
|
|
1763
|
+
hostId,
|
|
1764
|
+
slottedNodes
|
|
1765
|
+
);
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1769
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
1770
|
+
clientHydrate(
|
|
1771
|
+
parentVNode,
|
|
1772
|
+
childRenderNodes,
|
|
1773
|
+
slotNodes,
|
|
1774
|
+
shadowRootNodes,
|
|
1775
|
+
hostElm,
|
|
1776
|
+
nonShadowNodes[i2],
|
|
1777
|
+
hostId,
|
|
1778
|
+
slottedNodes
|
|
1779
|
+
);
|
|
1780
|
+
}
|
|
1781
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1782
|
+
childIdSplt = node.nodeValue.split(".");
|
|
1783
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
1784
|
+
childNodeType = childIdSplt[0];
|
|
1785
|
+
childVNode = createSimpleVNode({
|
|
1786
|
+
$hostId$: childIdSplt[1],
|
|
1787
|
+
$nodeId$: childIdSplt[2],
|
|
1788
|
+
$depth$: childIdSplt[3],
|
|
1789
|
+
$index$: childIdSplt[4] || "0",
|
|
1790
|
+
$elm$: node,
|
|
1791
|
+
$attrs$: null,
|
|
1792
|
+
$children$: null,
|
|
1793
|
+
$key$: null,
|
|
1794
|
+
$name$: null,
|
|
1795
|
+
$tag$: null,
|
|
1796
|
+
$text$: null
|
|
1797
|
+
});
|
|
1798
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
1799
|
+
childVNode.$elm$ = node.nextSibling;
|
|
1800
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
1801
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
1802
|
+
childRenderNodes.push(childVNode);
|
|
1803
|
+
node.remove();
|
|
1804
|
+
if (hostId === childVNode.$hostId$) {
|
|
1805
|
+
if (!parentVNode.$children$) {
|
|
1806
|
+
parentVNode.$children$ = [];
|
|
1807
|
+
}
|
|
1808
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1809
|
+
}
|
|
1810
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1811
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
1815
|
+
childVNode.$elm$ = node.nextSibling;
|
|
1816
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
1817
|
+
childRenderNodes.push(childVNode);
|
|
1818
|
+
node.remove();
|
|
1819
|
+
}
|
|
1820
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
1821
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
1822
|
+
childVNode.$tag$ = "slot";
|
|
1823
|
+
const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
|
|
1824
|
+
addSlot(
|
|
1825
|
+
slotName,
|
|
1826
|
+
childIdSplt[2],
|
|
1827
|
+
childVNode,
|
|
1828
|
+
node,
|
|
1829
|
+
parentVNode,
|
|
1830
|
+
childRenderNodes,
|
|
1831
|
+
slotNodes,
|
|
1832
|
+
shadowRootNodes,
|
|
1833
|
+
slottedNodes
|
|
1834
|
+
);
|
|
1835
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1836
|
+
if (BUILD13.shadowDom && shadowRootNodes) {
|
|
1837
|
+
node.remove();
|
|
1838
|
+
} else if (BUILD13.slotRelocation) {
|
|
1839
|
+
hostElm["s-cr"] = node;
|
|
1840
|
+
node["s-cn"] = true;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1846
|
+
const vnode = newVNode(null, node.textContent);
|
|
1847
|
+
vnode.$elm$ = node;
|
|
1848
|
+
vnode.$index$ = "0";
|
|
1849
|
+
parentVNode.$children$ = [vnode];
|
|
1850
|
+
}
|
|
1851
|
+
return parentVNode;
|
|
1852
|
+
};
|
|
1853
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
1854
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1855
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
1856
|
+
if (componentId) {
|
|
1857
|
+
orgLocNodes.set(componentId, node);
|
|
1858
|
+
}
|
|
1859
|
+
let i2 = 0;
|
|
1860
|
+
if (node.shadowRoot) {
|
|
1861
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1862
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1866
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
1867
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1868
|
+
}
|
|
1869
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1870
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
1871
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1872
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1873
|
+
node.nodeValue = "";
|
|
1874
|
+
node["s-en"] = childIdSplt[3];
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
var createSimpleVNode = (vnode) => {
|
|
1879
|
+
const defaultVNode = {
|
|
1880
|
+
$flags$: 0,
|
|
1881
|
+
$hostId$: null,
|
|
1882
|
+
$nodeId$: null,
|
|
1883
|
+
$depth$: null,
|
|
1884
|
+
$index$: "0",
|
|
1885
|
+
$elm$: null,
|
|
1886
|
+
$attrs$: null,
|
|
1887
|
+
$children$: null,
|
|
1888
|
+
$key$: null,
|
|
1889
|
+
$name$: null,
|
|
1890
|
+
$tag$: null,
|
|
1891
|
+
$text$: null
|
|
1892
|
+
};
|
|
1893
|
+
return { ...defaultVNode, ...vnode };
|
|
1894
|
+
};
|
|
1895
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1896
|
+
node["s-sr"] = true;
|
|
1897
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1898
|
+
if (BUILD13.shadowDom && shadowRootNodes) {
|
|
1899
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1900
|
+
if (childVNode.$name$) {
|
|
1901
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1902
|
+
}
|
|
1903
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1904
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1905
|
+
} else {
|
|
1906
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1907
|
+
}
|
|
1908
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1909
|
+
node.remove();
|
|
1910
|
+
if (childVNode.$depth$ === "0") {
|
|
1911
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1912
|
+
}
|
|
1913
|
+
} else {
|
|
1914
|
+
const slot = childVNode.$elm$;
|
|
1915
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1916
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1917
|
+
if (shouldMove) {
|
|
1918
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1919
|
+
}
|
|
1920
|
+
childRenderNodes.push(childVNode);
|
|
1921
|
+
}
|
|
1922
|
+
slotNodes.push(childVNode);
|
|
1923
|
+
if (!parentVNode.$children$) {
|
|
1924
|
+
parentVNode.$children$ = [];
|
|
1925
|
+
}
|
|
1926
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1927
|
+
}
|
|
1928
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1929
|
+
let slottedNode = slotNode.nextSibling;
|
|
1930
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1931
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1932
|
+
slottedNode["s-sn"] = slotName;
|
|
1933
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1934
|
+
slottedNode = slottedNode.nextSibling;
|
|
1935
|
+
}
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1938
|
+
// src/runtime/initialize-component.ts
|
|
1939
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
1940
|
+
|
|
1941
|
+
// src/runtime/mode.ts
|
|
1942
|
+
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
1943
|
+
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
1944
|
+
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
1945
|
+
|
|
1946
|
+
// src/runtime/proxy-component.ts
|
|
1947
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
1948
|
+
|
|
1949
|
+
// src/runtime/set-value.ts
|
|
1950
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
1951
|
+
|
|
1952
|
+
// src/runtime/parse-property-value.ts
|
|
1953
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
1954
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
1955
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
1956
|
+
if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
|
|
1957
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1958
|
+
}
|
|
1959
|
+
if (BUILD14.propNumber && propType & 2 /* Number */) {
|
|
1960
|
+
return parseFloat(propValue);
|
|
1961
|
+
}
|
|
1962
|
+
if (BUILD14.propString && propType & 1 /* String */) {
|
|
1963
|
+
return String(propValue);
|
|
1964
|
+
}
|
|
1965
|
+
return propValue;
|
|
1966
|
+
}
|
|
1967
|
+
return propValue;
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
// src/runtime/update-component.ts
|
|
1971
|
+
import { BUILD as BUILD18, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
1972
|
+
|
|
1973
|
+
// src/runtime/event-emitter.ts
|
|
1974
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
1975
|
+
|
|
1976
|
+
// src/runtime/element.ts
|
|
1977
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
1978
|
+
var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
1979
|
+
|
|
1980
|
+
// src/runtime/event-emitter.ts
|
|
1981
|
+
var createEvent = (ref, name, flags) => {
|
|
1982
|
+
const elm = getElement(ref);
|
|
1983
|
+
return {
|
|
1984
|
+
emit: (detail) => {
|
|
1985
|
+
if (BUILD16.isDev && !elm.isConnected) {
|
|
1986
|
+
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
1987
|
+
}
|
|
1988
|
+
return emitEvent(elm, name, {
|
|
1989
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1990
|
+
composed: !!(flags & 2 /* Composed */),
|
|
1991
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1992
|
+
detail
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
};
|
|
1997
|
+
var emitEvent = (elm, name, opts) => {
|
|
1998
|
+
const ev = plt.ce(name, opts);
|
|
1999
|
+
elm.dispatchEvent(ev);
|
|
2000
|
+
return ev;
|
|
2001
|
+
};
|
|
2002
|
+
|
|
2003
|
+
// src/runtime/styles.ts
|
|
2004
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
2005
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2006
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2007
|
+
let style = styles.get(scopeId2);
|
|
2008
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
2009
|
+
style = style || new CSSStyleSheet();
|
|
2010
|
+
if (typeof style === "string") {
|
|
2011
|
+
style = cssText;
|
|
2012
|
+
} else {
|
|
2013
|
+
style.replaceSync(cssText);
|
|
2014
|
+
}
|
|
2015
|
+
} else {
|
|
2016
|
+
style = cssText;
|
|
2017
|
+
}
|
|
2018
|
+
styles.set(scopeId2, style);
|
|
2019
|
+
};
|
|
2020
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
2021
|
+
var _a;
|
|
2022
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2023
|
+
const style = styles.get(scopeId2);
|
|
2024
|
+
if (!BUILD17.attachStyles) {
|
|
2025
|
+
return scopeId2;
|
|
2026
|
+
}
|
|
2027
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
2028
|
+
if (style) {
|
|
2029
|
+
if (typeof style === "string") {
|
|
2030
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
2031
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2032
|
+
let styleElm;
|
|
2033
|
+
if (!appliedStyles) {
|
|
2034
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2035
|
+
}
|
|
2036
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2037
|
+
if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2038
|
+
styleElm.innerHTML = style;
|
|
2039
|
+
} else {
|
|
2040
|
+
styleElm = doc.createElement("style");
|
|
2041
|
+
styleElm.innerHTML = style;
|
|
2042
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2043
|
+
if (nonce != null) {
|
|
2044
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2045
|
+
}
|
|
2046
|
+
if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2047
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2048
|
+
}
|
|
2049
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2050
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2051
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2052
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2053
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
2054
|
+
} else if ("host" in styleContainerNode) {
|
|
2055
|
+
if (supportsConstructableStylesheets) {
|
|
2056
|
+
const stylesheet = new CSSStyleSheet();
|
|
2057
|
+
stylesheet.replaceSync(style);
|
|
2058
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
2059
|
+
} else {
|
|
2060
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2061
|
+
if (existingStyleContainer) {
|
|
2062
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2063
|
+
} else {
|
|
2064
|
+
styleContainerNode.prepend(styleElm);
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
} else {
|
|
2068
|
+
styleContainerNode.append(styleElm);
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
2072
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2076
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
2077
|
+
}
|
|
2078
|
+
if (appliedStyles) {
|
|
2079
|
+
appliedStyles.add(scopeId2);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
} else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2083
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
return scopeId2;
|
|
2087
|
+
};
|
|
2088
|
+
var attachStyles = (hostRef) => {
|
|
2089
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2090
|
+
const elm = hostRef.$hostElement$;
|
|
2091
|
+
const flags = cmpMeta.$flags$;
|
|
2092
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2093
|
+
const scopeId2 = addStyle(
|
|
2094
|
+
BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2095
|
+
cmpMeta,
|
|
2096
|
+
hostRef.$modeName$
|
|
2097
|
+
);
|
|
2098
|
+
if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2099
|
+
elm["s-sc"] = scopeId2;
|
|
2100
|
+
elm.classList.add(scopeId2 + "-h");
|
|
2101
|
+
if (BUILD17.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
2102
|
+
elm.classList.add(scopeId2 + "-s");
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
endAttachStyles();
|
|
1650
2106
|
};
|
|
1651
|
-
var
|
|
1652
|
-
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1653
|
-
);
|
|
1654
|
-
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1655
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1656
|
-
);
|
|
2107
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1657
2108
|
|
|
1658
2109
|
// src/runtime/update-component.ts
|
|
1659
2110
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1660
|
-
if (
|
|
2111
|
+
if (BUILD18.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1661
2112
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
1662
2113
|
}
|
|
1663
2114
|
};
|
|
1664
2115
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1665
|
-
if (
|
|
2116
|
+
if (BUILD18.taskQueue && BUILD18.updatable) {
|
|
1666
2117
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1667
2118
|
}
|
|
1668
|
-
if (
|
|
2119
|
+
if (BUILD18.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1669
2120
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1670
2121
|
return;
|
|
1671
2122
|
}
|
|
1672
2123
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1673
2124
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1674
|
-
return
|
|
2125
|
+
return BUILD18.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1675
2126
|
};
|
|
1676
2127
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1677
2128
|
const elm = hostRef.$hostElement$;
|
|
1678
2129
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1679
|
-
const instance =
|
|
2130
|
+
const instance = BUILD18.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1680
2131
|
if (!instance) {
|
|
1681
2132
|
throw new Error(
|
|
1682
2133
|
`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`
|
|
@@ -1684,7 +2135,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1684
2135
|
}
|
|
1685
2136
|
let maybePromise;
|
|
1686
2137
|
if (isInitialLoad) {
|
|
1687
|
-
if (
|
|
2138
|
+
if (BUILD18.lazyLoad && BUILD18.hostListener) {
|
|
1688
2139
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1689
2140
|
if (hostRef.$queuedListeners$) {
|
|
1690
2141
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -1692,17 +2143,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1692
2143
|
}
|
|
1693
2144
|
}
|
|
1694
2145
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
1695
|
-
if (
|
|
2146
|
+
if (BUILD18.cmpWillLoad) {
|
|
1696
2147
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
1697
2148
|
}
|
|
1698
2149
|
} else {
|
|
1699
2150
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
1700
|
-
if (
|
|
2151
|
+
if (BUILD18.cmpWillUpdate) {
|
|
1701
2152
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
1702
2153
|
}
|
|
1703
2154
|
}
|
|
1704
2155
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
1705
|
-
if (
|
|
2156
|
+
if (BUILD18.cmpWillRender) {
|
|
1706
2157
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1707
2158
|
}
|
|
1708
2159
|
endSchedule();
|
|
@@ -1718,23 +2169,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1718
2169
|
const elm = hostRef.$hostElement$;
|
|
1719
2170
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1720
2171
|
const rc = elm["s-rc"];
|
|
1721
|
-
if (
|
|
2172
|
+
if (BUILD18.style && isInitialLoad) {
|
|
1722
2173
|
attachStyles(hostRef);
|
|
1723
2174
|
}
|
|
1724
2175
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1725
|
-
if (
|
|
2176
|
+
if (BUILD18.isDev) {
|
|
1726
2177
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1727
2178
|
}
|
|
1728
|
-
if (
|
|
2179
|
+
if (BUILD18.hydrateServerSide) {
|
|
1729
2180
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
1730
2181
|
} else {
|
|
1731
2182
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1732
2183
|
}
|
|
1733
|
-
if (
|
|
2184
|
+
if (BUILD18.isDev) {
|
|
1734
2185
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
1735
2186
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1736
2187
|
}
|
|
1737
|
-
if (
|
|
2188
|
+
if (BUILD18.hydrateServerSide) {
|
|
1738
2189
|
try {
|
|
1739
2190
|
serverSideConnected(elm);
|
|
1740
2191
|
if (isInitialLoad) {
|
|
@@ -1748,13 +2199,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1748
2199
|
consoleError(e, elm);
|
|
1749
2200
|
}
|
|
1750
2201
|
}
|
|
1751
|
-
if (
|
|
2202
|
+
if (BUILD18.asyncLoading && rc) {
|
|
1752
2203
|
rc.map((cb) => cb());
|
|
1753
2204
|
elm["s-rc"] = void 0;
|
|
1754
2205
|
}
|
|
1755
2206
|
endRender();
|
|
1756
2207
|
endUpdate();
|
|
1757
|
-
if (
|
|
2208
|
+
if (BUILD18.asyncLoading) {
|
|
1758
2209
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1759
2210
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1760
2211
|
if (childrenPromises.length === 0) {
|
|
@@ -1770,10 +2221,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1770
2221
|
};
|
|
1771
2222
|
var renderingRef = null;
|
|
1772
2223
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1773
|
-
const allRenderFn =
|
|
1774
|
-
const lazyLoad =
|
|
1775
|
-
const taskQueue =
|
|
1776
|
-
const updatable =
|
|
2224
|
+
const allRenderFn = BUILD18.allRenderFn ? true : false;
|
|
2225
|
+
const lazyLoad = BUILD18.lazyLoad ? true : false;
|
|
2226
|
+
const taskQueue = BUILD18.taskQueue ? true : false;
|
|
2227
|
+
const updatable = BUILD18.updatable ? true : false;
|
|
1777
2228
|
try {
|
|
1778
2229
|
renderingRef = instance;
|
|
1779
2230
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -1783,9 +2234,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1783
2234
|
if (updatable || lazyLoad) {
|
|
1784
2235
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1785
2236
|
}
|
|
1786
|
-
if (
|
|
1787
|
-
if (
|
|
1788
|
-
if (
|
|
2237
|
+
if (BUILD18.hasRenderFn || BUILD18.reflect) {
|
|
2238
|
+
if (BUILD18.vdomRender || BUILD18.reflect) {
|
|
2239
|
+
if (BUILD18.hydrateServerSide) {
|
|
1789
2240
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
1790
2241
|
} else {
|
|
1791
2242
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -1810,57 +2261,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1810
2261
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1811
2262
|
const elm = hostRef.$hostElement$;
|
|
1812
2263
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1813
|
-
const instance =
|
|
2264
|
+
const instance = BUILD18.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1814
2265
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1815
|
-
if (
|
|
1816
|
-
if (
|
|
2266
|
+
if (BUILD18.cmpDidRender) {
|
|
2267
|
+
if (BUILD18.isDev) {
|
|
1817
2268
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1818
2269
|
}
|
|
1819
2270
|
safeCall(instance, "componentDidRender");
|
|
1820
|
-
if (
|
|
2271
|
+
if (BUILD18.isDev) {
|
|
1821
2272
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1822
2273
|
}
|
|
1823
2274
|
}
|
|
1824
2275
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
1825
2276
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1826
2277
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1827
|
-
if (
|
|
2278
|
+
if (BUILD18.asyncLoading && BUILD18.cssAnnotations) {
|
|
1828
2279
|
addHydratedFlag(elm);
|
|
1829
2280
|
}
|
|
1830
|
-
if (
|
|
1831
|
-
if (
|
|
2281
|
+
if (BUILD18.cmpDidLoad) {
|
|
2282
|
+
if (BUILD18.isDev) {
|
|
1832
2283
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
1833
2284
|
}
|
|
1834
2285
|
safeCall(instance, "componentDidLoad");
|
|
1835
|
-
if (
|
|
2286
|
+
if (BUILD18.isDev) {
|
|
1836
2287
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
1837
2288
|
}
|
|
1838
2289
|
}
|
|
1839
2290
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
1840
2291
|
endPostUpdate();
|
|
1841
|
-
if (
|
|
2292
|
+
if (BUILD18.asyncLoading) {
|
|
1842
2293
|
hostRef.$onReadyResolve$(elm);
|
|
1843
2294
|
if (!ancestorComponent) {
|
|
1844
2295
|
appDidLoad(tagName);
|
|
1845
2296
|
}
|
|
1846
2297
|
}
|
|
1847
2298
|
} else {
|
|
1848
|
-
if (
|
|
1849
|
-
if (
|
|
2299
|
+
if (BUILD18.cmpDidUpdate) {
|
|
2300
|
+
if (BUILD18.isDev) {
|
|
1850
2301
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1851
2302
|
}
|
|
1852
2303
|
safeCall(instance, "componentDidUpdate");
|
|
1853
|
-
if (
|
|
2304
|
+
if (BUILD18.isDev) {
|
|
1854
2305
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1855
2306
|
}
|
|
1856
2307
|
}
|
|
1857
2308
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
1858
2309
|
endPostUpdate();
|
|
1859
2310
|
}
|
|
1860
|
-
if (
|
|
2311
|
+
if (BUILD18.method && BUILD18.lazyLoad) {
|
|
1861
2312
|
hostRef.$onInstanceResolve$(elm);
|
|
1862
2313
|
}
|
|
1863
|
-
if (
|
|
2314
|
+
if (BUILD18.asyncLoading) {
|
|
1864
2315
|
if (hostRef.$onRenderResolve$) {
|
|
1865
2316
|
hostRef.$onRenderResolve$();
|
|
1866
2317
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -1872,7 +2323,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1872
2323
|
}
|
|
1873
2324
|
};
|
|
1874
2325
|
var forceUpdate = (ref) => {
|
|
1875
|
-
if (
|
|
2326
|
+
if (BUILD18.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
1876
2327
|
const hostRef = getHostRef(ref);
|
|
1877
2328
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1878
2329
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -1883,14 +2334,14 @@ var forceUpdate = (ref) => {
|
|
|
1883
2334
|
return false;
|
|
1884
2335
|
};
|
|
1885
2336
|
var appDidLoad = (who) => {
|
|
1886
|
-
if (
|
|
2337
|
+
if (BUILD18.cssAnnotations) {
|
|
1887
2338
|
addHydratedFlag(doc.documentElement);
|
|
1888
2339
|
}
|
|
1889
|
-
if (
|
|
2340
|
+
if (BUILD18.asyncQueue) {
|
|
1890
2341
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
1891
2342
|
}
|
|
1892
2343
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1893
|
-
if (
|
|
2344
|
+
if (BUILD18.profile && performance.measure) {
|
|
1894
2345
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
1895
2346
|
}
|
|
1896
2347
|
};
|
|
@@ -1905,7 +2356,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
1905
2356
|
return void 0;
|
|
1906
2357
|
};
|
|
1907
2358
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
1908
|
-
if (
|
|
2359
|
+
if (BUILD18.lifecycleDOMEvents) {
|
|
1909
2360
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
1910
2361
|
bubbles: true,
|
|
1911
2362
|
composed: true,
|
|
@@ -1917,7 +2368,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
1917
2368
|
};
|
|
1918
2369
|
var addHydratedFlag = (elm) => {
|
|
1919
2370
|
var _a, _b;
|
|
1920
|
-
return
|
|
2371
|
+
return BUILD18.hydratedClass ? elm.classList.add((_a = BUILD18.hydratedSelectorName) != null ? _a : "hydrated") : BUILD18.hydratedAttribute ? elm.setAttribute((_b = BUILD18.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
1921
2372
|
};
|
|
1922
2373
|
var serverSideConnected = (elm) => {
|
|
1923
2374
|
const children = elm.children;
|
|
@@ -1936,21 +2387,21 @@ var serverSideConnected = (elm) => {
|
|
|
1936
2387
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1937
2388
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1938
2389
|
const hostRef = getHostRef(ref);
|
|
1939
|
-
if (
|
|
2390
|
+
if (BUILD19.lazyLoad && !hostRef) {
|
|
1940
2391
|
throw new Error(
|
|
1941
2392
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
|
|
1942
2393
|
);
|
|
1943
2394
|
}
|
|
1944
|
-
const elm =
|
|
2395
|
+
const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
1945
2396
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1946
2397
|
const flags = hostRef.$flags$;
|
|
1947
|
-
const instance =
|
|
2398
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1948
2399
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1949
2400
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1950
2401
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1951
|
-
if ((!
|
|
2402
|
+
if ((!BUILD19.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1952
2403
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1953
|
-
if (
|
|
2404
|
+
if (BUILD19.isDev) {
|
|
1954
2405
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
1955
2406
|
consoleDevWarn(
|
|
1956
2407
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -1973,8 +2424,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1973
2424
|
);
|
|
1974
2425
|
}
|
|
1975
2426
|
}
|
|
1976
|
-
if (!
|
|
1977
|
-
if (
|
|
2427
|
+
if (!BUILD19.lazyLoad || instance) {
|
|
2428
|
+
if (BUILD19.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1978
2429
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1979
2430
|
if (watchMethods) {
|
|
1980
2431
|
watchMethods.map((watchMethodName) => {
|
|
@@ -1986,8 +2437,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1986
2437
|
});
|
|
1987
2438
|
}
|
|
1988
2439
|
}
|
|
1989
|
-
if (
|
|
1990
|
-
if (
|
|
2440
|
+
if (BUILD19.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2441
|
+
if (BUILD19.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
1991
2442
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1992
2443
|
return;
|
|
1993
2444
|
}
|
|
@@ -2002,59 +2453,105 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2002
2453
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2003
2454
|
var _a, _b;
|
|
2004
2455
|
const prototype = Cstr.prototype;
|
|
2005
|
-
if (
|
|
2456
|
+
if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2006
2457
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2007
2458
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2008
2459
|
Object.defineProperty(prototype, cbName, {
|
|
2009
2460
|
value(...args) {
|
|
2010
2461
|
const hostRef = getHostRef(this);
|
|
2011
|
-
const instance =
|
|
2462
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2012
2463
|
if (!instance) {
|
|
2013
2464
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2014
2465
|
const cb = asyncInstance[cbName];
|
|
2015
2466
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2016
2467
|
});
|
|
2017
2468
|
} else {
|
|
2018
|
-
const cb =
|
|
2469
|
+
const cb = BUILD20.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2019
2470
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2020
2471
|
}
|
|
2021
2472
|
}
|
|
2022
2473
|
});
|
|
2023
2474
|
});
|
|
2024
2475
|
}
|
|
2025
|
-
if (
|
|
2026
|
-
if (
|
|
2476
|
+
if (BUILD20.member && cmpMeta.$members$ || BUILD20.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2477
|
+
if (BUILD20.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2027
2478
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2028
2479
|
}
|
|
2029
2480
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2030
2481
|
members.map(([memberName, [memberFlags]]) => {
|
|
2031
|
-
if ((
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2482
|
+
if ((BUILD20.prop || BUILD20.state) && (memberFlags & 31 /* Prop */ || (!BUILD20.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2483
|
+
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2484
|
+
Object.defineProperty(prototype, memberName, {
|
|
2485
|
+
get() {
|
|
2486
|
+
return getValue(this, memberName);
|
|
2487
|
+
},
|
|
2488
|
+
set(newValue) {
|
|
2489
|
+
if (BUILD20.isDev) {
|
|
2490
|
+
const ref = getHostRef(this);
|
|
2491
|
+
if (
|
|
2492
|
+
// we are proxying the instance (not element)
|
|
2493
|
+
(flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
|
|
2494
|
+
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2495
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2496
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2497
|
+
) {
|
|
2498
|
+
consoleDevWarn(
|
|
2499
|
+
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
2048
2500
|
More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
2049
|
-
|
|
2501
|
+
);
|
|
2502
|
+
}
|
|
2050
2503
|
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
})
|
|
2057
|
-
|
|
2504
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2505
|
+
},
|
|
2506
|
+
configurable: true,
|
|
2507
|
+
enumerable: true
|
|
2508
|
+
});
|
|
2509
|
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2510
|
+
if (BUILD20.lazyLoad) {
|
|
2511
|
+
Object.defineProperty(prototype, memberName, {
|
|
2512
|
+
get() {
|
|
2513
|
+
const ref = getHostRef(this);
|
|
2514
|
+
const instance = BUILD20.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2515
|
+
if (!instance) return;
|
|
2516
|
+
return instance[memberName];
|
|
2517
|
+
},
|
|
2518
|
+
configurable: true,
|
|
2519
|
+
enumerable: true
|
|
2520
|
+
});
|
|
2521
|
+
}
|
|
2522
|
+
if (memberFlags & 4096 /* Setter */) {
|
|
2523
|
+
const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
|
|
2524
|
+
Object.defineProperty(prototype, memberName, {
|
|
2525
|
+
set(newValue) {
|
|
2526
|
+
const ref = getHostRef(this);
|
|
2527
|
+
if (origSetter) {
|
|
2528
|
+
const currentValue = ref.$hostElement$[memberName];
|
|
2529
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2530
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2531
|
+
}
|
|
2532
|
+
origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
|
|
2533
|
+
setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
|
|
2534
|
+
return;
|
|
2535
|
+
}
|
|
2536
|
+
if (!ref) return;
|
|
2537
|
+
const setterSetVal = () => {
|
|
2538
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2539
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2540
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2541
|
+
}
|
|
2542
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
2543
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2544
|
+
};
|
|
2545
|
+
if (ref.$lazyInstance$) {
|
|
2546
|
+
setterSetVal();
|
|
2547
|
+
} else {
|
|
2548
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
} else if (BUILD20.lazyLoad && BUILD20.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2058
2555
|
Object.defineProperty(prototype, memberName, {
|
|
2059
2556
|
value(...args) {
|
|
2060
2557
|
var _a2;
|
|
@@ -2067,7 +2564,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2067
2564
|
});
|
|
2068
2565
|
}
|
|
2069
2566
|
});
|
|
2070
|
-
if (
|
|
2567
|
+
if (BUILD20.observeAttribute && (!BUILD20.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2071
2568
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2072
2569
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2073
2570
|
plt.jmp(() => {
|
|
@@ -2083,8 +2580,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2083
2580
|
const hostRef = getHostRef(this);
|
|
2084
2581
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2085
2582
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2086
|
-
const elm =
|
|
2087
|
-
const instance =
|
|
2583
|
+
const elm = BUILD20.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2584
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2088
2585
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2089
2586
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2090
2587
|
if (instance[callbackName] != null) {
|
|
@@ -2094,7 +2591,10 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2094
2591
|
}
|
|
2095
2592
|
return;
|
|
2096
2593
|
}
|
|
2097
|
-
|
|
2594
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2595
|
+
if (!propDesc.get || !!propDesc.set) {
|
|
2596
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2597
|
+
}
|
|
2098
2598
|
});
|
|
2099
2599
|
};
|
|
2100
2600
|
Cstr.observedAttributes = Array.from(
|
|
@@ -2104,7 +2604,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2104
2604
|
var _a2;
|
|
2105
2605
|
const attrName = m[1] || propName;
|
|
2106
2606
|
attrNameToPropName.set(attrName, propName);
|
|
2107
|
-
if (
|
|
2607
|
+
if (BUILD20.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2108
2608
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2109
2609
|
}
|
|
2110
2610
|
return attrName;
|
|
@@ -2122,7 +2622,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2122
2622
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2123
2623
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2124
2624
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2125
|
-
if ((
|
|
2625
|
+
if ((BUILD21.lazyLoad || BUILD21.hydrateClientSide) && bundleId) {
|
|
2126
2626
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2127
2627
|
if (CstrImport && "then" in CstrImport) {
|
|
2128
2628
|
const endLoad = uniqueTime(
|
|
@@ -2137,15 +2637,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2137
2637
|
if (!Cstr) {
|
|
2138
2638
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2139
2639
|
}
|
|
2140
|
-
if (
|
|
2141
|
-
if (
|
|
2640
|
+
if (BUILD21.member && !Cstr.isProxied) {
|
|
2641
|
+
if (BUILD21.watchCallback) {
|
|
2142
2642
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2143
2643
|
}
|
|
2144
2644
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2145
2645
|
Cstr.isProxied = true;
|
|
2146
2646
|
}
|
|
2147
2647
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2148
|
-
if (
|
|
2648
|
+
if (BUILD21.member) {
|
|
2149
2649
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2150
2650
|
}
|
|
2151
2651
|
try {
|
|
@@ -2153,10 +2653,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2153
2653
|
} catch (e) {
|
|
2154
2654
|
consoleError(e);
|
|
2155
2655
|
}
|
|
2156
|
-
if (
|
|
2656
|
+
if (BUILD21.member) {
|
|
2157
2657
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2158
2658
|
}
|
|
2159
|
-
if (
|
|
2659
|
+
if (BUILD21.watchCallback) {
|
|
2160
2660
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2161
2661
|
}
|
|
2162
2662
|
endNewInstance();
|
|
@@ -2166,24 +2666,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2166
2666
|
const cmpTag = elm.localName;
|
|
2167
2667
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2168
2668
|
}
|
|
2169
|
-
if (
|
|
2669
|
+
if (BUILD21.style && Cstr && Cstr.style) {
|
|
2170
2670
|
let style;
|
|
2171
2671
|
if (typeof Cstr.style === "string") {
|
|
2172
2672
|
style = Cstr.style;
|
|
2173
|
-
} else if (
|
|
2673
|
+
} else if (BUILD21.mode && typeof Cstr.style !== "string") {
|
|
2174
2674
|
hostRef.$modeName$ = computeMode(elm);
|
|
2175
2675
|
if (hostRef.$modeName$) {
|
|
2176
2676
|
style = Cstr.style[hostRef.$modeName$];
|
|
2177
2677
|
}
|
|
2178
|
-
if (
|
|
2678
|
+
if (BUILD21.hydrateServerSide && hostRef.$modeName$) {
|
|
2179
2679
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2180
2680
|
}
|
|
2181
2681
|
}
|
|
2182
2682
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2183
2683
|
if (!styles.has(scopeId2)) {
|
|
2184
2684
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2185
|
-
if (!
|
|
2186
|
-
|
|
2685
|
+
if (!BUILD21.hydrateServerSide && BUILD21.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2686
|
+
BUILD21.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2187
2687
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2188
2688
|
}
|
|
2189
2689
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2193,14 +2693,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2193
2693
|
}
|
|
2194
2694
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2195
2695
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2196
|
-
if (
|
|
2696
|
+
if (BUILD21.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2197
2697
|
ancestorComponent["s-rc"].push(schedule);
|
|
2198
2698
|
} else {
|
|
2199
2699
|
schedule();
|
|
2200
2700
|
}
|
|
2201
2701
|
};
|
|
2202
2702
|
var fireConnectedCallback = (instance) => {
|
|
2203
|
-
if (
|
|
2703
|
+
if (BUILD21.lazyLoad && BUILD21.connectedCallback) {
|
|
2204
2704
|
safeCall(instance, "connectedCallback");
|
|
2205
2705
|
}
|
|
2206
2706
|
};
|
|
@@ -2211,38 +2711,41 @@ var connectedCallback = (elm) => {
|
|
|
2211
2711
|
const hostRef = getHostRef(elm);
|
|
2212
2712
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2213
2713
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2214
|
-
if (
|
|
2714
|
+
if (BUILD22.hostListenerTargetParent) {
|
|
2215
2715
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2216
2716
|
}
|
|
2217
2717
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2218
2718
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2219
2719
|
let hostId;
|
|
2220
|
-
if (
|
|
2720
|
+
if (BUILD22.hydrateClientSide) {
|
|
2221
2721
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2222
2722
|
if (hostId) {
|
|
2223
|
-
if (
|
|
2224
|
-
const scopeId2 =
|
|
2723
|
+
if (BUILD22.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2724
|
+
const scopeId2 = BUILD22.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2225
2725
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2726
|
+
} else if (BUILD22.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2727
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD22.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2728
|
+
elm["s-sc"] = scopeId2;
|
|
2226
2729
|
}
|
|
2227
2730
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2228
2731
|
}
|
|
2229
2732
|
}
|
|
2230
|
-
if (
|
|
2231
|
-
if (
|
|
2733
|
+
if (BUILD22.slotRelocation && !hostId) {
|
|
2734
|
+
if (BUILD22.hydrateServerSide || (BUILD22.slot || BUILD22.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2232
2735
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2233
2736
|
setContentReference(elm);
|
|
2234
2737
|
}
|
|
2235
2738
|
}
|
|
2236
|
-
if (
|
|
2739
|
+
if (BUILD22.asyncLoading) {
|
|
2237
2740
|
let ancestorComponent = elm;
|
|
2238
2741
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2239
|
-
if (
|
|
2742
|
+
if (BUILD22.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2240
2743
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2241
2744
|
break;
|
|
2242
2745
|
}
|
|
2243
2746
|
}
|
|
2244
2747
|
}
|
|
2245
|
-
if (
|
|
2748
|
+
if (BUILD22.prop && !BUILD22.hydrateServerSide && cmpMeta.$members$) {
|
|
2246
2749
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2247
2750
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2248
2751
|
const value = elm[memberName];
|
|
@@ -2251,7 +2754,7 @@ var connectedCallback = (elm) => {
|
|
|
2251
2754
|
}
|
|
2252
2755
|
});
|
|
2253
2756
|
}
|
|
2254
|
-
if (
|
|
2757
|
+
if (BUILD22.initializeNextTick) {
|
|
2255
2758
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2256
2759
|
} else {
|
|
2257
2760
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2269,32 +2772,32 @@ var connectedCallback = (elm) => {
|
|
|
2269
2772
|
};
|
|
2270
2773
|
var setContentReference = (elm) => {
|
|
2271
2774
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2272
|
-
|
|
2775
|
+
BUILD22.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2273
2776
|
);
|
|
2274
2777
|
contentRefElm["s-cn"] = true;
|
|
2275
2778
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2276
2779
|
};
|
|
2277
2780
|
|
|
2278
2781
|
// src/runtime/disconnected-callback.ts
|
|
2279
|
-
import { BUILD as
|
|
2782
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2280
2783
|
var disconnectInstance = (instance) => {
|
|
2281
|
-
if (
|
|
2784
|
+
if (BUILD23.lazyLoad && BUILD23.disconnectedCallback) {
|
|
2282
2785
|
safeCall(instance, "disconnectedCallback");
|
|
2283
2786
|
}
|
|
2284
|
-
if (
|
|
2787
|
+
if (BUILD23.cmpDidUnload) {
|
|
2285
2788
|
safeCall(instance, "componentDidUnload");
|
|
2286
2789
|
}
|
|
2287
2790
|
};
|
|
2288
2791
|
var disconnectedCallback = async (elm) => {
|
|
2289
2792
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2290
2793
|
const hostRef = getHostRef(elm);
|
|
2291
|
-
if (
|
|
2794
|
+
if (BUILD23.hostListener) {
|
|
2292
2795
|
if (hostRef.$rmListeners$) {
|
|
2293
2796
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2294
2797
|
hostRef.$rmListeners$ = void 0;
|
|
2295
2798
|
}
|
|
2296
2799
|
}
|
|
2297
|
-
if (!
|
|
2800
|
+
if (!BUILD23.lazyLoad) {
|
|
2298
2801
|
disconnectInstance(elm);
|
|
2299
2802
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2300
2803
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2304,325 +2807,6 @@ var disconnectedCallback = async (elm) => {
|
|
|
2304
2807
|
}
|
|
2305
2808
|
};
|
|
2306
2809
|
|
|
2307
|
-
// src/runtime/dom-extras.ts
|
|
2308
|
-
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2309
|
-
var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
2310
|
-
patchCloneNode(hostElementPrototype);
|
|
2311
|
-
patchSlotAppendChild(hostElementPrototype);
|
|
2312
|
-
patchSlotAppend(hostElementPrototype);
|
|
2313
|
-
patchSlotPrepend(hostElementPrototype);
|
|
2314
|
-
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
2315
|
-
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2316
|
-
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2317
|
-
patchTextContent(hostElementPrototype);
|
|
2318
|
-
patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
|
|
2319
|
-
patchSlotRemoveChild(hostElementPrototype);
|
|
2320
|
-
};
|
|
2321
|
-
var patchCloneNode = (HostElementPrototype) => {
|
|
2322
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2323
|
-
HostElementPrototype.cloneNode = function(deep) {
|
|
2324
|
-
const srcNode = this;
|
|
2325
|
-
const isShadowDom = BUILD23.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2326
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2327
|
-
if (BUILD23.slot && !isShadowDom && deep) {
|
|
2328
|
-
let i2 = 0;
|
|
2329
|
-
let slotted, nonStencilNode;
|
|
2330
|
-
const stencilPrivates = [
|
|
2331
|
-
"s-id",
|
|
2332
|
-
"s-cr",
|
|
2333
|
-
"s-lr",
|
|
2334
|
-
"s-rc",
|
|
2335
|
-
"s-sc",
|
|
2336
|
-
"s-p",
|
|
2337
|
-
"s-cn",
|
|
2338
|
-
"s-sr",
|
|
2339
|
-
"s-sn",
|
|
2340
|
-
"s-hn",
|
|
2341
|
-
"s-ol",
|
|
2342
|
-
"s-nr",
|
|
2343
|
-
"s-si",
|
|
2344
|
-
"s-rf",
|
|
2345
|
-
"s-scs"
|
|
2346
|
-
];
|
|
2347
|
-
for (; i2 < srcNode.childNodes.length; i2++) {
|
|
2348
|
-
slotted = srcNode.childNodes[i2]["s-nr"];
|
|
2349
|
-
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
|
|
2350
|
-
if (slotted) {
|
|
2351
|
-
if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2352
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2353
|
-
} else {
|
|
2354
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
if (nonStencilNode) {
|
|
2358
|
-
clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
return clonedNode;
|
|
2363
|
-
};
|
|
2364
|
-
};
|
|
2365
|
-
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
2366
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2367
|
-
HostElementPrototype.appendChild = function(newChild) {
|
|
2368
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2369
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2370
|
-
if (slotNode) {
|
|
2371
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2372
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2373
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2374
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2375
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2376
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2377
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2378
|
-
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2379
|
-
updateFallbackSlotVisibility(this);
|
|
2380
|
-
return insertedNode;
|
|
2381
|
-
}
|
|
2382
|
-
return this.__appendChild(newChild);
|
|
2383
|
-
};
|
|
2384
|
-
};
|
|
2385
|
-
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
2386
|
-
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2387
|
-
ElementPrototype.removeChild = function(toRemove) {
|
|
2388
|
-
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2389
|
-
const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
|
|
2390
|
-
if (slotNode) {
|
|
2391
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
|
|
2392
|
-
const existingNode = slotChildNodes.find((n) => n === toRemove);
|
|
2393
|
-
if (existingNode) {
|
|
2394
|
-
existingNode.remove();
|
|
2395
|
-
updateFallbackSlotVisibility(this);
|
|
2396
|
-
return;
|
|
2397
|
-
}
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
return this.__removeChild(toRemove);
|
|
2401
|
-
};
|
|
2402
|
-
};
|
|
2403
|
-
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2404
|
-
const originalPrepend = HostElementPrototype.prepend;
|
|
2405
|
-
HostElementPrototype.prepend = function(...newChildren) {
|
|
2406
|
-
newChildren.forEach((newChild) => {
|
|
2407
|
-
if (typeof newChild === "string") {
|
|
2408
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2409
|
-
}
|
|
2410
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2411
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2412
|
-
if (slotNode) {
|
|
2413
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2414
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2415
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2416
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2417
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2418
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2419
|
-
const appendAfter = slotChildNodes[0];
|
|
2420
|
-
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2421
|
-
}
|
|
2422
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
2423
|
-
newChild.hidden = true;
|
|
2424
|
-
}
|
|
2425
|
-
return originalPrepend.call(this, newChild);
|
|
2426
|
-
});
|
|
2427
|
-
};
|
|
2428
|
-
};
|
|
2429
|
-
var patchSlotAppend = (HostElementPrototype) => {
|
|
2430
|
-
HostElementPrototype.append = function(...newChildren) {
|
|
2431
|
-
newChildren.forEach((newChild) => {
|
|
2432
|
-
if (typeof newChild === "string") {
|
|
2433
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2434
|
-
}
|
|
2435
|
-
this.appendChild(newChild);
|
|
2436
|
-
});
|
|
2437
|
-
};
|
|
2438
|
-
};
|
|
2439
|
-
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
2440
|
-
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
2441
|
-
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
2442
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2443
|
-
return originalInsertAdjacentHtml.call(this, position, text);
|
|
2444
|
-
}
|
|
2445
|
-
const container = this.ownerDocument.createElement("_");
|
|
2446
|
-
let node;
|
|
2447
|
-
container.innerHTML = text;
|
|
2448
|
-
if (position === "afterbegin") {
|
|
2449
|
-
while (node = container.firstChild) {
|
|
2450
|
-
this.prepend(node);
|
|
2451
|
-
}
|
|
2452
|
-
} else if (position === "beforeend") {
|
|
2453
|
-
while (node = container.firstChild) {
|
|
2454
|
-
this.append(node);
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
};
|
|
2458
|
-
};
|
|
2459
|
-
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
2460
|
-
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
2461
|
-
this.insertAdjacentHTML(position, text);
|
|
2462
|
-
};
|
|
2463
|
-
};
|
|
2464
|
-
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
2465
|
-
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
2466
|
-
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
2467
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2468
|
-
return originalInsertAdjacentElement.call(this, position, element);
|
|
2469
|
-
}
|
|
2470
|
-
if (position === "afterbegin") {
|
|
2471
|
-
this.prepend(element);
|
|
2472
|
-
return element;
|
|
2473
|
-
} else if (position === "beforeend") {
|
|
2474
|
-
this.append(element);
|
|
2475
|
-
return element;
|
|
2476
|
-
}
|
|
2477
|
-
return element;
|
|
2478
|
-
};
|
|
2479
|
-
};
|
|
2480
|
-
var patchTextContent = (hostElementPrototype) => {
|
|
2481
|
-
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2482
|
-
Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2483
|
-
if (BUILD23.experimentalScopedSlotChanges) {
|
|
2484
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2485
|
-
// To mimic shadow root behavior, we need to return the text content of all
|
|
2486
|
-
// nodes in a slot reference node
|
|
2487
|
-
get() {
|
|
2488
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2489
|
-
const textContent = slotRefNodes.map((node) => {
|
|
2490
|
-
var _a, _b;
|
|
2491
|
-
const text = [];
|
|
2492
|
-
let slotContent = node.nextSibling;
|
|
2493
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2494
|
-
if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
|
|
2495
|
-
text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
|
|
2496
|
-
}
|
|
2497
|
-
slotContent = slotContent.nextSibling;
|
|
2498
|
-
}
|
|
2499
|
-
return text.filter((ref) => ref !== "").join(" ");
|
|
2500
|
-
}).filter((text) => text !== "").join(" ");
|
|
2501
|
-
return " " + textContent + " ";
|
|
2502
|
-
},
|
|
2503
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
2504
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
2505
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
2506
|
-
set(value) {
|
|
2507
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2508
|
-
slotRefNodes.forEach((node) => {
|
|
2509
|
-
let slotContent = node.nextSibling;
|
|
2510
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2511
|
-
const tmp = slotContent;
|
|
2512
|
-
slotContent = slotContent.nextSibling;
|
|
2513
|
-
tmp.remove();
|
|
2514
|
-
}
|
|
2515
|
-
if (node["s-sn"] === "") {
|
|
2516
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
2517
|
-
textNode["s-sn"] = "";
|
|
2518
|
-
insertBefore(node.parentElement, textNode, node.nextSibling);
|
|
2519
|
-
} else {
|
|
2520
|
-
node.remove();
|
|
2521
|
-
}
|
|
2522
|
-
});
|
|
2523
|
-
}
|
|
2524
|
-
});
|
|
2525
|
-
} else {
|
|
2526
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2527
|
-
get() {
|
|
2528
|
-
var _a;
|
|
2529
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2530
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2531
|
-
return slotNode.nextSibling.textContent;
|
|
2532
|
-
} else if (slotNode) {
|
|
2533
|
-
return slotNode.textContent;
|
|
2534
|
-
} else {
|
|
2535
|
-
return this.__textContent;
|
|
2536
|
-
}
|
|
2537
|
-
},
|
|
2538
|
-
set(value) {
|
|
2539
|
-
var _a;
|
|
2540
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2541
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2542
|
-
slotNode.nextSibling.textContent = value;
|
|
2543
|
-
} else if (slotNode) {
|
|
2544
|
-
slotNode.textContent = value;
|
|
2545
|
-
} else {
|
|
2546
|
-
this.__textContent = value;
|
|
2547
|
-
const contentRefElm = this["s-cr"];
|
|
2548
|
-
if (contentRefElm) {
|
|
2549
|
-
insertBefore(this, contentRefElm, this.firstChild);
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2555
|
-
};
|
|
2556
|
-
var patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2557
|
-
class FakeNodeList extends Array {
|
|
2558
|
-
item(n) {
|
|
2559
|
-
return this[n];
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2563
|
-
const childNodesFn = elm.__lookupGetter__("childNodes");
|
|
2564
|
-
Object.defineProperty(elm, "children", {
|
|
2565
|
-
get() {
|
|
2566
|
-
return this.childNodes.map((n) => n.nodeType === 1);
|
|
2567
|
-
}
|
|
2568
|
-
});
|
|
2569
|
-
Object.defineProperty(elm, "childElementCount", {
|
|
2570
|
-
get() {
|
|
2571
|
-
return elm.children.length;
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
Object.defineProperty(elm, "childNodes", {
|
|
2575
|
-
get() {
|
|
2576
|
-
const childNodes = childNodesFn.call(this);
|
|
2577
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
|
|
2578
|
-
const result = new FakeNodeList();
|
|
2579
|
-
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
2580
|
-
const slot = childNodes[i2]["s-nr"];
|
|
2581
|
-
if (slot) {
|
|
2582
|
-
result.push(slot);
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
return result;
|
|
2586
|
-
}
|
|
2587
|
-
return FakeNodeList.from(childNodes);
|
|
2588
|
-
}
|
|
2589
|
-
});
|
|
2590
|
-
}
|
|
2591
|
-
};
|
|
2592
|
-
var getAllChildSlotNodes = (childNodes) => {
|
|
2593
|
-
const slotRefNodes = [];
|
|
2594
|
-
for (const childNode of Array.from(childNodes)) {
|
|
2595
|
-
if (childNode["s-sr"]) {
|
|
2596
|
-
slotRefNodes.push(childNode);
|
|
2597
|
-
}
|
|
2598
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
2599
|
-
}
|
|
2600
|
-
return slotRefNodes;
|
|
2601
|
-
};
|
|
2602
|
-
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
2603
|
-
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
2604
|
-
let i2 = 0;
|
|
2605
|
-
let childNode;
|
|
2606
|
-
for (; i2 < childNodes.length; i2++) {
|
|
2607
|
-
childNode = childNodes[i2];
|
|
2608
|
-
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
2609
|
-
return childNode;
|
|
2610
|
-
}
|
|
2611
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
2612
|
-
if (childNode) {
|
|
2613
|
-
return childNode;
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
return null;
|
|
2617
|
-
};
|
|
2618
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
2619
|
-
const childNodes = [n];
|
|
2620
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
2621
|
-
childNodes.push(n);
|
|
2622
|
-
}
|
|
2623
|
-
return childNodes;
|
|
2624
|
-
};
|
|
2625
|
-
|
|
2626
2810
|
// src/runtime/bootstrap-custom-element.ts
|
|
2627
2811
|
var defineCustomElement = (Cstr, compactMeta) => {
|
|
2628
2812
|
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
@@ -2649,11 +2833,11 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2649
2833
|
}
|
|
2650
2834
|
if (BUILD24.experimentalSlotFixes) {
|
|
2651
2835
|
if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2652
|
-
patchPseudoShadowDom(Cstr.prototype
|
|
2836
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
2653
2837
|
}
|
|
2654
2838
|
} else {
|
|
2655
2839
|
if (BUILD24.slotChildNodesFix) {
|
|
2656
|
-
patchChildSlotNodes(Cstr.prototype
|
|
2840
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
2657
2841
|
}
|
|
2658
2842
|
if (BUILD24.cloneNodeFix) {
|
|
2659
2843
|
patchCloneNode(Cstr.prototype);
|
|
@@ -2667,16 +2851,16 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2667
2851
|
}
|
|
2668
2852
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
2669
2853
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
2670
|
-
let hasHostListenerAttached = false;
|
|
2671
2854
|
Object.assign(Cstr.prototype, {
|
|
2855
|
+
__hasHostListenerAttached: false,
|
|
2672
2856
|
__registerHost() {
|
|
2673
2857
|
registerHost(this, cmpMeta);
|
|
2674
2858
|
},
|
|
2675
2859
|
connectedCallback() {
|
|
2676
|
-
if (!
|
|
2860
|
+
if (!this.__hasHostListenerAttached) {
|
|
2677
2861
|
const hostRef = getHostRef(this);
|
|
2678
2862
|
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
2679
|
-
|
|
2863
|
+
this.__hasHostListenerAttached = true;
|
|
2680
2864
|
}
|
|
2681
2865
|
connectedCallback(this);
|
|
2682
2866
|
if (BUILD24.connectedCallback && originalConnectedCallback) {
|
|
@@ -2859,11 +3043,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2859
3043
|
};
|
|
2860
3044
|
if (BUILD25.experimentalSlotFixes) {
|
|
2861
3045
|
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2862
|
-
patchPseudoShadowDom(HostElement.prototype
|
|
3046
|
+
patchPseudoShadowDom(HostElement.prototype);
|
|
2863
3047
|
}
|
|
2864
3048
|
} else {
|
|
2865
3049
|
if (BUILD25.slotChildNodesFix) {
|
|
2866
|
-
patchChildSlotNodes(HostElement.prototype
|
|
3050
|
+
patchChildSlotNodes(HostElement.prototype);
|
|
2867
3051
|
}
|
|
2868
3052
|
if (BUILD25.cloneNodeFix) {
|
|
2869
3053
|
patchCloneNode(HostElement.prototype);
|
|
@@ -3001,6 +3185,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3001
3185
|
childId = `${hostId}.${nodeId}`;
|
|
3002
3186
|
if (nodeRef.nodeType === 1 /* ElementNode */) {
|
|
3003
3187
|
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3188
|
+
if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
|
|
3189
|
+
nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
|
|
3190
|
+
}
|
|
3004
3191
|
} else if (nodeRef.nodeType === 3 /* TextNode */) {
|
|
3005
3192
|
if (hostId === 0) {
|
|
3006
3193
|
const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
|
|
@@ -3012,6 +3199,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3012
3199
|
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3013
3200
|
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
3014
3201
|
insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
|
|
3202
|
+
} else if (nodeRef.nodeType === 8 /* CommentNode */) {
|
|
3203
|
+
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3204
|
+
commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
|
|
3205
|
+
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
3015
3206
|
}
|
|
3016
3207
|
}
|
|
3017
3208
|
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
@@ -3092,6 +3283,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3092
3283
|
childElm["s-node-id"] = nodeId;
|
|
3093
3284
|
if (childElm.nodeType === 1 /* ElementNode */) {
|
|
3094
3285
|
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3286
|
+
if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
|
|
3287
|
+
childElm.setAttribute("s-sn", childElm["s-sn"]);
|
|
3288
|
+
}
|
|
3095
3289
|
} else if (childElm.nodeType === 3 /* TextNode */) {
|
|
3096
3290
|
const parentNode = childElm.parentNode;
|
|
3097
3291
|
const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
|