@atmgrupomaggioli/iris-button 0.2.0-dev.8 → 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.
Files changed (73) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  3. package/dist/cjs/{index-f786c569.js → index-CHCvKTZA.js} +163 -116
  4. package/dist/cjs/index-CHCvKTZA.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +1 -7
  6. package/dist/cjs/index.cjs.js.map +1 -1
  7. package/dist/cjs/iris-button.cjs.entry.js +18 -20
  8. package/dist/cjs/iris-button.cjs.entry.js.map +1 -1
  9. package/dist/cjs/iris-button.cjs.js +8 -7
  10. package/dist/cjs/iris-button.cjs.js.map +1 -1
  11. package/dist/cjs/iris-button.entry.cjs.js.map +1 -0
  12. package/dist/cjs/loader.cjs.js +4 -5
  13. package/dist/cjs/loader.cjs.js.map +1 -1
  14. package/dist/collection/collection-manifest.json +1 -1
  15. package/dist/collection/components/iris-button/iris-button.css +85 -13
  16. package/dist/collection/components/iris-button/iris-button.js +36 -16
  17. package/dist/collection/components/iris-button/iris-button.js.map +1 -1
  18. package/dist/collection/index.js +1 -10
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/components/index.js +1098 -4
  21. package/dist/components/index.js.map +1 -1
  22. package/dist/components/iris-button.js +23 -21
  23. package/dist/components/iris-button.js.map +1 -1
  24. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  25. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  26. package/dist/esm/{index-45a8db1c.js → index-CqbIY27k.js} +161 -94
  27. package/dist/esm/index-CqbIY27k.js.map +1 -0
  28. package/dist/esm/index.js +1 -4
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/iris-button.entry.js +18 -18
  31. package/dist/esm/iris-button.entry.js.map +1 -1
  32. package/dist/esm/iris-button.js +7 -5
  33. package/dist/esm/iris-button.js.map +1 -1
  34. package/dist/esm/loader.js +5 -4
  35. package/dist/esm/loader.js.map +1 -1
  36. package/dist/iris-button/index.esm.js +1 -1
  37. package/dist/iris-button/index.esm.js.map +1 -1
  38. package/dist/iris-button/iris-button.css +1 -1
  39. package/dist/iris-button/iris-button.entry.esm.js.map +1 -0
  40. package/dist/iris-button/iris-button.esm.js +1 -1
  41. package/dist/iris-button/iris-button.esm.js.map +1 -1
  42. package/dist/iris-button/loader.esm.js.map +1 -0
  43. package/dist/iris-button/p-6aaee13d.entry.js +2 -0
  44. package/dist/iris-button/p-6aaee13d.entry.js.map +1 -0
  45. package/dist/iris-button/p-CqbIY27k.js +3 -0
  46. package/dist/iris-button/p-CqbIY27k.js.map +1 -0
  47. package/dist/iris-button/p-DQuL1Twl.js +2 -0
  48. package/dist/iris-button/p-DQuL1Twl.js.map +1 -0
  49. package/dist/types/components/iris-button/iris-button.d.ts +8 -2
  50. package/dist/types/components.d.ts +8 -0
  51. package/dist/types/index.d.ts +1 -1
  52. package/dist/types/stencil-public-runtime.d.ts +1 -0
  53. package/package.json +9 -5
  54. package/readme.md +0 -1
  55. package/LICENSE +0 -21
  56. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  57. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  58. package/dist/cjs/index-f786c569.js.map +0 -1
  59. package/dist/collection/utils/utils.js +0 -4
  60. package/dist/collection/utils/utils.js.map +0 -1
  61. package/dist/components/p-913b636c.js +0 -1063
  62. package/dist/components/p-913b636c.js.map +0 -1
  63. package/dist/esm/app-globals-0f993ce5.js +0 -5
  64. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  65. package/dist/esm/index-45a8db1c.js.map +0 -1
  66. package/dist/iris-button/p-705a656b.js +0 -3
  67. package/dist/iris-button/p-705a656b.js.map +0 -1
  68. package/dist/iris-button/p-cbf16ce7.entry.js +0 -2
  69. package/dist/iris-button/p-cbf16ce7.entry.js.map +0 -1
  70. package/dist/iris-button/p-e1255160.js +0 -2
  71. package/dist/iris-button/p-e1255160.js.map +0 -1
  72. package/dist/types/utils/utils.d.ts +0 -1
  73. package/loader/package.json +0 -11
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'iris-button';
2
- const BUILD = /* iris-button */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: false, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
2
+ const BUILD = /* iris-button */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
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 hostRefs = /* @__PURE__ */ new WeakMap();
19
- var getHostRef = (ref) => hostRefs.get(ref);
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
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
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 = hostRefs.set(hostElement, hostRef);
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(doc2) {
144
+ function queryNonceMetaTagContent(doc) {
140
145
  var _a, _b, _c;
141
- return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
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
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
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}"]`) || doc.createElement("style");
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(doc);
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 */ && styleContainerNode.nodeName !== "HEAD") {
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 !== newValue) {
388
- let isProp = isMemberInElement(elm, memberName);
389
- let ln = memberName.toLowerCase();
390
- if (memberName === "class") {
391
- const classList = elm.classList;
392
- const oldClasses = parseClassList(oldValue);
393
- let newClasses = parseClassList(newValue);
394
- {
395
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
396
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
397
- }
398
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
399
- if (memberName[2] === "-") {
400
- memberName = memberName.slice(3);
401
- } else if (isMemberInElement(win, ln)) {
402
- memberName = ln.slice(2);
403
- } else {
404
- memberName = ln[2] + memberName.slice(3);
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 (oldValue || newValue) {
407
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
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
- } else {
417
- const isComplex = isComplexType(newValue);
418
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
419
- try {
420
- if (!elm.tagName.includes("-")) {
421
- const n = newValue == null ? "" : newValue;
422
- if (memberName === "list") {
423
- isProp = false;
424
- } else if (oldValue == null || elm[memberName] != n) {
425
- if (typeof elm.__lookupSetter__(memberName) === "function") {
426
- elm[memberName] = n;
427
- } else {
428
- elm.setAttribute(memberName, n);
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
- } catch (e) {
445
+ } else if (elm[memberName] !== newValue) {
446
+ elm[memberName] = newValue;
435
447
  }
448
+ } catch (e) {
436
449
  }
437
- if (newValue == null || newValue === false) {
438
- if (newValue !== false || elm.getAttribute(memberName) === "") {
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.setAttribute(memberName, newValue);
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$ = doc.createTextNode(newVNode2.$text$);
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
- elm = newVNode2.$elm$ = doc.createElementNS(
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
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
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$ &= ~16 /* isQueuedForUpdate */;
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$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
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/ionic-team/stencil/issues/5457).`
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$ &= ~8 /* isConstructingInstance */;
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$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1076
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
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$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1088
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
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 = doc.head;
1168
+ const head = win.document.head;
1107
1169
  const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1108
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
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 || "./", doc.baseURI).href;
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(doc);
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-45a8db1c.js.map
1291
+ //# sourceMappingURL=index-CqbIY27k.js.map