@esri/solutions-components 0.3.5 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +26 -8
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +2 -2
  3. package/dist/cjs/calcite-input-message_5.cjs.entry.js +6 -4
  4. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  5. package/dist/cjs/{csvUtils-83af7ae1.js → csvUtils-34666909.js} +1 -1
  6. package/dist/cjs/{interfaces-772edf61.js → interfaces-17c631bf.js} +1 -1
  7. package/dist/cjs/layer-table.cjs.entry.js +3 -3
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/map-card.cjs.entry.js +1 -1
  10. package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
  11. package/dist/cjs/public-notification.cjs.entry.js +41 -7
  12. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  13. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  14. package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
  15. package/dist/cjs/solutions-components.cjs.js +1 -1
  16. package/dist/collection/components/buffer-tools/buffer-tools.js +48 -0
  17. package/dist/collection/components/map-draw-tools/map-draw-tools.js +10 -4
  18. package/dist/collection/components/public-notification/public-notification.css +12 -12
  19. package/dist/collection/components/public-notification/public-notification.js +50 -4
  20. package/dist/collection/components/refine-selection/refine-selection.js +4 -2
  21. package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
  22. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
  23. package/dist/collection/demos/new-public-notification.html +7 -6
  24. package/dist/collection/utils/interfaces.js +1 -1
  25. package/dist/collection/utils/interfaces.ts +7 -2
  26. package/dist/components/buffer-tools2.js +10 -0
  27. package/dist/components/interfaces3.js +1 -1
  28. package/dist/components/map-draw-tools2.js +10 -4
  29. package/dist/components/public-notification.js +40 -6
  30. package/dist/components/refine-selection-tools2.js +4 -2
  31. package/dist/components/refine-selection2.js +4 -2
  32. package/dist/esm/buffer-tools_6.entry.js +26 -8
  33. package/dist/esm/calcite-combobox_3.entry.js +2 -2
  34. package/dist/esm/calcite-input-message_5.entry.js +6 -4
  35. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  36. package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
  37. package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
  38. package/dist/esm/layer-table.entry.js +3 -3
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/map-card.entry.js +1 -1
  41. package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
  42. package/dist/esm/public-notification.entry.js +41 -7
  43. package/dist/esm/solution-configuration.entry.js +2 -2
  44. package/dist/esm/solution-contents_3.entry.js +2 -2
  45. package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
  46. package/dist/esm/solutions-components.js +1 -1
  47. package/dist/solutions-components/demos/new-public-notification.html +7 -6
  48. package/dist/solutions-components/p-05e64bd1.js +498 -2
  49. package/dist/solutions-components/p-08a95b33.entry.js +138 -0
  50. package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
  51. package/dist/solutions-components/p-0ef91144.entry.js +913 -0
  52. package/dist/solutions-components/p-0f523243.entry.js +1916 -0
  53. package/dist/solutions-components/p-11b9510e.entry.js +173 -0
  54. package/dist/solutions-components/p-1b875d94.entry.js +58 -0
  55. package/dist/solutions-components/p-1c567f3a.js +23 -16
  56. package/dist/solutions-components/p-1c883db9.entry.js +43 -0
  57. package/dist/solutions-components/p-1f225056.js +322 -0
  58. package/dist/solutions-components/p-1f499e67.entry.js +72 -0
  59. package/dist/solutions-components/p-20d3d758.entry.js +881 -0
  60. package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
  61. package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
  62. package/dist/solutions-components/p-2447798c.entry.js +155 -0
  63. package/dist/solutions-components/p-2525e691.entry.js +432 -0
  64. package/dist/solutions-components/p-2561f5b5.js +4092 -0
  65. package/dist/solutions-components/p-29f887c0.entry.js +234 -0
  66. package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
  67. package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
  68. package/dist/solutions-components/p-2e9ed892.js +46 -1
  69. package/dist/solutions-components/p-316f56db.js +219 -2
  70. package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
  71. package/dist/solutions-components/p-356f8b54.entry.js +138 -0
  72. package/dist/solutions-components/p-359c58de.entry.js +172 -0
  73. package/dist/solutions-components/p-37336c0d.entry.js +116 -0
  74. package/dist/solutions-components/p-374a5031.js +105 -2
  75. package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
  76. package/dist/solutions-components/p-3b010ce1.js +17 -1
  77. package/dist/solutions-components/p-4307dacd.js +194 -1
  78. package/dist/solutions-components/p-44da2507.js +405 -14
  79. package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
  80. package/dist/solutions-components/p-4894bbeb.js +53 -2
  81. package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
  82. package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
  83. package/dist/solutions-components/p-4e32bf8c.js +482 -1
  84. package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
  85. package/dist/solutions-components/p-508317b3.js +13 -2
  86. package/dist/solutions-components/p-54697d58.entry.js +198 -0
  87. package/dist/solutions-components/p-55c79103.entry.js +311 -0
  88. package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
  89. package/dist/solutions-components/p-59b48fde.entry.js +443 -0
  90. package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
  91. package/dist/solutions-components/p-621d0534.entry.js +123 -0
  92. package/dist/solutions-components/p-63f6e8f1.js +14 -1
  93. package/dist/solutions-components/p-66aeec57.entry.js +61 -0
  94. package/dist/solutions-components/p-69834f46.entry.js +618 -0
  95. package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
  96. package/dist/solutions-components/p-6e0da576.js +13 -1
  97. package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
  98. package/dist/solutions-components/p-6fe17794.js +9 -1
  99. package/dist/solutions-components/p-7024cb16.entry.js +72 -0
  100. package/dist/solutions-components/p-70535506.entry.js +226 -0
  101. package/dist/solutions-components/p-708a63a8.js +12 -1
  102. package/dist/solutions-components/p-729708a3.js +14 -1
  103. package/dist/solutions-components/p-73e23995.js +6 -1
  104. package/dist/solutions-components/p-74b29d75.entry.js +231 -0
  105. package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
  106. package/dist/solutions-components/p-77182c3a.js +3015 -1
  107. package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
  108. package/dist/solutions-components/p-79709c19.js +60 -3
  109. package/dist/solutions-components/p-7a46ef97.js +181 -2
  110. package/dist/solutions-components/p-7be159e6.entry.js +175 -0
  111. package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
  112. package/dist/solutions-components/p-7daea1df.js +41 -1
  113. package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
  114. package/dist/solutions-components/p-7fb45059.entry.js +43 -0
  115. package/dist/solutions-components/p-815533de.js +306 -3
  116. package/dist/solutions-components/p-816622ca.entry.js +248 -0
  117. package/dist/solutions-components/p-83166522.js +205 -2
  118. package/dist/solutions-components/p-83bd1991.entry.js +36 -0
  119. package/dist/solutions-components/p-856464d7.entry.js +572 -0
  120. package/dist/solutions-components/p-8c349bad.entry.js +347 -0
  121. package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
  122. package/dist/solutions-components/p-904c185a.entry.js +228 -0
  123. package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
  124. package/dist/solutions-components/p-9371145a.entry.js +477 -0
  125. package/dist/solutions-components/p-93d3119d.js +1948 -1
  126. package/dist/solutions-components/p-95ec8062.entry.js +173 -0
  127. package/dist/solutions-components/p-991ee695.js +109 -1
  128. package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
  129. package/dist/solutions-components/p-9a9955db.js +41 -1
  130. package/dist/solutions-components/p-9c1ebc90.js +35 -16
  131. package/dist/solutions-components/p-9eba5c66.js +399 -3
  132. package/dist/solutions-components/p-a033a507.entry.js +252 -0
  133. package/dist/solutions-components/p-a3773415.entry.js +1132 -0
  134. package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
  135. package/dist/solutions-components/p-a5b1ab03.js +33 -3
  136. package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
  137. package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
  138. package/dist/solutions-components/p-a8005026.entry.js +565 -0
  139. package/dist/solutions-components/p-a80b3880.js +14 -1
  140. package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
  141. package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
  142. package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
  143. package/dist/solutions-components/p-ae1fd76b.js +11 -1
  144. package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
  145. package/dist/solutions-components/p-b359dc78.js +41 -1
  146. package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
  147. package/dist/solutions-components/p-b75cc407.entry.js +145 -0
  148. package/dist/solutions-components/p-b911cb75.entry.js +71 -0
  149. package/dist/solutions-components/p-b965e177.entry.js +335 -0
  150. package/dist/solutions-components/p-b978636e.js +14 -1
  151. package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
  152. package/dist/solutions-components/p-bd67334c.js +122 -2
  153. package/dist/solutions-components/p-bde20dba.entry.js +212 -0
  154. package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
  155. package/dist/solutions-components/p-c023e6a1.js +2028 -2
  156. package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
  157. package/dist/solutions-components/p-c579ed60.entry.js +447 -0
  158. package/dist/solutions-components/p-c92bc231.js +101 -2
  159. package/dist/solutions-components/p-cc815aca.js +839 -16
  160. package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
  161. package/dist/solutions-components/p-cdc46c0c.js +1751 -2
  162. package/dist/solutions-components/p-d12e6992.entry.js +118 -0
  163. package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
  164. package/dist/solutions-components/p-d48a24e6.js +754 -2
  165. package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
  166. package/dist/solutions-components/p-dbc9a5a8.js +80 -0
  167. package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
  168. package/dist/solutions-components/p-de39206f.entry.js +113 -0
  169. package/dist/solutions-components/p-de5416e8.js +28 -1
  170. package/dist/solutions-components/p-df420d54.entry.js +213 -0
  171. package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
  172. package/dist/solutions-components/p-e4845fec.entry.js +152 -0
  173. package/dist/solutions-components/p-e611d8c8.js +28 -1
  174. package/dist/solutions-components/p-e947d3b0.js +5 -1
  175. package/dist/solutions-components/p-ea534300.js +41 -2
  176. package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
  177. package/dist/solutions-components/p-ed36c637.entry.js +85 -0
  178. package/dist/solutions-components/p-f0add71c.js +74 -0
  179. package/dist/solutions-components/p-f42e014b.js +171 -2
  180. package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
  181. package/dist/solutions-components/p-fc884dd6.js +28 -16
  182. package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
  183. package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
  184. package/dist/solutions-components/solutions-components.esm.js +20 -1
  185. package/dist/solutions-components/utils/interfaces.ts +7 -2
  186. package/dist/types/components/buffer-tools/buffer-tools.d.ts +9 -1
  187. package/dist/types/components/public-notification/public-notification.d.ts +26 -0
  188. package/dist/types/components.d.ts +9 -1
  189. package/dist/types/preact.d.ts +3 -1
  190. package/dist/types/utils/interfaces.d.ts +4 -0
  191. package/package.json +1 -1
  192. package/dist/solutions-components/p-021432b8.entry.js +0 -12
  193. package/dist/solutions-components/p-03440b1e.entry.js +0 -11
  194. package/dist/solutions-components/p-0512635b.entry.js +0 -6
  195. package/dist/solutions-components/p-086ef115.entry.js +0 -29
  196. package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
  197. package/dist/solutions-components/p-0c088725.entry.js +0 -6
  198. package/dist/solutions-components/p-0f820c08.entry.js +0 -6
  199. package/dist/solutions-components/p-164780a0.entry.js +0 -6
  200. package/dist/solutions-components/p-179a68a0.entry.js +0 -6
  201. package/dist/solutions-components/p-184b5005.entry.js +0 -11
  202. package/dist/solutions-components/p-1d082fee.entry.js +0 -11
  203. package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
  204. package/dist/solutions-components/p-20a58e62.entry.js +0 -17
  205. package/dist/solutions-components/p-20b2458c.entry.js +0 -11
  206. package/dist/solutions-components/p-245d47c1.entry.js +0 -6
  207. package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
  208. package/dist/solutions-components/p-2cc72806.entry.js +0 -23
  209. package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
  210. package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
  211. package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
  212. package/dist/solutions-components/p-3109d940.entry.js +0 -6
  213. package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
  214. package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
  215. package/dist/solutions-components/p-3fa9b3c8.js +0 -36
  216. package/dist/solutions-components/p-40c41709.entry.js +0 -6
  217. package/dist/solutions-components/p-40e963c7.entry.js +0 -11
  218. package/dist/solutions-components/p-40f480da.entry.js +0 -11
  219. package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
  220. package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
  221. package/dist/solutions-components/p-506e4d78.entry.js +0 -6
  222. package/dist/solutions-components/p-576fdcab.entry.js +0 -6
  223. package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
  224. package/dist/solutions-components/p-65e177f1.entry.js +0 -6
  225. package/dist/solutions-components/p-67d710c2.entry.js +0 -6
  226. package/dist/solutions-components/p-7268b445.entry.js +0 -11
  227. package/dist/solutions-components/p-75ea4667.entry.js +0 -6
  228. package/dist/solutions-components/p-778c0a36.entry.js +0 -17
  229. package/dist/solutions-components/p-7a22509b.entry.js +0 -12
  230. package/dist/solutions-components/p-7bff51db.entry.js +0 -6
  231. package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
  232. package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
  233. package/dist/solutions-components/p-8060fb94.entry.js +0 -6
  234. package/dist/solutions-components/p-80a1b305.entry.js +0 -6
  235. package/dist/solutions-components/p-81eae877.entry.js +0 -12
  236. package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
  237. package/dist/solutions-components/p-877dd0dc.entry.js +0 -18
  238. package/dist/solutions-components/p-9106950a.entry.js +0 -11
  239. package/dist/solutions-components/p-979804a4.entry.js +0 -11
  240. package/dist/solutions-components/p-9862baa8.entry.js +0 -11
  241. package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
  242. package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
  243. package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
  244. package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
  245. package/dist/solutions-components/p-a33c044e.entry.js +0 -6
  246. package/dist/solutions-components/p-a516c658.entry.js +0 -6
  247. package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
  248. package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
  249. package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
  250. package/dist/solutions-components/p-ad469b92.entry.js +0 -11
  251. package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
  252. package/dist/solutions-components/p-addc1156.entry.js +0 -11
  253. package/dist/solutions-components/p-ae846934.entry.js +0 -11
  254. package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
  255. package/dist/solutions-components/p-b4e476b7.js +0 -257
  256. package/dist/solutions-components/p-b668daf8.js +0 -21
  257. package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
  258. package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
  259. package/dist/solutions-components/p-bd4d0773.entry.js +0 -6
  260. package/dist/solutions-components/p-be41429f.js +0 -21
  261. package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
  262. package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
  263. package/dist/solutions-components/p-c4afae53.entry.js +0 -12
  264. package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
  265. package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
  266. package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
  267. package/dist/solutions-components/p-d09a168c.entry.js +0 -6
  268. package/dist/solutions-components/p-d377f913.entry.js +0 -11
  269. package/dist/solutions-components/p-d4cefead.entry.js +0 -37
  270. package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
  271. package/dist/solutions-components/p-d8968487.entry.js +0 -11
  272. package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
  273. package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
  274. package/dist/solutions-components/p-ec27e493.entry.js +0 -11
  275. package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
  276. package/dist/solutions-components/p-ef21e195.entry.js +0 -23
  277. package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
  278. package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
  279. package/dist/solutions-components/p-f847291f.entry.js +0 -6
  280. package/dist/solutions-components/p-f90fd262.entry.js +0 -11
  281. package/dist/solutions-components/p-fc973005.entry.js +0 -6
  282. package/dist/solutions-components/p-ff9fb6bc.entry.js +0 -11
@@ -0,0 +1,335 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './p-c023e6a1.js';
7
+ import { a as getSlotted, t as toAriaBoolean } from './p-83166522.js';
8
+ import { H as Heading } from './p-508317b3.js';
9
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './p-ea534300.js';
10
+ import { u as updateHostInteraction } from './p-7daea1df.js';
11
+ import { g as guid } from './p-a80b3880.js';
12
+ import { I as ICON_TYPES } from './p-b978636e.js';
13
+ import { m as mutationObserverCallback, d as deselectRemovedItems, a as deselectSiblingItems, s as selectSiblings, h as handleFilter, g as getItemData, k as keyDownHandler, i as initialize, b as initializeObserver, c as cleanUpObserver, r as removeItem, e as calciteListItemChangeHandler, f as calciteInternalListItemValueChangeHandler, j as calciteListFocusOutHandler, l as setUpItems, n as setFocus, L as List } from './p-815533de.js';
14
+ import { c as createObserver } from './p-9a9955db.js';
15
+ import './p-729708a3.js';
16
+ import './p-e947d3b0.js';
17
+ import './p-ae1fd76b.js';
18
+ import './p-4e32bf8c.js';
19
+
20
+ /*!
21
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
22
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
23
+ * v1.0.0-beta.97
24
+ */
25
+ const CSS = {
26
+ container: "container",
27
+ content: "content",
28
+ contentSpaced: "content--spaced",
29
+ headerContainer: "header-container",
30
+ icon: "icon",
31
+ statusIcon: "status-icon",
32
+ toggle: "toggle",
33
+ toggleIcon: "toggle-icon",
34
+ title: "title",
35
+ heading: "heading",
36
+ header: "header",
37
+ button: "button",
38
+ summary: "summary",
39
+ description: "description",
40
+ controlContainer: "control-container",
41
+ valid: "valid",
42
+ invalid: "invalid",
43
+ loading: "loading"
44
+ };
45
+ const TEXT = {
46
+ collapse: "Collapse",
47
+ expand: "Expand",
48
+ loading: "Loading",
49
+ options: "Options"
50
+ };
51
+ const SLOTS = {
52
+ icon: "icon",
53
+ control: "control",
54
+ headerMenuActions: "header-menu-actions"
55
+ };
56
+ const ICONS = {
57
+ opened: "chevron-up",
58
+ closed: "chevron-down",
59
+ valid: "check-circle",
60
+ invalid: "exclamation-mark-triangle",
61
+ refresh: "refresh"
62
+ };
63
+ const HEADING_LEVEL = 4;
64
+
65
+ const blockCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:host{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 *{box-sizing:border-box}:host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);padding:0px;transition-property:margin;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0.215, 0.440, 0.420, 0.880);flex-basis:auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.header{justify-content:flex-start;padding:0px}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto;grid-template-areas:\"handle header control menu\";grid-column:header-start/menu-end;grid-row:1/2}.toggle{margin:0px;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0px;font-family:inherit;outline-color:transparent;text-align:initial;background-color:transparent}.toggle:hover{background-color:var(--calcite-ui-foreground-2)}.toggle:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}calcite-loader[inline]{grid-area:control;align-self:center}calcite-handle{grid-area:handle}.title{margin:0px;padding:0.75rem}.header .title .heading{padding:0px;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-ui-text-2);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);word-wrap:break-word;word-break:break-word}.description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;padding:0px;font-size:var(--calcite-font-size--2);color:var(--calcite-ui-text-3);word-wrap:break-word;word-break:break-word}.icon{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem;-webkit-margin-end:0px;margin-inline-end:0px;margin-block:0.75rem}.status-icon.valid{color:var(--calcite-ui-success)}.status-icon.invalid{color:var(--calcite-ui-danger)}.status-icon.loading{animation:spin var(--calcite-internal-animation-timing-medium) linear infinite}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.toggle-icon{margin-block:0.75rem;align-self:center;justify-self:end;color:var(--calcite-ui-text-3);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-margin-end:1rem;margin-inline-end:1rem;-webkit-margin-start:auto;margin-inline-start:auto}.toggle:hover .toggle-icon{color:var(--calcite-ui-text-1)}.container{display:flex;block-size:100%;flex-direction:column}.content{position:relative;flex:1 1 0%}@keyframes in{0%{opacity:0}100%{opacity:1}}.content{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out}.content--spaced{padding-block:var(--calcite-block-padding, 0.5rem);padding-inline:var(--calcite-block-padding, 0.625rem)}.control-container{margin:0px;display:flex;grid-area:control}calcite-action-menu{grid-area:menu}:host([open]){margin-block:0.5rem}:host([open]) .header .title .heading{color:var(--calcite-ui-text-1)}";
66
+
67
+ const Block = class {
68
+ constructor(hostRef) {
69
+ registerInstance(this, hostRef);
70
+ this.calciteBlockToggle = createEvent(this, "calciteBlockToggle", 6);
71
+ // --------------------------------------------------------------------------
72
+ //
73
+ // Properties
74
+ //
75
+ // --------------------------------------------------------------------------
76
+ /**
77
+ * When `true`, the component is collapsible.
78
+ */
79
+ this.collapsible = false;
80
+ /**
81
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
82
+ */
83
+ this.disabled = false;
84
+ /**
85
+ * When `true`, displays a drag handle in the header.
86
+ */
87
+ this.dragHandle = false;
88
+ /**
89
+ * Accessible name for the component's collapse button.
90
+ *
91
+ * @default "Collapse"
92
+ */
93
+ this.intlCollapse = TEXT.collapse;
94
+ /**
95
+ * Accessible name for the component's expand button.
96
+ *
97
+ * @default "Expand"
98
+ */
99
+ this.intlExpand = TEXT.expand;
100
+ /**
101
+ * Accessible name when the component is loading.
102
+ *
103
+ * @default "Loading"
104
+ */
105
+ this.intlLoading = TEXT.loading;
106
+ /**
107
+ * Accessible name for the component's options button.
108
+ *
109
+ * @default "Options"
110
+ */
111
+ this.intlOptions = TEXT.options;
112
+ /**
113
+ * When `true`, a busy indicator is displayed.
114
+ */
115
+ this.loading = false;
116
+ /**
117
+ * When `true`, expands the component and its contents.
118
+ */
119
+ this.open = false;
120
+ /**
121
+ * When `true`, removes padding for the slotted content.
122
+ *
123
+ * @deprecated Use `--calcite-block-padding` CSS variable instead.
124
+ */
125
+ this.disablePadding = false;
126
+ this.guid = guid();
127
+ // --------------------------------------------------------------------------
128
+ //
129
+ // Private Methods
130
+ //
131
+ // --------------------------------------------------------------------------
132
+ this.onHeaderClick = () => {
133
+ this.open = !this.open;
134
+ this.calciteBlockToggle.emit();
135
+ };
136
+ }
137
+ //--------------------------------------------------------------------------
138
+ //
139
+ // Lifecycle
140
+ //
141
+ //--------------------------------------------------------------------------
142
+ componentDidRender() {
143
+ updateHostInteraction(this);
144
+ }
145
+ // --------------------------------------------------------------------------
146
+ //
147
+ // Lifecycle
148
+ //
149
+ // --------------------------------------------------------------------------
150
+ connectedCallback() {
151
+ connectConditionalSlotComponent(this);
152
+ }
153
+ disconnectedCallback() {
154
+ disconnectConditionalSlotComponent(this);
155
+ }
156
+ // --------------------------------------------------------------------------
157
+ //
158
+ // Render Methods
159
+ //
160
+ // --------------------------------------------------------------------------
161
+ renderScrim() {
162
+ const { loading } = this;
163
+ const defaultSlot = h("slot", null);
164
+ return [loading ? h("calcite-scrim", { loading: loading }) : null, defaultSlot];
165
+ }
166
+ renderIcon() {
167
+ const { el, status } = this;
168
+ const showingLoadingStatus = this.loading && !this.open;
169
+ const statusIcon = showingLoadingStatus ? ICONS.refresh : ICONS[status];
170
+ const hasIcon = getSlotted(el, SLOTS.icon) || statusIcon;
171
+ const iconEl = !statusIcon ? (h("slot", { key: "icon-slot", name: SLOTS.icon })) : (h("calcite-icon", { class: {
172
+ [CSS.statusIcon]: true,
173
+ [CSS.valid]: status == "valid",
174
+ [CSS.invalid]: status == "invalid",
175
+ [CSS.loading]: showingLoadingStatus
176
+ }, icon: statusIcon, scale: "m" }));
177
+ return hasIcon ? h("div", { class: CSS.icon }, iconEl) : null;
178
+ }
179
+ renderTitle() {
180
+ const { heading, headingLevel, summary, description } = this;
181
+ return heading || summary || description ? (h("div", { class: CSS.title }, h(Heading, { class: CSS.heading, level: headingLevel || HEADING_LEVEL }, heading), summary || description ? (h("div", { class: CSS.description }, summary || description)) : null)) : null;
182
+ }
183
+ render() {
184
+ const { collapsible, el, intlCollapse, intlExpand, loading, open, intlLoading } = this;
185
+ const toggleLabel = open ? intlCollapse || TEXT.collapse : intlExpand || TEXT.expand;
186
+ const headerContent = (h("header", { class: CSS.header }, this.renderIcon(), this.renderTitle()));
187
+ const hasControl = !!getSlotted(el, SLOTS.control);
188
+ const hasMenuActions = !!getSlotted(el, SLOTS.headerMenuActions);
189
+ const collapseIcon = open ? ICONS.opened : ICONS.closed;
190
+ const { guid } = this;
191
+ const regionId = `${guid}-region`;
192
+ const buttonId = `${guid}-button`;
193
+ const headerNode = (h("div", { class: CSS.headerContainer }, this.dragHandle ? h("calcite-handle", null) : null, collapsible ? (h("button", { "aria-controls": regionId, "aria-expanded": collapsible ? toAriaBoolean(open) : null, "aria-label": toggleLabel, class: CSS.toggle, id: buttonId, onClick: this.onHeaderClick, title: toggleLabel }, headerContent, !hasControl && !hasMenuActions ? (h("calcite-icon", { "aria-hidden": "true", class: CSS.toggleIcon, icon: collapseIcon, scale: "s" })) : null)) : (headerContent), loading ? (h("calcite-loader", { inline: true, "is-active": true, label: intlLoading })) : hasControl ? (h("div", { class: CSS.controlContainer }, h("slot", { name: SLOTS.control }))) : null, hasMenuActions ? (h("calcite-action-menu", { label: this.intlOptions || TEXT.options }, h("slot", { name: SLOTS.headerMenuActions }))) : null));
194
+ return (h(Host, null, h("article", { "aria-busy": toAriaBoolean(loading), class: {
195
+ [CSS.container]: true
196
+ } }, headerNode, h("section", { "aria-expanded": toAriaBoolean(open), "aria-labelledby": buttonId, class: {
197
+ [CSS.content]: true,
198
+ [CSS.contentSpaced]: !this.disablePadding
199
+ }, hidden: !open, id: regionId }, this.renderScrim()))));
200
+ }
201
+ get el() { return getElement(this); }
202
+ };
203
+ Block.style = blockCss;
204
+
205
+ const pickListCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;box-sizing:border-box;display:flex;flex-shrink:0;flex-grow:1;flex-direction:column;align-items:stretch;background-color:transparent;font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}:host *{box-sizing:border-box}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([filter-enabled]) header{-webkit-margin-after:0.25rem;margin-block-end:0.25rem;display:flex;align-items:stretch;justify-content:flex-end;background-color:var(--calcite-ui-foreground-1);--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([filter-enabled]) header.sticky-pos{position:sticky;inset-block-start:0px;z-index:1}calcite-filter{-webkit-margin-after:0px;margin-block-end:0px}:host([loading][disabled]){min-block-size:2rem}";
206
+
207
+ const PickList = class {
208
+ constructor(hostRef) {
209
+ registerInstance(this, hostRef);
210
+ this.calciteListChange = createEvent(this, "calciteListChange", 6);
211
+ // --------------------------------------------------------------------------
212
+ //
213
+ // Properties
214
+ //
215
+ // --------------------------------------------------------------------------
216
+ /**
217
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
218
+ */
219
+ this.disabled = false;
220
+ /**
221
+ * When `true`, an input appears at the top of the list that can be used by end users to filter items in the list.
222
+ */
223
+ this.filterEnabled = false;
224
+ /**
225
+ * When `true`, a busy indicator is displayed.
226
+ */
227
+ this.loading = false;
228
+ /**
229
+ * Similar to standard radio buttons and checkboxes.
230
+ * When `true`, a user can select multiple `calcite-pick-list-item`s at a time.
231
+ * When `false`, only a single `calcite-pick-list-item` can be selected at a time,
232
+ * and a new selection will deselect previous selections.
233
+ */
234
+ this.multiple = false;
235
+ /**
236
+ * When `true` and single selection is enabled, the selection changes when navigating `calcite-pick-list-item`s via keyboard.
237
+ */
238
+ this.selectionFollowsFocus = false;
239
+ // --------------------------------------------------------------------------
240
+ //
241
+ // Private Properties
242
+ //
243
+ // --------------------------------------------------------------------------
244
+ this.selectedValues = new Map();
245
+ this.dataForFilter = [];
246
+ this.lastSelectedItem = null;
247
+ this.mutationObserver = createObserver("mutation", mutationObserverCallback.bind(this));
248
+ this.setFilterEl = (el) => {
249
+ this.filterEl = el;
250
+ };
251
+ this.deselectRemovedItems = deselectRemovedItems.bind(this);
252
+ this.deselectSiblingItems = deselectSiblingItems.bind(this);
253
+ this.selectSiblings = selectSiblings.bind(this);
254
+ this.handleFilter = handleFilter.bind(this);
255
+ this.getItemData = getItemData.bind(this);
256
+ this.keyDownHandler = keyDownHandler.bind(this);
257
+ }
258
+ // --------------------------------------------------------------------------
259
+ //
260
+ // Lifecycle
261
+ //
262
+ // --------------------------------------------------------------------------
263
+ connectedCallback() {
264
+ initialize.call(this);
265
+ initializeObserver.call(this);
266
+ }
267
+ disconnectedCallback() {
268
+ cleanUpObserver.call(this);
269
+ }
270
+ componentDidRender() {
271
+ updateHostInteraction(this);
272
+ }
273
+ calciteListItemRemoveHandler(event) {
274
+ removeItem.call(this, event);
275
+ }
276
+ calciteListItemChangeHandler(event) {
277
+ calciteListItemChangeHandler.call(this, event);
278
+ }
279
+ calciteInternalListItemPropsChangeHandler(event) {
280
+ event.stopPropagation();
281
+ this.setUpFilter();
282
+ }
283
+ calciteInternalListItemValueChangeHandler(event) {
284
+ calciteInternalListItemValueChangeHandler.call(this, event);
285
+ event.stopPropagation();
286
+ }
287
+ calciteListFocusOutHandler(event) {
288
+ calciteListFocusOutHandler.call(this, event);
289
+ }
290
+ // --------------------------------------------------------------------------
291
+ //
292
+ // Private Methods
293
+ //
294
+ // --------------------------------------------------------------------------
295
+ setUpItems() {
296
+ setUpItems.call(this, "calcite-pick-list-item");
297
+ }
298
+ setUpFilter() {
299
+ if (this.filterEnabled) {
300
+ this.dataForFilter = this.getItemData();
301
+ }
302
+ }
303
+ // --------------------------------------------------------------------------
304
+ //
305
+ // Public Methods
306
+ //
307
+ // --------------------------------------------------------------------------
308
+ /** Returns the component's selected `calcite-pick-list-item`s. */
309
+ async getSelectedItems() {
310
+ return this.selectedValues;
311
+ }
312
+ /**
313
+ * Sets focus on the component.
314
+ *
315
+ * @param focusId
316
+ */
317
+ async setFocus(focusId) {
318
+ return setFocus.call(this, focusId);
319
+ }
320
+ // --------------------------------------------------------------------------
321
+ //
322
+ // Render Methods
323
+ //
324
+ // --------------------------------------------------------------------------
325
+ getIconType() {
326
+ return this.multiple ? ICON_TYPES.square : ICON_TYPES.circle;
327
+ }
328
+ render() {
329
+ return h(List, { onKeyDown: this.keyDownHandler, props: this });
330
+ }
331
+ get el() { return getElement(this); }
332
+ };
333
+ PickList.style = pickListCss;
334
+
335
+ export { Block as calcite_block, PickList as calcite_pick_list };
@@ -8,4 +8,17 @@
8
8
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
9
9
  * v1.0.0-beta.97
10
10
  */
11
- const s={sticky:"sticky-pos"};var c;!function(s){s.circle="circle",s.square="square",s.grip="grip"}(c||(c={}));const n={menuActions:"menu-actions"};export{s as C,c as I,n as S}
11
+ const CSS = {
12
+ sticky: "sticky-pos"
13
+ };
14
+ var ICON_TYPES;
15
+ (function (ICON_TYPES) {
16
+ ICON_TYPES["circle"] = "circle";
17
+ ICON_TYPES["square"] = "square";
18
+ ICON_TYPES["grip"] = "grip";
19
+ })(ICON_TYPES || (ICON_TYPES = {}));
20
+ const SLOTS = {
21
+ menuActions: "menu-actions"
22
+ };
23
+
24
+ export { CSS as C, ICON_TYPES as I, SLOTS as S };
@@ -0,0 +1,42 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { r as registerInstance, c as createEvent, h, F as Fragment } from './p-c023e6a1.js';
7
+
8
+ const optionGroupCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block}";
9
+
10
+ const OptionGroup = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
13
+ this.calciteInternalOptionGroupChange = createEvent(this, "calciteInternalOptionGroupChange", 6);
14
+ //--------------------------------------------------------------------------
15
+ //
16
+ // Properties
17
+ //
18
+ //--------------------------------------------------------------------------
19
+ /**
20
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
21
+ */
22
+ this.disabled = false;
23
+ }
24
+ handlePropChange() {
25
+ this.calciteInternalOptionGroupChange.emit();
26
+ }
27
+ //--------------------------------------------------------------------------
28
+ //
29
+ // Render Methods
30
+ //
31
+ //--------------------------------------------------------------------------
32
+ render() {
33
+ return (h(Fragment, null, h("div", null, this.label), h("slot", null)));
34
+ }
35
+ static get watchers() { return {
36
+ "disabled": ["handlePropChange"],
37
+ "label": ["handlePropChange"]
38
+ }; }
39
+ };
40
+ OptionGroup.style = optionGroupCss;
41
+
42
+ export { OptionGroup as calcite_option_group };
@@ -3,9 +3,129 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{q as n,c as t}from"./p-83166522.js";
6
+ import { q as queryElementRoots, c as closestElementCrossShadowBoundary } from './p-83166522.js';
7
+
7
8
  /*!
8
9
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
10
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
10
11
  * v1.0.0-beta.97
11
- */const e="calciteInternalLabelClick",c="calciteInternalLabelConnected",o="calciteInternaLabelDisconnected",s="calcite-label",i=new WeakMap,a=new WeakMap,u=new WeakMap,l=new Set;function r(r){const d=(e=>{const{id:c}=e,o=c&&n(e,{selector:`${s}[for="${c}"]`});if(o)return o;const i=t(e,s);return!i||function(n,t){let e;const c="custom-element-ancestor-check",o=c=>{c.stopImmediatePropagation();const o=c.composedPath();e=o.slice(o.indexOf(t),o.indexOf(n))};return n.addEventListener(c,o,{once:!0}),t.dispatchEvent(new CustomEvent(c,{composed:!0,bubbles:!0})),n.removeEventListener(c,o),e.filter((e=>e!==t&&e!==n)).filter((n=>{var t;return null===(t=n.tagName)||void 0===t?void 0:t.includes("-")})).length>0}(i,e)?null:i})(r.el);if(i.has(d)||!d&&l.has(r))return;const f=v.bind(r);if(d){r.labelEl=d;const n=m.bind(r);i.set(r.labelEl,n),r.labelEl.addEventListener(e,n),l.delete(r),document.removeEventListener(c,a.get(r)),u.set(r,f),document.addEventListener(o,f)}else l.has(r)||(f(),document.removeEventListener(o,u.get(r)))}function d(n){if(l.delete(n),document.removeEventListener(c,a.get(n)),document.removeEventListener(o,u.get(n)),a.delete(n),u.delete(n),!n.labelEl)return;const t=i.get(n.labelEl);n.labelEl.removeEventListener(e,t),i.delete(n.labelEl)}function f(n){var t,e;return n.label||(null===(e=null===(t=n.labelEl)||void 0===t?void 0:t.textContent)||void 0===e?void 0:e.trim())||""}function m(n){this.disabled||this.el.contains(n.detail.sourceEvent.target)||this.onLabelClick(n)}function h(){l.has(this)&&r(this)}function v(){l.add(this);const n=a.get(this)||h.bind(this);a.set(this,n),document.addEventListener(c,n)}export{o as a,r as c,d,f as g,c as l}
12
+ */
13
+ /**
14
+ * Exported for testing purposes only
15
+ *
16
+ * @internal
17
+ */
18
+ const labelClickEvent = "calciteInternalLabelClick";
19
+ const labelConnectedEvent = "calciteInternalLabelConnected";
20
+ const labelDisconnectedEvent = "calciteInternaLabelDisconnected";
21
+ const labelTagName = "calcite-label";
22
+ const onLabelClickMap = new WeakMap();
23
+ const onLabelConnectedMap = new WeakMap();
24
+ const onLabelDisconnectedMap = new WeakMap();
25
+ const unlabeledComponents = new Set();
26
+ const findLabelForComponent = (componentEl) => {
27
+ const { id } = componentEl;
28
+ const forLabel = id && queryElementRoots(componentEl, { selector: `${labelTagName}[for="${id}"]` });
29
+ if (forLabel) {
30
+ return forLabel;
31
+ }
32
+ const parentLabel = closestElementCrossShadowBoundary(componentEl, labelTagName);
33
+ if (!parentLabel ||
34
+ // labelable components within other custom elements are not considered labelable
35
+ hasAncestorCustomElements(parentLabel, componentEl)) {
36
+ return null;
37
+ }
38
+ return parentLabel;
39
+ };
40
+ function hasAncestorCustomElements(label, componentEl) {
41
+ let traversedElements;
42
+ const customElementAncestorCheckEventType = "custom-element-ancestor-check";
43
+ const listener = (event) => {
44
+ event.stopImmediatePropagation();
45
+ const composedPath = event.composedPath();
46
+ traversedElements = composedPath.slice(composedPath.indexOf(componentEl), composedPath.indexOf(label));
47
+ };
48
+ label.addEventListener(customElementAncestorCheckEventType, listener, { once: true });
49
+ componentEl.dispatchEvent(new CustomEvent(customElementAncestorCheckEventType, { composed: true, bubbles: true }));
50
+ label.removeEventListener(customElementAncestorCheckEventType, listener);
51
+ const ancestorCustomElements = traversedElements
52
+ .filter((el) => el !== componentEl && el !== label)
53
+ .filter((el) => { var _a; return (_a = el.tagName) === null || _a === void 0 ? void 0 : _a.includes("-"); });
54
+ return ancestorCustomElements.length > 0;
55
+ }
56
+ /**
57
+ * Helper to set up label interactions on connectedCallback.
58
+ *
59
+ * @param component
60
+ */
61
+ function connectLabel(component) {
62
+ const labelEl = findLabelForComponent(component.el);
63
+ if (onLabelClickMap.has(labelEl) || (!labelEl && unlabeledComponents.has(component))) {
64
+ return;
65
+ }
66
+ const boundOnLabelDisconnected = onLabelDisconnected.bind(component);
67
+ if (labelEl) {
68
+ component.labelEl = labelEl;
69
+ const boundOnLabelClick = onLabelClick.bind(component);
70
+ onLabelClickMap.set(component.labelEl, boundOnLabelClick);
71
+ component.labelEl.addEventListener(labelClickEvent, boundOnLabelClick);
72
+ unlabeledComponents.delete(component);
73
+ document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
74
+ onLabelDisconnectedMap.set(component, boundOnLabelDisconnected);
75
+ document.addEventListener(labelDisconnectedEvent, boundOnLabelDisconnected);
76
+ }
77
+ else if (!unlabeledComponents.has(component)) {
78
+ boundOnLabelDisconnected();
79
+ document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
80
+ }
81
+ }
82
+ /**
83
+ * Helper to tear down label interactions on disconnectedCallback on labelable components.
84
+ *
85
+ * @param component
86
+ */
87
+ function disconnectLabel(component) {
88
+ unlabeledComponents.delete(component);
89
+ document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
90
+ document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
91
+ onLabelConnectedMap.delete(component);
92
+ onLabelDisconnectedMap.delete(component);
93
+ if (!component.labelEl) {
94
+ return;
95
+ }
96
+ const boundOnLabelClick = onLabelClickMap.get(component.labelEl);
97
+ component.labelEl.removeEventListener(labelClickEvent, boundOnLabelClick);
98
+ onLabelClickMap.delete(component.labelEl);
99
+ }
100
+ /**
101
+ * Helper to get the label text from a component.
102
+ *
103
+ * @param component
104
+ */
105
+ function getLabelText(component) {
106
+ var _a, _b;
107
+ return component.label || ((_b = (_a = component.labelEl) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || "";
108
+ }
109
+ function onLabelClick(event) {
110
+ if (this.disabled) {
111
+ return;
112
+ }
113
+ const containedLabelableChildClicked = this.el.contains(event.detail.sourceEvent.target);
114
+ if (containedLabelableChildClicked) {
115
+ return;
116
+ }
117
+ this.onLabelClick(event);
118
+ }
119
+ function onLabelConnected() {
120
+ if (unlabeledComponents.has(this)) {
121
+ connectLabel(this);
122
+ }
123
+ }
124
+ function onLabelDisconnected() {
125
+ unlabeledComponents.add(this);
126
+ const boundOnLabelConnected = onLabelConnectedMap.get(this) || onLabelConnected.bind(this);
127
+ onLabelConnectedMap.set(this, boundOnLabelConnected);
128
+ document.addEventListener(labelConnectedEvent, boundOnLabelConnected);
129
+ }
130
+
131
+ export { labelDisconnectedEvent as a, connectLabel as c, disconnectLabel as d, getLabelText as g, labelConnectedEvent as l };