@atmgrupomaggioli/iris-button 0.2.0-dev.8 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{index-f786c569.js → index-CHCvKTZA.js} +163 -116
- package/dist/cjs/index-CHCvKTZA.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -7
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/iris-button.cjs.entry.js +18 -20
- package/dist/cjs/iris-button.cjs.entry.js.map +1 -1
- package/dist/cjs/iris-button.cjs.js +8 -7
- package/dist/cjs/iris-button.cjs.js.map +1 -1
- package/dist/cjs/iris-button.entry.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/iris-button/iris-button.css +85 -13
- package/dist/collection/components/iris-button/iris-button.js +36 -16
- package/dist/collection/components/iris-button/iris-button.js.map +1 -1
- package/dist/collection/index.js +1 -10
- package/dist/collection/index.js.map +1 -1
- package/dist/components/index.js +1098 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/iris-button.js +23 -21
- package/dist/components/iris-button.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{index-45a8db1c.js → index-CqbIY27k.js} +161 -94
- package/dist/esm/index-CqbIY27k.js.map +1 -0
- package/dist/esm/index.js +1 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/iris-button.entry.js +18 -18
- package/dist/esm/iris-button.entry.js.map +1 -1
- package/dist/esm/iris-button.js +7 -5
- package/dist/esm/iris-button.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/iris-button/index.esm.js +1 -1
- package/dist/iris-button/index.esm.js.map +1 -1
- package/dist/iris-button/iris-button.css +1 -1
- package/dist/iris-button/iris-button.entry.esm.js.map +1 -0
- package/dist/iris-button/iris-button.esm.js +1 -1
- package/dist/iris-button/iris-button.esm.js.map +1 -1
- package/dist/iris-button/loader.esm.js.map +1 -0
- package/dist/iris-button/p-6aaee13d.entry.js +2 -0
- package/dist/iris-button/p-6aaee13d.entry.js.map +1 -0
- package/dist/iris-button/p-CqbIY27k.js +3 -0
- package/dist/iris-button/p-CqbIY27k.js.map +1 -0
- package/dist/iris-button/p-DQuL1Twl.js +2 -0
- package/dist/iris-button/p-DQuL1Twl.js.map +1 -0
- package/dist/types/components/iris-button/iris-button.d.ts +8 -2
- package/dist/types/components.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/package.json +12 -11
- package/readme.md +0 -1
- package/LICENSE +0 -21
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-f786c569.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/p-913b636c.js +0 -1063
- package/dist/components/p-913b636c.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-45a8db1c.js.map +0 -1
- package/dist/iris-button/p-705a656b.js +0 -3
- package/dist/iris-button/p-705a656b.js.map +0 -1
- package/dist/iris-button/p-cbf16ce7.entry.js +0 -2
- package/dist/iris-button/p-cbf16ce7.entry.js.map +0 -1
- package/dist/iris-button/p-e1255160.js +0 -2
- package/dist/iris-button/p-e1255160.js.map +0 -1
- package/dist/types/utils/utils.d.ts +0 -1
- package/loader/package.json +0 -11
@@ -1,8 +1,8 @@
|
|
1
1
|
const NAMESPACE = 'iris-button';
|
2
|
-
const BUILD = /* iris-button */ {
|
2
|
+
const BUILD = /* iris-button */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
3
3
|
|
4
4
|
/*
|
5
|
-
Stencil Client Platform v4.
|
5
|
+
Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com
|
6
6
|
*/
|
7
7
|
var __defProp = Object.defineProperty;
|
8
8
|
var __export = (target, all) => {
|
@@ -15,10 +15,15 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
15
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
16
16
|
|
17
17
|
// src/client/client-host-ref.ts
|
18
|
-
var
|
19
|
-
|
18
|
+
var getHostRef = (ref) => {
|
19
|
+
if (ref.__stencil__getHostRef) {
|
20
|
+
return ref.__stencil__getHostRef();
|
21
|
+
}
|
22
|
+
return void 0;
|
23
|
+
};
|
20
24
|
var registerInstance = (lazyInstance, hostRef) => {
|
21
|
-
|
25
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
26
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
22
27
|
};
|
23
28
|
var registerHost = (hostElement, cmpMeta) => {
|
24
29
|
const hostRef = {
|
@@ -32,7 +37,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
32
37
|
hostElement["s-p"] = [];
|
33
38
|
hostElement["s-rc"] = [];
|
34
39
|
}
|
35
|
-
const ref =
|
40
|
+
const ref = hostRef;
|
41
|
+
hostElement.__stencil__getHostRef = () => ref;
|
36
42
|
return ref;
|
37
43
|
};
|
38
44
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
@@ -76,7 +82,6 @@ var HYDRATED_STYLE_ID = "sty-id";
|
|
76
82
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
77
83
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
78
84
|
var win = typeof window !== "undefined" ? window : {};
|
79
|
-
var doc = win.document || { head: {} };
|
80
85
|
var plt = {
|
81
86
|
$flags$: 0,
|
82
87
|
$resourcesUrl$: "",
|
@@ -136,9 +141,9 @@ var isComplexType = (o) => {
|
|
136
141
|
};
|
137
142
|
|
138
143
|
// src/utils/query-nonce-meta-tag-content.ts
|
139
|
-
function queryNonceMetaTagContent(
|
144
|
+
function queryNonceMetaTagContent(doc) {
|
140
145
|
var _a, _b, _c;
|
141
|
-
return (_c = (_b = (_a =
|
146
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
142
147
|
}
|
143
148
|
|
144
149
|
// src/utils/result.ts
|
@@ -309,7 +314,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
309
314
|
var _a;
|
310
315
|
const scopeId2 = getScopeId(cmpMeta);
|
311
316
|
const style = styles.get(scopeId2);
|
312
|
-
|
317
|
+
if (!win.document) {
|
318
|
+
return scopeId2;
|
319
|
+
}
|
320
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
313
321
|
if (style) {
|
314
322
|
if (typeof style === "string") {
|
315
323
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
@@ -320,9 +328,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
320
328
|
}
|
321
329
|
if (!appliedStyles.has(scopeId2)) {
|
322
330
|
{
|
323
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) ||
|
331
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
324
332
|
styleElm.innerHTML = style;
|
325
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
333
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
326
334
|
if (nonce != null) {
|
327
335
|
styleElm.setAttribute("nonce", nonce);
|
328
336
|
}
|
@@ -351,7 +359,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
351
359
|
styleContainerNode.append(styleElm);
|
352
360
|
}
|
353
361
|
}
|
354
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */
|
362
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
355
363
|
styleContainerNode.insertBefore(styleElm, null);
|
356
364
|
}
|
357
365
|
}
|
@@ -376,7 +384,7 @@ var attachStyles = (hostRef) => {
|
|
376
384
|
const scopeId2 = addStyle(
|
377
385
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
378
386
|
cmpMeta);
|
379
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
387
|
+
if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
|
380
388
|
elm["s-sc"] = scopeId2;
|
381
389
|
elm.classList.add(scopeId2 + "-h");
|
382
390
|
}
|
@@ -384,68 +392,73 @@ var attachStyles = (hostRef) => {
|
|
384
392
|
};
|
385
393
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
386
394
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
387
|
-
if (oldValue
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
395
|
+
if (oldValue === newValue) {
|
396
|
+
return;
|
397
|
+
}
|
398
|
+
let isProp = isMemberInElement(elm, memberName);
|
399
|
+
let ln = memberName.toLowerCase();
|
400
|
+
if (memberName === "class") {
|
401
|
+
const classList = elm.classList;
|
402
|
+
const oldClasses = parseClassList(oldValue);
|
403
|
+
let newClasses = parseClassList(newValue);
|
404
|
+
{
|
405
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
406
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
407
|
+
}
|
408
|
+
} else if (memberName === "ref") {
|
409
|
+
if (newValue) {
|
410
|
+
newValue(elm);
|
411
|
+
}
|
412
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
413
|
+
if (memberName[2] === "-") {
|
414
|
+
memberName = memberName.slice(3);
|
415
|
+
} else if (isMemberInElement(win, ln)) {
|
416
|
+
memberName = ln.slice(2);
|
417
|
+
} else {
|
418
|
+
memberName = ln[2] + memberName.slice(3);
|
419
|
+
}
|
420
|
+
if (oldValue || newValue) {
|
421
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
422
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
423
|
+
if (oldValue) {
|
424
|
+
plt.rel(elm, memberName, oldValue, capture);
|
405
425
|
}
|
406
|
-
if (
|
407
|
-
|
408
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
409
|
-
if (oldValue) {
|
410
|
-
plt.rel(elm, memberName, oldValue, capture);
|
411
|
-
}
|
412
|
-
if (newValue) {
|
413
|
-
plt.ael(elm, memberName, newValue, capture);
|
414
|
-
}
|
426
|
+
if (newValue) {
|
427
|
+
plt.ael(elm, memberName, newValue, capture);
|
415
428
|
}
|
416
|
-
}
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
429
|
+
}
|
430
|
+
} else {
|
431
|
+
const isComplex = isComplexType(newValue);
|
432
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
433
|
+
try {
|
434
|
+
if (!elm.tagName.includes("-")) {
|
435
|
+
const n = newValue == null ? "" : newValue;
|
436
|
+
if (memberName === "list") {
|
437
|
+
isProp = false;
|
438
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
439
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
440
|
+
elm[memberName] = n;
|
441
|
+
} else {
|
442
|
+
elm.setAttribute(memberName, n);
|
430
443
|
}
|
431
|
-
} else if (elm[memberName] !== newValue) {
|
432
|
-
elm[memberName] = newValue;
|
433
444
|
}
|
434
|
-
}
|
445
|
+
} else if (elm[memberName] !== newValue) {
|
446
|
+
elm[memberName] = newValue;
|
435
447
|
}
|
448
|
+
} catch (e) {
|
436
449
|
}
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
elm.removeAttribute(memberName);
|
441
|
-
}
|
442
|
-
}
|
443
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
444
|
-
newValue = newValue === true ? "" : newValue;
|
450
|
+
}
|
451
|
+
if (newValue == null || newValue === false) {
|
452
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
445
453
|
{
|
446
|
-
elm.
|
454
|
+
elm.removeAttribute(memberName);
|
447
455
|
}
|
448
456
|
}
|
457
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
458
|
+
newValue = newValue === true ? "" : newValue;
|
459
|
+
{
|
460
|
+
elm.setAttribute(memberName, newValue);
|
461
|
+
}
|
449
462
|
}
|
450
463
|
}
|
451
464
|
};
|
@@ -500,7 +513,6 @@ function sortedAttrNames(attrNames) {
|
|
500
513
|
);
|
501
514
|
}
|
502
515
|
var hostTagName;
|
503
|
-
var useNativeShadowDom = false;
|
504
516
|
var isSvgMode = false;
|
505
517
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
506
518
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
@@ -508,14 +520,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
508
520
|
let elm;
|
509
521
|
let childNode;
|
510
522
|
if (newVNode2.$text$ !== null) {
|
511
|
-
elm = newVNode2.$elm$ =
|
523
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
512
524
|
} else {
|
513
525
|
if (!isSvgMode) {
|
514
526
|
isSvgMode = newVNode2.$tag$ === "svg";
|
515
527
|
}
|
516
|
-
|
528
|
+
if (!win.document) {
|
529
|
+
throw new Error(
|
530
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
531
|
+
);
|
532
|
+
}
|
533
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
517
534
|
isSvgMode ? SVG_NS : HTML_NS,
|
518
|
-
|
535
|
+
newVNode2.$tag$
|
519
536
|
) ;
|
520
537
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
521
538
|
isSvgMode = false;
|
@@ -563,6 +580,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
563
580
|
const vnode = vnodes[index];
|
564
581
|
if (vnode) {
|
565
582
|
const elm = vnode.$elm$;
|
583
|
+
nullifyVNodeRefs(vnode);
|
566
584
|
if (elm) {
|
567
585
|
elm.remove();
|
568
586
|
}
|
@@ -651,9 +669,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
651
669
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
652
670
|
}
|
653
671
|
{
|
654
|
-
|
655
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
656
|
-
}
|
672
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
657
673
|
}
|
658
674
|
if (oldChildren !== null && newChildren !== null) {
|
659
675
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
@@ -675,6 +691,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
675
691
|
elm.data = text;
|
676
692
|
}
|
677
693
|
};
|
694
|
+
var nullifyVNodeRefs = (vNode) => {
|
695
|
+
{
|
696
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
697
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
698
|
+
}
|
699
|
+
};
|
678
700
|
var insertBefore = (parent, newNode, reference) => {
|
679
701
|
{
|
680
702
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
@@ -682,7 +704,6 @@ var insertBefore = (parent, newNode, reference) => {
|
|
682
704
|
};
|
683
705
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
684
706
|
const hostElm = hostRef.$hostElement$;
|
685
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
686
707
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
687
708
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
688
709
|
hostTagName = hostElm.tagName;
|
@@ -697,7 +718,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
697
718
|
rootVnode.$flags$ |= 4 /* isHost */;
|
698
719
|
hostRef.$vnode$ = rootVnode;
|
699
720
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
700
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
701
721
|
patch(oldVNode, rootVnode, isInitialLoad);
|
702
722
|
};
|
703
723
|
|
@@ -736,6 +756,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
736
756
|
);
|
737
757
|
}
|
738
758
|
let maybePromise;
|
759
|
+
if (isInitialLoad) {
|
760
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
761
|
+
} else {
|
762
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
763
|
+
}
|
764
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
739
765
|
endSchedule();
|
740
766
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
741
767
|
};
|
@@ -778,7 +804,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
778
804
|
try {
|
779
805
|
instance = instance.render() ;
|
780
806
|
{
|
781
|
-
hostRef.$flags$ &=
|
807
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
782
808
|
}
|
783
809
|
{
|
784
810
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
@@ -799,12 +825,15 @@ var postUpdateComponent = (hostRef) => {
|
|
799
825
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
800
826
|
const elm = hostRef.$hostElement$;
|
801
827
|
const endPostUpdate = createTime("postUpdate", tagName);
|
828
|
+
const instance = hostRef.$lazyInstance$ ;
|
802
829
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
830
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
803
831
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
804
832
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
805
833
|
{
|
806
834
|
addHydratedFlag(elm);
|
807
835
|
}
|
836
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
808
837
|
endPostUpdate();
|
809
838
|
{
|
810
839
|
hostRef.$onReadyResolve$(elm);
|
@@ -813,6 +842,7 @@ var postUpdateComponent = (hostRef) => {
|
|
813
842
|
}
|
814
843
|
}
|
815
844
|
} else {
|
845
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
816
846
|
endPostUpdate();
|
817
847
|
}
|
818
848
|
{
|
@@ -823,15 +853,22 @@ var postUpdateComponent = (hostRef) => {
|
|
823
853
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
824
854
|
nextTick(() => scheduleUpdate(hostRef, false));
|
825
855
|
}
|
826
|
-
hostRef.$flags$ &=
|
856
|
+
hostRef.$flags$ &= -517;
|
827
857
|
}
|
828
858
|
};
|
829
859
|
var appDidLoad = (who) => {
|
830
|
-
{
|
831
|
-
addHydratedFlag(doc.documentElement);
|
832
|
-
}
|
833
860
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
834
861
|
};
|
862
|
+
var safeCall = (instance, method, arg, elm) => {
|
863
|
+
if (instance && instance[method]) {
|
864
|
+
try {
|
865
|
+
return instance[method](arg);
|
866
|
+
} catch (e) {
|
867
|
+
consoleError(e, elm);
|
868
|
+
}
|
869
|
+
}
|
870
|
+
return void 0;
|
871
|
+
};
|
835
872
|
var addHydratedFlag = (elm) => {
|
836
873
|
var _a;
|
837
874
|
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
@@ -843,7 +880,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
843
880
|
const hostRef = getHostRef(ref);
|
844
881
|
if (!hostRef) {
|
845
882
|
throw new Error(
|
846
|
-
`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/
|
883
|
+
`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/stenciljs/core/issues/5457).`
|
847
884
|
);
|
848
885
|
}
|
849
886
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
@@ -856,6 +893,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
856
893
|
hostRef.$instanceValues$.set(propName, newVal);
|
857
894
|
if (instance) {
|
858
895
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
896
|
+
if (instance.componentShouldUpdate) {
|
897
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
898
|
+
return;
|
899
|
+
}
|
900
|
+
}
|
859
901
|
scheduleUpdate(hostRef, false);
|
860
902
|
}
|
861
903
|
}
|
@@ -866,7 +908,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
866
908
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
867
909
|
var _a, _b;
|
868
910
|
const prototype = Cstr.prototype;
|
869
|
-
if (cmpMeta.$members$ || BUILD.watchCallback
|
911
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
870
912
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
871
913
|
members.map(([memberName, [memberFlags]]) => {
|
872
914
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
@@ -988,7 +1030,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
988
1030
|
let Cstr;
|
989
1031
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
990
1032
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
991
|
-
|
1033
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
1034
|
+
if (bundleId) {
|
992
1035
|
const CstrImport = loadModule(cmpMeta, hostRef);
|
993
1036
|
if (CstrImport && "then" in CstrImport) {
|
994
1037
|
const endLoad = uniqueTime();
|
@@ -1014,9 +1057,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1014
1057
|
consoleError(e, elm);
|
1015
1058
|
}
|
1016
1059
|
{
|
1017
|
-
hostRef.$flags$ &=
|
1060
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
1018
1061
|
}
|
1019
1062
|
endNewInstance();
|
1063
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
1064
|
+
} else {
|
1065
|
+
Cstr = elm.constructor;
|
1066
|
+
const cmpTag = elm.localName;
|
1067
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
1020
1068
|
}
|
1021
1069
|
if (Cstr && Cstr.style) {
|
1022
1070
|
let style;
|
@@ -1040,6 +1088,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1040
1088
|
}
|
1041
1089
|
};
|
1042
1090
|
var fireConnectedCallback = (instance, elm) => {
|
1091
|
+
{
|
1092
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
1093
|
+
}
|
1043
1094
|
};
|
1044
1095
|
|
1045
1096
|
// src/runtime/connected-callback.ts
|
@@ -1072,20 +1123,27 @@ var connectedCallback = (elm) => {
|
|
1072
1123
|
initializeComponent(elm, hostRef, cmpMeta);
|
1073
1124
|
}
|
1074
1125
|
} else {
|
1075
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
1076
|
-
hostRef.$
|
1126
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
1127
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
1128
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
1129
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
1077
1130
|
}
|
1078
1131
|
}
|
1079
1132
|
endConnected();
|
1080
1133
|
}
|
1081
1134
|
};
|
1082
1135
|
var disconnectInstance = (instance, elm) => {
|
1136
|
+
{
|
1137
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
1138
|
+
}
|
1083
1139
|
};
|
1084
1140
|
var disconnectedCallback = async (elm) => {
|
1085
1141
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1086
1142
|
const hostRef = getHostRef(elm);
|
1087
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
1088
|
-
hostRef.$
|
1143
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
1144
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
1145
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
1146
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
1089
1147
|
}
|
1090
1148
|
}
|
1091
1149
|
if (rootAppliedStyles.has(elm)) {
|
@@ -1099,18 +1157,22 @@ var disconnectedCallback = async (elm) => {
|
|
1099
1157
|
// src/runtime/bootstrap-lazy.ts
|
1100
1158
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
1101
1159
|
var _a;
|
1160
|
+
if (!win.document) {
|
1161
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
1162
|
+
return;
|
1163
|
+
}
|
1102
1164
|
const endBootstrap = createTime();
|
1103
1165
|
const cmpTags = [];
|
1104
1166
|
const exclude = options.exclude || [];
|
1105
1167
|
const customElements2 = win.customElements;
|
1106
|
-
const head =
|
1168
|
+
const head = win.document.head;
|
1107
1169
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
1108
|
-
const dataStyles = /* @__PURE__ */
|
1170
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
1109
1171
|
const deferredConnectedCallbacks = [];
|
1110
1172
|
let appLoadFallback;
|
1111
1173
|
let isBootstrapping = true;
|
1112
1174
|
Object.assign(plt, options);
|
1113
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
1175
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
1114
1176
|
let hasSlotRelocation = false;
|
1115
1177
|
lazyBundles.map((lazyBundle) => {
|
1116
1178
|
lazyBundle[1].map((compactMeta) => {
|
@@ -1170,6 +1232,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1170
1232
|
plt.raf(() => {
|
1171
1233
|
var _a3;
|
1172
1234
|
const hostRef = getHostRef(this);
|
1235
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
1236
|
+
if (i2 > -1) {
|
1237
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
1238
|
+
}
|
1173
1239
|
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
1174
1240
|
delete hostRef.$vnode$.$elm$;
|
1175
1241
|
}
|
@@ -1198,7 +1264,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1198
1264
|
}
|
1199
1265
|
if (dataStyles.innerHTML.length) {
|
1200
1266
|
dataStyles.setAttribute("data-styles", "");
|
1201
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
1267
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
1202
1268
|
if (nonce != null) {
|
1203
1269
|
dataStyles.setAttribute("nonce", nonce);
|
1204
1270
|
}
|
@@ -1220,5 +1286,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1220
1286
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
1221
1287
|
|
1222
1288
|
export { bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
1289
|
+
//# sourceMappingURL=index-CqbIY27k.js.map
|
1223
1290
|
|
1224
|
-
//# sourceMappingURL=index-
|
1291
|
+
//# sourceMappingURL=index-CqbIY27k.js.map
|