@esri/calcite-components 1.0.0-next.363 → 1.0.0-next.367

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 (226) hide show
  1. package/dist/calcite/calcite.esm.js +1 -1
  2. package/dist/calcite/p-0282fd8b.system.entry.js +5 -0
  3. package/dist/calcite/p-050ff462.entry.js +5 -0
  4. package/dist/calcite/p-05b03971.system.entry.js +5 -0
  5. package/dist/calcite/p-08847812.entry.js +5 -0
  6. package/dist/calcite/p-1bcce6c9.entry.js +5 -0
  7. package/dist/calcite/p-1ef9235e.system.entry.js +5 -0
  8. package/dist/calcite/p-25ed6059.entry.js +5 -0
  9. package/dist/calcite/{p-0b0ce9b2.system.entry.js → p-3280f0ac.system.entry.js} +1 -1
  10. package/dist/calcite/p-40cbbd20.entry.js +5 -0
  11. package/dist/calcite/p-4347fde9.system.entry.js +5 -0
  12. package/dist/calcite/p-43cd4b9b.entry.js +5 -0
  13. package/dist/calcite/{p-e6d14bc5.system.entry.js → p-4dcae709.system.entry.js} +1 -1
  14. package/dist/calcite/p-55e2658e.entry.js +5 -0
  15. package/dist/calcite/p-5682a918.entry.js +5 -0
  16. package/dist/calcite/p-597b782e.system.entry.js +5 -0
  17. package/dist/calcite/p-60e4f404.entry.js +5 -0
  18. package/dist/calcite/p-660c8077.js +5 -0
  19. package/dist/calcite/p-7279ccf9.entry.js +5 -0
  20. package/dist/calcite/p-832d7f68.system.entry.js +5 -0
  21. package/dist/calcite/p-888a152c.system.entry.js +5 -0
  22. package/dist/calcite/p-946c3bed.system.entry.js +5 -0
  23. package/dist/calcite/p-94717214.entry.js +5 -0
  24. package/dist/calcite/p-953259af.entry.js +5 -0
  25. package/dist/calcite/p-96808ed2.entry.js +5 -0
  26. package/dist/calcite/p-99d32fc3.system.js +1 -1
  27. package/dist/calcite/p-9b723fdd.system.entry.js +5 -0
  28. package/dist/calcite/p-9f349c92.entry.js +5 -0
  29. package/dist/calcite/p-9fe77a88.system.entry.js +5 -0
  30. package/dist/calcite/p-a52288cd.system.entry.js +5 -0
  31. package/dist/calcite/p-a71d17b4.entry.js +5 -0
  32. package/dist/calcite/p-aea7c650.system.entry.js +5 -0
  33. package/dist/calcite/p-af7ed41f.system.entry.js +5 -0
  34. package/dist/calcite/p-b14e0be5.system.entry.js +5 -0
  35. package/dist/calcite/p-b53b28e3.system.js +5 -0
  36. package/dist/calcite/p-b88d7391.entry.js +5 -0
  37. package/dist/calcite/p-ba000c59.entry.js +5 -0
  38. package/dist/calcite/p-ba915998.entry.js +5 -0
  39. package/dist/calcite/p-cf2be87e.entry.js +5 -0
  40. package/dist/calcite/p-dd4457cd.entry.js +5 -0
  41. package/dist/calcite/p-eff2fb8c.system.entry.js +5 -0
  42. package/dist/calcite/p-f4614b28.system.entry.js +5 -0
  43. package/dist/calcite/{p-8b145872.system.entry.js → p-f94619be.system.entry.js} +1 -1
  44. package/dist/calcite/p-fd57beb5.system.entry.js +5 -0
  45. package/dist/cjs/calcite-action-bar.cjs.entry.js +3 -24
  46. package/dist/cjs/calcite-action-group.cjs.entry.js +13 -0
  47. package/dist/cjs/calcite-action-menu.cjs.entry.js +3 -0
  48. package/dist/cjs/calcite-action-pad.cjs.entry.js +8 -0
  49. package/dist/cjs/calcite-alert.cjs.entry.js +15 -9
  50. package/dist/cjs/calcite-block_2.cjs.entry.js +14 -1
  51. package/dist/cjs/calcite-chip.cjs.entry.js +14 -1
  52. package/dist/cjs/calcite-combobox_3.cjs.entry.js +22 -11
  53. package/dist/cjs/calcite-input.cjs.entry.js +3 -0
  54. package/dist/cjs/calcite-link.cjs.entry.js +13 -2
  55. package/dist/cjs/calcite-list_3.cjs.entry.js +13 -0
  56. package/dist/cjs/calcite-modal.cjs.entry.js +5 -2
  57. package/dist/cjs/calcite-notice.cjs.entry.js +8 -0
  58. package/dist/cjs/calcite-panel.cjs.entry.js +18 -12
  59. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +23 -0
  60. package/dist/cjs/calcite-shell_3.cjs.entry.js +35 -7
  61. package/dist/cjs/calcite-tile.cjs.entry.js +13 -0
  62. package/dist/cjs/calcite-tip_3.cjs.entry.js +13 -1
  63. package/dist/cjs/calcite-tree_2.cjs.entry.js +6 -0
  64. package/dist/cjs/calcite-value-list_2.cjs.entry.js +12 -0
  65. package/dist/cjs/calcite.cjs.js +1 -1
  66. package/dist/cjs/conditionalSlot-e874fbb0.js +43 -0
  67. package/dist/cjs/loader.cjs.js +1 -1
  68. package/dist/collection/components/calcite-action-group/calcite-action-group.js +12 -0
  69. package/dist/collection/components/calcite-action-menu/calcite-action-menu.js +3 -0
  70. package/dist/collection/components/calcite-action-pad/calcite-action-pad.js +7 -0
  71. package/dist/collection/components/calcite-alert/calcite-alert.js +15 -9
  72. package/dist/collection/components/calcite-block/calcite-block.js +13 -1
  73. package/dist/collection/components/calcite-chip/calcite-chip.js +13 -1
  74. package/dist/collection/components/calcite-combobox/calcite-combobox.js +42 -13
  75. package/dist/collection/components/calcite-combobox/resources.js +3 -0
  76. package/dist/collection/components/calcite-input/calcite-input.js +3 -0
  77. package/dist/collection/components/calcite-link/calcite-link.js +31 -2
  78. package/dist/collection/components/calcite-list-item/calcite-list-item.js +12 -0
  79. package/dist/collection/components/calcite-modal/calcite-modal.js +5 -2
  80. package/dist/collection/components/calcite-notice/calcite-notice.js +7 -0
  81. package/dist/collection/components/calcite-panel/calcite-panel.js +19 -14
  82. package/dist/collection/components/calcite-pick-list-group/calcite-pick-list-group.js +12 -0
  83. package/dist/collection/components/calcite-pick-list-item/calcite-pick-list-item.js +12 -0
  84. package/dist/collection/components/calcite-shell/calcite-shell.js +14 -2
  85. package/dist/collection/components/calcite-shell-center-row/calcite-shell-center-row.js +13 -1
  86. package/dist/collection/components/calcite-shell-panel/calcite-shell-panel.js +9 -4
  87. package/dist/collection/components/calcite-tile/calcite-tile.js +12 -0
  88. package/dist/collection/components/calcite-tip/calcite-tip.js +13 -1
  89. package/dist/collection/components/calcite-tree-item/calcite-tree-item.js +5 -0
  90. package/dist/collection/components/calcite-value-list-item/calcite-value-list-item.js +12 -0
  91. package/dist/collection/utils/conditionalSlot.js +22 -11
  92. package/dist/components/calcite-action-bar.js +2 -23
  93. package/dist/components/calcite-action-group2.js +12 -0
  94. package/dist/components/calcite-action-menu2.js +3 -0
  95. package/dist/components/calcite-action-pad.js +7 -0
  96. package/dist/components/calcite-alert.js +15 -9
  97. package/dist/components/calcite-block.js +13 -1
  98. package/dist/components/calcite-chip2.js +13 -1
  99. package/dist/components/calcite-combobox.js +21 -12
  100. package/dist/components/calcite-input2.js +3 -0
  101. package/dist/components/calcite-link2.js +14 -2
  102. package/dist/components/calcite-list-item.js +12 -0
  103. package/dist/components/calcite-modal.js +5 -2
  104. package/dist/components/calcite-notice.js +7 -0
  105. package/dist/components/calcite-panel.js +17 -12
  106. package/dist/components/calcite-pick-list-group.js +12 -0
  107. package/dist/components/calcite-pick-list-item2.js +12 -0
  108. package/dist/components/calcite-shell-center-row.js +13 -1
  109. package/dist/components/calcite-shell-panel.js +9 -4
  110. package/dist/components/calcite-shell.js +14 -2
  111. package/dist/components/calcite-tile2.js +12 -0
  112. package/dist/components/calcite-tip.js +13 -1
  113. package/dist/components/calcite-tree-item.js +5 -0
  114. package/dist/components/calcite-value-list-item.js +12 -0
  115. package/dist/components/conditionalSlot.js +40 -0
  116. package/dist/components/utils2.js +4 -1
  117. package/dist/custom-elements/index.js +300 -110
  118. package/dist/esm/calcite-action-bar.entry.js +2 -23
  119. package/dist/esm/calcite-action-group.entry.js +13 -0
  120. package/dist/esm/calcite-action-menu.entry.js +3 -0
  121. package/dist/esm/calcite-action-pad.entry.js +8 -0
  122. package/dist/esm/calcite-alert.entry.js +15 -9
  123. package/dist/esm/calcite-block_2.entry.js +14 -1
  124. package/dist/esm/calcite-chip.entry.js +14 -1
  125. package/dist/esm/calcite-combobox_3.entry.js +22 -11
  126. package/dist/esm/calcite-input.entry.js +3 -0
  127. package/dist/esm/calcite-link.entry.js +13 -2
  128. package/dist/esm/calcite-list_3.entry.js +13 -0
  129. package/dist/esm/calcite-modal.entry.js +5 -2
  130. package/dist/esm/calcite-notice.entry.js +8 -0
  131. package/dist/esm/calcite-panel.entry.js +18 -12
  132. package/dist/esm/calcite-pick-list_3.entry.js +23 -0
  133. package/dist/esm/calcite-shell_3.entry.js +35 -7
  134. package/dist/esm/calcite-tile.entry.js +13 -0
  135. package/dist/esm/calcite-tip_3.entry.js +13 -1
  136. package/dist/esm/calcite-tree_2.entry.js +6 -0
  137. package/dist/esm/calcite-value-list_2.entry.js +12 -0
  138. package/dist/esm/calcite.js +1 -1
  139. package/dist/esm/conditionalSlot-0c4ea23a.js +40 -0
  140. package/dist/esm/loader.js +1 -1
  141. package/dist/esm-es5/calcite-action-bar.entry.js +2 -2
  142. package/dist/esm-es5/calcite-action-group.entry.js +1 -1
  143. package/dist/esm-es5/calcite-action-menu.entry.js +2 -2
  144. package/dist/esm-es5/calcite-action-pad.entry.js +2 -2
  145. package/dist/esm-es5/calcite-alert.entry.js +1 -1
  146. package/dist/esm-es5/calcite-block_2.entry.js +1 -1
  147. package/dist/esm-es5/calcite-chip.entry.js +2 -2
  148. package/dist/esm-es5/calcite-combobox_3.entry.js +2 -2
  149. package/dist/esm-es5/calcite-input.entry.js +1 -1
  150. package/dist/esm-es5/calcite-link.entry.js +2 -2
  151. package/dist/esm-es5/calcite-list_3.entry.js +1 -1
  152. package/dist/esm-es5/calcite-modal.entry.js +1 -1
  153. package/dist/esm-es5/calcite-notice.entry.js +2 -2
  154. package/dist/esm-es5/calcite-panel.entry.js +2 -2
  155. package/dist/esm-es5/calcite-pick-list_3.entry.js +1 -1
  156. package/dist/esm-es5/calcite-shell_3.entry.js +1 -1
  157. package/dist/esm-es5/calcite-tile.entry.js +1 -1
  158. package/dist/esm-es5/calcite-tip_3.entry.js +1 -1
  159. package/dist/esm-es5/calcite-tree_2.entry.js +1 -1
  160. package/dist/esm-es5/calcite-value-list_2.entry.js +1 -1
  161. package/dist/esm-es5/calcite.js +1 -1
  162. package/dist/esm-es5/conditionalSlot-0c4ea23a.js +5 -0
  163. package/dist/esm-es5/loader.js +1 -1
  164. package/dist/extras/docs-json.json +43 -1
  165. package/dist/types/components/calcite-action-group/calcite-action-group.d.ts +4 -1
  166. package/dist/types/components/calcite-action-menu/calcite-action-menu.d.ts +2 -1
  167. package/dist/types/components/calcite-action-pad/calcite-action-pad.d.ts +4 -1
  168. package/dist/types/components/calcite-alert/calcite-alert.d.ts +2 -0
  169. package/dist/types/components/calcite-block/calcite-block.d.ts +4 -1
  170. package/dist/types/components/calcite-chip/calcite-chip.d.ts +4 -1
  171. package/dist/types/components/calcite-combobox/calcite-combobox.d.ts +4 -0
  172. package/dist/types/components/calcite-combobox/resources.d.ts +3 -0
  173. package/dist/types/components/calcite-link/calcite-link.d.ts +5 -0
  174. package/dist/types/components/calcite-list-item/calcite-list-item.d.ts +4 -1
  175. package/dist/types/components/calcite-modal/calcite-modal.d.ts +2 -1
  176. package/dist/types/components/calcite-notice/calcite-notice.d.ts +4 -1
  177. package/dist/types/components/calcite-panel/calcite-panel.d.ts +5 -6
  178. package/dist/types/components/calcite-pick-list-group/calcite-pick-list-group.d.ts +4 -1
  179. package/dist/types/components/calcite-pick-list-item/calcite-pick-list-item.d.ts +4 -1
  180. package/dist/types/components/calcite-shell/calcite-shell.d.ts +4 -1
  181. package/dist/types/components/calcite-shell-center-row/calcite-shell-center-row.d.ts +4 -1
  182. package/dist/types/components/calcite-shell-panel/calcite-shell-panel.d.ts +3 -1
  183. package/dist/types/components/calcite-tile/calcite-tile.d.ts +4 -1
  184. package/dist/types/components/calcite-tip/calcite-tip.d.ts +4 -1
  185. package/dist/types/components/calcite-tree-item/calcite-tree-item.d.ts +3 -1
  186. package/dist/types/components/calcite-value-list-item/calcite-value-list-item.d.ts +4 -1
  187. package/dist/types/components.d.ts +18 -0
  188. package/hydrate/index.js +301 -109
  189. package/package.json +1 -2
  190. package/dist/calcite/p-0af820bf.entry.js +0 -5
  191. package/dist/calcite/p-0cf878ed.system.entry.js +0 -5
  192. package/dist/calcite/p-1a5dae4a.entry.js +0 -5
  193. package/dist/calcite/p-1b3a66ec.system.entry.js +0 -5
  194. package/dist/calcite/p-1d7a9909.system.entry.js +0 -5
  195. package/dist/calcite/p-253efee4.entry.js +0 -5
  196. package/dist/calcite/p-2618de8a.entry.js +0 -5
  197. package/dist/calcite/p-273cd5ab.entry.js +0 -5
  198. package/dist/calcite/p-28adfebc.entry.js +0 -5
  199. package/dist/calcite/p-2a8938c7.system.entry.js +0 -5
  200. package/dist/calcite/p-2c954eaa.system.entry.js +0 -5
  201. package/dist/calcite/p-37bddb73.system.entry.js +0 -5
  202. package/dist/calcite/p-3ab992ff.system.entry.js +0 -5
  203. package/dist/calcite/p-3b73b785.system.entry.js +0 -5
  204. package/dist/calcite/p-4659df78.entry.js +0 -5
  205. package/dist/calcite/p-54e271c9.system.entry.js +0 -5
  206. package/dist/calcite/p-57558d4b.entry.js +0 -5
  207. package/dist/calcite/p-5df1936f.entry.js +0 -5
  208. package/dist/calcite/p-698167ac.entry.js +0 -5
  209. package/dist/calcite/p-7d355abe.system.entry.js +0 -5
  210. package/dist/calcite/p-85fb7bc0.entry.js +0 -5
  211. package/dist/calcite/p-8d36bc7c.entry.js +0 -5
  212. package/dist/calcite/p-9d81d229.entry.js +0 -5
  213. package/dist/calcite/p-a0043c61.entry.js +0 -5
  214. package/dist/calcite/p-a1f65f6e.entry.js +0 -5
  215. package/dist/calcite/p-a4dec1f6.system.entry.js +0 -5
  216. package/dist/calcite/p-a9c50960.system.entry.js +0 -5
  217. package/dist/calcite/p-aaed1677.entry.js +0 -5
  218. package/dist/calcite/p-ac778725.system.entry.js +0 -5
  219. package/dist/calcite/p-ac8cf248.entry.js +0 -5
  220. package/dist/calcite/p-b4d3f1c1.entry.js +0 -5
  221. package/dist/calcite/p-c0ed9eff.entry.js +0 -5
  222. package/dist/calcite/p-cb9cd28c.system.entry.js +0 -5
  223. package/dist/calcite/p-d578e568.system.entry.js +0 -5
  224. package/dist/calcite/p-e564004a.system.entry.js +0 -5
  225. package/dist/calcite/p-f6fc151d.system.entry.js +0 -5
  226. package/dist/calcite/p-f73124d0.entry.js +0 -5
@@ -18,6 +18,11 @@ export class CalciteLink {
18
18
  //--------------------------------------------------------------------------
19
19
  /** is the link disabled */
20
20
  this.disabled = false;
21
+ /** Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:
22
+ * Without a value, the browser will suggest a filename/extension
23
+ * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
24
+ */
25
+ this.download = false;
21
26
  /** the node type of the rendered child element */
22
27
  this.childElType = "span";
23
28
  //--------------------------------------------------------------------------
@@ -41,14 +46,20 @@ export class CalciteLink {
41
46
  this.childElType = this.href ? "a" : "span";
42
47
  }
43
48
  render() {
44
- const dir = getElementDir(this.el);
49
+ const { download, el } = this;
50
+ const dir = getElementDir(el);
45
51
  const iconStartEl = (h("calcite-icon", { class: "calcite-link--icon icon-start", flipRtl: this.iconFlipRtl === "start" || this.iconFlipRtl === "both", icon: this.iconStart, scale: "s" }));
46
52
  const iconEndEl = (h("calcite-icon", { class: "calcite-link--icon icon-end", flipRtl: this.iconFlipRtl === "end" || this.iconFlipRtl === "both", icon: this.iconEnd, scale: "s" }));
47
53
  const Tag = this.childElType;
48
54
  const role = this.childElType === "span" ? "link" : null;
49
55
  const tabIndex = this.disabled ? -1 : this.childElType === "span" ? 0 : null;
50
56
  return (h(Host, { role: "presentation" },
51
- h(Tag, { class: { [CSS_UTILITY.rtl]: dir === "rtl" }, href: Tag === "a" && this.href, ref: this.storeTagRef, rel: Tag === "a" && this.rel, role: role, tabIndex: tabIndex, target: Tag === "a" && this.target },
57
+ h(Tag, { class: { [CSS_UTILITY.rtl]: dir === "rtl" },
58
+ /*
59
+ When the 'download' property of type 'boolean | string' is set to true, the value is "".
60
+ This works around that issue for now.
61
+ */
62
+ download: Tag === "a" && (download === "" || download) ? download : null, href: Tag === "a" && this.href, ref: this.storeTagRef, rel: Tag === "a" && this.rel, role: role, tabIndex: tabIndex, target: Tag === "a" && this.target },
52
63
  this.iconStart ? iconStartEl : null,
53
64
  h("slot", null),
54
65
  this.iconEnd ? iconEndEl : null)));
@@ -89,6 +100,24 @@ export class CalciteLink {
89
100
  "reflect": true,
90
101
  "defaultValue": "false"
91
102
  },
103
+ "download": {
104
+ "type": "any",
105
+ "mutable": false,
106
+ "complexType": {
107
+ "original": "string | boolean",
108
+ "resolved": "boolean | string",
109
+ "references": {}
110
+ },
111
+ "required": false,
112
+ "optional": false,
113
+ "docs": {
114
+ "tags": [],
115
+ "text": "Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:\nWithout a value, the browser will suggest a filename/extension\nSee: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download"
116
+ },
117
+ "attribute": "download",
118
+ "reflect": true,
119
+ "defaultValue": "false"
120
+ },
92
121
  "href": {
93
122
  "type": "string",
94
123
  "mutable": false,
@@ -5,6 +5,7 @@
5
5
  import { Component, Element, Prop, h, Host, Method } from "@stencil/core";
6
6
  import { SLOTS, CSS } from "./resources";
7
7
  import { getSlotted } from "../../utils/dom";
8
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
8
9
  /**
9
10
  * @slot - A slot for adding `calcite-list-item` and `calcite-list-item-group` elements.
10
11
  * @slot actions-start - A slot for adding actionable `calcite-action` elements before the content of the list item.
@@ -30,6 +31,17 @@ export class CalciteListItem {
30
31
  }
31
32
  // --------------------------------------------------------------------------
32
33
  //
34
+ // Lifecycle
35
+ //
36
+ // --------------------------------------------------------------------------
37
+ connectedCallback() {
38
+ connectConditionalSlotComponent(this);
39
+ }
40
+ disconnectedCallback() {
41
+ disconnectConditionalSlotComponent(this);
42
+ }
43
+ // --------------------------------------------------------------------------
44
+ //
33
45
  // Public Methods
34
46
  //
35
47
  // --------------------------------------------------------------------------
@@ -8,6 +8,7 @@ import { queryShadowRoot } from "@a11y/focus-trap/shadow";
8
8
  import { isFocusable, isHidden } from "@a11y/focus-trap/focusable";
9
9
  import { TEXT, SLOTS, CSS, ICONS } from "./resources";
10
10
  import { createObserver } from "../../utils/observers";
11
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
11
12
  const isFocusableExtended = (el) => {
12
13
  return isCalciteFocusable(el) || isFocusable(el);
13
14
  };
@@ -115,11 +116,13 @@ export class CalciteModal {
115
116
  var _a;
116
117
  (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
117
118
  this.updateFooterVisibility();
119
+ connectConditionalSlotComponent(this);
118
120
  }
119
121
  disconnectedCallback() {
120
122
  var _a;
121
123
  this.removeOverflowHiddenClass();
122
124
  (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
125
+ disconnectConditionalSlotComponent(this);
123
126
  }
124
127
  render() {
125
128
  return (h(Host, { "aria-describedby": this.contentId, "aria-labelledby": this.titleId, "aria-modal": "true", role: "dialog" },
@@ -141,7 +144,7 @@ export class CalciteModal {
141
144
  h("div", { "data-focus-fence": true, onFocus: this.focusFirstElement, tabindex: "0" }))));
142
145
  }
143
146
  renderFooter() {
144
- return this.hasFooter ? (h("div", { class: CSS.footer },
147
+ return this.hasFooter ? (h("div", { class: CSS.footer, key: "footer" },
145
148
  h("span", { class: CSS.back },
146
149
  h("slot", { name: SLOTS.back })),
147
150
  h("span", { class: CSS.secondary },
@@ -150,7 +153,7 @@ export class CalciteModal {
150
153
  h("slot", { name: SLOTS.primary })))) : null;
151
154
  }
152
155
  renderCloseButton() {
153
- return !this.disableCloseButton ? (h("button", { "aria-label": this.intlClose, class: CSS.close, onClick: this.close, ref: (el) => (this.closeButtonEl = el), title: this.intlClose },
156
+ return !this.disableCloseButton ? (h("button", { "aria-label": this.intlClose, class: CSS.close, key: "button", onClick: this.close, ref: (el) => (this.closeButtonEl = el), title: this.intlClose },
154
157
  h("calcite-icon", { icon: ICONS.close, scale: this.scale === "s" ? "s" : this.scale === "m" ? "m" : this.scale === "l" ? "l" : null }))) : null;
155
158
  }
156
159
  renderStyle() {
@@ -6,6 +6,7 @@ import { Component, Element, Event, h, Method, Prop, Watch } from "@stencil/core
6
6
  import { CSS, SLOTS, TEXT } from "./resources";
7
7
  import { StatusIcons } from "../calcite-alert/interfaces";
8
8
  import { getSlotted, setRequestedIcon } from "../../utils/dom";
9
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
9
10
  /** Notices are intended to be used to present users with important-but-not-crucial contextual tips or copy. Because
10
11
  * notices are displayed inline, a common use case is displaying them on page-load to present users with short hints or contextual copy.
11
12
  * They are optionally dismissible - useful for keeping track of whether or not a user has dismissed the notice. You can also choose not
@@ -56,6 +57,12 @@ export class CalciteNotice {
56
57
  // Lifecycle
57
58
  //
58
59
  //--------------------------------------------------------------------------
60
+ connectedCallback() {
61
+ connectConditionalSlotComponent(this);
62
+ }
63
+ disconnectedCallback() {
64
+ disconnectConditionalSlotComponent(this);
65
+ }
59
66
  componentWillLoad() {
60
67
  this.requestedIcon = setRequestedIcon(StatusIcons, this.icon, this.color);
61
68
  }
@@ -7,6 +7,7 @@ import { CSS, HEADING_LEVEL, ICONS, SLOTS, TEXT } from "./resources";
7
7
  import { getElementDir, getSlotted } from "../../utils/dom";
8
8
  import { CalciteHeading } from "../functional/CalciteHeading";
9
9
  import { SLOTS as ACTION_MENU_SLOTS } from "../calcite-action-menu/resources";
10
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
10
11
  /**
11
12
  * @slot - A slot for adding custom content.
12
13
  * @slot header-actions-start - A slot for adding actions or content to the start side of the panel header.
@@ -82,6 +83,17 @@ export class CalcitePanel {
82
83
  }
83
84
  // --------------------------------------------------------------------------
84
85
  //
86
+ // Lifecycle
87
+ //
88
+ // --------------------------------------------------------------------------
89
+ connectedCallback() {
90
+ connectConditionalSlotComponent(this);
91
+ }
92
+ disconnectedCallback() {
93
+ disconnectConditionalSlotComponent(this);
94
+ }
95
+ // --------------------------------------------------------------------------
96
+ //
85
97
  // Methods
86
98
  //
87
99
  // --------------------------------------------------------------------------
@@ -123,7 +135,7 @@ export class CalcitePanel {
123
135
  * Allows user to override the entire header-content node.
124
136
  */
125
137
  renderHeaderSlottedContent() {
126
- return (h("div", { class: CSS.headerContent, key: "header-content" },
138
+ return (h("div", { class: CSS.headerContent, key: "slotted-header-content" },
127
139
  h("slot", { name: SLOTS.headerContent })));
128
140
  }
129
141
  renderHeaderStartActions() {
@@ -145,7 +157,7 @@ export class CalcitePanel {
145
157
  renderMenu() {
146
158
  const { el, intlOptions, menuOpen } = this;
147
159
  const hasMenuItems = getSlotted(el, SLOTS.headerMenuActions);
148
- return hasMenuItems ? (h("calcite-action-menu", { flipPlacements: ["top", "bottom"], label: intlOptions || TEXT.options, open: menuOpen, placement: "bottom-end" },
160
+ return hasMenuItems ? (h("calcite-action-menu", { flipPlacements: ["top", "bottom"], key: "menu", label: intlOptions || TEXT.options, open: menuOpen, placement: "bottom-end" },
149
161
  h("calcite-action", { icon: ICONS.menu, slot: ACTION_MENU_SLOTS.trigger, text: intlOptions || TEXT.options }),
150
162
  h("slot", { name: SLOTS.headerMenuActions }))) : null;
151
163
  }
@@ -170,20 +182,13 @@ export class CalcitePanel {
170
182
  actionsNodeEnd,
171
183
  headerMenuNode)) : null;
172
184
  }
173
- /**
174
- * Allows user to override the entire footer node.
175
- */
176
- renderFooterSlottedContent() {
185
+ renderFooterNode() {
177
186
  const { el } = this;
178
187
  const hasFooterSlottedContent = getSlotted(el, SLOTS.footer);
179
- return hasFooterSlottedContent ? (h("footer", { class: CSS.footer },
180
- h("slot", { name: SLOTS.footer }))) : null;
181
- }
182
- renderFooterActions() {
183
- const { el } = this;
184
188
  const hasFooterActions = getSlotted(el, SLOTS.footerActions);
185
- return hasFooterActions ? (h("footer", { class: CSS.footer },
186
- h("slot", { name: SLOTS.footerActions }))) : null;
189
+ return hasFooterSlottedContent || hasFooterActions ? (h("footer", { class: CSS.footer, key: "footer" },
190
+ hasFooterSlottedContent ? h("slot", { key: "footer-slot", name: SLOTS.footer }) : null,
191
+ hasFooterActions ? h("slot", { key: "footer-actions-slot", name: SLOTS.footerActions }) : null)) : null;
187
192
  }
188
193
  renderContent() {
189
194
  const { el } = this;
@@ -203,7 +208,7 @@ export class CalcitePanel {
203
208
  const panelNode = (h("article", { "aria-busy": loading.toString(), class: CSS.container, hidden: dismissible && dismissed, onKeyDown: panelKeyDownHandler, ref: this.setContainerRef, tabIndex: dismissible ? 0 : -1 },
204
209
  this.renderHeaderNode(),
205
210
  this.renderContent(),
206
- this.renderFooterSlottedContent() || this.renderFooterActions()));
211
+ this.renderFooterNode()));
207
212
  return (h(Fragment, null,
208
213
  loading || disabled ? h("calcite-scrim", { loading: loading }) : null,
209
214
  panelNode));
@@ -7,10 +7,22 @@ import { CSS, SLOTS } from "./resources";
7
7
  import { HEADING_LEVEL } from "./resources";
8
8
  import { getSlotted } from "../../utils/dom";
9
9
  import { CalciteHeading, constrainHeadingLevel } from "../functional/CalciteHeading";
10
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
10
11
  /**
11
12
  * @slot - A slot for adding `calcite-pick-list-item` elements.
12
13
  */
13
14
  export class CalcitePickListGroup {
15
+ // --------------------------------------------------------------------------
16
+ //
17
+ // Lifecycle
18
+ //
19
+ // --------------------------------------------------------------------------
20
+ connectedCallback() {
21
+ connectConditionalSlotComponent(this);
22
+ }
23
+ disconnectedCallback() {
24
+ disconnectConditionalSlotComponent(this);
25
+ }
14
26
  // --------------------------------------------------------------------------
15
27
  //
16
28
  // Render Methods
@@ -6,6 +6,7 @@ import { Component, Element, Event, Fragment, h, Method, Prop, Watch } from "@st
6
6
  import { CSS, ICONS, SLOTS, TEXT } from "./resources";
7
7
  import { ICON_TYPES } from "../calcite-pick-list/resources";
8
8
  import { getSlotted } from "../../utils/dom";
9
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
9
10
  /**
10
11
  * @slot actions-end - a slot for adding actions or content to the end side of the item.
11
12
  * @slot actions-start - a slot for adding actions or content to the start side of the item.
@@ -90,6 +91,17 @@ export class CalcitePickListItem {
90
91
  }
91
92
  // --------------------------------------------------------------------------
92
93
  //
94
+ // Lifecycle
95
+ //
96
+ // --------------------------------------------------------------------------
97
+ connectedCallback() {
98
+ connectConditionalSlotComponent(this);
99
+ }
100
+ disconnectedCallback() {
101
+ disconnectConditionalSlotComponent(this);
102
+ }
103
+ // --------------------------------------------------------------------------
104
+ //
93
105
  // Public Methods
94
106
  //
95
107
  // --------------------------------------------------------------------------
@@ -5,6 +5,7 @@
5
5
  import { Component, Element, Prop, h, Fragment } from "@stencil/core";
6
6
  import { CSS, SLOTS } from "./resources";
7
7
  import { getSlotted } from "../../utils/dom";
8
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
8
9
  /**
9
10
  * @slot - A slot for adding content to the shell. This content will appear between any leading and trailing panels added to the shell. (eg. a map)
10
11
  * @slot header - A slot for adding header content. This content will be positioned at the top of the shell.
@@ -27,12 +28,23 @@ export class CalciteShell {
27
28
  }
28
29
  // --------------------------------------------------------------------------
29
30
  //
31
+ // Lifecycle
32
+ //
33
+ // --------------------------------------------------------------------------
34
+ connectedCallback() {
35
+ connectConditionalSlotComponent(this);
36
+ }
37
+ disconnectedCallback() {
38
+ disconnectConditionalSlotComponent(this);
39
+ }
40
+ // --------------------------------------------------------------------------
41
+ //
30
42
  // Render Methods
31
43
  //
32
44
  // --------------------------------------------------------------------------
33
45
  renderHeader() {
34
46
  const hasHeader = !!getSlotted(this.el, SLOTS.header);
35
- return hasHeader ? h("slot", { name: SLOTS.header }) : null;
47
+ return hasHeader ? h("slot", { key: "header", name: SLOTS.header }) : null;
36
48
  }
37
49
  renderContent() {
38
50
  const content = !!this.contentBehind
@@ -53,7 +65,7 @@ export class CalciteShell {
53
65
  }
54
66
  renderFooter() {
55
67
  const hasFooter = !!getSlotted(this.el, SLOTS.footer);
56
- return hasFooter ? (h("div", { class: CSS.footer },
68
+ return hasFooter ? (h("div", { class: CSS.footer, key: "footer" },
57
69
  h("slot", { name: SLOTS.footer }))) : null;
58
70
  }
59
71
  renderMain() {
@@ -5,6 +5,7 @@
5
5
  import { Component, Element, Prop, h, Fragment } from "@stencil/core";
6
6
  import { CSS, SLOTS } from "./resources";
7
7
  import { getSlotted } from "../../utils/dom";
8
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
8
9
  /**
9
10
  * @slot - A slot for adding content to the shell panel.
10
11
  * @slot action-bar - A slot for adding a `calcite-action-bar` to the panel.
@@ -31,6 +32,17 @@ export class CalciteShellCenterRow {
31
32
  }
32
33
  // --------------------------------------------------------------------------
33
34
  //
35
+ // Lifecycle
36
+ //
37
+ // --------------------------------------------------------------------------
38
+ connectedCallback() {
39
+ connectConditionalSlotComponent(this);
40
+ }
41
+ disconnectedCallback() {
42
+ disconnectConditionalSlotComponent(this);
43
+ }
44
+ // --------------------------------------------------------------------------
45
+ //
34
46
  // Render Methods
35
47
  //
36
48
  // --------------------------------------------------------------------------
@@ -39,7 +51,7 @@ export class CalciteShellCenterRow {
39
51
  const contentNode = (h("div", { class: CSS.content },
40
52
  h("slot", null)));
41
53
  const actionBar = getSlotted(el, SLOTS.actionBar);
42
- const actionBarNode = actionBar ? (h("div", { class: CSS.actionBarContainer },
54
+ const actionBarNode = actionBar ? (h("div", { class: CSS.actionBarContainer, key: "action-bar" },
43
55
  h("slot", { name: SLOTS.actionBar }))) : null;
44
56
  const children = [actionBarNode, contentNode];
45
57
  if ((actionBar === null || actionBar === void 0 ? void 0 : actionBar.position) === "end") {
@@ -6,6 +6,7 @@ import { Component, Element, Event, Prop, Watch, h, State, forceUpdate } from "@
6
6
  import { CSS, SLOTS, TEXT } from "./resources";
7
7
  import { getSlotted, getElementDir } from "../../utils/dom";
8
8
  import { clamp } from "../../utils/math";
9
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
9
10
  /**
10
11
  * @slot - A slot for adding content to the shell panel.
11
12
  * @slot action-bar - A slot for adding a `calcite-action-bar` to the panel.
@@ -151,7 +152,11 @@ export class CalciteShellPanel {
151
152
  // Lifecycle
152
153
  //
153
154
  //--------------------------------------------------------------------------
155
+ connectedCallback() {
156
+ connectConditionalSlotComponent(this);
157
+ }
154
158
  disconnectedCallback() {
159
+ disconnectConditionalSlotComponent(this);
155
160
  this.disconnectSeparator();
156
161
  }
157
162
  componentDidLoad() {
@@ -165,18 +170,18 @@ export class CalciteShellPanel {
165
170
  renderHeader() {
166
171
  const { el } = this;
167
172
  const hasHeader = getSlotted(el, SLOTS.header);
168
- return hasHeader ? (h("div", { class: CSS.contentHeader },
173
+ return hasHeader ? (h("div", { class: CSS.contentHeader, key: "header" },
169
174
  h("slot", { name: SLOTS.header }))) : null;
170
175
  }
171
176
  render() {
172
177
  const { collapsed, detached, position, initialContentWidth, contentWidth, contentWidthMax, contentWidthMin, intlResize, resizable } = this;
173
178
  const allowResizing = !detached && resizable;
174
- const contentNode = (h("div", { class: { [CSS.content]: true, [CSS.contentDetached]: detached }, hidden: collapsed, ref: this.storeContentEl, style: allowResizing && contentWidth ? { width: `${contentWidth}px` } : null },
179
+ const contentNode = (h("div", { class: { [CSS.content]: true, [CSS.contentDetached]: detached }, hidden: collapsed, key: "content", ref: this.storeContentEl, style: allowResizing && contentWidth ? { width: `${contentWidth}px` } : null },
175
180
  this.renderHeader(),
176
181
  h("div", { class: CSS.contentBody },
177
182
  h("slot", null))));
178
- const separatorNode = allowResizing ? (h("div", { "aria-label": intlResize, "aria-orientation": "horizontal", "aria-valuemax": contentWidthMax, "aria-valuemin": contentWidthMin, "aria-valuenow": contentWidth !== null && contentWidth !== void 0 ? contentWidth : initialContentWidth, class: CSS.separator, onKeyDown: this.separatorKeyDown, ref: this.connectSeparator, role: "separator", tabIndex: 0, "touch-action": "none" })) : null;
179
- const actionBarNode = h("slot", { name: SLOTS.actionBar });
183
+ const separatorNode = allowResizing ? (h("div", { "aria-label": intlResize, "aria-orientation": "horizontal", "aria-valuemax": contentWidthMax, "aria-valuemin": contentWidthMin, "aria-valuenow": contentWidth !== null && contentWidth !== void 0 ? contentWidth : initialContentWidth, class: CSS.separator, key: "separator", onKeyDown: this.separatorKeyDown, ref: this.connectSeparator, role: "separator", tabIndex: 0, "touch-action": "none" })) : null;
184
+ const actionBarNode = h("slot", { key: "action-bar", name: SLOTS.actionBar });
180
185
  const mainNodes = [actionBarNode, contentNode, separatorNode];
181
186
  if (position === "end") {
182
187
  mainNodes.reverse();
@@ -5,6 +5,7 @@
5
5
  import { Component, Element, Fragment, h, Prop } from "@stencil/core";
6
6
  import { SLOTS } from "./resources";
7
7
  import { getSlotted } from "../../utils/dom";
8
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
8
9
  /**
9
10
  * @slot content-start - A slot for adding non-actionable elements before the tile content.
10
11
  * @slot content-end - A slot for adding non-actionable elements after the tile content.
@@ -34,6 +35,17 @@ export class CalciteTile {
34
35
  }
35
36
  // --------------------------------------------------------------------------
36
37
  //
38
+ // Lifecycle
39
+ //
40
+ // --------------------------------------------------------------------------
41
+ connectedCallback() {
42
+ connectConditionalSlotComponent(this);
43
+ }
44
+ disconnectedCallback() {
45
+ disconnectConditionalSlotComponent(this);
46
+ }
47
+ // --------------------------------------------------------------------------
48
+ //
37
49
  // Render Methods
38
50
  //
39
51
  // --------------------------------------------------------------------------
@@ -6,6 +6,7 @@ import { Component, Element, Event, Prop, h, Fragment } from "@stencil/core";
6
6
  import { CSS, ICONS, SLOTS, TEXT, HEADING_LEVEL } from "./resources";
7
7
  import { getSlotted } from "../../utils/dom";
8
8
  import { CalciteHeading, constrainHeadingLevel } from "../functional/CalciteHeading";
9
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
9
10
  /**
10
11
  * @slot - A slot for adding text and a hyperlink.
11
12
  * @slot thumbnail - A slot for adding an HTML image element to the tip.
@@ -41,6 +42,17 @@ export class CalciteTip {
41
42
  }
42
43
  // --------------------------------------------------------------------------
43
44
  //
45
+ // Lifecycle
46
+ //
47
+ // --------------------------------------------------------------------------
48
+ connectedCallback() {
49
+ connectConditionalSlotComponent(this);
50
+ }
51
+ disconnectedCallback() {
52
+ disconnectConditionalSlotComponent(this);
53
+ }
54
+ // --------------------------------------------------------------------------
55
+ //
44
56
  // Render Methods
45
57
  //
46
58
  // --------------------------------------------------------------------------
@@ -60,7 +72,7 @@ export class CalciteTip {
60
72
  }
61
73
  renderImageFrame() {
62
74
  const { el } = this;
63
- return getSlotted(el, SLOTS.thumbnail) ? (h("div", { class: CSS.imageFrame },
75
+ return getSlotted(el, SLOTS.thumbnail) ? (h("div", { class: CSS.imageFrame, key: "thumbnail" },
64
76
  h("slot", { name: SLOTS.thumbnail }))) : null;
65
77
  }
66
78
  renderInfoNode() {
@@ -7,6 +7,7 @@ import { TreeSelectionMode } from "../calcite-tree/interfaces";
7
7
  import { nodeListToArray, getElementDir, filterDirectChildren, getSlotted } from "../../utils/dom";
8
8
  import { CSS, SLOTS, ICONS } from "./resources";
9
9
  import { CSS_UTILITY } from "../../utils/resources";
10
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
10
11
  /**
11
12
  * @slot - A slot for adding content to the item.
12
13
  * @slot children - A slot for adding nested `calcite-tree` elements.
@@ -78,6 +79,10 @@ export class CalciteTreeItem {
78
79
  const { expanded } = this.parentTreeItem;
79
80
  this.updateParentIsExpanded(this.parentTreeItem, expanded);
80
81
  }
82
+ connectConditionalSlotComponent(this);
83
+ }
84
+ disconnectedCallback() {
85
+ disconnectConditionalSlotComponent(this);
81
86
  }
82
87
  componentWillRender() {
83
88
  this.hasChildren = !!this.el.querySelector("calcite-tree");
@@ -9,6 +9,7 @@ import { CSS } from "../calcite-pick-list-item/resources";
9
9
  import { ICONS, SLOTS } from "./resources";
10
10
  import { SLOTS as PICK_LIST_SLOTS } from "../calcite-pick-list-item/resources";
11
11
  import { getSlotted } from "../../utils/dom";
12
+ import { connectConditionalSlotComponent, disconnectConditionalSlotComponent } from "../../utils/conditionalSlot";
12
13
  /**
13
14
  * @slot actions-end - A slot for adding actions or content to the end side of the item.
14
15
  * @slot actions-start - A slot for adding actions or content to the start side of the item.
@@ -66,6 +67,17 @@ export class CalciteValueListItem {
66
67
  }
67
68
  // --------------------------------------------------------------------------
68
69
  //
70
+ // Lifecycle
71
+ //
72
+ // --------------------------------------------------------------------------
73
+ connectedCallback() {
74
+ connectConditionalSlotComponent(this);
75
+ }
76
+ disconnectedCallback() {
77
+ disconnectConditionalSlotComponent(this);
78
+ }
79
+ // --------------------------------------------------------------------------
80
+ //
69
81
  // Public Methods
70
82
  //
71
83
  // --------------------------------------------------------------------------
@@ -3,24 +3,35 @@
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
4
  */
5
5
  import { forceUpdate } from "@stencil/core";
6
- const slotChangedMap = new WeakMap();
7
- function onSlotChange() {
8
- forceUpdate(this);
9
- }
10
- const eventType = "slotchange";
6
+ import { createObserver } from "./observers";
7
+ const observed = new Set();
8
+ let mutationObserver;
9
+ const observerOptions = { childList: true };
11
10
  /**
12
11
  * Helper to set up a conditional slot component on connectedCallback.
13
12
  */
14
13
  export function connectConditionalSlotComponent(component) {
15
- const boundSlotChange = onSlotChange.bind(component);
16
- component.el.shadowRoot.addEventListener(eventType, boundSlotChange);
17
- slotChangedMap.set(component, boundSlotChange);
14
+ if (!mutationObserver) {
15
+ mutationObserver = createObserver("mutation", processMutations);
16
+ }
17
+ mutationObserver.observe(component.el, observerOptions);
18
18
  }
19
19
  /**
20
20
  * Helper to tear down a conditional slot component on disconnectedCallback.
21
21
  */
22
22
  export function disconnectConditionalSlotComponent(component) {
23
- const boundSlotChange = slotChangedMap.get(component);
24
- component.el.shadowRoot.removeEventListener(eventType, boundSlotChange);
25
- slotChangedMap.delete(component);
23
+ observed.delete(component.el);
24
+ // we explicitly process queued mutations and disconnect and reconnect
25
+ // the observer until MutationObserver gets an `unobserve` method
26
+ // see https://github.com/whatwg/dom/issues/126
27
+ processMutations(mutationObserver.takeRecords());
28
+ mutationObserver.disconnect();
29
+ for (const [element] of observed.entries()) {
30
+ mutationObserver.observe(element, observerOptions);
31
+ }
32
+ }
33
+ function processMutations(mutations) {
34
+ mutations.forEach(({ target }) => {
35
+ forceUpdate(target);
36
+ });
26
37
  }
@@ -2,10 +2,11 @@
2
2
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
4
  */
5
- import { forceUpdate, HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
5
+ import { HTMLElement, createEvent, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
6
6
  import { t as toggleChildActionText, C as CalciteExpandToggle, o as overflowActionsDebounceInMs, q as queryActions, a as overflowActions, g as getOverflowCount } from './CalciteExpandToggle.js';
7
7
  import { f as focusElement, b as getSlotted } from './dom.js';
8
8
  import { c as createObserver } from './observers.js';
9
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot.js';
9
10
  import { d as defineCustomElement$8 } from './calcite-action2.js';
10
11
  import { d as defineCustomElement$7 } from './calcite-action-group2.js';
11
12
  import { d as defineCustomElement$6 } from './calcite-action-menu2.js';
@@ -27,28 +28,6 @@ const TEXT = {
27
28
  collapse: "Collapse"
28
29
  };
29
30
 
30
- const slotChangedMap = new WeakMap();
31
- function onSlotChange() {
32
- forceUpdate(this);
33
- }
34
- const eventType = "slotchange";
35
- /**
36
- * Helper to set up a conditional slot component on connectedCallback.
37
- */
38
- function connectConditionalSlotComponent(component) {
39
- const boundSlotChange = onSlotChange.bind(component);
40
- component.el.shadowRoot.addEventListener(eventType, boundSlotChange);
41
- slotChangedMap.set(component, boundSlotChange);
42
- }
43
- /**
44
- * Helper to tear down a conditional slot component on disconnectedCallback.
45
- */
46
- function disconnectConditionalSlotComponent(component) {
47
- const boundSlotChange = slotChangedMap.get(component);
48
- component.el.shadowRoot.removeEventListener(eventType, boundSlotChange);
49
- slotChangedMap.delete(component);
50
- }
51
-
52
31
  const calciteActionBarCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{pointer-events:auto;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:stretch;align-self:stretch;max-width:15vw}:host([overflow-actions-disabled]){overflow-y:auto}:host([expanded]){max-width:20vw}::slotted(calcite-action-group){border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}::slotted(calcite-action-group:last-child){border-bottom-width:0px}.action-group--bottom{-ms-flex-positive:1;flex-grow:1;-ms-flex-pack:end;justify-content:flex-end;padding-bottom:0px}";
53
32
 
54
33
  let CalciteActionBar$1 = class extends HTMLElement {
@@ -5,6 +5,7 @@
5
5
  import { HTMLElement, h, Fragment, proxyCustomElement } from '@stencil/core/internal/client';
6
6
  import { b as getSlotted } from './dom.js';
7
7
  import { S as SLOTS$1, d as defineCustomElement$5 } from './calcite-action-menu2.js';
8
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot.js';
8
9
  import { d as defineCustomElement$6 } from './calcite-action2.js';
9
10
  import { d as defineCustomElement$4 } from './calcite-icon2.js';
10
11
  import { d as defineCustomElement$3 } from './calcite-loader2.js';
@@ -60,6 +61,17 @@ let CalciteActionGroup = class extends HTMLElement {
60
61
  }
61
62
  // --------------------------------------------------------------------------
62
63
  //
64
+ // Lifecycle
65
+ //
66
+ // --------------------------------------------------------------------------
67
+ connectedCallback() {
68
+ connectConditionalSlotComponent(this);
69
+ }
70
+ disconnectedCallback() {
71
+ disconnectConditionalSlotComponent(this);
72
+ }
73
+ // --------------------------------------------------------------------------
74
+ //
63
75
  // Component Methods
64
76
  //
65
77
  // --------------------------------------------------------------------------
@@ -7,6 +7,7 @@ import { b as getSlotted, f as focusElement } from './dom.js';
7
7
  import { g as getRoundRobinIndex } from './array.js';
8
8
  import { g as guid } from './guid.js';
9
9
  import { c as createObserver } from './observers.js';
10
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot.js';
10
11
  import { d as defineCustomElement$5 } from './calcite-action2.js';
11
12
  import { d as defineCustomElement$4 } from './calcite-icon2.js';
12
13
  import { d as defineCustomElement$3 } from './calcite-loader2.js';
@@ -237,11 +238,13 @@ let CalciteActionMenu = class extends HTMLElement {
237
238
  var _a;
238
239
  (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
239
240
  this.getActions();
241
+ connectConditionalSlotComponent(this);
240
242
  }
241
243
  disconnectedCallback() {
242
244
  var _a;
243
245
  (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
244
246
  this.disconnectMenuButtonEl();
247
+ disconnectConditionalSlotComponent(this);
245
248
  }
246
249
  expandedHandler() {
247
250
  this.open = false;