@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
@@ -1,8 +1,8 @@
1
1
  const NAMESPACE = 'component-library';
2
- 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 };
2
+ 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 };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
@@ -35,10 +35,15 @@ var reWireGetterSetter = (instance, hostRef) => {
35
35
  };
36
36
 
37
37
  // src/client/client-host-ref.ts
38
- var hostRefs = /* @__PURE__ */ new WeakMap();
39
- var getHostRef = (ref) => hostRefs.get(ref);
38
+ var getHostRef = (ref) => {
39
+ if (ref.__stencil__getHostRef) {
40
+ return ref.__stencil__getHostRef();
41
+ }
42
+ return void 0;
43
+ };
40
44
  var registerInstance = (lazyInstance, hostRef) => {
41
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
45
+ lazyInstance.__stencil__getHostRef = () => hostRef;
46
+ hostRef.$lazyInstance$ = lazyInstance;
42
47
  {
43
48
  reWireGetterSetter(lazyInstance, hostRef);
44
49
  }
@@ -58,7 +63,8 @@ var registerHost = (hostElement, cmpMeta) => {
58
63
  hostElement["s-p"] = [];
59
64
  hostElement["s-rc"] = [];
60
65
  }
61
- const ref = hostRefs.set(hostElement, hostRef);
66
+ const ref = hostRef;
67
+ hostElement.__stencil__getHostRef = () => ref;
62
68
  return ref;
63
69
  };
64
70
  var isMemberInElement = (elm, memberName) => memberName in elm;
@@ -109,7 +115,6 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
109
115
  "formStateRestoreCallback"
110
116
  ];
111
117
  var win = typeof window !== "undefined" ? window : {};
112
- var doc = win.document || { head: {} };
113
118
  var plt = {
114
119
  $flags$: 0,
115
120
  $resourcesUrl$: "",
@@ -120,9 +125,10 @@ var plt = {
120
125
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
121
126
  };
122
127
  var supportsListenerOptions = /* @__PURE__ */ (() => {
128
+ var _a;
123
129
  let supportsListenerOptions2 = false;
124
130
  try {
125
- doc.addEventListener(
131
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
126
132
  "e",
127
133
  null,
128
134
  Object.defineProperty({}, "passive", {
@@ -188,9 +194,9 @@ var isComplexType = (o) => {
188
194
  };
189
195
 
190
196
  // src/utils/query-nonce-meta-tag-content.ts
191
- function queryNonceMetaTagContent(doc2) {
197
+ function queryNonceMetaTagContent(doc) {
192
198
  var _a, _b, _c;
193
- 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;
199
+ 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;
194
200
  }
195
201
 
196
202
  // src/utils/result.ts
@@ -242,12 +248,11 @@ var unwrapErr = (result) => {
242
248
  }
243
249
  };
244
250
  var updateFallbackSlotVisibility = (elm) => {
245
- const childNodes = elm.__childNodes || elm.childNodes;
251
+ const childNodes = internalCall(elm, "childNodes");
246
252
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
247
253
  getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
248
- var _a;
249
254
  if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
250
- if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
255
+ if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
251
256
  slotNode.hidden = true;
252
257
  } else {
253
258
  slotNode.hidden = false;
@@ -255,19 +260,31 @@ var updateFallbackSlotVisibility = (elm) => {
255
260
  }
256
261
  });
257
262
  }
258
- for (const childNode of childNodes) {
259
- if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
263
+ let i2 = 0;
264
+ for (i2 = 0; i2 < childNodes.length; i2++) {
265
+ const childNode = childNodes[i2];
266
+ if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
260
267
  updateFallbackSlotVisibility(childNode);
261
268
  }
262
269
  }
263
270
  };
271
+ var getSlottedChildNodes = (childNodes) => {
272
+ const result = [];
273
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
274
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
275
+ if (slottedNode && slottedNode.isConnected) {
276
+ result.push(slottedNode);
277
+ }
278
+ }
279
+ return result;
280
+ };
264
281
  function getHostSlotNodes(childNodes, hostName, slotName) {
265
282
  let i2 = 0;
266
283
  let slottedNodes = [];
267
284
  let childNode;
268
285
  for (; i2 < childNodes.length; i2++) {
269
286
  childNode = childNodes[i2];
270
- if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
287
+ if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
271
288
  slottedNodes.push(childNode);
272
289
  if (typeof slotName !== "undefined") return slottedNodes;
273
290
  }
@@ -275,11 +292,12 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
275
292
  }
276
293
  return slottedNodes;
277
294
  }
278
- var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
295
+ var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
279
296
  const childNodes = [];
280
- if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
281
- while ((node = node.nextSibling) && node["s-sn"] === slotName) {
282
- childNodes.push(node);
297
+ if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
298
+ let node = slot;
299
+ while (node = node.nextSibling) {
300
+ if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
283
301
  }
284
302
  return childNodes;
285
303
  };
@@ -298,6 +316,44 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
298
316
  }
299
317
  return slotName === "";
300
318
  };
319
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
320
+ function patchSlotNode(node) {
321
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
322
+ const assignedFactory = (elementsOnly) => (function(opts) {
323
+ const toReturn = [];
324
+ const slotName = this["s-sn"];
325
+ if (opts == null ? void 0 : opts.flatten) {
326
+ console.error(`
327
+ Flattening is not supported for Stencil non-shadow slots.
328
+ You can use \`.childNodes\` to nested slot fallback content.
329
+ If you have a particular use case, please open an issue on the Stencil repo.
330
+ `);
331
+ }
332
+ const parent = this["s-cr"].parentElement;
333
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
334
+ slottedNodes.forEach((n) => {
335
+ if (slotName === getSlotName(n)) {
336
+ toReturn.push(n);
337
+ }
338
+ });
339
+ if (elementsOnly) {
340
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
341
+ }
342
+ return toReturn;
343
+ }).bind(node);
344
+ node.assignedElements = assignedFactory(true);
345
+ node.assignedNodes = assignedFactory(false);
346
+ }
347
+ function internalCall(node, method) {
348
+ if ("__" + method in node) {
349
+ const toReturn = node["__" + method];
350
+ if (typeof toReturn !== "function") return toReturn;
351
+ return toReturn.bind(node);
352
+ } else {
353
+ if (typeof node[method] !== "function") return node[method];
354
+ return node[method].bind(node);
355
+ }
356
+ }
301
357
  var createTime = (fnName, tagName = "") => {
302
358
  {
303
359
  return () => {
@@ -478,7 +534,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
478
534
  var _a;
479
535
  const scopeId2 = getScopeId(cmpMeta);
480
536
  const style = styles.get(scopeId2);
481
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
537
+ if (!win.document) {
538
+ return scopeId2;
539
+ }
540
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
482
541
  if (style) {
483
542
  if (typeof style === "string") {
484
543
  styleContainerNode = styleContainerNode.head || styleContainerNode;
@@ -489,9 +548,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
489
548
  }
490
549
  if (!appliedStyles.has(scopeId2)) {
491
550
  {
492
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
551
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
493
552
  styleElm.innerHTML = style;
494
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
553
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
495
554
  if (nonce != null) {
496
555
  styleElm.setAttribute("nonce", nonce);
497
556
  }
@@ -553,104 +612,105 @@ var attachStyles = (hostRef) => {
553
612
  };
554
613
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
555
614
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
556
- if (oldValue !== newValue) {
557
- let isProp = isMemberInElement(elm, memberName);
558
- let ln = memberName.toLowerCase();
559
- if (memberName === "class") {
560
- const classList = elm.classList;
561
- const oldClasses = parseClassList(oldValue);
562
- let newClasses = parseClassList(newValue);
563
- {
564
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
565
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
566
- }
567
- } else if (memberName === "style") {
568
- {
569
- for (const prop in oldValue) {
570
- if (!newValue || newValue[prop] == null) {
571
- if (prop.includes("-")) {
572
- elm.style.removeProperty(prop);
573
- } else {
574
- elm.style[prop] = "";
575
- }
576
- }
577
- }
578
- }
579
- for (const prop in newValue) {
580
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
615
+ if (oldValue === newValue) {
616
+ return;
617
+ }
618
+ let isProp = isMemberInElement(elm, memberName);
619
+ let ln = memberName.toLowerCase();
620
+ if (memberName === "class") {
621
+ const classList = elm.classList;
622
+ const oldClasses = parseClassList(oldValue);
623
+ let newClasses = parseClassList(newValue);
624
+ {
625
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
626
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
627
+ }
628
+ } else if (memberName === "style") {
629
+ {
630
+ for (const prop in oldValue) {
631
+ if (!newValue || newValue[prop] == null) {
581
632
  if (prop.includes("-")) {
582
- elm.style.setProperty(prop, newValue[prop]);
633
+ elm.style.removeProperty(prop);
583
634
  } else {
584
- elm.style[prop] = newValue[prop];
635
+ elm.style[prop] = "";
585
636
  }
586
637
  }
587
638
  }
588
- } else if (memberName === "key") ; else if (memberName === "ref") {
589
- if (newValue) {
590
- newValue(elm);
591
- }
592
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
593
- if (memberName[2] === "-") {
594
- memberName = memberName.slice(3);
595
- } else if (isMemberInElement(win, ln)) {
596
- memberName = ln.slice(2);
597
- } else {
598
- memberName = ln[2] + memberName.slice(3);
599
- }
600
- if (oldValue || newValue) {
601
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
602
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
603
- if (oldValue) {
604
- plt.rel(elm, memberName, oldValue, capture);
605
- }
606
- if (newValue) {
607
- plt.ael(elm, memberName, newValue, capture);
639
+ }
640
+ for (const prop in newValue) {
641
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
642
+ if (prop.includes("-")) {
643
+ elm.style.setProperty(prop, newValue[prop]);
644
+ } else {
645
+ elm.style[prop] = newValue[prop];
608
646
  }
609
647
  }
648
+ }
649
+ } else if (memberName === "key") ; else if (memberName === "ref") {
650
+ if (newValue) {
651
+ newValue(elm);
652
+ }
653
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
654
+ if (memberName[2] === "-") {
655
+ memberName = memberName.slice(3);
656
+ } else if (isMemberInElement(win, ln)) {
657
+ memberName = ln.slice(2);
610
658
  } else {
611
- const isComplex = isComplexType(newValue);
612
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
613
- try {
614
- if (!elm.tagName.includes("-")) {
615
- const n = newValue == null ? "" : newValue;
616
- if (memberName === "list") {
617
- isProp = false;
618
- } else if (oldValue == null || elm[memberName] != n) {
619
- if (typeof elm.__lookupSetter__(memberName) === "function") {
620
- elm[memberName] = n;
621
- } else {
622
- elm.setAttribute(memberName, n);
623
- }
659
+ memberName = ln[2] + memberName.slice(3);
660
+ }
661
+ if (oldValue || newValue) {
662
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
663
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
664
+ if (oldValue) {
665
+ plt.rel(elm, memberName, oldValue, capture);
666
+ }
667
+ if (newValue) {
668
+ plt.ael(elm, memberName, newValue, capture);
669
+ }
670
+ }
671
+ } else {
672
+ const isComplex = isComplexType(newValue);
673
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
674
+ try {
675
+ if (!elm.tagName.includes("-")) {
676
+ const n = newValue == null ? "" : newValue;
677
+ if (memberName === "list") {
678
+ isProp = false;
679
+ } else if (oldValue == null || elm[memberName] != n) {
680
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
681
+ elm[memberName] = n;
682
+ } else {
683
+ elm.setAttribute(memberName, n);
624
684
  }
625
- } else if (elm[memberName] !== newValue) {
626
- elm[memberName] = newValue;
627
685
  }
628
- } catch (e) {
686
+ } else if (elm[memberName] !== newValue) {
687
+ elm[memberName] = newValue;
629
688
  }
689
+ } catch (e) {
630
690
  }
631
- let xlink = false;
632
- {
633
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
634
- memberName = ln;
635
- xlink = true;
636
- }
691
+ }
692
+ let xlink = false;
693
+ {
694
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
695
+ memberName = ln;
696
+ xlink = true;
637
697
  }
638
- if (newValue == null || newValue === false) {
639
- if (newValue !== false || elm.getAttribute(memberName) === "") {
640
- if (xlink) {
641
- elm.removeAttributeNS(XLINK_NS, memberName);
642
- } else {
643
- elm.removeAttribute(memberName);
644
- }
645
- }
646
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
647
- newValue = newValue === true ? "" : newValue;
698
+ }
699
+ if (newValue == null || newValue === false) {
700
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
648
701
  if (xlink) {
649
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
702
+ elm.removeAttributeNS(XLINK_NS, memberName);
650
703
  } else {
651
- elm.setAttribute(memberName, newValue);
704
+ elm.removeAttribute(memberName);
652
705
  }
653
706
  }
707
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
708
+ newValue = newValue === true ? "" : newValue;
709
+ if (xlink) {
710
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
711
+ } else {
712
+ elm.setAttribute(memberName, newValue);
713
+ }
654
714
  }
655
715
  }
656
716
  };
@@ -736,11 +796,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
736
796
  }
737
797
  }
738
798
  if (newVNode2.$text$ !== null) {
739
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
799
+ elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
740
800
  } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
741
- elm = newVNode2.$elm$ = doc.createTextNode("");
801
+ elm = newVNode2.$elm$ = win.document.createTextNode("");
802
+ {
803
+ updateElement(null, newVNode2, isSvgMode);
804
+ }
742
805
  } else {
743
- elm = newVNode2.$elm$ = doc.createElement(
806
+ if (!win.document) {
807
+ throw new Error(
808
+ "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."
809
+ );
810
+ }
811
+ elm = newVNode2.$elm$ = win.document.createElement(
744
812
  !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
745
813
  );
746
814
  {
@@ -765,6 +833,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
765
833
  elm["s-cr"] = contentRef;
766
834
  elm["s-sn"] = newVNode2.$name$ || "";
767
835
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
836
+ patchSlotNode(elm);
768
837
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
769
838
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
770
839
  {
@@ -954,14 +1023,11 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
954
1023
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
955
1024
  const oldChildren = oldVNode.$children$;
956
1025
  const newChildren = newVNode2.$children$;
957
- const tag = newVNode2.$tag$;
958
1026
  const text = newVNode2.$text$;
959
1027
  let defaultHolder;
960
1028
  if (text === null) {
961
1029
  {
962
- if (tag === "slot" && !useNativeShadowDom) ; else {
963
- updateElement(oldVNode, newVNode2, isSvgMode);
964
- }
1030
+ updateElement(oldVNode, newVNode2, isSvgMode);
965
1031
  }
966
1032
  if (oldChildren !== null && newChildren !== null) {
967
1033
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -1100,8 +1166,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1100
1166
  markSlotContentForRelocation(rootVnode.$elm$);
1101
1167
  for (const relocateData of relocateNodes) {
1102
1168
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1103
- if (!nodeToRelocate["s-ol"]) {
1104
- const orgLocationNode = doc.createTextNode("");
1169
+ if (!nodeToRelocate["s-ol"] && win.document) {
1170
+ const orgLocationNode = win.document.createTextNode("");
1105
1171
  orgLocationNode["s-nr"] = nodeToRelocate;
1106
1172
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1107
1173
  }
@@ -1142,7 +1208,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1142
1208
  }
1143
1209
  }
1144
1210
  }
1145
- nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
1211
+ nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
1146
1212
  } else {
1147
1213
  if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1148
1214
  if (isInitialLoad) {
@@ -1205,10 +1271,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1205
1271
  hostRef.$queuedListeners$ = void 0;
1206
1272
  }
1207
1273
  }
1208
- {
1209
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1210
- }
1274
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1275
+ } else {
1276
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
1211
1277
  }
1278
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
1212
1279
  endSchedule();
1213
1280
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1214
1281
  };
@@ -1274,14 +1341,13 @@ var postUpdateComponent = (hostRef) => {
1274
1341
  const endPostUpdate = createTime("postUpdate", tagName);
1275
1342
  const instance = hostRef.$lazyInstance$ ;
1276
1343
  const ancestorComponent = hostRef.$ancestorComponent$;
1344
+ safeCall(instance, "componentDidRender", void 0, elm);
1277
1345
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1278
1346
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1279
1347
  {
1280
1348
  addHydratedFlag(elm);
1281
1349
  }
1282
- {
1283
- safeCall(instance, "componentDidLoad", void 0, elm);
1284
- }
1350
+ safeCall(instance, "componentDidLoad", void 0, elm);
1285
1351
  endPostUpdate();
1286
1352
  {
1287
1353
  hostRef.$onReadyResolve$(elm);
@@ -1290,9 +1356,7 @@ var postUpdateComponent = (hostRef) => {
1290
1356
  }
1291
1357
  }
1292
1358
  } else {
1293
- {
1294
- safeCall(instance, "componentDidUpdate", void 0, elm);
1295
- }
1359
+ safeCall(instance, "componentDidUpdate", void 0, elm);
1296
1360
  endPostUpdate();
1297
1361
  }
1298
1362
  {
@@ -1333,7 +1397,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1333
1397
  const hostRef = getHostRef(ref);
1334
1398
  if (!hostRef) {
1335
1399
  throw new Error(
1336
- `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).`
1400
+ `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).`
1337
1401
  );
1338
1402
  }
1339
1403
  const elm = hostRef.$hostElement$ ;
@@ -1359,6 +1423,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1359
1423
  }
1360
1424
  }
1361
1425
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1426
+ if (instance.componentShouldUpdate) {
1427
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1428
+ return;
1429
+ }
1430
+ }
1362
1431
  scheduleUpdate(hostRef, false);
1363
1432
  }
1364
1433
  }
@@ -1560,6 +1629,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1560
1629
  hostRef.$flags$ |= 128 /* isWatchReady */;
1561
1630
  }
1562
1631
  endNewInstance();
1632
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1563
1633
  } else {
1564
1634
  Cstr = elm.constructor;
1565
1635
  const cmpTag = elm.localName;
@@ -1587,6 +1657,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1587
1657
  }
1588
1658
  };
1589
1659
  var fireConnectedCallback = (instance, elm) => {
1660
+ {
1661
+ safeCall(instance, "connectedCallback", void 0, elm);
1662
+ }
1590
1663
  };
1591
1664
 
1592
1665
  // src/runtime/connected-callback.ts
@@ -1626,21 +1699,29 @@ var connectedCallback = (elm) => {
1626
1699
  }
1627
1700
  } else {
1628
1701
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1629
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1630
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1702
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1703
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1704
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1705
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1631
1706
  }
1632
1707
  }
1633
1708
  endConnected();
1634
1709
  }
1635
1710
  };
1636
1711
  var setContentReference = (elm) => {
1637
- const contentRefElm = elm["s-cr"] = doc.createComment(
1712
+ if (!win.document) {
1713
+ return;
1714
+ }
1715
+ const contentRefElm = elm["s-cr"] = win.document.createComment(
1638
1716
  ""
1639
1717
  );
1640
1718
  contentRefElm["s-cn"] = true;
1641
1719
  insertBefore(elm, contentRefElm, elm.firstChild);
1642
1720
  };
1643
1721
  var disconnectInstance = (instance, elm) => {
1722
+ {
1723
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
1724
+ }
1644
1725
  };
1645
1726
  var disconnectedCallback = async (elm) => {
1646
1727
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1651,8 +1732,10 @@ var disconnectedCallback = async (elm) => {
1651
1732
  hostRef.$rmListeners$ = void 0;
1652
1733
  }
1653
1734
  }
1654
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1655
- hostRef.$onReadyPromise$.then(() => disconnectInstance());
1735
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1736
+ disconnectInstance(hostRef.$lazyInstance$, elm);
1737
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1738
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
1656
1739
  }
1657
1740
  }
1658
1741
  if (rootAppliedStyles.has(elm)) {
@@ -1666,18 +1749,22 @@ var disconnectedCallback = async (elm) => {
1666
1749
  // src/runtime/bootstrap-lazy.ts
1667
1750
  var bootstrapLazy = (lazyBundles, options = {}) => {
1668
1751
  var _a;
1752
+ if (!win.document) {
1753
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
1754
+ return;
1755
+ }
1669
1756
  const endBootstrap = createTime();
1670
1757
  const cmpTags = [];
1671
1758
  const exclude = options.exclude || [];
1672
1759
  const customElements2 = win.customElements;
1673
- const head = doc.head;
1760
+ const head = win.document.head;
1674
1761
  const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1675
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
1762
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
1676
1763
  const deferredConnectedCallbacks = [];
1677
1764
  let appLoadFallback;
1678
1765
  let isBootstrapping = true;
1679
1766
  Object.assign(plt, options);
1680
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
1767
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
1681
1768
  let hasSlotRelocation = false;
1682
1769
  lazyBundles.map((lazyBundle) => {
1683
1770
  lazyBundle[1].map((compactMeta) => {
@@ -1780,7 +1867,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1780
1867
  }
1781
1868
  if (dataStyles.innerHTML.length) {
1782
1869
  dataStyles.setAttribute("data-styles", "");
1783
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1870
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1784
1871
  if (nonce != null) {
1785
1872
  dataStyles.setAttribute("nonce", nonce);
1786
1873
  }
@@ -1801,7 +1888,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1801
1888
  // src/runtime/fragment.ts
1802
1889
  var Fragment = (_, children) => children;
1803
1890
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1804
- if (listeners) {
1891
+ if (listeners && win.document) {
1805
1892
  listeners.map(([flags, name, method]) => {
1806
1893
  const target = elm;
1807
1894
  const handler = hostListenerProxy(hostRef, method);