@esri/solutions-components 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -5
  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/map-card.cjs.entry.js +1 -1
  9. package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
  10. package/dist/cjs/public-notification.cjs.entry.js +16 -10
  11. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  12. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  13. package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
  14. package/dist/collection/components/buffer-tools/buffer-tools.js +2 -2
  15. package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
  16. package/dist/collection/components/public-notification/public-notification.js +14 -8
  17. package/dist/collection/components/refine-selection/refine-selection.js +4 -2
  18. package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
  19. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
  20. package/dist/collection/demos/new-public-notification.html +2 -1
  21. package/dist/collection/utils/interfaces.js +1 -1
  22. package/dist/collection/utils/interfaces.ts +2 -2
  23. package/dist/components/interfaces3.js +1 -1
  24. package/dist/components/map-draw-tools2.js +2 -1
  25. package/dist/components/public-notification.js +14 -8
  26. package/dist/components/refine-selection-tools2.js +4 -2
  27. package/dist/components/refine-selection2.js +4 -2
  28. package/dist/esm/buffer-tools_6.entry.js +8 -5
  29. package/dist/esm/calcite-combobox_3.entry.js +2 -2
  30. package/dist/esm/calcite-input-message_5.entry.js +6 -4
  31. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  32. package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
  33. package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
  34. package/dist/esm/layer-table.entry.js +3 -3
  35. package/dist/esm/map-card.entry.js +1 -1
  36. package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
  37. package/dist/esm/public-notification.entry.js +16 -10
  38. package/dist/esm/solution-configuration.entry.js +2 -2
  39. package/dist/esm/solution-contents_3.entry.js +2 -2
  40. package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
  41. package/dist/solutions-components/demos/new-public-notification.html +2 -1
  42. package/dist/solutions-components/p-05e64bd1.js +498 -2
  43. package/dist/solutions-components/p-08a95b33.entry.js +138 -0
  44. package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
  45. package/dist/solutions-components/p-0ef91144.entry.js +913 -0
  46. package/dist/solutions-components/p-0f523243.entry.js +1916 -0
  47. package/dist/solutions-components/p-11b9510e.entry.js +173 -0
  48. package/dist/solutions-components/p-1b875d94.entry.js +58 -0
  49. package/dist/solutions-components/p-1c567f3a.js +23 -16
  50. package/dist/solutions-components/p-1c883db9.entry.js +43 -0
  51. package/dist/solutions-components/p-1f225056.js +322 -0
  52. package/dist/solutions-components/p-1f499e67.entry.js +72 -0
  53. package/dist/solutions-components/p-20d3d758.entry.js +881 -0
  54. package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
  55. package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
  56. package/dist/solutions-components/p-2447798c.entry.js +155 -0
  57. package/dist/solutions-components/p-2525e691.entry.js +432 -0
  58. package/dist/solutions-components/p-2561f5b5.js +4092 -0
  59. package/dist/solutions-components/p-29f887c0.entry.js +234 -0
  60. package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
  61. package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
  62. package/dist/solutions-components/p-2e9ed892.js +46 -1
  63. package/dist/solutions-components/p-316f56db.js +219 -2
  64. package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
  65. package/dist/solutions-components/p-356f8b54.entry.js +138 -0
  66. package/dist/solutions-components/p-359c58de.entry.js +172 -0
  67. package/dist/solutions-components/p-37336c0d.entry.js +116 -0
  68. package/dist/solutions-components/p-374a5031.js +105 -2
  69. package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
  70. package/dist/solutions-components/p-3b010ce1.js +17 -1
  71. package/dist/solutions-components/p-4307dacd.js +194 -1
  72. package/dist/solutions-components/p-44da2507.js +405 -14
  73. package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
  74. package/dist/solutions-components/p-4894bbeb.js +53 -2
  75. package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
  76. package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
  77. package/dist/solutions-components/p-4e32bf8c.js +482 -1
  78. package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
  79. package/dist/solutions-components/p-508317b3.js +13 -2
  80. package/dist/solutions-components/p-54697d58.entry.js +198 -0
  81. package/dist/solutions-components/p-55c79103.entry.js +311 -0
  82. package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
  83. package/dist/solutions-components/p-59b48fde.entry.js +443 -0
  84. package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
  85. package/dist/solutions-components/p-621d0534.entry.js +123 -0
  86. package/dist/solutions-components/p-63f6e8f1.js +14 -1
  87. package/dist/solutions-components/p-66aeec57.entry.js +61 -0
  88. package/dist/solutions-components/p-69834f46.entry.js +618 -0
  89. package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
  90. package/dist/solutions-components/p-6e0da576.js +13 -1
  91. package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
  92. package/dist/solutions-components/p-6fe17794.js +9 -1
  93. package/dist/solutions-components/p-7024cb16.entry.js +72 -0
  94. package/dist/solutions-components/p-70535506.entry.js +226 -0
  95. package/dist/solutions-components/p-708a63a8.js +12 -1
  96. package/dist/solutions-components/p-729708a3.js +14 -1
  97. package/dist/solutions-components/p-73e23995.js +6 -1
  98. package/dist/solutions-components/p-74b29d75.entry.js +231 -0
  99. package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
  100. package/dist/solutions-components/p-77182c3a.js +3015 -1
  101. package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
  102. package/dist/solutions-components/p-79709c19.js +60 -3
  103. package/dist/solutions-components/p-7a46ef97.js +181 -2
  104. package/dist/solutions-components/p-7be159e6.entry.js +175 -0
  105. package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
  106. package/dist/solutions-components/p-7daea1df.js +41 -1
  107. package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
  108. package/dist/solutions-components/p-7fb45059.entry.js +43 -0
  109. package/dist/solutions-components/p-815533de.js +306 -3
  110. package/dist/solutions-components/p-816622ca.entry.js +248 -0
  111. package/dist/solutions-components/p-83166522.js +205 -2
  112. package/dist/solutions-components/p-83bd1991.entry.js +36 -0
  113. package/dist/solutions-components/p-856464d7.entry.js +572 -0
  114. package/dist/solutions-components/p-8c349bad.entry.js +347 -0
  115. package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
  116. package/dist/solutions-components/p-904c185a.entry.js +228 -0
  117. package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
  118. package/dist/solutions-components/p-9371145a.entry.js +477 -0
  119. package/dist/solutions-components/p-93d3119d.js +1948 -1
  120. package/dist/solutions-components/p-95ec8062.entry.js +173 -0
  121. package/dist/solutions-components/p-991ee695.js +109 -1
  122. package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
  123. package/dist/solutions-components/p-9a9955db.js +41 -1
  124. package/dist/solutions-components/p-9c1ebc90.js +35 -16
  125. package/dist/solutions-components/p-9eba5c66.js +399 -3
  126. package/dist/solutions-components/p-a033a507.entry.js +252 -0
  127. package/dist/solutions-components/p-a3773415.entry.js +1132 -0
  128. package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
  129. package/dist/solutions-components/p-a5b1ab03.js +33 -3
  130. package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
  131. package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
  132. package/dist/solutions-components/p-a8005026.entry.js +565 -0
  133. package/dist/solutions-components/p-a80b3880.js +14 -1
  134. package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
  135. package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
  136. package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
  137. package/dist/solutions-components/p-ae1fd76b.js +11 -1
  138. package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
  139. package/dist/solutions-components/p-b359dc78.js +41 -1
  140. package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
  141. package/dist/solutions-components/p-b75cc407.entry.js +145 -0
  142. package/dist/solutions-components/p-b911cb75.entry.js +71 -0
  143. package/dist/solutions-components/p-b965e177.entry.js +335 -0
  144. package/dist/solutions-components/p-b978636e.js +14 -1
  145. package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
  146. package/dist/solutions-components/p-bd67334c.js +122 -2
  147. package/dist/solutions-components/p-bde20dba.entry.js +212 -0
  148. package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
  149. package/dist/solutions-components/p-c023e6a1.js +2028 -2
  150. package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
  151. package/dist/solutions-components/p-c579ed60.entry.js +447 -0
  152. package/dist/solutions-components/p-c92bc231.js +101 -2
  153. package/dist/solutions-components/p-cc815aca.js +839 -16
  154. package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
  155. package/dist/solutions-components/p-cdc46c0c.js +1751 -2
  156. package/dist/solutions-components/p-d12e6992.entry.js +118 -0
  157. package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
  158. package/dist/solutions-components/p-d48a24e6.js +754 -2
  159. package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
  160. package/dist/solutions-components/p-dbc9a5a8.js +80 -0
  161. package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
  162. package/dist/solutions-components/p-de39206f.entry.js +113 -0
  163. package/dist/solutions-components/p-de5416e8.js +28 -1
  164. package/dist/solutions-components/p-df420d54.entry.js +213 -0
  165. package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
  166. package/dist/solutions-components/p-e4845fec.entry.js +152 -0
  167. package/dist/solutions-components/p-e611d8c8.js +28 -1
  168. package/dist/solutions-components/p-e947d3b0.js +5 -1
  169. package/dist/solutions-components/p-ea534300.js +41 -2
  170. package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
  171. package/dist/solutions-components/p-ed36c637.entry.js +85 -0
  172. package/dist/solutions-components/p-f0add71c.js +74 -0
  173. package/dist/solutions-components/p-f42e014b.js +171 -2
  174. package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
  175. package/dist/solutions-components/p-fc884dd6.js +28 -16
  176. package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
  177. package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
  178. package/dist/solutions-components/solutions-components.esm.js +20 -1
  179. package/dist/solutions-components/utils/interfaces.ts +2 -2
  180. package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
  181. package/dist/types/components/public-notification/public-notification.d.ts +9 -1
  182. package/dist/types/components.d.ts +2 -2
  183. package/package.json +1 -1
  184. package/dist/solutions-components/p-021432b8.entry.js +0 -12
  185. package/dist/solutions-components/p-03440b1e.entry.js +0 -11
  186. package/dist/solutions-components/p-0512635b.entry.js +0 -6
  187. package/dist/solutions-components/p-086ef115.entry.js +0 -29
  188. package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
  189. package/dist/solutions-components/p-0c088725.entry.js +0 -6
  190. package/dist/solutions-components/p-0f820c08.entry.js +0 -6
  191. package/dist/solutions-components/p-164780a0.entry.js +0 -6
  192. package/dist/solutions-components/p-179a68a0.entry.js +0 -6
  193. package/dist/solutions-components/p-184b5005.entry.js +0 -11
  194. package/dist/solutions-components/p-1d082fee.entry.js +0 -11
  195. package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
  196. package/dist/solutions-components/p-20a58e62.entry.js +0 -17
  197. package/dist/solutions-components/p-20b2458c.entry.js +0 -11
  198. package/dist/solutions-components/p-245d47c1.entry.js +0 -6
  199. package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
  200. package/dist/solutions-components/p-2cc72806.entry.js +0 -23
  201. package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
  202. package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
  203. package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
  204. package/dist/solutions-components/p-3109d940.entry.js +0 -6
  205. package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
  206. package/dist/solutions-components/p-3649acb3.entry.js +0 -18
  207. package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
  208. package/dist/solutions-components/p-3fa9b3c8.js +0 -36
  209. package/dist/solutions-components/p-40c41709.entry.js +0 -6
  210. package/dist/solutions-components/p-40e963c7.entry.js +0 -11
  211. package/dist/solutions-components/p-40f480da.entry.js +0 -11
  212. package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
  213. package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
  214. package/dist/solutions-components/p-506e4d78.entry.js +0 -6
  215. package/dist/solutions-components/p-576fdcab.entry.js +0 -6
  216. package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
  217. package/dist/solutions-components/p-65e177f1.entry.js +0 -6
  218. package/dist/solutions-components/p-67d710c2.entry.js +0 -6
  219. package/dist/solutions-components/p-7268b445.entry.js +0 -11
  220. package/dist/solutions-components/p-75ea4667.entry.js +0 -6
  221. package/dist/solutions-components/p-778c0a36.entry.js +0 -17
  222. package/dist/solutions-components/p-7a22509b.entry.js +0 -12
  223. package/dist/solutions-components/p-7bff51db.entry.js +0 -6
  224. package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
  225. package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
  226. package/dist/solutions-components/p-8060fb94.entry.js +0 -6
  227. package/dist/solutions-components/p-80a1b305.entry.js +0 -6
  228. package/dist/solutions-components/p-81eae877.entry.js +0 -12
  229. package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
  230. package/dist/solutions-components/p-851e04ae.entry.js +0 -6
  231. package/dist/solutions-components/p-9106950a.entry.js +0 -11
  232. package/dist/solutions-components/p-979804a4.entry.js +0 -11
  233. package/dist/solutions-components/p-9862baa8.entry.js +0 -11
  234. package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
  235. package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
  236. package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
  237. package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
  238. package/dist/solutions-components/p-a33c044e.entry.js +0 -6
  239. package/dist/solutions-components/p-a516c658.entry.js +0 -6
  240. package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
  241. package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
  242. package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
  243. package/dist/solutions-components/p-ad469b92.entry.js +0 -11
  244. package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
  245. package/dist/solutions-components/p-addc1156.entry.js +0 -11
  246. package/dist/solutions-components/p-ae846934.entry.js +0 -11
  247. package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
  248. package/dist/solutions-components/p-b4e476b7.js +0 -257
  249. package/dist/solutions-components/p-b668daf8.js +0 -21
  250. package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
  251. package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
  252. package/dist/solutions-components/p-be41429f.js +0 -21
  253. package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
  254. package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
  255. package/dist/solutions-components/p-c4afae53.entry.js +0 -12
  256. package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
  257. package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
  258. package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
  259. package/dist/solutions-components/p-d09a168c.entry.js +0 -6
  260. package/dist/solutions-components/p-d377f913.entry.js +0 -11
  261. package/dist/solutions-components/p-d4cefead.entry.js +0 -37
  262. package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
  263. package/dist/solutions-components/p-d8968487.entry.js +0 -11
  264. package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
  265. package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
  266. package/dist/solutions-components/p-ec27e493.entry.js +0 -11
  267. package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
  268. package/dist/solutions-components/p-ef21e195.entry.js +0 -23
  269. package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
  270. package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
  271. package/dist/solutions-components/p-f847291f.entry.js +0 -6
  272. package/dist/solutions-components/p-f90fd262.entry.js +0 -11
  273. package/dist/solutions-components/p-fc973005.entry.js +0 -6
  274. package/dist/solutions-components/p-ff9fb6bc.entry.js +0 -11
@@ -0,0 +1,85 @@
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 { l as labelConnectedEvent, a as labelDisconnectedEvent } from './p-bd67334c.js';
8
+ import './p-83166522.js';
9
+ import './p-729708a3.js';
10
+ import './p-a80b3880.js';
11
+
12
+ /*!
13
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
15
+ * v1.0.0-beta.97
16
+ */
17
+ const CSS = {
18
+ container: "container"
19
+ };
20
+
21
+ const labelCss = "@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{display:inline}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host(:not([disable-spacing])[scale=s]) .container{-webkit-margin-after:var(--calcite-label-margin-bottom, 0.5rem);margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host(:not([disable-spacing])[scale=m]) .container{-webkit-margin-after:var(--calcite-label-margin-bottom, 0.75rem);margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host(:not([disable-spacing])[scale=l]) .container{-webkit-margin-after:var(--calcite-label-margin-bottom, 1rem);margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;-webkit-margin-before:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-ui-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{pointer-events:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted(*){pointer-events:none}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([disable-spacing]) .container{margin:0px;gap:0px}";
22
+
23
+ const Label = class {
24
+ constructor(hostRef) {
25
+ registerInstance(this, hostRef);
26
+ this.calciteInternalLabelClick = createEvent(this, "calciteInternalLabelClick", 2);
27
+ //--------------------------------------------------------------------------
28
+ //
29
+ // Properties
30
+ //
31
+ //--------------------------------------------------------------------------
32
+ /** Specifies the text alignment of the component. */
33
+ this.alignment = "start";
34
+ /**
35
+ * Specifies the status of the component and any child input, or input messages.
36
+ *
37
+ * @deprecated Set directly on the component the label is bound to instead.
38
+ */
39
+ this.status = "idle";
40
+ /** Specifies the size of the component. */
41
+ this.scale = "m";
42
+ /** Defines the layout of the label in relation to the component. Use `"inline"` positions to wrap the label and component on the same line. */
43
+ this.layout = "default";
44
+ /**
45
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
46
+ *
47
+ * @deprecated Use the `disabled` property on the component the label is bound to instead.
48
+ */
49
+ this.disabled = false;
50
+ /**
51
+ * When `true`, disables the component's spacing.
52
+ *
53
+ * @deprecated Set the `--calcite-label-margin-bottom` css variable to `0` instead.
54
+ */
55
+ this.disableSpacing = false;
56
+ //--------------------------------------------------------------------------
57
+ //
58
+ // Private Methods
59
+ //
60
+ //--------------------------------------------------------------------------
61
+ this.labelClickHandler = (event) => {
62
+ this.calciteInternalLabelClick.emit({
63
+ sourceEvent: event
64
+ });
65
+ };
66
+ }
67
+ //--------------------------------------------------------------------------
68
+ //
69
+ // Lifecycle
70
+ //
71
+ //--------------------------------------------------------------------------
72
+ connectedCallback() {
73
+ document.dispatchEvent(new CustomEvent(labelConnectedEvent));
74
+ }
75
+ disconnectedCallback() {
76
+ document.dispatchEvent(new CustomEvent(labelDisconnectedEvent));
77
+ }
78
+ render() {
79
+ return (h(Host, { onClick: this.labelClickHandler }, h("div", { class: CSS.container }, h("slot", null))));
80
+ }
81
+ get el() { return getElement(this); }
82
+ };
83
+ Label.style = labelCss;
84
+
85
+ export { Label as calcite_label };
@@ -0,0 +1,74 @@
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 { b as queryFeaturesByID } from './p-1f225056.js';
7
+
8
+ /** @license
9
+ * Copyright 2022 Esri
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+ /**
24
+ * Export a csv of the attributes from the features that match the provided ids
25
+ *
26
+ * @param layerView layer view to query
27
+ * @param ids number array of ids to export to csv
28
+ *
29
+ * @returns Promise when the function has completed
30
+ */
31
+ async function exportCSV(layerView, ids, addColumnTitle) {
32
+ const featureSet = await queryFeaturesByID(ids, layerView.layer);
33
+ const attributes = featureSet.features.map(f => f.attributes);
34
+ const fieldNames = {};
35
+ const entry = attributes[0];
36
+ Object.keys(entry).forEach(k => {
37
+ if (entry.hasOwnProperty(k)) {
38
+ fieldNames[k] = k;
39
+ }
40
+ });
41
+ _downloadCSVFile(fieldNames, attributes, `notify-${Date.now().toString()}`, addColumnTitle);
42
+ }
43
+ /**
44
+ * Download the CSV file
45
+ *
46
+ * @param fieldNames the names for each of the features fields
47
+ * @param attributes the features attributes
48
+ *
49
+ * Based on:
50
+ * https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2
51
+ *
52
+ * @returns void
53
+ */
54
+ function _downloadCSVFile(fieldNames, attributes, fileTitle, addColumnTitle) {
55
+ if (addColumnTitle && fieldNames) {
56
+ attributes.unshift(fieldNames);
57
+ }
58
+ // format values to string so it doesn't get tripped up when a value has a comma
59
+ // another option could be to export with a different delimiter
60
+ const csv = attributes.reduce((prev, cur) => {
61
+ return prev + Object.values(cur).map(v => `"${v}"`).join(",") + "\r\n";
62
+ }, "");
63
+ const link = document.createElement("a");
64
+ if (link.download !== undefined) {
65
+ link.href = URL.createObjectURL(new Blob([csv], { type: "text/csv;charset=utf-8;" }));
66
+ link.download = `${fileTitle}.csv` || "export.csv";
67
+ link.style.visibility = "hidden";
68
+ document.body.appendChild(link);
69
+ link.click();
70
+ document.body.removeChild(link);
71
+ }
72
+ }
73
+
74
+ export { exportCSV as e };
@@ -3,9 +3,178 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{n}from"./p-9eba5c66.js";
6
+ import { n as numberStringFormatter } from './p-9eba5c66.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
- */function t(n,t,e){const a=n.getTime(),r=!(t instanceof Date)||a>=t.getTime(),s=!(e instanceof Date)||a<=e.getTime();return r&&s}function e(n,t,e){if(!(n instanceof Date))return null;const a=n.getTime(),r=t instanceof Date&&a<t.getTime(),s=e instanceof Date&&a>e.getTime();return r?t:s?e:n}function a(n,t=!1){if(n instanceof Date)return n;if(!n||"string"!=typeof n)return null;const e=n.split(/[: T-]/).map(parseFloat),a=new Date(e[0],(e[1]||1)-1,e[2]||1);if(a.setFullYear(e[0]),isNaN(a.getTime()))throw new Error(`Invalid ISO 8601 date: "${n}"`);return t?D(a):a}function r(n){return"string"==typeof n?n:n instanceof Date?new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().split("T")[0]:""}function s(n,t){return n instanceof Date&&t instanceof Date&&n.getDate()===t.getDate()&&n.getMonth()===t.getMonth()&&n.getFullYear()===t.getFullYear()}function o(n){const t=n.getMonth(),e=new Date(n);return e.setMonth(t-1),t===e.getMonth()?new Date(n.getFullYear(),t,0):e}function i(n){const t=n.getMonth(),e=new Date(n);return e.setMonth(t+1),(t+2)%7==e.getMonth()%7?new Date(n.getFullYear(),t+2,0):e}function c(t,e){const{separator:a,unitOrder:r}=e,s=f(r),o=t.split(a).map((t=>n.delocalize(t)));return{day:parseInt(o[s.indexOf("d")]),month:parseInt(o[s.indexOf("m")])-1,year:parseInt(o[s.indexOf("y")])}}function f(n){const t=n.toLowerCase();return["d","m","y"].sort(((n,e)=>t.indexOf(n)-t.indexOf(e)))}function u(n,t){return(n.getTime()-t.getTime())/864e5}function D(n){return n.setHours(23,59,59,999),n}export{a,e as b,s as c,r as d,f as e,o as f,u as g,t as i,i as n,c as p,D as s}
12
+ */
13
+ /**
14
+ * Check if date is within a min and max
15
+ *
16
+ * @param date
17
+ * @param min
18
+ * @param max
19
+ */
20
+ function inRange(date, min, max) {
21
+ const time = date.getTime();
22
+ const afterMin = !(min instanceof Date) || time >= min.getTime();
23
+ const beforeMax = !(max instanceof Date) || time <= max.getTime();
24
+ return afterMin && beforeMax;
25
+ }
26
+ /**
27
+ * Ensures date is within range,
28
+ * returns min or max if out of bounds
29
+ *
30
+ * @param date
31
+ * @param min
32
+ * @param max
33
+ */
34
+ function dateFromRange(date, min, max) {
35
+ if (!(date instanceof Date)) {
36
+ return null;
37
+ }
38
+ const time = date.getTime();
39
+ const beforeMin = min instanceof Date && time < min.getTime();
40
+ const afterMax = max instanceof Date && time > max.getTime();
41
+ if (beforeMin) {
42
+ return min;
43
+ }
44
+ if (afterMax) {
45
+ return max;
46
+ }
47
+ return date;
48
+ }
49
+ /**
50
+ * Parse an iso8601 string (YYYY-mm-dd) into a valid date.
51
+ * TODO: handle time when time of day UI is added
52
+ *
53
+ * @param iso8601
54
+ * @param isEndDate
55
+ */
56
+ function dateFromISO(iso8601, isEndDate = false) {
57
+ if (iso8601 instanceof Date) {
58
+ return iso8601;
59
+ }
60
+ if (!iso8601 || typeof iso8601 !== "string") {
61
+ return null;
62
+ }
63
+ const d = iso8601.split(/[: T-]/).map(parseFloat);
64
+ const date = new Date(d[0], (d[1] || 1) - 1, d[2] || 1);
65
+ date.setFullYear(d[0]);
66
+ if (isNaN(date.getTime())) {
67
+ throw new Error(`Invalid ISO 8601 date: "${iso8601}"`);
68
+ }
69
+ if (isEndDate) {
70
+ return setEndOfDay(date);
71
+ }
72
+ return date;
73
+ }
74
+ /**
75
+ * Return first portion of ISO string (YYYY-mm-dd)
76
+ *
77
+ * @param date
78
+ */
79
+ function dateToISO(date) {
80
+ if (typeof date === "string") {
81
+ return date;
82
+ }
83
+ if (date instanceof Date) {
84
+ return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().split("T")[0];
85
+ }
86
+ return "";
87
+ }
88
+ /**
89
+ * Check if two dates are the same day, month, year
90
+ *
91
+ * @param d1
92
+ * @param d2
93
+ */
94
+ function sameDate(d1, d2) {
95
+ return (d1 instanceof Date &&
96
+ d2 instanceof Date &&
97
+ d1.getDate() === d2.getDate() &&
98
+ d1.getMonth() === d2.getMonth() &&
99
+ d1.getFullYear() === d2.getFullYear());
100
+ }
101
+ /**
102
+ * Get a date one month in the past
103
+ *
104
+ * @param date
105
+ */
106
+ function prevMonth(date) {
107
+ const month = date.getMonth();
108
+ const nextDate = new Date(date);
109
+ nextDate.setMonth(month - 1);
110
+ // date doesn't exist in new month, use last day
111
+ if (month === nextDate.getMonth()) {
112
+ return new Date(date.getFullYear(), month, 0);
113
+ }
114
+ return nextDate;
115
+ }
116
+ /**
117
+ * Get a date one month in the future
118
+ *
119
+ * @param date
120
+ */
121
+ function nextMonth(date) {
122
+ const month = date.getMonth();
123
+ const nextDate = new Date(date);
124
+ nextDate.setMonth(month + 1);
125
+ // date doesn't exist in new month, use last day
126
+ if ((month + 2) % 7 === nextDate.getMonth() % 7) {
127
+ return new Date(date.getFullYear(), month + 2, 0);
128
+ }
129
+ return nextDate;
130
+ }
131
+ /**
132
+ * Parse numeric units for day, month, and year from a localized string
133
+ * month starts at 0 (can pass to date constructor)
134
+ *
135
+ * @param str
136
+ * @param localeData
137
+ */
138
+ function parseDateString(str, localeData) {
139
+ const { separator, unitOrder } = localeData;
140
+ const order = getOrder(unitOrder);
141
+ const values = str.split(separator).map((part) => numberStringFormatter.delocalize(part));
142
+ return {
143
+ day: parseInt(values[order.indexOf("d")]),
144
+ month: parseInt(values[order.indexOf("m")]) - 1,
145
+ year: parseInt(values[order.indexOf("y")])
146
+ };
147
+ }
148
+ /**
149
+ * Based on the unitOrder string, find order of month, day, and year for locale
150
+ *
151
+ * @param unitOrder
152
+ */
153
+ function getOrder(unitOrder) {
154
+ const signifiers = ["d", "m", "y"];
155
+ const order = unitOrder.toLowerCase();
156
+ return signifiers.sort((a, b) => order.indexOf(a) - order.indexOf(b));
157
+ }
158
+ /**
159
+ * Get number of days between two dates
160
+ *
161
+ * @param date1
162
+ * @param date2
163
+ */
164
+ function getDaysDiff(date1, date2) {
165
+ const ts1 = date1.getTime();
166
+ const ts2 = date2.getTime();
167
+ return (ts1 - ts2) / (1000 * 3600 * 24);
168
+ }
169
+ /**
170
+ * Set time of the day to the end.
171
+ *
172
+ * @param {Date} date Date.
173
+ * @returns {Date} Date with time set to end of day .
174
+ */
175
+ function setEndOfDay(date) {
176
+ date.setHours(23, 59, 59, 999);
177
+ return date;
178
+ }
179
+
180
+ export { dateFromISO as a, dateFromRange as b, sameDate as c, dateToISO as d, getOrder as e, prevMonth as f, getDaysDiff as g, inRange as i, nextMonth as n, parseDateString as p, setEndOfDay as s };
@@ -0,0 +1,308 @@
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, g as getElement, F as Fragment } from './p-c023e6a1.js';
7
+ import { c as createObserver } from './p-9a9955db.js';
8
+ import { f as focusElement } from './p-83166522.js';
9
+ import { c as connectLabel, d as disconnectLabel } from './p-bd67334c.js';
10
+ import { c as connectForm, d as disconnectForm, a as afterConnectDefaultValueSet, H as HiddenFormInputSlot } from './p-316f56db.js';
11
+ import { u as updateHostInteraction } from './p-7daea1df.js';
12
+ import './p-729708a3.js';
13
+ import './p-a80b3880.js';
14
+
15
+ const optionCss = "@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}";
16
+
17
+ const Option = class {
18
+ constructor(hostRef) {
19
+ registerInstance(this, hostRef);
20
+ this.calciteInternalOptionChange = createEvent(this, "calciteInternalOptionChange", 6);
21
+ //--------------------------------------------------------------------------
22
+ //
23
+ // Properties
24
+ //
25
+ //--------------------------------------------------------------------------
26
+ /**
27
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
28
+ */
29
+ this.disabled = false;
30
+ this.mutationObserver = createObserver("mutation", () => {
31
+ this.ensureTextContentDependentProps();
32
+ this.calciteInternalOptionChange.emit();
33
+ });
34
+ }
35
+ handlePropChange(_newValue, _oldValue, propName) {
36
+ if (propName === "label" || propName === "value") {
37
+ this.ensureTextContentDependentProps();
38
+ }
39
+ this.calciteInternalOptionChange.emit();
40
+ }
41
+ //--------------------------------------------------------------------------
42
+ //
43
+ // Private Methods
44
+ //
45
+ //--------------------------------------------------------------------------
46
+ ensureTextContentDependentProps() {
47
+ const { el: { textContent } } = this;
48
+ if (!this.label || this.label === this.internallySetLabel) {
49
+ this.label = textContent;
50
+ this.internallySetLabel = textContent;
51
+ }
52
+ if (!this.value || this.value === this.internallySetValue) {
53
+ this.value = textContent;
54
+ this.internallySetValue = textContent;
55
+ }
56
+ }
57
+ //--------------------------------------------------------------------------
58
+ //
59
+ // Lifecycle
60
+ //
61
+ //--------------------------------------------------------------------------
62
+ connectedCallback() {
63
+ var _a;
64
+ this.ensureTextContentDependentProps();
65
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, {
66
+ attributeFilter: ["label", "value"],
67
+ characterData: true,
68
+ childList: true,
69
+ subtree: true
70
+ });
71
+ }
72
+ disconnectedCallback() {
73
+ var _a;
74
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
75
+ }
76
+ //--------------------------------------------------------------------------
77
+ //
78
+ // Render Methods
79
+ //
80
+ //--------------------------------------------------------------------------
81
+ render() {
82
+ return h("slot", null, this.label);
83
+ }
84
+ get el() { return getElement(this); }
85
+ static get watchers() { return {
86
+ "disabled": ["handlePropChange"],
87
+ "label": ["handlePropChange"],
88
+ "selected": ["handlePropChange"],
89
+ "value": ["handlePropChange"]
90
+ }; }
91
+ };
92
+ Option.style = optionCss;
93
+
94
+ /*!
95
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
96
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
97
+ * v1.0.0-beta.97
98
+ */
99
+ const CSS = {
100
+ icon: "icon",
101
+ iconContainer: "icon-container",
102
+ select: "select"
103
+ };
104
+
105
+ const selectCss = "@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{--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{position:relative;display:flex;align-items:stretch;inline-size:var(--select-width)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){block-size:1.5rem;--calcite-select-font-size:var(--calcite-font-size--2);--calcite-select-spacing-inline:0.5rem 2rem}:host([scale=s]) .icon-container{padding-inline:0.5rem}:host([scale=m]){block-size:2rem;--calcite-select-font-size:var(--calcite-font-size--1);--calcite-select-spacing-inline:0.75rem 2.5rem}:host([scale=m]) .icon-container{padding-inline:0.75rem}:host([scale=l]){block-size:44px;--calcite-select-font-size:var(--calcite-font-size-0);--calcite-select-spacing-inline:1rem 3rem}:host([scale=l]) .icon-container{padding-inline:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}.select{margin:0px;box-sizing:border-box;inline-size:100%;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);font-family:inherit;color:var(--calcite-ui-text-2);outline-color:transparent;font-size:var(--calcite-select-font-size);padding-inline:var(--calcite-select-spacing-inline);border-inline-end-width:0px}.select:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.select:hover{background-color:var(--calcite-ui-foreground-2)}select:disabled{border-color:var(--calcite-ui-border-input);--tw-bg-opacity:1}.icon-container{pointer-events:none;position:absolute;inset-block:0px;display:flex;align-items:center;border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:transparent;color:var(--calcite-ui-text-2);inset-inline-end:0px;border-inline-width:0px 1px}.select:focus~.icon-container{border-color:transparent}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
106
+
107
+ function isOption(optionOrGroup) {
108
+ return optionOrGroup.tagName === "CALCITE-OPTION";
109
+ }
110
+ function isOptionGroup(optionOrGroup) {
111
+ return optionOrGroup.tagName === "CALCITE-OPTION-GROUP";
112
+ }
113
+ const Select = class {
114
+ constructor(hostRef) {
115
+ registerInstance(this, hostRef);
116
+ this.calciteSelectChange = createEvent(this, "calciteSelectChange", 6);
117
+ //--------------------------------------------------------------------------
118
+ //
119
+ // Properties
120
+ //
121
+ //--------------------------------------------------------------------------
122
+ /**
123
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
124
+ */
125
+ this.disabled = false;
126
+ /**
127
+ * When `true`, the component must have a value in order for the form to submit.
128
+ *
129
+ * @internal
130
+ */
131
+ this.required = false;
132
+ /**
133
+ * Specifies the size of the component.
134
+ */
135
+ this.scale = "m";
136
+ /** The component's `selectedOption` value. */
137
+ this.value = null;
138
+ /**
139
+ * Specifies the width of the component.
140
+ */
141
+ this.width = "auto";
142
+ this.componentToNativeEl = new Map();
143
+ this.mutationObserver = createObserver("mutation", () => this.populateInternalSelect());
144
+ this.handleInternalSelectChange = () => {
145
+ const selected = this.selectEl.selectedOptions[0];
146
+ this.selectFromNativeOption(selected);
147
+ requestAnimationFrame(() => this.emitChangeEvent());
148
+ };
149
+ this.populateInternalSelect = () => {
150
+ const optionsAndGroups = Array.from(this.el.children).filter((child) => child.tagName === "CALCITE-OPTION" || child.tagName === "CALCITE-OPTION-GROUP");
151
+ this.clearInternalSelect();
152
+ optionsAndGroups.forEach((optionOrGroup) => { var _a; return (_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.append(this.toNativeElement(optionOrGroup)); });
153
+ };
154
+ this.storeSelectRef = (node) => {
155
+ this.selectEl = node;
156
+ this.populateInternalSelect();
157
+ const selected = this.selectEl.selectedOptions[0];
158
+ this.selectFromNativeOption(selected);
159
+ };
160
+ this.emitChangeEvent = () => {
161
+ this.calciteSelectChange.emit();
162
+ };
163
+ }
164
+ valueHandler(value) {
165
+ const items = this.el.querySelectorAll("calcite-option");
166
+ items.forEach((item) => (item.selected = item.value === value));
167
+ }
168
+ selectedOptionHandler(selectedOption) {
169
+ this.value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value;
170
+ }
171
+ //--------------------------------------------------------------------------
172
+ //
173
+ // Lifecycle
174
+ //
175
+ //--------------------------------------------------------------------------
176
+ connectedCallback() {
177
+ var _a;
178
+ const { el } = this;
179
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(el, {
180
+ subtree: true,
181
+ childList: true
182
+ });
183
+ connectLabel(this);
184
+ connectForm(this);
185
+ }
186
+ disconnectedCallback() {
187
+ var _a;
188
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
189
+ disconnectLabel(this);
190
+ disconnectForm(this);
191
+ }
192
+ componentDidLoad() {
193
+ var _a, _b;
194
+ afterConnectDefaultValueSet(this, (_b = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "");
195
+ }
196
+ componentDidRender() {
197
+ updateHostInteraction(this);
198
+ }
199
+ //--------------------------------------------------------------------------
200
+ //
201
+ // Public Methods
202
+ //
203
+ //--------------------------------------------------------------------------
204
+ /** Sets focus on the component. */
205
+ async setFocus() {
206
+ focusElement(this.selectEl);
207
+ }
208
+ handleOptionOrGroupChange(event) {
209
+ event.stopPropagation();
210
+ const optionOrGroup = event.target;
211
+ const nativeEl = this.componentToNativeEl.get(optionOrGroup);
212
+ if (!nativeEl) {
213
+ return;
214
+ }
215
+ this.updateNativeElement(optionOrGroup, nativeEl);
216
+ if (isOption(optionOrGroup) && optionOrGroup.selected) {
217
+ this.deselectAllExcept(optionOrGroup);
218
+ this.selectedOption = optionOrGroup;
219
+ }
220
+ }
221
+ //--------------------------------------------------------------------------
222
+ //
223
+ // Private Methods
224
+ //
225
+ //--------------------------------------------------------------------------
226
+ onLabelClick() {
227
+ this.setFocus();
228
+ }
229
+ updateNativeElement(optionOrGroup, nativeOptionOrGroup) {
230
+ nativeOptionOrGroup.disabled = optionOrGroup.disabled;
231
+ nativeOptionOrGroup.label = optionOrGroup.label;
232
+ if (isOption(optionOrGroup)) {
233
+ const option = nativeOptionOrGroup;
234
+ option.selected = optionOrGroup.selected;
235
+ option.value = optionOrGroup.value;
236
+ // need to set innerText for mobile
237
+ // see https://stackoverflow.com/questions/35021620/ios-safari-not-showing-all-options-for-select-menu/41749701
238
+ option.innerText = optionOrGroup.label;
239
+ }
240
+ }
241
+ clearInternalSelect() {
242
+ this.componentToNativeEl.forEach((value) => value.remove());
243
+ this.componentToNativeEl.clear();
244
+ }
245
+ selectFromNativeOption(nativeOption) {
246
+ if (!nativeOption) {
247
+ return;
248
+ }
249
+ let futureSelected;
250
+ this.componentToNativeEl.forEach((nativeOptionOrGroup, optionOrGroup) => {
251
+ if (isOption(optionOrGroup) && nativeOptionOrGroup === nativeOption) {
252
+ optionOrGroup.selected = true;
253
+ futureSelected = optionOrGroup;
254
+ this.deselectAllExcept(optionOrGroup);
255
+ }
256
+ });
257
+ if (futureSelected) {
258
+ this.selectedOption = futureSelected;
259
+ }
260
+ }
261
+ toNativeElement(optionOrGroup) {
262
+ if (isOption(optionOrGroup)) {
263
+ const option = document.createElement("option");
264
+ this.updateNativeElement(optionOrGroup, option);
265
+ this.componentToNativeEl.set(optionOrGroup, option);
266
+ return option;
267
+ }
268
+ if (isOptionGroup(optionOrGroup)) {
269
+ const group = document.createElement("optgroup");
270
+ this.updateNativeElement(optionOrGroup, group);
271
+ Array.from(optionOrGroup.children).forEach((option) => {
272
+ const nativeOption = this.toNativeElement(option);
273
+ group.append(nativeOption);
274
+ this.componentToNativeEl.set(optionOrGroup, nativeOption);
275
+ });
276
+ this.componentToNativeEl.set(optionOrGroup, group);
277
+ return group;
278
+ }
279
+ throw new Error("unsupported element child provided");
280
+ }
281
+ deselectAllExcept(except) {
282
+ this.el.querySelectorAll("calcite-option").forEach((option) => {
283
+ if (option === except) {
284
+ return;
285
+ }
286
+ option.selected = false;
287
+ });
288
+ }
289
+ //--------------------------------------------------------------------------
290
+ //
291
+ // Render Methods
292
+ //
293
+ //--------------------------------------------------------------------------
294
+ renderChevron() {
295
+ return (h("div", { class: CSS.iconContainer }, h("calcite-icon", { class: CSS.icon, icon: "chevron-down", scale: "s" })));
296
+ }
297
+ render() {
298
+ return (h(Fragment, null, h("select", { "aria-label": this.label, class: CSS.select, disabled: this.disabled, onChange: this.handleInternalSelectChange, ref: this.storeSelectRef }, h("slot", null)), this.renderChevron(), h(HiddenFormInputSlot, { component: this })));
299
+ }
300
+ get el() { return getElement(this); }
301
+ static get watchers() { return {
302
+ "value": ["valueHandler"],
303
+ "selectedOption": ["selectedOptionHandler"]
304
+ }; }
305
+ };
306
+ Select.style = selectCss;
307
+
308
+ export { Option as calcite_option, Select as calcite_select };