@uh-design-system/component-library 0.4.1 → 0.4.2

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 (54) hide show
  1. package/dist/cjs/component-library.cjs.js +3 -3
  2. package/dist/cjs/ds-accordion_3.cjs.entry.js +1 -1
  3. package/dist/cjs/ds-checkbox-group.cjs.entry.js +2 -2
  4. package/dist/cjs/ds-checkbox.cjs.entry.js +2 -2
  5. package/dist/cjs/ds-input-validity.cjs.entry.js +3 -3
  6. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +4 -4
  7. package/dist/cjs/ds-link.cjs.entry.js +4 -4
  8. package/dist/cjs/ds-text-input.cjs.entry.js +1 -1
  9. package/dist/cjs/ds-visually-hidden.cjs.entry.js +1 -1
  10. package/dist/cjs/{index-b1d61146.js → index-b2bddcf4.js} +221 -134
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +0 -171
  14. package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +1 -1
  15. package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +3 -3
  16. package/dist/collection/components/01-base-components/ds-link/ds-link.css +0 -138
  17. package/dist/collection/components/01-base-components/ds-link/ds-link.js +3 -3
  18. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +4 -1
  19. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +0 -138
  20. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +3 -3
  21. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -1
  22. package/dist/component-library/component-library.esm.js +1 -1
  23. package/dist/component-library/ds-accordion_3.entry.js +1 -1
  24. package/dist/component-library/ds-checkbox-group.entry.js +1 -1
  25. package/dist/component-library/ds-checkbox.entry.js +1 -1
  26. package/dist/component-library/ds-input-validity.entry.js +1 -1
  27. package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
  28. package/dist/component-library/ds-link.entry.js +1 -1
  29. package/dist/component-library/ds-text-input.entry.js +1 -1
  30. package/dist/component-library/ds-visually-hidden.entry.js +1 -1
  31. package/dist/component-library/index-50783b0c.js +2 -0
  32. package/dist/components/ds-checkbox-group.js +1 -1
  33. package/dist/components/ds-checkbox2.js +1 -1
  34. package/dist/components/ds-input-validity2.js +3 -3
  35. package/dist/components/ds-link-with-arrow.js +4 -4
  36. package/dist/components/ds-link.js +4 -4
  37. package/dist/components/index2.js +203 -135
  38. package/dist/esm/component-library.js +4 -4
  39. package/dist/esm/ds-accordion_3.entry.js +1 -1
  40. package/dist/esm/ds-checkbox-group.entry.js +2 -2
  41. package/dist/esm/ds-checkbox.entry.js +2 -2
  42. package/dist/esm/ds-input-validity.entry.js +3 -3
  43. package/dist/esm/ds-link-with-arrow.entry.js +4 -4
  44. package/dist/esm/ds-link.entry.js +4 -4
  45. package/dist/esm/ds-text-input.entry.js +1 -1
  46. package/dist/esm/ds-visually-hidden.entry.js +1 -1
  47. package/dist/esm/{index-aaccd233.js → index-50783b0c.js} +221 -134
  48. package/dist/esm/loader.js +3 -3
  49. package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +1 -1
  50. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +1 -1
  51. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +1 -1
  52. package/dist/types/components.d.ts +6 -6
  53. package/package.json +18 -18
  54. package/dist/component-library/index-aaccd233.js +0 -2
@@ -21,10 +21,10 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'component-library';
24
- const BUILD = /* component-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, 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: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
24
+ const BUILD = /* component-library */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: true, hasRenderFn: true, hostListener: true, 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: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
25
25
 
26
26
  /*
27
- Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
27
+ Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
28
28
  */
29
29
  var __defProp = Object.defineProperty;
30
30
  var __export = (target, all) => {
@@ -57,10 +57,15 @@ var reWireGetterSetter = (instance, hostRef) => {
57
57
  };
58
58
 
59
59
  // src/client/client-host-ref.ts
60
- var hostRefs = /* @__PURE__ */ new WeakMap();
61
- var getHostRef = (ref) => hostRefs.get(ref);
60
+ var getHostRef = (ref) => {
61
+ if (ref.__stencil__getHostRef) {
62
+ return ref.__stencil__getHostRef();
63
+ }
64
+ return void 0;
65
+ };
62
66
  var registerInstance = (lazyInstance, hostRef) => {
63
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
67
+ lazyInstance.__stencil__getHostRef = () => hostRef;
68
+ hostRef.$lazyInstance$ = lazyInstance;
64
69
  {
65
70
  reWireGetterSetter(lazyInstance, hostRef);
66
71
  }
@@ -80,7 +85,8 @@ var registerHost = (hostElement, cmpMeta) => {
80
85
  hostElement["s-p"] = [];
81
86
  hostElement["s-rc"] = [];
82
87
  }
83
- const ref = hostRefs.set(hostElement, hostRef);
88
+ const ref = hostRef;
89
+ hostElement.__stencil__getHostRef = () => ref;
84
90
  return ref;
85
91
  };
86
92
  var isMemberInElement = (elm, memberName) => memberName in elm;
@@ -131,7 +137,6 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
131
137
  "formStateRestoreCallback"
132
138
  ];
133
139
  var win = typeof window !== "undefined" ? window : {};
134
- var doc = win.document || { head: {} };
135
140
  var plt = {
136
141
  $flags$: 0,
137
142
  $resourcesUrl$: "",
@@ -142,9 +147,10 @@ var plt = {
142
147
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
143
148
  };
144
149
  var supportsListenerOptions = /* @__PURE__ */ (() => {
150
+ var _a;
145
151
  let supportsListenerOptions2 = false;
146
152
  try {
147
- doc.addEventListener(
153
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
148
154
  "e",
149
155
  null,
150
156
  Object.defineProperty({}, "passive", {
@@ -210,9 +216,9 @@ var isComplexType = (o) => {
210
216
  };
211
217
 
212
218
  // src/utils/query-nonce-meta-tag-content.ts
213
- function queryNonceMetaTagContent(doc2) {
219
+ function queryNonceMetaTagContent(doc) {
214
220
  var _a, _b, _c;
215
- 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;
221
+ 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;
216
222
  }
217
223
 
218
224
  // src/utils/result.ts
@@ -264,12 +270,11 @@ var unwrapErr = (result) => {
264
270
  }
265
271
  };
266
272
  var updateFallbackSlotVisibility = (elm) => {
267
- const childNodes = elm.__childNodes || elm.childNodes;
273
+ const childNodes = internalCall(elm, "childNodes");
268
274
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
269
275
  getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
270
- var _a;
271
276
  if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
272
- if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
277
+ if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
273
278
  slotNode.hidden = true;
274
279
  } else {
275
280
  slotNode.hidden = false;
@@ -277,19 +282,31 @@ var updateFallbackSlotVisibility = (elm) => {
277
282
  }
278
283
  });
279
284
  }
280
- for (const childNode of childNodes) {
281
- if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
285
+ let i2 = 0;
286
+ for (i2 = 0; i2 < childNodes.length; i2++) {
287
+ const childNode = childNodes[i2];
288
+ if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
282
289
  updateFallbackSlotVisibility(childNode);
283
290
  }
284
291
  }
285
292
  };
293
+ var getSlottedChildNodes = (childNodes) => {
294
+ const result = [];
295
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
296
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
297
+ if (slottedNode && slottedNode.isConnected) {
298
+ result.push(slottedNode);
299
+ }
300
+ }
301
+ return result;
302
+ };
286
303
  function getHostSlotNodes(childNodes, hostName, slotName) {
287
304
  let i2 = 0;
288
305
  let slottedNodes = [];
289
306
  let childNode;
290
307
  for (; i2 < childNodes.length; i2++) {
291
308
  childNode = childNodes[i2];
292
- if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
309
+ if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
293
310
  slottedNodes.push(childNode);
294
311
  if (typeof slotName !== "undefined") return slottedNodes;
295
312
  }
@@ -297,11 +314,12 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
297
314
  }
298
315
  return slottedNodes;
299
316
  }
300
- var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
317
+ var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
301
318
  const childNodes = [];
302
- if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
303
- while ((node = node.nextSibling) && node["s-sn"] === slotName) {
304
- childNodes.push(node);
319
+ if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
320
+ let node = slot;
321
+ while (node = node.nextSibling) {
322
+ if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
305
323
  }
306
324
  return childNodes;
307
325
  };
@@ -320,6 +338,44 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
320
338
  }
321
339
  return slotName === "";
322
340
  };
341
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
342
+ function patchSlotNode(node) {
343
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
344
+ const assignedFactory = (elementsOnly) => (function(opts) {
345
+ const toReturn = [];
346
+ const slotName = this["s-sn"];
347
+ if (opts == null ? void 0 : opts.flatten) {
348
+ console.error(`
349
+ Flattening is not supported for Stencil non-shadow slots.
350
+ You can use \`.childNodes\` to nested slot fallback content.
351
+ If you have a particular use case, please open an issue on the Stencil repo.
352
+ `);
353
+ }
354
+ const parent = this["s-cr"].parentElement;
355
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
356
+ slottedNodes.forEach((n) => {
357
+ if (slotName === getSlotName(n)) {
358
+ toReturn.push(n);
359
+ }
360
+ });
361
+ if (elementsOnly) {
362
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
363
+ }
364
+ return toReturn;
365
+ }).bind(node);
366
+ node.assignedElements = assignedFactory(true);
367
+ node.assignedNodes = assignedFactory(false);
368
+ }
369
+ function internalCall(node, method) {
370
+ if ("__" + method in node) {
371
+ const toReturn = node["__" + method];
372
+ if (typeof toReturn !== "function") return toReturn;
373
+ return toReturn.bind(node);
374
+ } else {
375
+ if (typeof node[method] !== "function") return node[method];
376
+ return node[method].bind(node);
377
+ }
378
+ }
323
379
  var createTime = (fnName, tagName = "") => {
324
380
  {
325
381
  return () => {
@@ -500,7 +556,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
500
556
  var _a;
501
557
  const scopeId2 = getScopeId(cmpMeta);
502
558
  const style = styles.get(scopeId2);
503
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
559
+ if (!win.document) {
560
+ return scopeId2;
561
+ }
562
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
504
563
  if (style) {
505
564
  if (typeof style === "string") {
506
565
  styleContainerNode = styleContainerNode.head || styleContainerNode;
@@ -511,9 +570,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
511
570
  }
512
571
  if (!appliedStyles.has(scopeId2)) {
513
572
  {
514
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
573
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
515
574
  styleElm.innerHTML = style;
516
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
575
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
517
576
  if (nonce != null) {
518
577
  styleElm.setAttribute("nonce", nonce);
519
578
  }
@@ -575,104 +634,105 @@ var attachStyles = (hostRef) => {
575
634
  };
576
635
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
577
636
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
578
- if (oldValue !== newValue) {
579
- let isProp = isMemberInElement(elm, memberName);
580
- let ln = memberName.toLowerCase();
581
- if (memberName === "class") {
582
- const classList = elm.classList;
583
- const oldClasses = parseClassList(oldValue);
584
- let newClasses = parseClassList(newValue);
585
- {
586
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
587
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
588
- }
589
- } else if (memberName === "style") {
590
- {
591
- for (const prop in oldValue) {
592
- if (!newValue || newValue[prop] == null) {
593
- if (prop.includes("-")) {
594
- elm.style.removeProperty(prop);
595
- } else {
596
- elm.style[prop] = "";
597
- }
598
- }
599
- }
600
- }
601
- for (const prop in newValue) {
602
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
637
+ if (oldValue === newValue) {
638
+ return;
639
+ }
640
+ let isProp = isMemberInElement(elm, memberName);
641
+ let ln = memberName.toLowerCase();
642
+ if (memberName === "class") {
643
+ const classList = elm.classList;
644
+ const oldClasses = parseClassList(oldValue);
645
+ let newClasses = parseClassList(newValue);
646
+ {
647
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
648
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
649
+ }
650
+ } else if (memberName === "style") {
651
+ {
652
+ for (const prop in oldValue) {
653
+ if (!newValue || newValue[prop] == null) {
603
654
  if (prop.includes("-")) {
604
- elm.style.setProperty(prop, newValue[prop]);
655
+ elm.style.removeProperty(prop);
605
656
  } else {
606
- elm.style[prop] = newValue[prop];
657
+ elm.style[prop] = "";
607
658
  }
608
659
  }
609
660
  }
610
- } else if (memberName === "key") ; else if (memberName === "ref") {
611
- if (newValue) {
612
- newValue(elm);
613
- }
614
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
615
- if (memberName[2] === "-") {
616
- memberName = memberName.slice(3);
617
- } else if (isMemberInElement(win, ln)) {
618
- memberName = ln.slice(2);
619
- } else {
620
- memberName = ln[2] + memberName.slice(3);
621
- }
622
- if (oldValue || newValue) {
623
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
624
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
625
- if (oldValue) {
626
- plt.rel(elm, memberName, oldValue, capture);
627
- }
628
- if (newValue) {
629
- plt.ael(elm, memberName, newValue, capture);
661
+ }
662
+ for (const prop in newValue) {
663
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
664
+ if (prop.includes("-")) {
665
+ elm.style.setProperty(prop, newValue[prop]);
666
+ } else {
667
+ elm.style[prop] = newValue[prop];
630
668
  }
631
669
  }
670
+ }
671
+ } else if (memberName === "key") ; else if (memberName === "ref") {
672
+ if (newValue) {
673
+ newValue(elm);
674
+ }
675
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
676
+ if (memberName[2] === "-") {
677
+ memberName = memberName.slice(3);
678
+ } else if (isMemberInElement(win, ln)) {
679
+ memberName = ln.slice(2);
632
680
  } else {
633
- const isComplex = isComplexType(newValue);
634
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
635
- try {
636
- if (!elm.tagName.includes("-")) {
637
- const n = newValue == null ? "" : newValue;
638
- if (memberName === "list") {
639
- isProp = false;
640
- } else if (oldValue == null || elm[memberName] != n) {
641
- if (typeof elm.__lookupSetter__(memberName) === "function") {
642
- elm[memberName] = n;
643
- } else {
644
- elm.setAttribute(memberName, n);
645
- }
681
+ memberName = ln[2] + memberName.slice(3);
682
+ }
683
+ if (oldValue || newValue) {
684
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
685
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
686
+ if (oldValue) {
687
+ plt.rel(elm, memberName, oldValue, capture);
688
+ }
689
+ if (newValue) {
690
+ plt.ael(elm, memberName, newValue, capture);
691
+ }
692
+ }
693
+ } else {
694
+ const isComplex = isComplexType(newValue);
695
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
696
+ try {
697
+ if (!elm.tagName.includes("-")) {
698
+ const n = newValue == null ? "" : newValue;
699
+ if (memberName === "list") {
700
+ isProp = false;
701
+ } else if (oldValue == null || elm[memberName] != n) {
702
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
703
+ elm[memberName] = n;
704
+ } else {
705
+ elm.setAttribute(memberName, n);
646
706
  }
647
- } else if (elm[memberName] !== newValue) {
648
- elm[memberName] = newValue;
649
707
  }
650
- } catch (e) {
708
+ } else if (elm[memberName] !== newValue) {
709
+ elm[memberName] = newValue;
651
710
  }
711
+ } catch (e) {
652
712
  }
653
- let xlink = false;
654
- {
655
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
656
- memberName = ln;
657
- xlink = true;
658
- }
713
+ }
714
+ let xlink = false;
715
+ {
716
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
717
+ memberName = ln;
718
+ xlink = true;
659
719
  }
660
- if (newValue == null || newValue === false) {
661
- if (newValue !== false || elm.getAttribute(memberName) === "") {
662
- if (xlink) {
663
- elm.removeAttributeNS(XLINK_NS, memberName);
664
- } else {
665
- elm.removeAttribute(memberName);
666
- }
667
- }
668
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
669
- newValue = newValue === true ? "" : newValue;
720
+ }
721
+ if (newValue == null || newValue === false) {
722
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
670
723
  if (xlink) {
671
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
724
+ elm.removeAttributeNS(XLINK_NS, memberName);
672
725
  } else {
673
- elm.setAttribute(memberName, newValue);
726
+ elm.removeAttribute(memberName);
674
727
  }
675
728
  }
729
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
730
+ newValue = newValue === true ? "" : newValue;
731
+ if (xlink) {
732
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
733
+ } else {
734
+ elm.setAttribute(memberName, newValue);
735
+ }
676
736
  }
677
737
  }
678
738
  };
@@ -758,11 +818,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
758
818
  }
759
819
  }
760
820
  if (newVNode2.$text$ !== null) {
761
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
821
+ elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
762
822
  } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
763
- elm = newVNode2.$elm$ = doc.createTextNode("");
823
+ elm = newVNode2.$elm$ = win.document.createTextNode("");
824
+ {
825
+ updateElement(null, newVNode2, isSvgMode);
826
+ }
764
827
  } else {
765
- elm = newVNode2.$elm$ = doc.createElement(
828
+ if (!win.document) {
829
+ throw new Error(
830
+ "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."
831
+ );
832
+ }
833
+ elm = newVNode2.$elm$ = win.document.createElement(
766
834
  !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
767
835
  );
768
836
  {
@@ -787,6 +855,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
787
855
  elm["s-cr"] = contentRef;
788
856
  elm["s-sn"] = newVNode2.$name$ || "";
789
857
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
858
+ patchSlotNode(elm);
790
859
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
791
860
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
792
861
  {
@@ -976,14 +1045,11 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
976
1045
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
977
1046
  const oldChildren = oldVNode.$children$;
978
1047
  const newChildren = newVNode2.$children$;
979
- const tag = newVNode2.$tag$;
980
1048
  const text = newVNode2.$text$;
981
1049
  let defaultHolder;
982
1050
  if (text === null) {
983
1051
  {
984
- if (tag === "slot" && !useNativeShadowDom) ; else {
985
- updateElement(oldVNode, newVNode2, isSvgMode);
986
- }
1052
+ updateElement(oldVNode, newVNode2, isSvgMode);
987
1053
  }
988
1054
  if (oldChildren !== null && newChildren !== null) {
989
1055
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -1122,8 +1188,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1122
1188
  markSlotContentForRelocation(rootVnode.$elm$);
1123
1189
  for (const relocateData of relocateNodes) {
1124
1190
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1125
- if (!nodeToRelocate["s-ol"]) {
1126
- const orgLocationNode = doc.createTextNode("");
1191
+ if (!nodeToRelocate["s-ol"] && win.document) {
1192
+ const orgLocationNode = win.document.createTextNode("");
1127
1193
  orgLocationNode["s-nr"] = nodeToRelocate;
1128
1194
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1129
1195
  }
@@ -1164,7 +1230,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1164
1230
  }
1165
1231
  }
1166
1232
  }
1167
- nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
1233
+ nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
1168
1234
  } else {
1169
1235
  if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1170
1236
  if (isInitialLoad) {
@@ -1227,10 +1293,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1227
1293
  hostRef.$queuedListeners$ = void 0;
1228
1294
  }
1229
1295
  }
1230
- {
1231
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1232
- }
1296
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1297
+ } else {
1298
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
1233
1299
  }
1300
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
1234
1301
  endSchedule();
1235
1302
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1236
1303
  };
@@ -1296,14 +1363,13 @@ var postUpdateComponent = (hostRef) => {
1296
1363
  const endPostUpdate = createTime("postUpdate", tagName);
1297
1364
  const instance = hostRef.$lazyInstance$ ;
1298
1365
  const ancestorComponent = hostRef.$ancestorComponent$;
1366
+ safeCall(instance, "componentDidRender", void 0, elm);
1299
1367
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1300
1368
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1301
1369
  {
1302
1370
  addHydratedFlag(elm);
1303
1371
  }
1304
- {
1305
- safeCall(instance, "componentDidLoad", void 0, elm);
1306
- }
1372
+ safeCall(instance, "componentDidLoad", void 0, elm);
1307
1373
  endPostUpdate();
1308
1374
  {
1309
1375
  hostRef.$onReadyResolve$(elm);
@@ -1312,9 +1378,7 @@ var postUpdateComponent = (hostRef) => {
1312
1378
  }
1313
1379
  }
1314
1380
  } else {
1315
- {
1316
- safeCall(instance, "componentDidUpdate", void 0, elm);
1317
- }
1381
+ safeCall(instance, "componentDidUpdate", void 0, elm);
1318
1382
  endPostUpdate();
1319
1383
  }
1320
1384
  {
@@ -1355,7 +1419,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1355
1419
  const hostRef = getHostRef(ref);
1356
1420
  if (!hostRef) {
1357
1421
  throw new Error(
1358
- `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).`
1422
+ `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).`
1359
1423
  );
1360
1424
  }
1361
1425
  const elm = hostRef.$hostElement$ ;
@@ -1381,6 +1445,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1381
1445
  }
1382
1446
  }
1383
1447
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1448
+ if (instance.componentShouldUpdate) {
1449
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1450
+ return;
1451
+ }
1452
+ }
1384
1453
  scheduleUpdate(hostRef, false);
1385
1454
  }
1386
1455
  }
@@ -1582,6 +1651,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1582
1651
  hostRef.$flags$ |= 128 /* isWatchReady */;
1583
1652
  }
1584
1653
  endNewInstance();
1654
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1585
1655
  } else {
1586
1656
  Cstr = elm.constructor;
1587
1657
  const cmpTag = elm.localName;
@@ -1609,6 +1679,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1609
1679
  }
1610
1680
  };
1611
1681
  var fireConnectedCallback = (instance, elm) => {
1682
+ {
1683
+ safeCall(instance, "connectedCallback", void 0, elm);
1684
+ }
1612
1685
  };
1613
1686
 
1614
1687
  // src/runtime/connected-callback.ts
@@ -1648,21 +1721,29 @@ var connectedCallback = (elm) => {
1648
1721
  }
1649
1722
  } else {
1650
1723
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1651
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1652
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1724
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1725
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1726
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1727
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1653
1728
  }
1654
1729
  }
1655
1730
  endConnected();
1656
1731
  }
1657
1732
  };
1658
1733
  var setContentReference = (elm) => {
1659
- const contentRefElm = elm["s-cr"] = doc.createComment(
1734
+ if (!win.document) {
1735
+ return;
1736
+ }
1737
+ const contentRefElm = elm["s-cr"] = win.document.createComment(
1660
1738
  ""
1661
1739
  );
1662
1740
  contentRefElm["s-cn"] = true;
1663
1741
  insertBefore(elm, contentRefElm, elm.firstChild);
1664
1742
  };
1665
1743
  var disconnectInstance = (instance, elm) => {
1744
+ {
1745
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
1746
+ }
1666
1747
  };
1667
1748
  var disconnectedCallback = async (elm) => {
1668
1749
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1673,8 +1754,10 @@ var disconnectedCallback = async (elm) => {
1673
1754
  hostRef.$rmListeners$ = void 0;
1674
1755
  }
1675
1756
  }
1676
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1677
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1757
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1758
+ disconnectInstance(hostRef.$lazyInstance$, elm);
1759
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1760
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
1678
1761
  }
1679
1762
  }
1680
1763
  if (rootAppliedStyles.has(elm)) {
@@ -1688,18 +1771,22 @@ var disconnectedCallback = async (elm) => {
1688
1771
  // src/runtime/bootstrap-lazy.ts
1689
1772
  var bootstrapLazy = (lazyBundles, options = {}) => {
1690
1773
  var _a;
1774
+ if (!win.document) {
1775
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
1776
+ return;
1777
+ }
1691
1778
  const endBootstrap = createTime();
1692
1779
  const cmpTags = [];
1693
1780
  const exclude = options.exclude || [];
1694
1781
  const customElements2 = win.customElements;
1695
- const head = doc.head;
1782
+ const head = win.document.head;
1696
1783
  const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1697
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
1784
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
1698
1785
  const deferredConnectedCallbacks = [];
1699
1786
  let appLoadFallback;
1700
1787
  let isBootstrapping = true;
1701
1788
  Object.assign(plt, options);
1702
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
1789
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
1703
1790
  let hasSlotRelocation = false;
1704
1791
  lazyBundles.map((lazyBundle) => {
1705
1792
  lazyBundle[1].map((compactMeta) => {
@@ -1802,7 +1889,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1802
1889
  }
1803
1890
  if (dataStyles.innerHTML.length) {
1804
1891
  dataStyles.setAttribute("data-styles", "");
1805
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1892
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1806
1893
  if (nonce != null) {
1807
1894
  dataStyles.setAttribute("nonce", nonce);
1808
1895
  }
@@ -1823,7 +1910,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1823
1910
  // src/runtime/fragment.ts
1824
1911
  var Fragment = (_, children) => children;
1825
1912
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1826
- if (listeners) {
1913
+ if (listeners && win.document) {
1827
1914
  listeners.map(([flags, name, method]) => {
1828
1915
  const target = elm;
1829
1916
  const handler = hostListenerProxy(hostRef, method);