@atmgrupomaggioli/iris-button 0.2.0-dev.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +9 -5
- 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
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app-globals-V2Kpy_OQ.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\n"],"names":[],"mappings":";;AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}
|
@@ -1,30 +1,10 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
function _interopNamespace(e) {
|
4
|
-
if (e && e.__esModule) return e;
|
5
|
-
var n = Object.create(null);
|
6
|
-
if (e) {
|
7
|
-
Object.keys(e).forEach(function (k) {
|
8
|
-
if (k !== 'default') {
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
11
|
-
enumerable: true,
|
12
|
-
get: function () {
|
13
|
-
return e[k];
|
14
|
-
}
|
15
|
-
});
|
16
|
-
}
|
17
|
-
});
|
18
|
-
}
|
19
|
-
n['default'] = e;
|
20
|
-
return Object.freeze(n);
|
21
|
-
}
|
22
|
-
|
23
3
|
const NAMESPACE = 'iris-button';
|
24
|
-
const BUILD = /* iris-button */ {
|
4
|
+
const BUILD = /* iris-button */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
25
5
|
|
26
6
|
/*
|
27
|
-
Stencil Client Platform v4.
|
7
|
+
Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com
|
28
8
|
*/
|
29
9
|
var __defProp = Object.defineProperty;
|
30
10
|
var __export = (target, all) => {
|
@@ -37,10 +17,15 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
37
17
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
38
18
|
|
39
19
|
// src/client/client-host-ref.ts
|
40
|
-
var
|
41
|
-
|
20
|
+
var getHostRef = (ref) => {
|
21
|
+
if (ref.__stencil__getHostRef) {
|
22
|
+
return ref.__stencil__getHostRef();
|
23
|
+
}
|
24
|
+
return void 0;
|
25
|
+
};
|
42
26
|
var registerInstance = (lazyInstance, hostRef) => {
|
43
|
-
|
27
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
28
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
44
29
|
};
|
45
30
|
var registerHost = (hostElement, cmpMeta) => {
|
46
31
|
const hostRef = {
|
@@ -54,7 +39,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
54
39
|
hostElement["s-p"] = [];
|
55
40
|
hostElement["s-rc"] = [];
|
56
41
|
}
|
57
|
-
const ref =
|
42
|
+
const ref = hostRef;
|
43
|
+
hostElement.__stencil__getHostRef = () => ref;
|
58
44
|
return ref;
|
59
45
|
};
|
60
46
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
@@ -73,13 +59,13 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
73
59
|
return module[exportName];
|
74
60
|
}
|
75
61
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
76
|
-
return
|
62
|
+
return import(
|
77
63
|
/* @vite-ignore */
|
78
64
|
/* webpackInclude: /\.entry\.js$/ */
|
79
65
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
80
66
|
/* webpackMode: "lazy" */
|
81
67
|
`./${bundleId}.entry.js${""}`
|
82
|
-
)
|
68
|
+
).then(
|
83
69
|
(importedModule) => {
|
84
70
|
{
|
85
71
|
cmpModules.set(bundleId, importedModule);
|
@@ -98,7 +84,6 @@ var HYDRATED_STYLE_ID = "sty-id";
|
|
98
84
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
99
85
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
100
86
|
var win = typeof window !== "undefined" ? window : {};
|
101
|
-
var doc = win.document || { head: {} };
|
102
87
|
var plt = {
|
103
88
|
$flags$: 0,
|
104
89
|
$resourcesUrl$: "",
|
@@ -158,9 +143,9 @@ var isComplexType = (o) => {
|
|
158
143
|
};
|
159
144
|
|
160
145
|
// src/utils/query-nonce-meta-tag-content.ts
|
161
|
-
function queryNonceMetaTagContent(
|
146
|
+
function queryNonceMetaTagContent(doc) {
|
162
147
|
var _a, _b, _c;
|
163
|
-
return (_c = (_b = (_a =
|
148
|
+
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;
|
164
149
|
}
|
165
150
|
|
166
151
|
// src/utils/result.ts
|
@@ -331,7 +316,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
331
316
|
var _a;
|
332
317
|
const scopeId2 = getScopeId(cmpMeta);
|
333
318
|
const style = styles.get(scopeId2);
|
334
|
-
|
319
|
+
if (!win.document) {
|
320
|
+
return scopeId2;
|
321
|
+
}
|
322
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
335
323
|
if (style) {
|
336
324
|
if (typeof style === "string") {
|
337
325
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
@@ -342,9 +330,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
342
330
|
}
|
343
331
|
if (!appliedStyles.has(scopeId2)) {
|
344
332
|
{
|
345
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) ||
|
333
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
346
334
|
styleElm.innerHTML = style;
|
347
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
335
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
348
336
|
if (nonce != null) {
|
349
337
|
styleElm.setAttribute("nonce", nonce);
|
350
338
|
}
|
@@ -373,7 +361,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
373
361
|
styleContainerNode.append(styleElm);
|
374
362
|
}
|
375
363
|
}
|
376
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */
|
364
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
377
365
|
styleContainerNode.insertBefore(styleElm, null);
|
378
366
|
}
|
379
367
|
}
|
@@ -398,7 +386,7 @@ var attachStyles = (hostRef) => {
|
|
398
386
|
const scopeId2 = addStyle(
|
399
387
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
400
388
|
cmpMeta);
|
401
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
389
|
+
if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
|
402
390
|
elm["s-sc"] = scopeId2;
|
403
391
|
elm.classList.add(scopeId2 + "-h");
|
404
392
|
}
|
@@ -406,68 +394,73 @@ var attachStyles = (hostRef) => {
|
|
406
394
|
};
|
407
395
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
408
396
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
409
|
-
if (oldValue
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
397
|
+
if (oldValue === newValue) {
|
398
|
+
return;
|
399
|
+
}
|
400
|
+
let isProp = isMemberInElement(elm, memberName);
|
401
|
+
let ln = memberName.toLowerCase();
|
402
|
+
if (memberName === "class") {
|
403
|
+
const classList = elm.classList;
|
404
|
+
const oldClasses = parseClassList(oldValue);
|
405
|
+
let newClasses = parseClassList(newValue);
|
406
|
+
{
|
407
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
408
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
409
|
+
}
|
410
|
+
} else if (memberName === "ref") {
|
411
|
+
if (newValue) {
|
412
|
+
newValue(elm);
|
413
|
+
}
|
414
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
415
|
+
if (memberName[2] === "-") {
|
416
|
+
memberName = memberName.slice(3);
|
417
|
+
} else if (isMemberInElement(win, ln)) {
|
418
|
+
memberName = ln.slice(2);
|
419
|
+
} else {
|
420
|
+
memberName = ln[2] + memberName.slice(3);
|
421
|
+
}
|
422
|
+
if (oldValue || newValue) {
|
423
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
424
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
425
|
+
if (oldValue) {
|
426
|
+
plt.rel(elm, memberName, oldValue, capture);
|
427
427
|
}
|
428
|
-
if (
|
429
|
-
|
430
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
431
|
-
if (oldValue) {
|
432
|
-
plt.rel(elm, memberName, oldValue, capture);
|
433
|
-
}
|
434
|
-
if (newValue) {
|
435
|
-
plt.ael(elm, memberName, newValue, capture);
|
436
|
-
}
|
428
|
+
if (newValue) {
|
429
|
+
plt.ael(elm, memberName, newValue, capture);
|
437
430
|
}
|
438
|
-
}
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
431
|
+
}
|
432
|
+
} else {
|
433
|
+
const isComplex = isComplexType(newValue);
|
434
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
435
|
+
try {
|
436
|
+
if (!elm.tagName.includes("-")) {
|
437
|
+
const n = newValue == null ? "" : newValue;
|
438
|
+
if (memberName === "list") {
|
439
|
+
isProp = false;
|
440
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
441
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
442
|
+
elm[memberName] = n;
|
443
|
+
} else {
|
444
|
+
elm.setAttribute(memberName, n);
|
452
445
|
}
|
453
|
-
} else if (elm[memberName] !== newValue) {
|
454
|
-
elm[memberName] = newValue;
|
455
446
|
}
|
456
|
-
}
|
447
|
+
} else if (elm[memberName] !== newValue) {
|
448
|
+
elm[memberName] = newValue;
|
457
449
|
}
|
450
|
+
} catch (e) {
|
458
451
|
}
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
elm.removeAttribute(memberName);
|
463
|
-
}
|
464
|
-
}
|
465
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
466
|
-
newValue = newValue === true ? "" : newValue;
|
452
|
+
}
|
453
|
+
if (newValue == null || newValue === false) {
|
454
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
467
455
|
{
|
468
|
-
elm.
|
456
|
+
elm.removeAttribute(memberName);
|
469
457
|
}
|
470
458
|
}
|
459
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
460
|
+
newValue = newValue === true ? "" : newValue;
|
461
|
+
{
|
462
|
+
elm.setAttribute(memberName, newValue);
|
463
|
+
}
|
471
464
|
}
|
472
465
|
}
|
473
466
|
};
|
@@ -522,7 +515,6 @@ function sortedAttrNames(attrNames) {
|
|
522
515
|
);
|
523
516
|
}
|
524
517
|
var hostTagName;
|
525
|
-
var useNativeShadowDom = false;
|
526
518
|
var isSvgMode = false;
|
527
519
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
528
520
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
@@ -530,14 +522,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
530
522
|
let elm;
|
531
523
|
let childNode;
|
532
524
|
if (newVNode2.$text$ !== null) {
|
533
|
-
elm = newVNode2.$elm$ =
|
525
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
534
526
|
} else {
|
535
527
|
if (!isSvgMode) {
|
536
528
|
isSvgMode = newVNode2.$tag$ === "svg";
|
537
529
|
}
|
538
|
-
|
530
|
+
if (!win.document) {
|
531
|
+
throw new Error(
|
532
|
+
"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."
|
533
|
+
);
|
534
|
+
}
|
535
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
539
536
|
isSvgMode ? SVG_NS : HTML_NS,
|
540
|
-
|
537
|
+
newVNode2.$tag$
|
541
538
|
) ;
|
542
539
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
543
540
|
isSvgMode = false;
|
@@ -585,6 +582,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
585
582
|
const vnode = vnodes[index];
|
586
583
|
if (vnode) {
|
587
584
|
const elm = vnode.$elm$;
|
585
|
+
nullifyVNodeRefs(vnode);
|
588
586
|
if (elm) {
|
589
587
|
elm.remove();
|
590
588
|
}
|
@@ -673,9 +671,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
673
671
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
674
672
|
}
|
675
673
|
{
|
676
|
-
|
677
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
678
|
-
}
|
674
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
679
675
|
}
|
680
676
|
if (oldChildren !== null && newChildren !== null) {
|
681
677
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
@@ -697,6 +693,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
697
693
|
elm.data = text;
|
698
694
|
}
|
699
695
|
};
|
696
|
+
var nullifyVNodeRefs = (vNode) => {
|
697
|
+
{
|
698
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
699
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
700
|
+
}
|
701
|
+
};
|
700
702
|
var insertBefore = (parent, newNode, reference) => {
|
701
703
|
{
|
702
704
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
@@ -704,7 +706,6 @@ var insertBefore = (parent, newNode, reference) => {
|
|
704
706
|
};
|
705
707
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
706
708
|
const hostElm = hostRef.$hostElement$;
|
707
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
708
709
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
709
710
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
710
711
|
hostTagName = hostElm.tagName;
|
@@ -719,7 +720,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
719
720
|
rootVnode.$flags$ |= 4 /* isHost */;
|
720
721
|
hostRef.$vnode$ = rootVnode;
|
721
722
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
722
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
723
723
|
patch(oldVNode, rootVnode, isInitialLoad);
|
724
724
|
};
|
725
725
|
|
@@ -758,6 +758,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
758
758
|
);
|
759
759
|
}
|
760
760
|
let maybePromise;
|
761
|
+
if (isInitialLoad) {
|
762
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
763
|
+
} else {
|
764
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
765
|
+
}
|
766
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
761
767
|
endSchedule();
|
762
768
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
763
769
|
};
|
@@ -800,7 +806,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
800
806
|
try {
|
801
807
|
instance = instance.render() ;
|
802
808
|
{
|
803
|
-
hostRef.$flags$ &=
|
809
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
804
810
|
}
|
805
811
|
{
|
806
812
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
@@ -821,12 +827,15 @@ var postUpdateComponent = (hostRef) => {
|
|
821
827
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
822
828
|
const elm = hostRef.$hostElement$;
|
823
829
|
const endPostUpdate = createTime("postUpdate", tagName);
|
830
|
+
const instance = hostRef.$lazyInstance$ ;
|
824
831
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
832
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
825
833
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
826
834
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
827
835
|
{
|
828
836
|
addHydratedFlag(elm);
|
829
837
|
}
|
838
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
830
839
|
endPostUpdate();
|
831
840
|
{
|
832
841
|
hostRef.$onReadyResolve$(elm);
|
@@ -835,6 +844,7 @@ var postUpdateComponent = (hostRef) => {
|
|
835
844
|
}
|
836
845
|
}
|
837
846
|
} else {
|
847
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
838
848
|
endPostUpdate();
|
839
849
|
}
|
840
850
|
{
|
@@ -845,15 +855,22 @@ var postUpdateComponent = (hostRef) => {
|
|
845
855
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
846
856
|
nextTick(() => scheduleUpdate(hostRef, false));
|
847
857
|
}
|
848
|
-
hostRef.$flags$ &=
|
858
|
+
hostRef.$flags$ &= -517;
|
849
859
|
}
|
850
860
|
};
|
851
861
|
var appDidLoad = (who) => {
|
852
|
-
{
|
853
|
-
addHydratedFlag(doc.documentElement);
|
854
|
-
}
|
855
862
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
856
863
|
};
|
864
|
+
var safeCall = (instance, method, arg, elm) => {
|
865
|
+
if (instance && instance[method]) {
|
866
|
+
try {
|
867
|
+
return instance[method](arg);
|
868
|
+
} catch (e) {
|
869
|
+
consoleError(e, elm);
|
870
|
+
}
|
871
|
+
}
|
872
|
+
return void 0;
|
873
|
+
};
|
857
874
|
var addHydratedFlag = (elm) => {
|
858
875
|
var _a;
|
859
876
|
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
@@ -865,7 +882,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
865
882
|
const hostRef = getHostRef(ref);
|
866
883
|
if (!hostRef) {
|
867
884
|
throw new Error(
|
868
|
-
`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/
|
885
|
+
`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).`
|
869
886
|
);
|
870
887
|
}
|
871
888
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
@@ -878,6 +895,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
878
895
|
hostRef.$instanceValues$.set(propName, newVal);
|
879
896
|
if (instance) {
|
880
897
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
898
|
+
if (instance.componentShouldUpdate) {
|
899
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
900
|
+
return;
|
901
|
+
}
|
902
|
+
}
|
881
903
|
scheduleUpdate(hostRef, false);
|
882
904
|
}
|
883
905
|
}
|
@@ -888,7 +910,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
888
910
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
889
911
|
var _a, _b;
|
890
912
|
const prototype = Cstr.prototype;
|
891
|
-
if (cmpMeta.$members$ || BUILD.watchCallback
|
913
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
892
914
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
893
915
|
members.map(([memberName, [memberFlags]]) => {
|
894
916
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
@@ -1010,7 +1032,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1010
1032
|
let Cstr;
|
1011
1033
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
1012
1034
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1013
|
-
|
1035
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
1036
|
+
if (bundleId) {
|
1014
1037
|
const CstrImport = loadModule(cmpMeta, hostRef);
|
1015
1038
|
if (CstrImport && "then" in CstrImport) {
|
1016
1039
|
const endLoad = uniqueTime();
|
@@ -1036,9 +1059,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1036
1059
|
consoleError(e, elm);
|
1037
1060
|
}
|
1038
1061
|
{
|
1039
|
-
hostRef.$flags$ &=
|
1062
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
1040
1063
|
}
|
1041
1064
|
endNewInstance();
|
1065
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
1066
|
+
} else {
|
1067
|
+
Cstr = elm.constructor;
|
1068
|
+
const cmpTag = elm.localName;
|
1069
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
1042
1070
|
}
|
1043
1071
|
if (Cstr && Cstr.style) {
|
1044
1072
|
let style;
|
@@ -1062,6 +1090,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1062
1090
|
}
|
1063
1091
|
};
|
1064
1092
|
var fireConnectedCallback = (instance, elm) => {
|
1093
|
+
{
|
1094
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
1095
|
+
}
|
1065
1096
|
};
|
1066
1097
|
|
1067
1098
|
// src/runtime/connected-callback.ts
|
@@ -1094,20 +1125,27 @@ var connectedCallback = (elm) => {
|
|
1094
1125
|
initializeComponent(elm, hostRef, cmpMeta);
|
1095
1126
|
}
|
1096
1127
|
} else {
|
1097
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
1098
|
-
hostRef.$
|
1128
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
1129
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
1130
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
1131
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
1099
1132
|
}
|
1100
1133
|
}
|
1101
1134
|
endConnected();
|
1102
1135
|
}
|
1103
1136
|
};
|
1104
1137
|
var disconnectInstance = (instance, elm) => {
|
1138
|
+
{
|
1139
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
1140
|
+
}
|
1105
1141
|
};
|
1106
1142
|
var disconnectedCallback = async (elm) => {
|
1107
1143
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1108
1144
|
const hostRef = getHostRef(elm);
|
1109
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
1110
|
-
hostRef.$
|
1145
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
1146
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
1147
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
1148
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
1111
1149
|
}
|
1112
1150
|
}
|
1113
1151
|
if (rootAppliedStyles.has(elm)) {
|
@@ -1121,18 +1159,22 @@ var disconnectedCallback = async (elm) => {
|
|
1121
1159
|
// src/runtime/bootstrap-lazy.ts
|
1122
1160
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
1123
1161
|
var _a;
|
1162
|
+
if (!win.document) {
|
1163
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
1164
|
+
return;
|
1165
|
+
}
|
1124
1166
|
const endBootstrap = createTime();
|
1125
1167
|
const cmpTags = [];
|
1126
1168
|
const exclude = options.exclude || [];
|
1127
1169
|
const customElements2 = win.customElements;
|
1128
|
-
const head =
|
1170
|
+
const head = win.document.head;
|
1129
1171
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
1130
|
-
const dataStyles = /* @__PURE__ */
|
1172
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
1131
1173
|
const deferredConnectedCallbacks = [];
|
1132
1174
|
let appLoadFallback;
|
1133
1175
|
let isBootstrapping = true;
|
1134
1176
|
Object.assign(plt, options);
|
1135
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
1177
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
1136
1178
|
let hasSlotRelocation = false;
|
1137
1179
|
lazyBundles.map((lazyBundle) => {
|
1138
1180
|
lazyBundle[1].map((compactMeta) => {
|
@@ -1192,6 +1234,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1192
1234
|
plt.raf(() => {
|
1193
1235
|
var _a3;
|
1194
1236
|
const hostRef = getHostRef(this);
|
1237
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
1238
|
+
if (i2 > -1) {
|
1239
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
1240
|
+
}
|
1195
1241
|
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
1196
1242
|
delete hostRef.$vnode$.$elm$;
|
1197
1243
|
}
|
@@ -1220,7 +1266,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1220
1266
|
}
|
1221
1267
|
if (dataStyles.innerHTML.length) {
|
1222
1268
|
dataStyles.setAttribute("data-styles", "");
|
1223
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
1269
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
1224
1270
|
if (nonce != null) {
|
1225
1271
|
dataStyles.setAttribute("nonce", nonce);
|
1226
1272
|
}
|
@@ -1247,5 +1293,6 @@ exports.h = h;
|
|
1247
1293
|
exports.promiseResolve = promiseResolve;
|
1248
1294
|
exports.registerInstance = registerInstance;
|
1249
1295
|
exports.setNonce = setNonce;
|
1296
|
+
//# sourceMappingURL=index-CHCvKTZA.js.map
|
1250
1297
|
|
1251
|
-
//# sourceMappingURL=index-
|
1298
|
+
//# sourceMappingURL=index-CHCvKTZA.js.map
|