@esri/solutions-components 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,173 @@
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, f as forceUpdate } from './p-c023e6a1.js';
7
+ import { c as createObserver } from './p-9a9955db.js';
8
+ import { u as updateHostInteraction } from './p-7daea1df.js';
9
+ import { t as toAriaBoolean } from './p-83166522.js';
10
+ import './p-729708a3.js';
11
+ import './p-a80b3880.js';
12
+
13
+ /*!
14
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
15
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
16
+ * v1.0.0-beta.97
17
+ */
18
+ const CSS = {
19
+ button: "button",
20
+ buttonTextVisible: "button--text-visible",
21
+ buttonCompact: "button--compact",
22
+ iconContainer: "icon-container",
23
+ slotContainer: "slot-container",
24
+ slotContainerHidden: "slot-container--hidden",
25
+ textContainer: "text-container",
26
+ textContainerVisible: "text-container--visible"
27
+ };
28
+ const TEXT = {
29
+ loading: "Loading"
30
+ };
31
+ const SLOTS = {
32
+ tooltip: "tooltip"
33
+ };
34
+
35
+ const actionCss = "@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}: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;background-color:transparent;--calcite-action-indicator-color:var(--calcite-ui-brand)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;background-color:var(--calcite-ui-foreground-1);fill:var(--calcite-ui-text-3);font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-3);outline-color:transparent;text-align:unset;flex:1 0 auto}.button:hover{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.button:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.button:active{background-color:var(--calcite-ui-foreground-3)}.button .icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1rem}.button .text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.button .text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus,:host([active][loading]) .button{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([active]) .button:active{background-color:var(--calcite-ui-foreground-1)}:host([appearance=clear]) .button,:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host([appearance=clear]) .button:hover,:host([appearance=clear]) .button:focus,:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:transparent;box-shadow:0 0 0 2px var(--calcite-ui-border-1) inset}:host([active][appearance=clear]) .button,:host([active][appearance=clear]) .button:hover,:host([active][appearance=clear]) .button:focus,:host([active][appearance=transparent]) .button,:host([active][appearance=transparent]) .button:hover,:host([active][appearance=transparent]) .button:focus{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([appearance=clear][loading]) .button,:host([appearance=clear][disabled]) .button,:host([appearance=transparent][loading]) .button,:host([appearance=transparent][disabled]) .button{background-color:transparent}:host([loading]) .button,:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-ui-foreground-1)}:host([loading]) .button .text-container,:host([loading]) .button:hover .text-container,:host([loading]) .button:focus .text-container{opacity:var(--calcite-ui-opacity-disabled)}:host([loading]) calcite-loader[inline]{color:var(--calcite-ui-text-3);-webkit-margin-end:0px;margin-inline-end:0px}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-ui-foreground-1);opacity:var(--calcite-ui-opacity-disabled)}:host([disabled][active]) .button,:host([disabled][active]) .button:hover,:host([disabled][active]) .button:focus{background-color:var(--calcite-ui-foreground-3);opacity:var(--calcite-ui-opacity-disabled)}:host([indicator]) .button::after{content:\"\";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;border-width:2px;background-color:var(--calcite-action-indicator-color);border-color:var(--calcite-ui-foreground-1);inset-block-end:0.75rem;inset-inline-end:0.75rem}:host([indicator]) .button--text-visible::after{inset-block-end:auto}:host([indicator]) .button--text-visible .text-container--visible{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([indicator]) .button:hover::after,:host([indicator]) .button:focus::after{border-color:var(--calcite-ui-foreground-1)}:host([indicator][scale=s]) .button::after{inset-block-end:0.25rem;inset-inline-end:0.25rem}:host([indicator][scale=s]) .button--text-visible::after{inset-block-end:auto;inset-inline-end:0.5rem}:host([indicator][active]) .button::after{border-color:var(--calcite-ui-foreground-3)}";
36
+
37
+ const Action = class {
38
+ constructor(hostRef) {
39
+ registerInstance(this, hostRef);
40
+ this.calciteActionClick = createEvent(this, "calciteActionClick", 6);
41
+ // --------------------------------------------------------------------------
42
+ //
43
+ // Properties
44
+ //
45
+ // --------------------------------------------------------------------------
46
+ /**
47
+ * When `true`, the component is highlighted.
48
+ */
49
+ this.active = false;
50
+ /** Specifies the appearance of the component. */
51
+ this.appearance = "solid";
52
+ /**
53
+ * When `true`, the side padding of the component is reduced. Compact mode is used internally by components, e.g. `calcite-block-section`.
54
+ */
55
+ this.compact = false;
56
+ /**
57
+ * When `true`, interaction is prevented and the component is displayed with lower opacity.
58
+ */
59
+ this.disabled = false;
60
+ /**
61
+ * When `true`, indicates unread changes.
62
+ */
63
+ this.indicator = false;
64
+ /**
65
+ * Specifies the text label to display while loading.
66
+ *
67
+ * @default "Loading"
68
+ */
69
+ this.intlLoading = TEXT.loading;
70
+ /**
71
+ * When `true`, a busy indicator is displayed.
72
+ */
73
+ this.loading = false;
74
+ /**
75
+ * Specifies the size of the component.
76
+ */
77
+ this.scale = "m";
78
+ /**
79
+ * Indicates whether the text is displayed.
80
+ */
81
+ this.textEnabled = false;
82
+ this.mutationObserver = createObserver("mutation", () => forceUpdate(this));
83
+ // --------------------------------------------------------------------------
84
+ //
85
+ // Private Methods
86
+ //
87
+ // --------------------------------------------------------------------------
88
+ this.handleTooltipSlotChange = (event) => {
89
+ const tooltips = event.target
90
+ .assignedElements({
91
+ flatten: true
92
+ })
93
+ .filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-tooltip"));
94
+ const tooltip = tooltips[0];
95
+ if (tooltip) {
96
+ tooltip.referenceElement = this.buttonEl;
97
+ }
98
+ };
99
+ this.calciteActionClickHandler = () => {
100
+ if (!this.disabled) {
101
+ this.calciteActionClick.emit();
102
+ }
103
+ };
104
+ }
105
+ // --------------------------------------------------------------------------
106
+ //
107
+ // Lifecycle
108
+ //
109
+ // --------------------------------------------------------------------------
110
+ connectedCallback() {
111
+ var _a;
112
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
113
+ }
114
+ disconnectedCallback() {
115
+ var _a;
116
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
117
+ }
118
+ componentDidRender() {
119
+ updateHostInteraction(this);
120
+ }
121
+ // --------------------------------------------------------------------------
122
+ //
123
+ // Methods
124
+ //
125
+ // --------------------------------------------------------------------------
126
+ /** Sets focus on the component. */
127
+ async setFocus() {
128
+ var _a;
129
+ (_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.focus();
130
+ }
131
+ // --------------------------------------------------------------------------
132
+ //
133
+ // Render Methods
134
+ //
135
+ // --------------------------------------------------------------------------
136
+ renderTextContainer() {
137
+ const { text, textEnabled } = this;
138
+ const textContainerClasses = {
139
+ [CSS.textContainer]: true,
140
+ [CSS.textContainerVisible]: textEnabled
141
+ };
142
+ return text ? (h("div", { class: textContainerClasses, key: "text-container" }, text)) : null;
143
+ }
144
+ renderIconContainer() {
145
+ var _a;
146
+ const { loading, icon, scale, el, intlLoading } = this;
147
+ const iconScale = scale === "l" ? "m" : "s";
148
+ const loaderScale = scale === "l" ? "l" : "m";
149
+ const calciteLoaderNode = loading ? (h("calcite-loader", { active: true, inline: true, label: intlLoading, scale: loaderScale })) : null;
150
+ const calciteIconNode = icon ? h("calcite-icon", { icon: icon, scale: iconScale }) : null;
151
+ const iconNode = calciteLoaderNode || calciteIconNode;
152
+ const hasIconToDisplay = iconNode || ((_a = el.children) === null || _a === void 0 ? void 0 : _a.length);
153
+ const slotContainerNode = (h("div", { class: {
154
+ [CSS.slotContainer]: true,
155
+ [CSS.slotContainerHidden]: loading
156
+ } }, h("slot", null)));
157
+ return hasIconToDisplay ? (h("div", { "aria-hidden": "true", class: CSS.iconContainer, key: "icon-container" }, iconNode, slotContainerNode)) : null;
158
+ }
159
+ render() {
160
+ const { compact, disabled, loading, textEnabled, label, text } = this;
161
+ const ariaLabel = label || text;
162
+ const buttonClasses = {
163
+ [CSS.button]: true,
164
+ [CSS.buttonTextVisible]: textEnabled,
165
+ [CSS.buttonCompact]: compact
166
+ };
167
+ return (h(Host, { onClick: this.calciteActionClickHandler }, h("button", { "aria-busy": toAriaBoolean(loading), "aria-disabled": toAriaBoolean(disabled), "aria-label": ariaLabel, class: buttonClasses, disabled: disabled, ref: (buttonEl) => (this.buttonEl = buttonEl) }, this.renderIconContainer(), this.renderTextContainer()), h("slot", { name: SLOTS.tooltip, onSlotchange: this.handleTooltipSlotChange })));
168
+ }
169
+ get el() { return getElement(this); }
170
+ };
171
+ Action.style = actionCss;
172
+
173
+ export { Action as calcite_action };
@@ -8,4 +8,112 @@
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
- function r(r){const{r:n,g:t,b:s}=r;return`#${n.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`.toLowerCase()}const n=/^[0-9A-F]$/i,t=/^#[0-9A-F]{3}$/i,s=/^#[0-9A-F]{6}$/i;function e(r){return u(r)||i(r)}function u(r){return r&&4===r.length&&t.test(r)}function i(r){return r&&7===r.length&&s.test(r)}function a(n){return(n=n.toLowerCase()).startsWith("#")||(n=`#${n}`),u(n)?r(f(n)):n}function f(r){if(!e(r))return null;if(3===(r=r.replace("#","")).length){const[n,t,s]=r.split("");return{r:parseInt(`${n}${n}`,16),g:parseInt(`${t}${t}`,16),b:parseInt(`${s}${s}`,16)}}return{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}}const c={HEX:"hex",HEXA:"hexa",RGB_CSS:"rgb-css",RGBA_CSS:"rgba-css",HSL_CSS:"hsl-css",HSLA_CSS:"hsla-css"},o="rgb",l="rgba",h="hsl",$="hsla",b="hsv",g="hsva";function p(r){if("string"==typeof r){if(r.startsWith("#")){const{length:n}=r;if(4===n||7===n)return c.HEX;if(5===n||9===n)return c.HEXA}if(r.startsWith("rgba("))return c.RGBA_CSS;if(r.startsWith("rgb("))return c.RGB_CSS;if(r.startsWith("hsl("))return c.HSL_CSS;if(r.startsWith("hsla("))return c.HSLA_CSS}if("object"==typeof r){if(S(r,"r","g","b"))return S(r,"a")?l:o;if(S(r,"h","s","l"))return S(r,"a")?$:h;if(S(r,"h","s","v"))return S(r,"a")?g:b}return null}function S(r,...n){return n.every((n=>n&&r&&`${n}`in r))}function A(r,n){return(null==r?void 0:r.rgbNumber())===(null==n?void 0:n.rgbNumber())}export{c as C,i as a,n as b,A as c,f as h,e as i,a as n,p,r}
11
+ function rgbToHex(color) {
12
+ const { r, g, b } = color;
13
+ return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b
14
+ .toString(16)
15
+ .padStart(2, "0")}`.toLowerCase();
16
+ }
17
+ const hexChar = /^[0-9A-F]$/i;
18
+ const shortHandHex = /^#[0-9A-F]{3}$/i;
19
+ const longhandHex = /^#[0-9A-F]{6}$/i;
20
+ function isValidHex(hex) {
21
+ return isShorthandHex(hex) || isLonghandHex(hex);
22
+ }
23
+ function isShorthandHex(hex) {
24
+ return hex && hex.length === 4 && shortHandHex.test(hex);
25
+ }
26
+ function isLonghandHex(hex) {
27
+ return hex && hex.length === 7 && longhandHex.test(hex);
28
+ }
29
+ function normalizeHex(hex) {
30
+ hex = hex.toLowerCase();
31
+ if (!hex.startsWith("#")) {
32
+ hex = `#${hex}`;
33
+ }
34
+ if (isShorthandHex(hex)) {
35
+ return rgbToHex(hexToRGB(hex));
36
+ }
37
+ return hex;
38
+ }
39
+ function hexToRGB(hex) {
40
+ if (!isValidHex(hex)) {
41
+ return null;
42
+ }
43
+ hex = hex.replace("#", "");
44
+ if (hex.length === 3) {
45
+ const [first, second, third] = hex.split("");
46
+ const r = parseInt(`${first}${first}`, 16);
47
+ const g = parseInt(`${second}${second}`, 16);
48
+ const b = parseInt(`${third}${third}`, 16);
49
+ return { r, g, b };
50
+ }
51
+ const r = parseInt(hex.slice(0, 2), 16);
52
+ const g = parseInt(hex.slice(2, 4), 16);
53
+ const b = parseInt(hex.slice(4, 6), 16);
54
+ return { r, g, b };
55
+ }
56
+ // these utils allow users to pass enum values as strings without having to access the enum
57
+ // based on the approach suggested by https://github.com/microsoft/TypeScript/issues/17690#issuecomment-321365759,
58
+ const enumify = (x) => x;
59
+ const CSSColorMode = enumify({
60
+ HEX: "hex",
61
+ HEXA: "hexa",
62
+ RGB_CSS: "rgb-css",
63
+ RGBA_CSS: "rgba-css",
64
+ HSL_CSS: "hsl-css",
65
+ HSLA_CSS: "hsla-css"
66
+ });
67
+ const ObjectColorMode = enumify({
68
+ RGB: "rgb",
69
+ RGBA: "rgba",
70
+ HSL: "hsl",
71
+ HSLA: "hsla",
72
+ HSV: "hsv",
73
+ HSVA: "hsva"
74
+ });
75
+ function parseMode(colorValue) {
76
+ if (typeof colorValue === "string") {
77
+ if (colorValue.startsWith("#")) {
78
+ const { length } = colorValue;
79
+ if (length === 4 || length === 7) {
80
+ return CSSColorMode.HEX;
81
+ }
82
+ if (length === 5 || length === 9) {
83
+ return CSSColorMode.HEXA;
84
+ }
85
+ }
86
+ if (colorValue.startsWith("rgba(")) {
87
+ return CSSColorMode.RGBA_CSS;
88
+ }
89
+ if (colorValue.startsWith("rgb(")) {
90
+ return CSSColorMode.RGB_CSS;
91
+ }
92
+ if (colorValue.startsWith("hsl(")) {
93
+ return CSSColorMode.HSL_CSS;
94
+ }
95
+ if (colorValue.startsWith("hsla(")) {
96
+ return CSSColorMode.HSLA_CSS;
97
+ }
98
+ }
99
+ if (typeof colorValue === "object") {
100
+ if (hasChannels(colorValue, "r", "g", "b")) {
101
+ return hasChannels(colorValue, "a") ? ObjectColorMode.RGBA : ObjectColorMode.RGB;
102
+ }
103
+ if (hasChannels(colorValue, "h", "s", "l")) {
104
+ return hasChannels(colorValue, "a") ? ObjectColorMode.HSLA : ObjectColorMode.HSL;
105
+ }
106
+ if (hasChannels(colorValue, "h", "s", "v")) {
107
+ return hasChannels(colorValue, "a") ? ObjectColorMode.HSVA : ObjectColorMode.HSV;
108
+ }
109
+ }
110
+ return null;
111
+ }
112
+ function hasChannels(colorObject, ...channels) {
113
+ return channels.every((channel) => channel && colorObject && `${channel}` in colorObject);
114
+ }
115
+ function colorEqual(value1, value2) {
116
+ return (value1 === null || value1 === void 0 ? void 0 : value1.rgbNumber()) === (value2 === null || value2 === void 0 ? void 0 : value2.rgbNumber());
117
+ }
118
+
119
+ export { CSSColorMode as C, isLonghandHex as a, hexChar as b, colorEqual as c, hexToRGB as h, isValidHex as i, normalizeHex as n, parseMode as p, rgbToHex as r };
@@ -0,0 +1,213 @@
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 } from './p-c023e6a1.js';
7
+ import { n as normalizeHex, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './p-991ee695.js';
8
+ import { c as color } from './p-93d3119d.js';
9
+ import { f as focusElement } from './p-83166522.js';
10
+ import { T as TEXT } from './p-374a5031.js';
11
+ import './p-3b010ce1.js';
12
+ import './p-729708a3.js';
13
+ import './p-a80b3880.js';
14
+
15
+ /*!
16
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
17
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
18
+ * v1.0.0-beta.97
19
+ */
20
+ const CSS = {
21
+ container: "container",
22
+ preview: "preview",
23
+ input: "input"
24
+ };
25
+
26
+ const colorPickerHexInputCss = "@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}.container{display:inline-grid;inline-size:100%;align-items:center;grid-template-columns:1fr auto}.preview{grid-column:2/3;pointer-events:none;margin-block:0px;margin-inline:0.25rem;display:flex;align-items:center}.preview,.input{grid-row:1}.input{grid-column:1/3;inline-size:100%;text-transform:uppercase}";
27
+
28
+ const DEFAULT_COLOR = color();
29
+ const ColorPickerHexInput = class {
30
+ constructor(hostRef) {
31
+ registerInstance(this, hostRef);
32
+ this.calciteColorPickerHexInputChange = createEvent(this, "calciteColorPickerHexInputChange", 6);
33
+ //--------------------------------------------------------------------------
34
+ //
35
+ // Public Properties
36
+ //
37
+ //--------------------------------------------------------------------------
38
+ /**
39
+ * When `false`, an empty color (`null`) will be allowed as a `value`. Otherwise, a color value is enforced on the component.
40
+ *
41
+ * When `true`, a color value is enforced, and clearing the input or blurring will restore the last valid `value`. When `false`, an empty color (`null`) will be allowed as a `value`.
42
+ */
43
+ this.allowEmpty = false;
44
+ /**
45
+ * Accessible name for the Hex input.
46
+ *
47
+ * @default "Hex"
48
+ */
49
+ this.intlHex = TEXT.hex;
50
+ /**
51
+ * Accessible name for the Hex input when there is no color selected.
52
+ *
53
+ * @default "No color"
54
+ */
55
+ this.intlNoColor = TEXT.noColor;
56
+ /** Specifies the size of the component. */
57
+ this.scale = "m";
58
+ /**
59
+ * The Hex value.
60
+ */
61
+ this.value = normalizeHex(DEFAULT_COLOR.hex());
62
+ this.onCalciteInternalInputBlur = () => {
63
+ const node = this.inputNode;
64
+ const inputValue = node.value;
65
+ const hex = `#${inputValue}`;
66
+ const willClearValue = this.allowEmpty && !inputValue;
67
+ if (willClearValue || (isValidHex(hex) && isLonghandHex(hex))) {
68
+ return;
69
+ }
70
+ // manipulating DOM directly since rerender doesn't update input value
71
+ node.value =
72
+ this.allowEmpty && !this.internalColor
73
+ ? ""
74
+ : this.formatForInternalInput(rgbToHex(this.internalColor.object()));
75
+ };
76
+ this.onInputChange = () => {
77
+ this.internalSetValue(this.inputNode.value, this.value);
78
+ };
79
+ /**
80
+ * The last valid/selected color. Used as a fallback if an invalid hex code is entered.
81
+ */
82
+ this.internalColor = DEFAULT_COLOR;
83
+ this.previousNonNullValue = this.value;
84
+ this.storeInputRef = (node) => {
85
+ this.inputNode = node;
86
+ };
87
+ }
88
+ //--------------------------------------------------------------------------
89
+ //
90
+ // Lifecycle
91
+ //
92
+ //--------------------------------------------------------------------------
93
+ connectedCallback() {
94
+ const { allowEmpty, value } = this;
95
+ if (value) {
96
+ const normalized = normalizeHex(value);
97
+ if (isValidHex(normalized)) {
98
+ this.internalSetValue(normalized, normalized, false);
99
+ }
100
+ return;
101
+ }
102
+ if (allowEmpty) {
103
+ this.internalSetValue(null, null, false);
104
+ }
105
+ }
106
+ handleValueChange(value, oldValue) {
107
+ this.internalSetValue(value, oldValue, false);
108
+ }
109
+ // using @Listen as a workaround for VDOM listener not firing
110
+ onInputKeyDown(event) {
111
+ const { altKey, ctrlKey, metaKey, shiftKey } = event;
112
+ const { internalColor, value } = this;
113
+ const { key } = event;
114
+ if (key === "Tab" || key === "Enter") {
115
+ this.onInputChange();
116
+ return;
117
+ }
118
+ const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
119
+ const oldValue = this.value;
120
+ if (isNudgeKey) {
121
+ if (!value) {
122
+ this.internalSetValue(this.previousNonNullValue, oldValue);
123
+ event.preventDefault();
124
+ return;
125
+ }
126
+ const direction = key === "ArrowUp" ? 1 : -1;
127
+ const bump = shiftKey ? 10 : 1;
128
+ this.internalSetValue(normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
129
+ event.preventDefault();
130
+ return;
131
+ }
132
+ const withModifiers = altKey || ctrlKey || metaKey;
133
+ const singleChar = key.length === 1;
134
+ const validHexChar = hexChar.test(key);
135
+ if (singleChar && !withModifiers && !validHexChar) {
136
+ event.preventDefault();
137
+ }
138
+ }
139
+ onPaste(event) {
140
+ const hex = event.clipboardData.getData("text");
141
+ if (isValidHex(hex)) {
142
+ event.preventDefault();
143
+ this.inputNode.value = hex.slice(1);
144
+ }
145
+ }
146
+ //--------------------------------------------------------------------------
147
+ //
148
+ // Lifecycle
149
+ //
150
+ //--------------------------------------------------------------------------
151
+ render() {
152
+ const { intlHex, value } = this;
153
+ const hexInputValue = this.formatForInternalInput(value);
154
+ return (h("div", { class: CSS.container }, h("calcite-input", { class: CSS.input, label: intlHex, maxLength: 6, numberingSystem: this.numberingSystem, onCalciteInputChange: this.onInputChange, onCalciteInternalInputBlur: this.onCalciteInternalInputBlur, onKeyDown: this.handleKeyDown, onPaste: this.onPaste, prefixText: "#", ref: this.storeInputRef, scale: this.scale, value: hexInputValue }), hexInputValue ? (h("calcite-color-picker-swatch", { active: true, class: CSS.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
155
+ }
156
+ //--------------------------------------------------------------------------
157
+ //
158
+ // Public Methods
159
+ //
160
+ //--------------------------------------------------------------------------
161
+ /** Sets focus on the component. */
162
+ async setFocus() {
163
+ focusElement(this.inputNode);
164
+ }
165
+ //--------------------------------------------------------------------------
166
+ //
167
+ // Private Methods
168
+ //
169
+ //--------------------------------------------------------------------------
170
+ internalSetValue(value, oldValue, emit = true) {
171
+ if (value) {
172
+ const normalized = normalizeHex(value);
173
+ if (isValidHex(normalized)) {
174
+ const { internalColor } = this;
175
+ const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
176
+ this.internalColor = color(normalized);
177
+ this.previousNonNullValue = normalized;
178
+ this.value = normalized;
179
+ if (changed && emit) {
180
+ this.calciteColorPickerHexInputChange.emit();
181
+ }
182
+ return;
183
+ }
184
+ }
185
+ else if (this.allowEmpty) {
186
+ this.internalColor = null;
187
+ this.value = null;
188
+ if (emit) {
189
+ this.calciteColorPickerHexInputChange.emit();
190
+ }
191
+ return;
192
+ }
193
+ this.value = oldValue;
194
+ }
195
+ formatForInternalInput(hex) {
196
+ return hex ? hex.replace("#", "") : "";
197
+ }
198
+ nudgeRGBChannels(color$1, amount) {
199
+ return color.rgb(color$1.array().map((channel) => channel + amount));
200
+ }
201
+ handleKeyDown(event) {
202
+ if (event.key === "Enter") {
203
+ event.preventDefault();
204
+ }
205
+ }
206
+ get el() { return getElement(this); }
207
+ static get watchers() { return {
208
+ "value": ["handleValueChange"]
209
+ }; }
210
+ };
211
+ ColorPickerHexInput.style = colorPickerHexInputCss;
212
+
213
+ export { ColorPickerHexInput as calcite_color_picker_hex_input };
@@ -8,4 +8,44 @@
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
- function t(t,s,n){const i=function(t){class s extends window.MutationObserver{constructor(t){super(t),this.observedEntry=[],this.callback=t}observe(t,s){return this.observedEntry.push({target:t,options:s}),super.observe(t,s)}unobserve(t){const s=this.observedEntry.filter((s=>s.target!==t));this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),s.forEach((t=>this.observe(t.target,t.options)))}}return"intersection"===t?window.IntersectionObserver:"mutation"===t?s:window.ResizeObserver}(t);return new i(s,n)}export{t as c}
11
+ /**
12
+ * This utility ensures observers are created only for browser contexts.
13
+ *
14
+ * @param type - the type of observer to create
15
+ * @param callback - the observer callback
16
+ * @param options - the observer options
17
+ */
18
+ function createObserver(type, callback, options) {
19
+ const Observer = getObserver(type);
20
+ return new Observer(callback, options);
21
+ }
22
+ function getObserver(type) {
23
+ // based on https://github.com/whatwg/dom/issues/126#issuecomment-1049814948
24
+ class ExtendedMutationObserver extends window.MutationObserver {
25
+ constructor(callback) {
26
+ super(callback);
27
+ this.observedEntry = [];
28
+ this.callback = callback;
29
+ }
30
+ observe(target, options) {
31
+ this.observedEntry.push({ target, options });
32
+ return super.observe(target, options);
33
+ }
34
+ unobserve(target) {
35
+ const newObservedEntries = this.observedEntry.filter((observed) => observed.target !== target);
36
+ this.observedEntry = [];
37
+ this.callback(super.takeRecords(), this);
38
+ this.disconnect();
39
+ newObservedEntries.forEach((observed) => this.observe(observed.target, observed.options));
40
+ }
41
+ }
42
+ return (function () {
43
+ return (type === "intersection"
44
+ ? window.IntersectionObserver
45
+ : type === "mutation"
46
+ ? ExtendedMutationObserver
47
+ : window.ResizeObserver);
48
+ })();
49
+ }
50
+
51
+ export { createObserver as c };
@@ -3,19 +3,38 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{c as a}from"./p-4307dacd.js";
7
- /** @license
8
- * Copyright 2022 Esri
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */const{state:e,onChange:s}=a({managedLayers:[],highlightHandle:void 0,layerNameHash:{}}),n=new CustomEvent("managedLayersChanged",{bubbles:!0,cancelable:!1,composed:!0});s("managedLayers",(()=>{dispatchEvent(n)}));export{e as s}
6
+ import { c as createStore } from './p-4307dacd.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
+ const { state, onChange } = createStore({
24
+ // List of layers added and managed by the component
25
+ managedLayers: [],
26
+ // Handle: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle
27
+ highlightHandle: undefined,
28
+ // ILayerHash title: id lookup to be used across components
29
+ layerNameHash: {}
30
+ });
31
+ const managedLayersChangedEvent = new CustomEvent("managedLayersChanged", {
32
+ bubbles: true,
33
+ cancelable: false,
34
+ composed: true
35
+ });
36
+ onChange("managedLayers", () => {
37
+ dispatchEvent(managedLayersChangedEvent);
38
+ });
39
+
40
+ export { state as s };