@esri/solutions-components 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (530) hide show
  1. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +16 -6
  2. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +1 -1
  3. package/dist/cjs/solution-configuration.cjs.entry.js +10 -3
  4. package/dist/cjs/solution-configuration.cjs.entry.js.map +1 -1
  5. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -1
  6. package/dist/cjs/solution-contents_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/{solution-store-e2fc11ac.js → solution-store-893499a5.js} +3 -1
  8. package/dist/cjs/solution-store-893499a5.js.map +1 -0
  9. package/dist/collection/components/solution-configuration/solution-configuration.js +9 -2
  10. package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
  11. package/dist/collection/components/solution-item/solution-item.js +2 -0
  12. package/dist/collection/components/solution-item/solution-item.js.map +1 -1
  13. package/dist/collection/components/solution-item-details/solution-item-details.js +15 -5
  14. package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
  15. package/dist/collection/utils/solution-store.js +2 -0
  16. package/dist/collection/utils/solution-store.js.map +1 -1
  17. package/dist/collection/utils/solution-store.ts +2 -0
  18. package/dist/esm/calcite-shell-panel_14.entry.js +16 -6
  19. package/dist/esm/calcite-shell-panel_14.entry.js.map +1 -1
  20. package/dist/esm/solution-configuration.entry.js +10 -3
  21. package/dist/esm/solution-configuration.entry.js.map +1 -1
  22. package/dist/esm/solution-contents_3.entry.js +3 -1
  23. package/dist/esm/solution-contents_3.entry.js.map +1 -1
  24. package/dist/esm/{solution-store-b3c65467.js → solution-store-0c58c852.js} +3 -1
  25. package/dist/esm/solution-store-0c58c852.js.map +1 -0
  26. package/dist/solutions-components/{p-b25f6ebe.js → p-659edb14.js} +3 -1
  27. package/dist/solutions-components/p-659edb14.js.map +1 -0
  28. package/dist/solutions-components/{p-638738f2.entry.js → p-77c75f3a.entry.js} +4 -2
  29. package/dist/solutions-components/p-77c75f3a.entry.js.map +1 -0
  30. package/dist/solutions-components/{p-7e8985f2.entry.js → p-90629c1d.entry.js} +11 -4
  31. package/dist/solutions-components/p-90629c1d.entry.js.map +1 -0
  32. package/dist/solutions-components/{p-542189bc.entry.js → p-984cb687.entry.js} +17 -7
  33. package/dist/solutions-components/p-984cb687.entry.js.map +1 -0
  34. package/dist/solutions-components/solutions-components.esm.js +1 -1
  35. package/dist/solutions-components/utils/solution-store.ts +2 -0
  36. package/dist/solutions-components_commit.txt +9 -6
  37. package/dist/types/components/solution-item-details/solution-item-details.d.ts +2 -1
  38. package/package.json +1 -1
  39. package/dist/cjs/solution-store-e2fc11ac.js.map +0 -1
  40. package/dist/components/ExpandToggle.js +0 -112
  41. package/dist/components/ExpandToggle.js.map +0 -1
  42. package/dist/components/Heading.js +0 -24
  43. package/dist/components/Heading.js.map +0 -1
  44. package/dist/components/_commonjsHelpers.js +0 -24
  45. package/dist/components/_commonjsHelpers.js.map +0 -1
  46. package/dist/components/action-bar.js +0 -278
  47. package/dist/components/action-bar.js.map +0 -1
  48. package/dist/components/action-group.js +0 -151
  49. package/dist/components/action-group.js.map +0 -1
  50. package/dist/components/action-menu.js +0 -358
  51. package/dist/components/action-menu.js.map +0 -1
  52. package/dist/components/action.js +0 -216
  53. package/dist/components/action.js.map +0 -1
  54. package/dist/components/array.js +0 -17
  55. package/dist/components/array.js.map +0 -1
  56. package/dist/components/buffer-tools.d.ts +0 -11
  57. package/dist/components/buffer-tools.js +0 -13
  58. package/dist/components/buffer-tools.js.map +0 -1
  59. package/dist/components/buffer-tools2.js +0 -256
  60. package/dist/components/buffer-tools2.js.map +0 -1
  61. package/dist/components/button.js +0 -265
  62. package/dist/components/button.js.map +0 -1
  63. package/dist/components/calcite-accordion-item.js +0 -246
  64. package/dist/components/calcite-accordion-item.js.map +0 -1
  65. package/dist/components/calcite-accordion.js +0 -182
  66. package/dist/components/calcite-accordion.js.map +0 -1
  67. package/dist/components/calcite-action-bar.js +0 -13
  68. package/dist/components/calcite-action-bar.js.map +0 -1
  69. package/dist/components/calcite-action-group.js +0 -13
  70. package/dist/components/calcite-action-group.js.map +0 -1
  71. package/dist/components/calcite-action-menu.js +0 -13
  72. package/dist/components/calcite-action-menu.js.map +0 -1
  73. package/dist/components/calcite-action-pad.js +0 -199
  74. package/dist/components/calcite-action-pad.js.map +0 -1
  75. package/dist/components/calcite-action.js +0 -13
  76. package/dist/components/calcite-action.js.map +0 -1
  77. package/dist/components/calcite-alert.js +0 -299
  78. package/dist/components/calcite-alert.js.map +0 -1
  79. package/dist/components/calcite-avatar.js +0 -184
  80. package/dist/components/calcite-avatar.js.map +0 -1
  81. package/dist/components/calcite-block-section.js +0 -157
  82. package/dist/components/calcite-block-section.js.map +0 -1
  83. package/dist/components/calcite-block.js +0 -277
  84. package/dist/components/calcite-block.js.map +0 -1
  85. package/dist/components/calcite-button.js +0 -13
  86. package/dist/components/calcite-button.js.map +0 -1
  87. package/dist/components/calcite-card.js +0 -189
  88. package/dist/components/calcite-card.js.map +0 -1
  89. package/dist/components/calcite-checkbox.js +0 -13
  90. package/dist/components/calcite-checkbox.js.map +0 -1
  91. package/dist/components/calcite-chip.js +0 -13
  92. package/dist/components/calcite-chip.js.map +0 -1
  93. package/dist/components/calcite-color-picker-hex-input.js +0 -13
  94. package/dist/components/calcite-color-picker-hex-input.js.map +0 -1
  95. package/dist/components/calcite-color-picker-swatch.js +0 -13
  96. package/dist/components/calcite-color-picker-swatch.js.map +0 -1
  97. package/dist/components/calcite-color-picker.js +0 -1038
  98. package/dist/components/calcite-color-picker.js.map +0 -1
  99. package/dist/components/calcite-combobox-item-group.js +0 -77
  100. package/dist/components/calcite-combobox-item-group.js.map +0 -1
  101. package/dist/components/calcite-combobox-item.js +0 -13
  102. package/dist/components/calcite-combobox-item.js.map +0 -1
  103. package/dist/components/calcite-combobox.js +0 -13
  104. package/dist/components/calcite-combobox.js.map +0 -1
  105. package/dist/components/calcite-date-picker-day.js +0 -13
  106. package/dist/components/calcite-date-picker-day.js.map +0 -1
  107. package/dist/components/calcite-date-picker-month-header.js +0 -13
  108. package/dist/components/calcite-date-picker-month-header.js.map +0 -1
  109. package/dist/components/calcite-date-picker-month.js +0 -13
  110. package/dist/components/calcite-date-picker-month.js.map +0 -1
  111. package/dist/components/calcite-date-picker.js +0 -13
  112. package/dist/components/calcite-date-picker.js.map +0 -1
  113. package/dist/components/calcite-dropdown-group.js +0 -101
  114. package/dist/components/calcite-dropdown-group.js.map +0 -1
  115. package/dist/components/calcite-dropdown-item.js +0 -237
  116. package/dist/components/calcite-dropdown-item.js.map +0 -1
  117. package/dist/components/calcite-dropdown.js +0 -13
  118. package/dist/components/calcite-dropdown.js.map +0 -1
  119. package/dist/components/calcite-fab.js +0 -146
  120. package/dist/components/calcite-fab.js.map +0 -1
  121. package/dist/components/calcite-filter.js +0 -197
  122. package/dist/components/calcite-filter.js.map +0 -1
  123. package/dist/components/calcite-flow-item.js +0 -245
  124. package/dist/components/calcite-flow-item.js.map +0 -1
  125. package/dist/components/calcite-flow.js +0 -149
  126. package/dist/components/calcite-flow.js.map +0 -1
  127. package/dist/components/calcite-graph.js +0 -13
  128. package/dist/components/calcite-graph.js.map +0 -1
  129. package/dist/components/calcite-handle.js +0 -13
  130. package/dist/components/calcite-handle.js.map +0 -1
  131. package/dist/components/calcite-icon.js +0 -13
  132. package/dist/components/calcite-icon.js.map +0 -1
  133. package/dist/components/calcite-inline-editable.js +0 -296
  134. package/dist/components/calcite-inline-editable.js.map +0 -1
  135. package/dist/components/calcite-input-date-picker.js +0 -715
  136. package/dist/components/calcite-input-date-picker.js.map +0 -1
  137. package/dist/components/calcite-input-message.js +0 -13
  138. package/dist/components/calcite-input-message.js.map +0 -1
  139. package/dist/components/calcite-input-number.js +0 -639
  140. package/dist/components/calcite-input-number.js.map +0 -1
  141. package/dist/components/calcite-input-text.js +0 -402
  142. package/dist/components/calcite-input-text.js.map +0 -1
  143. package/dist/components/calcite-input-time-picker.js +0 -436
  144. package/dist/components/calcite-input-time-picker.js.map +0 -1
  145. package/dist/components/calcite-input.js +0 -13
  146. package/dist/components/calcite-input.js.map +0 -1
  147. package/dist/components/calcite-label.js +0 -13
  148. package/dist/components/calcite-label.js.map +0 -1
  149. package/dist/components/calcite-link.js +0 -13
  150. package/dist/components/calcite-link.js.map +0 -1
  151. package/dist/components/calcite-list-item-group.js +0 -67
  152. package/dist/components/calcite-list-item-group.js.map +0 -1
  153. package/dist/components/calcite-list-item.js +0 -13
  154. package/dist/components/calcite-list-item.js.map +0 -1
  155. package/dist/components/calcite-list.js +0 -13
  156. package/dist/components/calcite-list.js.map +0 -1
  157. package/dist/components/calcite-loader.js +0 -13
  158. package/dist/components/calcite-loader.js.map +0 -1
  159. package/dist/components/calcite-modal.js +0 -500
  160. package/dist/components/calcite-modal.js.map +0 -1
  161. package/dist/components/calcite-notice.js +0 -13
  162. package/dist/components/calcite-notice.js.map +0 -1
  163. package/dist/components/calcite-option-group.js +0 -66
  164. package/dist/components/calcite-option-group.js.map +0 -1
  165. package/dist/components/calcite-option.js +0 -13
  166. package/dist/components/calcite-option.js.map +0 -1
  167. package/dist/components/calcite-pagination.js +0 -260
  168. package/dist/components/calcite-pagination.js.map +0 -1
  169. package/dist/components/calcite-panel.js +0 -13
  170. package/dist/components/calcite-panel.js.map +0 -1
  171. package/dist/components/calcite-pick-list-group.js +0 -76
  172. package/dist/components/calcite-pick-list-group.js.map +0 -1
  173. package/dist/components/calcite-pick-list-item.js +0 -13
  174. package/dist/components/calcite-pick-list-item.js.map +0 -1
  175. package/dist/components/calcite-pick-list.js +0 -175
  176. package/dist/components/calcite-pick-list.js.map +0 -1
  177. package/dist/components/calcite-popover-manager.js +0 -96
  178. package/dist/components/calcite-popover-manager.js.map +0 -1
  179. package/dist/components/calcite-popover.js +0 -13
  180. package/dist/components/calcite-popover.js.map +0 -1
  181. package/dist/components/calcite-progress.js +0 -13
  182. package/dist/components/calcite-progress.js.map +0 -1
  183. package/dist/components/calcite-radio-button-group.js +0 -134
  184. package/dist/components/calcite-radio-button-group.js.map +0 -1
  185. package/dist/components/calcite-radio-button.js +0 -312
  186. package/dist/components/calcite-radio-button.js.map +0 -1
  187. package/dist/components/calcite-radio-group-item.js +0 -13
  188. package/dist/components/calcite-radio-group-item.js.map +0 -1
  189. package/dist/components/calcite-radio-group.js +0 -13
  190. package/dist/components/calcite-radio-group.js.map +0 -1
  191. package/dist/components/calcite-rating.js +0 -203
  192. package/dist/components/calcite-rating.js.map +0 -1
  193. package/dist/components/calcite-scrim.js +0 -13
  194. package/dist/components/calcite-scrim.js.map +0 -1
  195. package/dist/components/calcite-select.js +0 -13
  196. package/dist/components/calcite-select.js.map +0 -1
  197. package/dist/components/calcite-shell-center-row.js +0 -102
  198. package/dist/components/calcite-shell-center-row.js.map +0 -1
  199. package/dist/components/calcite-shell-panel.js +0 -13
  200. package/dist/components/calcite-shell-panel.js.map +0 -1
  201. package/dist/components/calcite-shell.js +0 -13
  202. package/dist/components/calcite-shell.js.map +0 -1
  203. package/dist/components/calcite-slider.js +0 -13
  204. package/dist/components/calcite-slider.js.map +0 -1
  205. package/dist/components/calcite-sortable-list.js +0 -204
  206. package/dist/components/calcite-sortable-list.js.map +0 -1
  207. package/dist/components/calcite-split-button.js +0 -170
  208. package/dist/components/calcite-split-button.js.map +0 -1
  209. package/dist/components/calcite-stepper-item.js +0 -273
  210. package/dist/components/calcite-stepper-item.js.map +0 -1
  211. package/dist/components/calcite-stepper.js +0 -258
  212. package/dist/components/calcite-stepper.js.map +0 -1
  213. package/dist/components/calcite-switch.js +0 -13
  214. package/dist/components/calcite-switch.js.map +0 -1
  215. package/dist/components/calcite-tab-nav.js +0 -13
  216. package/dist/components/calcite-tab-nav.js.map +0 -1
  217. package/dist/components/calcite-tab-title.js +0 -13
  218. package/dist/components/calcite-tab-title.js.map +0 -1
  219. package/dist/components/calcite-tab.js +0 -13
  220. package/dist/components/calcite-tab.js.map +0 -1
  221. package/dist/components/calcite-tabs.js +0 -13
  222. package/dist/components/calcite-tabs.js.map +0 -1
  223. package/dist/components/calcite-tile-select-group.js +0 -67
  224. package/dist/components/calcite-tile-select-group.js.map +0 -1
  225. package/dist/components/calcite-tile-select.js +0 -268
  226. package/dist/components/calcite-tile-select.js.map +0 -1
  227. package/dist/components/calcite-tile.js +0 -13
  228. package/dist/components/calcite-tile.js.map +0 -1
  229. package/dist/components/calcite-time-picker.js +0 -13
  230. package/dist/components/calcite-time-picker.js.map +0 -1
  231. package/dist/components/calcite-tip-group.js +0 -43
  232. package/dist/components/calcite-tip-group.js.map +0 -1
  233. package/dist/components/calcite-tip-manager.js +0 -225
  234. package/dist/components/calcite-tip-manager.js.map +0 -1
  235. package/dist/components/calcite-tip.js +0 -164
  236. package/dist/components/calcite-tip.js.map +0 -1
  237. package/dist/components/calcite-tooltip-manager.js +0 -59
  238. package/dist/components/calcite-tooltip-manager.js.map +0 -1
  239. package/dist/components/calcite-tooltip.js +0 -13
  240. package/dist/components/calcite-tooltip.js.map +0 -1
  241. package/dist/components/calcite-tree-item.js +0 -13
  242. package/dist/components/calcite-tree-item.js.map +0 -1
  243. package/dist/components/calcite-tree.js +0 -13
  244. package/dist/components/calcite-tree.js.map +0 -1
  245. package/dist/components/calcite-value-list-item.js +0 -13
  246. package/dist/components/calcite-value-list-item.js.map +0 -1
  247. package/dist/components/calcite-value-list.js +0 -13
  248. package/dist/components/calcite-value-list.js.map +0 -1
  249. package/dist/components/check-list.d.ts +0 -11
  250. package/dist/components/check-list.js +0 -13
  251. package/dist/components/check-list.js.map +0 -1
  252. package/dist/components/check-list2.js +0 -128
  253. package/dist/components/check-list2.js.map +0 -1
  254. package/dist/components/checkbox.js +0 -167
  255. package/dist/components/checkbox.js.map +0 -1
  256. package/dist/components/chip.js +0 -172
  257. package/dist/components/chip.js.map +0 -1
  258. package/dist/components/color-picker-hex-input.js +0 -365
  259. package/dist/components/color-picker-hex-input.js.map +0 -1
  260. package/dist/components/color-picker-swatch.js +0 -2036
  261. package/dist/components/color-picker-swatch.js.map +0 -1
  262. package/dist/components/combobox-item.js +0 -184
  263. package/dist/components/combobox-item.js.map +0 -1
  264. package/dist/components/combobox.js +0 -914
  265. package/dist/components/combobox.js.map +0 -1
  266. package/dist/components/conditionalSlot.js +0 -52
  267. package/dist/components/conditionalSlot.js.map +0 -1
  268. package/dist/components/config-buffer-tools.d.ts +0 -11
  269. package/dist/components/config-buffer-tools.js +0 -185
  270. package/dist/components/config-buffer-tools.js.map +0 -1
  271. package/dist/components/config-draw-tools.d.ts +0 -11
  272. package/dist/components/config-draw-tools.js +0 -124
  273. package/dist/components/config-draw-tools.js.map +0 -1
  274. package/dist/components/config-layer-picker.d.ts +0 -11
  275. package/dist/components/config-layer-picker.js +0 -148
  276. package/dist/components/config-layer-picker.js.map +0 -1
  277. package/dist/components/config-pdf-download.d.ts +0 -11
  278. package/dist/components/config-pdf-download.js +0 -157
  279. package/dist/components/config-pdf-download.js.map +0 -1
  280. package/dist/components/date-picker-day.js +0 -113
  281. package/dist/components/date-picker-day.js.map +0 -1
  282. package/dist/components/date-picker-month-header.js +0 -226
  283. package/dist/components/date-picker-month-header.js.map +0 -1
  284. package/dist/components/date-picker-month.js +0 -346
  285. package/dist/components/date-picker-month.js.map +0 -1
  286. package/dist/components/date-picker.js +0 -577
  287. package/dist/components/date-picker.js.map +0 -1
  288. package/dist/components/date.js +0 -182
  289. package/dist/components/date.js.map +0 -1
  290. package/dist/components/debounce.js +0 -489
  291. package/dist/components/debounce.js.map +0 -1
  292. package/dist/components/dom.js +0 -233
  293. package/dist/components/dom.js.map +0 -1
  294. package/dist/components/dropdown.js +0 -507
  295. package/dist/components/dropdown.js.map +0 -1
  296. package/dist/components/filter.js +0 -765
  297. package/dist/components/filter.js.map +0 -1
  298. package/dist/components/floating-ui.js +0 -1787
  299. package/dist/components/floating-ui.js.map +0 -1
  300. package/dist/components/form.js +0 -230
  301. package/dist/components/form.js.map +0 -1
  302. package/dist/components/graph.js +0 -256
  303. package/dist/components/graph.js.map +0 -1
  304. package/dist/components/guid.js +0 -26
  305. package/dist/components/guid.js.map +0 -1
  306. package/dist/components/handle.js +0 -121
  307. package/dist/components/handle.js.map +0 -1
  308. package/dist/components/icon.js +0 -204
  309. package/dist/components/icon.js.map +0 -1
  310. package/dist/components/index.d.ts +0 -48
  311. package/dist/components/index.js +0 -190
  312. package/dist/components/index.js.map +0 -1
  313. package/dist/components/index2.js +0 -201
  314. package/dist/components/index2.js.map +0 -1
  315. package/dist/components/input-message.js +0 -103
  316. package/dist/components/input-message.js.map +0 -1
  317. package/dist/components/input.js +0 -742
  318. package/dist/components/input.js.map +0 -1
  319. package/dist/components/interactive.js +0 -53
  320. package/dist/components/interactive.js.map +0 -1
  321. package/dist/components/interfaces.js +0 -21
  322. package/dist/components/interfaces.js.map +0 -1
  323. package/dist/components/interfaces2.js +0 -23
  324. package/dist/components/interfaces2.js.map +0 -1
  325. package/dist/components/interfaces3.js +0 -72
  326. package/dist/components/interfaces3.js.map +0 -1
  327. package/dist/components/json-editor.d.ts +0 -11
  328. package/dist/components/json-editor.js +0 -13
  329. package/dist/components/json-editor.js.map +0 -1
  330. package/dist/components/json-editor2.js +0 -443
  331. package/dist/components/json-editor2.js.map +0 -1
  332. package/dist/components/key.js +0 -18
  333. package/dist/components/key.js.map +0 -1
  334. package/dist/components/label.js +0 -108
  335. package/dist/components/label.js.map +0 -1
  336. package/dist/components/label2.js +0 -133
  337. package/dist/components/label2.js.map +0 -1
  338. package/dist/components/labelFormats.js +0 -212
  339. package/dist/components/labelFormats.js.map +0 -1
  340. package/dist/components/link.js +0 -125
  341. package/dist/components/link.js.map +0 -1
  342. package/dist/components/list-item.js +0 -151
  343. package/dist/components/list-item.js.map +0 -1
  344. package/dist/components/list.js +0 -85
  345. package/dist/components/list.js.map +0 -1
  346. package/dist/components/loadModules.js +0 -30
  347. package/dist/components/loadModules.js.map +0 -1
  348. package/dist/components/loader.js +0 -118
  349. package/dist/components/loader.js.map +0 -1
  350. package/dist/components/locale.js +0 -414
  351. package/dist/components/locale.js.map +0 -1
  352. package/dist/components/locale2.js +0 -415
  353. package/dist/components/locale2.js.map +0 -1
  354. package/dist/components/map-draw-tools.d.ts +0 -11
  355. package/dist/components/map-draw-tools.js +0 -13
  356. package/dist/components/map-draw-tools.js.map +0 -1
  357. package/dist/components/map-draw-tools2.js +0 -230
  358. package/dist/components/map-draw-tools2.js.map +0 -1
  359. package/dist/components/map-layer-picker.d.ts +0 -11
  360. package/dist/components/map-layer-picker.js +0 -13
  361. package/dist/components/map-layer-picker.js.map +0 -1
  362. package/dist/components/map-layer-picker2.js +0 -190
  363. package/dist/components/map-layer-picker2.js.map +0 -1
  364. package/dist/components/map-search.d.ts +0 -11
  365. package/dist/components/map-search.js +0 -157
  366. package/dist/components/map-search.js.map +0 -1
  367. package/dist/components/map-select-tools.d.ts +0 -11
  368. package/dist/components/map-select-tools.js +0 -13
  369. package/dist/components/map-select-tools.js.map +0 -1
  370. package/dist/components/map-select-tools2.js +0 -555
  371. package/dist/components/map-select-tools2.js.map +0 -1
  372. package/dist/components/mapViewUtils.js +0 -131
  373. package/dist/components/mapViewUtils.js.map +0 -1
  374. package/dist/components/math.js +0 -26
  375. package/dist/components/math.js.map +0 -1
  376. package/dist/components/nonChromiumPlatformUtils.js +0 -505
  377. package/dist/components/nonChromiumPlatformUtils.js.map +0 -1
  378. package/dist/components/notice.js +0 -194
  379. package/dist/components/notice.js.map +0 -1
  380. package/dist/components/observers.js +0 -58
  381. package/dist/components/observers.js.map +0 -1
  382. package/dist/components/openCloseComponent.js +0 -58
  383. package/dist/components/openCloseComponent.js.map +0 -1
  384. package/dist/components/option.js +0 -111
  385. package/dist/components/option.js.map +0 -1
  386. package/dist/components/panel.js +0 -461
  387. package/dist/components/panel.js.map +0 -1
  388. package/dist/components/pdf-download.d.ts +0 -11
  389. package/dist/components/pdf-download.js +0 -13
  390. package/dist/components/pdf-download.js.map +0 -1
  391. package/dist/components/pdf-download2.js +0 -243
  392. package/dist/components/pdf-download2.js.map +0 -1
  393. package/dist/components/pick-list-item.js +0 -257
  394. package/dist/components/pick-list-item.js.map +0 -1
  395. package/dist/components/popover.js +0 -502
  396. package/dist/components/popover.js.map +0 -1
  397. package/dist/components/progress.js +0 -62
  398. package/dist/components/progress.js.map +0 -1
  399. package/dist/components/public-notification.d.ts +0 -11
  400. package/dist/components/public-notification.js +0 -784
  401. package/dist/components/public-notification.js.map +0 -1
  402. package/dist/components/publicNotificationStore.js +0 -40
  403. package/dist/components/publicNotificationStore.js.map +0 -1
  404. package/dist/components/queryUtils.js +0 -163
  405. package/dist/components/queryUtils.js.map +0 -1
  406. package/dist/components/radio-group-item.js +0 -103
  407. package/dist/components/radio-group-item.js.map +0 -1
  408. package/dist/components/radio-group.js +0 -237
  409. package/dist/components/radio-group.js.map +0 -1
  410. package/dist/components/refine-selection-tools.d.ts +0 -11
  411. package/dist/components/refine-selection-tools.js +0 -13
  412. package/dist/components/refine-selection-tools.js.map +0 -1
  413. package/dist/components/refine-selection-tools2.js +0 -500
  414. package/dist/components/refine-selection-tools2.js.map +0 -1
  415. package/dist/components/refine-selection.d.ts +0 -11
  416. package/dist/components/refine-selection.js +0 -13
  417. package/dist/components/refine-selection.js.map +0 -1
  418. package/dist/components/refine-selection2.js +0 -369
  419. package/dist/components/refine-selection2.js.map +0 -1
  420. package/dist/components/resources.js +0 -26
  421. package/dist/components/resources.js.map +0 -1
  422. package/dist/components/resources2.js +0 -23
  423. package/dist/components/resources2.js.map +0 -1
  424. package/dist/components/resources3.js +0 -40
  425. package/dist/components/resources3.js.map +0 -1
  426. package/dist/components/scrim.js +0 -85
  427. package/dist/components/scrim.js.map +0 -1
  428. package/dist/components/select.js +0 -261
  429. package/dist/components/select.js.map +0 -1
  430. package/dist/components/shared-list-render.js +0 -321
  431. package/dist/components/shared-list-render.js.map +0 -1
  432. package/dist/components/shell-panel.js +0 -283
  433. package/dist/components/shell-panel.js.map +0 -1
  434. package/dist/components/shell.js +0 -123
  435. package/dist/components/shell.js.map +0 -1
  436. package/dist/components/slider.js +0 -898
  437. package/dist/components/slider.js.map +0 -1
  438. package/dist/components/solution-configuration.d.ts +0 -11
  439. package/dist/components/solution-configuration.js +0 -2225
  440. package/dist/components/solution-configuration.js.map +0 -1
  441. package/dist/components/solution-contents.d.ts +0 -11
  442. package/dist/components/solution-contents.js +0 -13
  443. package/dist/components/solution-contents.js.map +0 -1
  444. package/dist/components/solution-contents2.js +0 -130
  445. package/dist/components/solution-contents2.js.map +0 -1
  446. package/dist/components/solution-item-details.d.ts +0 -11
  447. package/dist/components/solution-item-details.js +0 -13
  448. package/dist/components/solution-item-details.js.map +0 -1
  449. package/dist/components/solution-item-details2.js +0 -236
  450. package/dist/components/solution-item-details2.js.map +0 -1
  451. package/dist/components/solution-item-icon.d.ts +0 -11
  452. package/dist/components/solution-item-icon.js +0 -13
  453. package/dist/components/solution-item-icon.js.map +0 -1
  454. package/dist/components/solution-item-icon2.js +0 -344
  455. package/dist/components/solution-item-icon2.js.map +0 -1
  456. package/dist/components/solution-item-sharing.d.ts +0 -11
  457. package/dist/components/solution-item-sharing.js +0 -13
  458. package/dist/components/solution-item-sharing.js.map +0 -1
  459. package/dist/components/solution-item-sharing2.js +0 -169
  460. package/dist/components/solution-item-sharing2.js.map +0 -1
  461. package/dist/components/solution-item.d.ts +0 -11
  462. package/dist/components/solution-item.js +0 -13
  463. package/dist/components/solution-item.js.map +0 -1
  464. package/dist/components/solution-item2.js +0 -317
  465. package/dist/components/solution-item2.js.map +0 -1
  466. package/dist/components/solution-organization-variables.d.ts +0 -11
  467. package/dist/components/solution-organization-variables.js +0 -13
  468. package/dist/components/solution-organization-variables.js.map +0 -1
  469. package/dist/components/solution-organization-variables2.js +0 -134
  470. package/dist/components/solution-organization-variables2.js.map +0 -1
  471. package/dist/components/solution-resource-item.d.ts +0 -11
  472. package/dist/components/solution-resource-item.js +0 -13
  473. package/dist/components/solution-resource-item.js.map +0 -1
  474. package/dist/components/solution-resource-item2.js +0 -358
  475. package/dist/components/solution-resource-item2.js.map +0 -1
  476. package/dist/components/solution-spatial-ref.d.ts +0 -11
  477. package/dist/components/solution-spatial-ref.js +0 -13
  478. package/dist/components/solution-spatial-ref.js.map +0 -1
  479. package/dist/components/solution-spatial-ref2.js +0 -21448
  480. package/dist/components/solution-spatial-ref2.js.map +0 -1
  481. package/dist/components/solution-store.js +0 -4094
  482. package/dist/components/solution-store.js.map +0 -1
  483. package/dist/components/solution-template-data.d.ts +0 -11
  484. package/dist/components/solution-template-data.js +0 -13
  485. package/dist/components/solution-template-data.js.map +0 -1
  486. package/dist/components/solution-template-data2.js +0 -235
  487. package/dist/components/solution-template-data2.js.map +0 -1
  488. package/dist/components/solution-variables.d.ts +0 -11
  489. package/dist/components/solution-variables.js +0 -13
  490. package/dist/components/solution-variables.js.map +0 -1
  491. package/dist/components/solution-variables2.js +0 -152
  492. package/dist/components/solution-variables2.js.map +0 -1
  493. package/dist/components/sortable.esm.js +0 -3028
  494. package/dist/components/sortable.esm.js.map +0 -1
  495. package/dist/components/store-manager.d.ts +0 -11
  496. package/dist/components/store-manager.js +0 -85
  497. package/dist/components/store-manager.js.map +0 -1
  498. package/dist/components/switch.js +0 -141
  499. package/dist/components/switch.js.map +0 -1
  500. package/dist/components/tab-nav.js +0 -243
  501. package/dist/components/tab-nav.js.map +0 -1
  502. package/dist/components/tab-title.js +0 -278
  503. package/dist/components/tab-title.js.map +0 -1
  504. package/dist/components/tab.js +0 -156
  505. package/dist/components/tab.js.map +0 -1
  506. package/dist/components/tabs.js +0 -190
  507. package/dist/components/tabs.js.map +0 -1
  508. package/dist/components/tile.js +0 -131
  509. package/dist/components/tile.js.map +0 -1
  510. package/dist/components/time-picker.js +0 -945
  511. package/dist/components/time-picker.js.map +0 -1
  512. package/dist/components/tooltip.js +0 -401
  513. package/dist/components/tooltip.js.map +0 -1
  514. package/dist/components/tree-item.js +0 -296
  515. package/dist/components/tree-item.js.map +0 -1
  516. package/dist/components/tree.js +0 -329
  517. package/dist/components/tree.js.map +0 -1
  518. package/dist/components/utils.js +0 -121
  519. package/dist/components/utils.js.map +0 -1
  520. package/dist/components/utils2.js +0 -53
  521. package/dist/components/utils2.js.map +0 -1
  522. package/dist/components/value-list-item.js +0 -206
  523. package/dist/components/value-list-item.js.map +0 -1
  524. package/dist/components/value-list.js +0 -335
  525. package/dist/components/value-list.js.map +0 -1
  526. package/dist/esm/solution-store-b3c65467.js.map +0 -1
  527. package/dist/solutions-components/p-542189bc.entry.js.map +0 -1
  528. package/dist/solutions-components/p-638738f2.entry.js.map +0 -1
  529. package/dist/solutions-components/p-7e8985f2.entry.js.map +0 -1
  530. package/dist/solutions-components/p-b25f6ebe.js.map +0 -1
@@ -1,1038 +0,0 @@
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 { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
- import { c as color, d as defineCustomElement$a } from './color-picker-swatch.js';
8
- import { D as DEFAULT_COLOR, T as TEXT, a as DIMENSIONS, H as HSV_LIMITS, C as CSS, d as defineCustomElement$b, b as DEFAULT_STORAGE_KEY_PREFIX, R as RGB_LIMITS } from './color-picker-hex-input.js';
9
- import { i as isPrimaryPointerButton, c as getElementDir, f as focusElement } from './dom.js';
10
- import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual } from './utils.js';
11
- import { c as clamp } from './math.js';
12
- import { u as updateHostInteraction } from './interactive.js';
13
- import { i as isActivationKey } from './key.js';
14
- import { d as defineCustomElement$c } from './button.js';
15
- import { d as defineCustomElement$9 } from './icon.js';
16
- import { d as defineCustomElement$8 } from './input.js';
17
- import { d as defineCustomElement$7 } from './loader.js';
18
- import { d as defineCustomElement$6 } from './progress.js';
19
- import { d as defineCustomElement$5 } from './tab.js';
20
- import { d as defineCustomElement$4 } from './tab-nav.js';
21
- import { d as defineCustomElement$3 } from './tab-title.js';
22
- import { d as defineCustomElement$2 } from './tabs.js';
23
- import { d as debounce, i as isObject } from './debounce.js';
24
-
25
- /** Error message constants. */
26
- var FUNC_ERROR_TEXT = 'Expected a function';
27
-
28
- /**
29
- * Creates a throttled function that only invokes `func` at most once per
30
- * every `wait` milliseconds. The throttled function comes with a `cancel`
31
- * method to cancel delayed `func` invocations and a `flush` method to
32
- * immediately invoke them. Provide `options` to indicate whether `func`
33
- * should be invoked on the leading and/or trailing edge of the `wait`
34
- * timeout. The `func` is invoked with the last arguments provided to the
35
- * throttled function. Subsequent calls to the throttled function return the
36
- * result of the last `func` invocation.
37
- *
38
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
39
- * invoked on the trailing edge of the timeout only if the throttled function
40
- * is invoked more than once during the `wait` timeout.
41
- *
42
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
43
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
44
- *
45
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
46
- * for details over the differences between `_.throttle` and `_.debounce`.
47
- *
48
- * @static
49
- * @memberOf _
50
- * @since 0.1.0
51
- * @category Function
52
- * @param {Function} func The function to throttle.
53
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
54
- * @param {Object} [options={}] The options object.
55
- * @param {boolean} [options.leading=true]
56
- * Specify invoking on the leading edge of the timeout.
57
- * @param {boolean} [options.trailing=true]
58
- * Specify invoking on the trailing edge of the timeout.
59
- * @returns {Function} Returns the new throttled function.
60
- * @example
61
- *
62
- * // Avoid excessively updating the position while scrolling.
63
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
64
- *
65
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
66
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
67
- * jQuery(element).on('click', throttled);
68
- *
69
- * // Cancel the trailing throttled invocation.
70
- * jQuery(window).on('popstate', throttled.cancel);
71
- */
72
- function throttle(func, wait, options) {
73
- var leading = true,
74
- trailing = true;
75
-
76
- if (typeof func != 'function') {
77
- throw new TypeError(FUNC_ERROR_TEXT);
78
- }
79
- if (isObject(options)) {
80
- leading = 'leading' in options ? !!options.leading : leading;
81
- trailing = 'trailing' in options ? !!options.trailing : trailing;
82
- }
83
- return debounce(func, wait, {
84
- 'leading': leading,
85
- 'maxWait': wait,
86
- 'trailing': trailing
87
- });
88
- }
89
-
90
- const colorPickerCss = "@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-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{flex-direction:column}:host([scale=s]) .channel{inline-size:100%;-webkit-margin-after:4px;margin-block-end:4px}:host([scale=s]) .channel:last-child{-webkit-margin-after:0;margin-block-end:0}:host([scale=m]) .container{inline-size:272px}:host([scale=l]) .header{-webkit-padding-after:0px;padding-block-end:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .color-field-and-slider{-webkit-margin-after:-20px;margin-block-end:-20px}:host([scale=l]) .section{padding-block:0 16px;padding-inline:16px}:host([scale=l]) .section:first-of-type{-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;-webkit-padding-before:16px;padding-block-start:16px}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around;min-block-size:98px;inline-size:160px}:host([scale=l]) .color-mode-container{flex-shrink:3}:host([appearance=minimal]) .container{border:none}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{-webkit-margin-after:-16px;margin-block-end:-16px;touch-action:none}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 12px;padding-inline:12px}.section:first-of-type{-webkit-padding-before:12px;padding-block-start:12px}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;-webkit-padding-after:0.25rem;padding-block-end:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{-webkit-padding-before:12px;padding-block-start:12px}.channels{display:flex;justify-content:space-between}.channel{inline-size:31%}.saved-colors{-webkit-padding-before:12px;padding-block-start:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;inline-size:100%}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
91
-
92
- const throttleFor60FpsInMs = 16;
93
- const defaultValue = normalizeHex(DEFAULT_COLOR.hex());
94
- const defaultFormat = "auto";
95
- const ColorPicker = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
96
- constructor() {
97
- super();
98
- this.__registerHost();
99
- this.__attachShadow();
100
- this.calciteColorPickerChange = createEvent(this, "calciteColorPickerChange", 6);
101
- this.calciteColorPickerInput = createEvent(this, "calciteColorPickerInput", 6);
102
- //--------------------------------------------------------------------------
103
- //
104
- // Public properties
105
- //
106
- //--------------------------------------------------------------------------
107
- /**
108
- * When `false`, an empty color (`null`) will be allowed as a `value`. Otherwise, a color value is enforced on the component.
109
- *
110
- * 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`.
111
- */
112
- this.allowEmpty = false;
113
- /**
114
- * Specifies the appearance style of the component -
115
- *
116
- * `"solid"` (containing border) or `"minimal"` (no containing border).
117
- */
118
- this.appearance = "solid";
119
- /**
120
- * Internal prop for advanced use-cases.
121
- *
122
- * @internal
123
- */
124
- this.color = DEFAULT_COLOR;
125
- /**
126
- * When `true`, interaction is prevented and the component is displayed with lower opacity.
127
- */
128
- this.disabled = false;
129
- /**
130
- * The format of `value`.
131
- *
132
- * When `"auto"`, the format will be inferred from `value` when set.
133
- *
134
- * @default "auto"
135
- */
136
- this.format = defaultFormat;
137
- /** When `true`, hides the Hex input. */
138
- this.hideHex = false;
139
- /** When `true`, hides the RGB/HSV channel inputs. */
140
- this.hideChannels = false;
141
- /** When `true`, hides the saved colors section. */
142
- this.hideSaved = false;
143
- /**
144
- * Accessible name for the RGB section's blue channel.
145
- *
146
- * @default "B"
147
- */
148
- this.intlB = TEXT.b;
149
- /**
150
- * Accessible name for the RGB section's blue channel description.
151
- *
152
- * @default "Blue"
153
- */
154
- this.intlBlue = TEXT.blue;
155
- /**
156
- * Accessible name for the delete color button.
157
- *
158
- * @default "Delete color"
159
- */
160
- this.intlDeleteColor = TEXT.deleteColor;
161
- /**
162
- * Accessible name for the RGB section's green channel.
163
- *
164
- * @default "G"
165
- */
166
- this.intlG = TEXT.g;
167
- /**
168
- * Accessible name for the RGB section's green channel description.
169
- *
170
- * @default "Green"
171
- */
172
- this.intlGreen = TEXT.green;
173
- /**
174
- * Accessible name for the HSV section's hue channel.
175
- *
176
- * @default "H"
177
- */
178
- this.intlH = TEXT.h;
179
- /**
180
- * Accessible name for the HSV mode.
181
- *
182
- * @default "HSV"
183
- */
184
- this.intlHsv = TEXT.hsv;
185
- /**
186
- * Accessible name for the Hex input.
187
- *
188
- * @default "Hex"
189
- */
190
- this.intlHex = TEXT.hex;
191
- /**
192
- * Accessible name for the HSV section's hue channel description.
193
- *
194
- * @default "Hue"
195
- */
196
- this.intlHue = TEXT.hue;
197
- /**
198
- * Accessible name for the Hex input when there is no color selected.
199
- *
200
- * @default "No color"
201
- */
202
- this.intlNoColor = TEXT.noColor;
203
- /**
204
- * Accessible name for the RGB section's red channel.
205
- *
206
- * @default "R"
207
- */
208
- this.intlR = TEXT.r;
209
- /**
210
- * Accessible name for the RGB section's red channel description.
211
- *
212
- * @default "Red"
213
- */
214
- this.intlRed = TEXT.red;
215
- /**
216
- * Accessible name for the RGB mode.
217
- *
218
- * @default "RGB"
219
- */
220
- this.intlRgb = TEXT.rgb;
221
- /**
222
- * Accessible name for the HSV section's saturation channel.
223
- *
224
- * @default "S"
225
- */
226
- this.intlS = TEXT.s;
227
- /**
228
- * Accessible name for the HSV section's saturation channel description.
229
- *
230
- * @default "Saturation"
231
- */
232
- this.intlSaturation = TEXT.saturation;
233
- /**
234
- * Accessible name for the save color button.
235
- *
236
- * @default "Save color"
237
- */
238
- this.intlSaveColor = TEXT.saveColor;
239
- /**
240
- * Accessible name for the saved colors section.
241
- *
242
- * @default "Saved"
243
- */
244
- this.intlSaved = TEXT.saved;
245
- /**
246
- * Accessible name for the HSV section's value channel.
247
- *
248
- * @default "V"
249
- */
250
- this.intlV = TEXT.v;
251
- /**
252
- * Accessible name for the HSV section's value channel description.
253
- *
254
- * @default "Value"
255
- */
256
- this.intlValue = TEXT.value;
257
- /** Specifies the size of the component. */
258
- this.scale = "m";
259
- /**
260
- * The component's value, where the value can be a CSS color string, or a RGB, HSL or HSV object.
261
- *
262
- * The type will be preserved as the color is updated.
263
- *
264
- * @default "#007ac2"
265
- * @see [CSS Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color)
266
- * @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
267
- */
268
- this.value = defaultValue;
269
- this.colorFieldAndSliderHovered = false;
270
- this.hueThumbState = "idle";
271
- this.internalColorUpdateContext = null;
272
- this.mode = CSSColorMode.HEX;
273
- this.shiftKeyChannelAdjustment = 0;
274
- this.sliderThumbState = "idle";
275
- this.colorFieldAndSliderInteractive = false;
276
- this.channelMode = "rgb";
277
- this.channels = this.toChannels(DEFAULT_COLOR);
278
- this.dimensions = DIMENSIONS.m;
279
- this.savedColors = [];
280
- this.handleTabActivate = (event) => {
281
- this.channelMode = event.currentTarget.getAttribute("data-color-mode");
282
- this.updateChannelsFromColor(this.color);
283
- };
284
- this.handleColorFieldScopeKeyDown = (event) => {
285
- const { key } = event;
286
- const arrowKeyToXYOffset = {
287
- ArrowUp: { x: 0, y: -10 },
288
- ArrowRight: { x: 10, y: 0 },
289
- ArrowDown: { x: 0, y: 10 },
290
- ArrowLeft: { x: -10, y: 0 }
291
- };
292
- if (arrowKeyToXYOffset[key]) {
293
- event.preventDefault();
294
- this.scopeOrientation = key === "ArrowDown" || key === "ArrowUp" ? "vertical" : "horizontal";
295
- this.captureColorFieldColor(this.colorFieldScopeLeft + arrowKeyToXYOffset[key].x || 0, this.colorFieldScopeTop + arrowKeyToXYOffset[key].y || 0, false);
296
- }
297
- };
298
- this.handleHueScopeKeyDown = (event) => {
299
- const modifier = event.shiftKey ? 10 : 1;
300
- const { key } = event;
301
- const arrowKeyToXOffset = {
302
- ArrowUp: 1,
303
- ArrowRight: 1,
304
- ArrowDown: -1,
305
- ArrowLeft: -1
306
- };
307
- if (arrowKeyToXOffset[key]) {
308
- event.preventDefault();
309
- const delta = arrowKeyToXOffset[key] * modifier;
310
- const hue = this.baseColorFieldColor.hue();
311
- const color = this.baseColorFieldColor.hue(hue + delta);
312
- this.internalColorSet(color, false);
313
- }
314
- };
315
- this.handleHexInputChange = (event) => {
316
- event.stopPropagation();
317
- const { allowEmpty, color: color$1 } = this;
318
- const input = event.target;
319
- const hex = input.value;
320
- if (allowEmpty && !hex) {
321
- this.internalColorSet(null);
322
- return;
323
- }
324
- const normalizedHex = color$1 && normalizeHex(color$1.hex());
325
- if (hex !== normalizedHex) {
326
- this.internalColorSet(color(hex));
327
- }
328
- };
329
- this.handleSavedColorSelect = (event) => {
330
- const swatch = event.currentTarget;
331
- this.internalColorSet(color(swatch.color));
332
- };
333
- this.handleChannelInput = (event) => {
334
- const input = event.currentTarget;
335
- const internalInput = event.detail.nativeEvent.target;
336
- const channelIndex = Number(input.getAttribute("data-channel-index"));
337
- const limit = this.channelMode === "rgb"
338
- ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
339
- : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
340
- let inputValue;
341
- if (this.allowEmpty && !input.value) {
342
- inputValue = "";
343
- }
344
- else {
345
- const value = Number(input.value) + this.shiftKeyChannelAdjustment;
346
- const clamped = clamp(value, 0, limit);
347
- inputValue = clamped.toString();
348
- }
349
- input.value = inputValue;
350
- internalInput.value = inputValue;
351
- };
352
- this.handleChannelChange = (event) => {
353
- const input = event.currentTarget;
354
- const channelIndex = Number(input.getAttribute("data-channel-index"));
355
- const channels = [...this.channels];
356
- const shouldClearChannels = this.allowEmpty && !input.value;
357
- if (shouldClearChannels) {
358
- this.channels = [null, null, null];
359
- this.internalColorSet(null);
360
- return;
361
- }
362
- channels[channelIndex] = Number(input.value);
363
- this.updateColorFromChannels(channels);
364
- };
365
- this.handleSavedColorKeyDown = (event) => {
366
- if (isActivationKey(event.key)) {
367
- event.preventDefault();
368
- this.handleSavedColorSelect(event);
369
- }
370
- };
371
- this.handleColorFieldAndSliderPointerLeave = () => {
372
- this.colorFieldAndSliderInteractive = false;
373
- this.colorFieldAndSliderHovered = false;
374
- if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
375
- this.hueThumbState = "idle";
376
- this.sliderThumbState = "idle";
377
- this.drawColorFieldAndSlider();
378
- }
379
- };
380
- this.handleColorFieldAndSliderPointerDown = (event) => {
381
- var _a, _b;
382
- if (!isPrimaryPointerButton(event)) {
383
- return;
384
- }
385
- const { offsetX, offsetY } = event;
386
- const region = this.getCanvasRegion(offsetY);
387
- if (region === "color-field") {
388
- this.hueThumbState = "drag";
389
- this.captureColorFieldColor(offsetX, offsetY);
390
- (_a = this.colorFieldScopeNode) === null || _a === void 0 ? void 0 : _a.focus();
391
- }
392
- else if (region === "slider") {
393
- this.sliderThumbState = "drag";
394
- this.captureHueSliderColor(offsetX);
395
- (_b = this.hueScopeNode) === null || _b === void 0 ? void 0 : _b.focus();
396
- }
397
- // prevent text selection outside of color field & slider area
398
- event.preventDefault();
399
- document.addEventListener("pointermove", this.globalPointerMoveHandler);
400
- document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
401
- this.activeColorFieldAndSliderRect =
402
- this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
403
- };
404
- this.globalPointerUpHandler = (event) => {
405
- if (!isPrimaryPointerButton(event)) {
406
- return;
407
- }
408
- const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
409
- this.hueThumbState = "idle";
410
- this.sliderThumbState = "idle";
411
- this.activeColorFieldAndSliderRect = null;
412
- this.drawColorFieldAndSlider();
413
- if (previouslyDragging) {
414
- this.calciteColorPickerChange.emit();
415
- }
416
- };
417
- this.globalPointerMoveHandler = (event) => {
418
- const { el, dimensions } = this;
419
- const sliderThumbDragging = this.sliderThumbState === "drag";
420
- const hueThumbDragging = this.hueThumbState === "drag";
421
- if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
422
- return;
423
- }
424
- let samplingX;
425
- let samplingY;
426
- const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
427
- const { clientX, clientY } = event;
428
- if (this.colorFieldAndSliderHovered) {
429
- samplingX = clientX - colorFieldAndSliderRect.x;
430
- samplingY = clientY - colorFieldAndSliderRect.y;
431
- }
432
- else {
433
- const colorFieldWidth = dimensions.colorField.width;
434
- const colorFieldHeight = dimensions.colorField.height;
435
- const hueSliderHeight = dimensions.slider.height;
436
- if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
437
- clientX > colorFieldAndSliderRect.x) {
438
- samplingX = clientX - colorFieldAndSliderRect.x;
439
- }
440
- else if (clientX < colorFieldAndSliderRect.x) {
441
- samplingX = 0;
442
- }
443
- else {
444
- samplingX = colorFieldWidth - 1;
445
- }
446
- if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
447
- clientY > colorFieldAndSliderRect.y) {
448
- samplingY = clientY - colorFieldAndSliderRect.y;
449
- }
450
- else if (clientY < colorFieldAndSliderRect.y) {
451
- samplingY = 0;
452
- }
453
- else {
454
- samplingY = colorFieldHeight + hueSliderHeight;
455
- }
456
- }
457
- if (hueThumbDragging) {
458
- this.captureColorFieldColor(samplingX, samplingY, false);
459
- }
460
- else {
461
- this.captureHueSliderColor(samplingX);
462
- }
463
- };
464
- this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
465
- const { dimensions: { colorField, slider, thumb } } = this;
466
- this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
467
- this.colorFieldAndSliderHovered = true;
468
- const region = this.getCanvasRegion(offsetY);
469
- if (region === "color-field") {
470
- const prevHueThumbState = this.hueThumbState;
471
- const color = this.baseColorFieldColor.hsv();
472
- const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
473
- const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
474
- const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
475
- let transitionedBetweenHoverAndIdle = false;
476
- if (prevHueThumbState === "idle" && hoveringThumb) {
477
- this.hueThumbState = "hover";
478
- transitionedBetweenHoverAndIdle = true;
479
- }
480
- else if (prevHueThumbState === "hover" && !hoveringThumb) {
481
- this.hueThumbState = "idle";
482
- transitionedBetweenHoverAndIdle = true;
483
- }
484
- if (this.hueThumbState !== "drag") {
485
- if (transitionedBetweenHoverAndIdle) {
486
- // refresh since we won't update color and thus no redraw
487
- this.drawColorFieldAndSlider();
488
- }
489
- }
490
- }
491
- else if (region === "slider") {
492
- const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
493
- const prevSliderThumbState = this.sliderThumbState;
494
- const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
495
- const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
496
- const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
497
- let sliderThumbTransitionedBetweenHoverAndIdle = false;
498
- if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
499
- this.sliderThumbState = "hover";
500
- sliderThumbTransitionedBetweenHoverAndIdle = true;
501
- }
502
- else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
503
- this.sliderThumbState = "idle";
504
- sliderThumbTransitionedBetweenHoverAndIdle = true;
505
- }
506
- if (this.sliderThumbState !== "drag") {
507
- if (sliderThumbTransitionedBetweenHoverAndIdle) {
508
- // refresh since we won't update color and thus no redraw
509
- this.drawColorFieldAndSlider();
510
- }
511
- }
512
- }
513
- };
514
- this.storeColorFieldScope = (node) => {
515
- this.colorFieldScopeNode = node;
516
- };
517
- this.storeHueScope = (node) => {
518
- this.hueScopeNode = node;
519
- };
520
- this.renderChannelsTabTitle = (channelMode) => {
521
- const { channelMode: activeChannelMode, intlRgb, intlHsv } = this;
522
- const active = channelMode === activeChannelMode;
523
- const label = channelMode === "rgb" ? intlRgb : intlHsv;
524
- return (h("calcite-tab-title", { active: active, class: CSS.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate }, label));
525
- };
526
- this.renderChannelsTab = (channelMode) => {
527
- const { channelMode: activeChannelMode, channels, intlB, intlBlue, intlG, intlGreen, intlH, intlHue, intlR, intlRed, intlS, intlSaturation, intlV, intlValue } = this;
528
- const active = channelMode === activeChannelMode;
529
- const isRgb = channelMode === "rgb";
530
- const channelLabels = isRgb ? [intlR, intlG, intlB] : [intlH, intlS, intlV];
531
- const channelAriaLabels = isRgb
532
- ? [intlRed, intlGreen, intlBlue]
533
- : [intlHue, intlSaturation, intlValue];
534
- const direction = getElementDir(this.el);
535
- return (h("calcite-tab", { active: active, class: CSS.control, key: channelMode }, h("div", { class: CSS.channels, dir: "ltr" }, channels.map((channel, index) =>
536
- /* the channel container is ltr, so we apply the host's direction */
537
- this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
538
- };
539
- this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS.channel, "data-channel-index": index, dir: direction, label: ariaLabel, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
540
- this.deleteColor = () => {
541
- const colorToDelete = this.color.hex();
542
- const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
543
- if (!inStorage) {
544
- return;
545
- }
546
- const savedColors = this.savedColors.filter((color) => color !== colorToDelete);
547
- this.savedColors = savedColors;
548
- const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
549
- if (this.storageId) {
550
- localStorage.setItem(storageKey, JSON.stringify(savedColors));
551
- }
552
- };
553
- this.saveColor = () => {
554
- const colorToSave = this.color.hex();
555
- const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
556
- if (alreadySaved) {
557
- return;
558
- }
559
- const savedColors = [...this.savedColors, colorToSave];
560
- this.savedColors = savedColors;
561
- const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
562
- if (this.storageId) {
563
- localStorage.setItem(storageKey, JSON.stringify(savedColors));
564
- }
565
- };
566
- this.drawColorFieldAndSlider = throttle(() => {
567
- if (!this.fieldAndSliderRenderingContext) {
568
- return;
569
- }
570
- this.drawColorField();
571
- this.drawHueSlider();
572
- }, throttleFor60FpsInMs);
573
- this.captureColorFieldColor = (x, y, skipEqual = true) => {
574
- const { dimensions: { colorField: { height, width } } } = this;
575
- const saturation = Math.round((HSV_LIMITS.s / width) * x);
576
- const value = Math.round((HSV_LIMITS.v / height) * (height - y));
577
- this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
578
- };
579
- this.initColorFieldAndSlider = (canvas) => {
580
- this.fieldAndSliderRenderingContext = canvas.getContext("2d");
581
- this.updateCanvasSize(canvas);
582
- };
583
- }
584
- handleColorChange(color, oldColor) {
585
- this.drawColorFieldAndSlider();
586
- this.updateChannelsFromColor(color);
587
- this.previousColor = oldColor;
588
- }
589
- handleFormatChange(format) {
590
- this.setMode(format);
591
- this.internalColorSet(this.color, false, "internal");
592
- }
593
- handleScaleChange(scale = "m") {
594
- var _a;
595
- this.updateDimensions(scale);
596
- this.updateCanvasSize((_a = this.fieldAndSliderRenderingContext) === null || _a === void 0 ? void 0 : _a.canvas);
597
- }
598
- handleValueChange(value, oldValue) {
599
- const { allowEmpty, format } = this;
600
- const checkMode = !allowEmpty || value;
601
- let modeChanged = false;
602
- if (checkMode) {
603
- const nextMode = parseMode(value);
604
- if (!nextMode || (format !== "auto" && nextMode !== format)) {
605
- this.showIncompatibleColorWarning(value, format);
606
- this.value = oldValue;
607
- return;
608
- }
609
- modeChanged = this.mode !== nextMode;
610
- this.setMode(nextMode);
611
- }
612
- const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
613
- if (this.internalColorUpdateContext === "initial") {
614
- return;
615
- }
616
- if (this.internalColorUpdateContext === "user-interaction") {
617
- this.calciteColorPickerInput.emit();
618
- if (!dragging) {
619
- this.calciteColorPickerChange.emit();
620
- }
621
- return;
622
- }
623
- const color$1 = allowEmpty && !value ? null : color(value);
624
- const colorChanged = !colorEqual(color$1, this.color);
625
- if (modeChanged || colorChanged) {
626
- this.internalColorSet(color$1, true, "internal");
627
- }
628
- }
629
- //--------------------------------------------------------------------------
630
- //
631
- // Internal State/Props
632
- //
633
- //--------------------------------------------------------------------------
634
- get baseColorFieldColor() {
635
- return this.color || this.previousColor || DEFAULT_COLOR;
636
- }
637
- // using @Listen as a workaround for VDOM listener not firing
638
- handleChannelKeyUpOrDown(event) {
639
- this.shiftKeyChannelAdjustment = 0;
640
- const { key } = event;
641
- if ((key !== "ArrowUp" && key !== "ArrowDown") ||
642
- !event.composedPath().some((node) => { var _a; return (_a = node.classList) === null || _a === void 0 ? void 0 : _a.contains(CSS.channel); })) {
643
- return;
644
- }
645
- const { shiftKey } = event;
646
- event.preventDefault();
647
- if (!this.color) {
648
- this.internalColorSet(this.previousColor);
649
- event.stopPropagation();
650
- return;
651
- }
652
- // this gets applied to the input's up/down arrow increment/decrement
653
- const complementaryBump = 9;
654
- this.shiftKeyChannelAdjustment =
655
- key === "ArrowUp" && shiftKey
656
- ? complementaryBump
657
- : key === "ArrowDown" && shiftKey
658
- ? -complementaryBump
659
- : 0;
660
- }
661
- //--------------------------------------------------------------------------
662
- //
663
- // Public Methods
664
- //
665
- //--------------------------------------------------------------------------
666
- /** Sets focus on the component. */
667
- async setFocus() {
668
- return focusElement(this.colorFieldScopeNode);
669
- }
670
- //--------------------------------------------------------------------------
671
- //
672
- // Lifecycle
673
- //
674
- //--------------------------------------------------------------------------
675
- componentWillLoad() {
676
- const { allowEmpty, color: color$1, format, value } = this;
677
- const willSetNoColor = allowEmpty && !value;
678
- const parsedMode = parseMode(value);
679
- const valueIsCompatible = willSetNoColor || (format === "auto" && parsedMode) || format === parsedMode;
680
- const initialColor = willSetNoColor ? null : valueIsCompatible ? color(value) : color$1;
681
- if (!valueIsCompatible) {
682
- this.showIncompatibleColorWarning(value, format);
683
- }
684
- this.setMode(format);
685
- this.internalColorSet(initialColor, false, "initial");
686
- this.updateDimensions(this.scale);
687
- const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
688
- if (this.storageId && localStorage.getItem(storageKey)) {
689
- this.savedColors = JSON.parse(localStorage.getItem(storageKey));
690
- }
691
- }
692
- disconnectedCallback() {
693
- document.removeEventListener("pointermove", this.globalPointerMoveHandler);
694
- document.removeEventListener("pointerup", this.globalPointerUpHandler);
695
- }
696
- componentDidRender() {
697
- updateHostInteraction(this);
698
- }
699
- //--------------------------------------------------------------------------
700
- //
701
- // Render Methods
702
- //
703
- //--------------------------------------------------------------------------
704
- render() {
705
- const { allowEmpty, color, intlDeleteColor, hideHex, hideChannels, hideSaved, intlHex, intlSaved, intlSaveColor, savedColors, scale } = this;
706
- const selectedColorInHex = color ? color.hex() : null;
707
- const hexInputScale = scale === "l" ? "m" : "s";
708
- const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
709
- const hueTop = hueScopeTop !== null && hueScopeTop !== void 0 ? hueScopeTop : sliderHeight / 2 + colorFieldHeight;
710
- const hueLeft = hueScopeLeft !== null && hueScopeLeft !== void 0 ? hueScopeLeft : (colorFieldWidth * DEFAULT_COLOR.hue()) / HSV_LIMITS.h;
711
- const noColor = color === null;
712
- const vertical = scopeOrientation === "vertical";
713
- return (h("div", { class: CSS.container }, h("div", { class: CSS.colorFieldAndSliderWrap }, h("canvas", { class: {
714
- [CSS.colorFieldAndSlider]: true,
715
- [CSS.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
716
- }, onPointerDown: this.handleColorFieldAndSliderPointerDown, onPointerEnter: this.handleColorFieldAndSliderPointerEnterOrMove, onPointerLeave: this.handleColorFieldAndSliderPointerLeave, onPointerMove: this.handleColorFieldAndSliderPointerEnterOrMove, ref: this.initColorFieldAndSlider }), h("div", { "aria-label": vertical ? this.intlValue : this.intlSaturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color === null || color === void 0 ? void 0 : color.saturationv() : color === null || color === void 0 ? void 0 : color.value()) || "0", class: { [CSS.scope]: true, [CSS.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, ref: this.storeColorFieldScope, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0" }), h("div", { "aria-label": this.intlHue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": (color === null || color === void 0 ? void 0 : color.round().hue()) || DEFAULT_COLOR.round().hue(), class: { [CSS.scope]: true, [CSS.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, ref: this.storeHueScope, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0" })), hideHex && hideChannels ? null : (h("div", { class: {
717
- [CSS.controlSection]: true,
718
- [CSS.section]: true
719
- } }, hideHex ? null : (h("div", { class: CSS.hexOptions }, h("span", { class: {
720
- [CSS.header]: true,
721
- [CSS.headerHex]: true
722
- } }, intlHex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS.control, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
723
- [CSS.colorModeContainer]: true,
724
- [CSS.splitSection]: true
725
- }, scale: hexInputScale }, h("calcite-tab-nav", { slot: "tab-nav" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv"))))), hideSaved ? null : (h("div", { class: { [CSS.savedColorsSection]: true, [CSS.section]: true } }, h("div", { class: CSS.header }, h("label", null, intlSaved), h("div", { class: CSS.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS.deleteColor, color: "neutral", disabled: noColor, iconStart: "minus", label: intlDeleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS.saveColor, color: "neutral", disabled: noColor, iconStart: "plus", label: intlSaveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS.savedColors }, [
726
- ...savedColors.map((color) => (h("calcite-color-picker-swatch", { active: selectedColorInHex === color, class: CSS.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
727
- ])) : null))));
728
- }
729
- // --------------------------------------------------------------------------
730
- //
731
- // Private Methods
732
- //
733
- //--------------------------------------------------------------------------
734
- handleKeyDown(event) {
735
- if (event.key === "Enter") {
736
- event.preventDefault();
737
- }
738
- }
739
- showIncompatibleColorWarning(value, format) {
740
- console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
741
- }
742
- setMode(format) {
743
- this.mode = format === "auto" ? this.mode : format;
744
- }
745
- captureHueSliderColor(x) {
746
- const { dimensions: { slider: { width } } } = this;
747
- const hue = (360 / width) * x;
748
- this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
749
- }
750
- getCanvasRegion(y) {
751
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
752
- if (y <= colorFieldHeight) {
753
- return "color-field";
754
- }
755
- if (y <= colorFieldHeight + sliderHeight) {
756
- return "slider";
757
- }
758
- return "none";
759
- }
760
- internalColorSet(color, skipEqual = true, context = "user-interaction") {
761
- if (skipEqual && colorEqual(color, this.color)) {
762
- return;
763
- }
764
- this.internalColorUpdateContext = context;
765
- this.color = color;
766
- this.value = this.toValue(color);
767
- this.internalColorUpdateContext = null;
768
- }
769
- toValue(color, format = this.mode) {
770
- if (!color) {
771
- return null;
772
- }
773
- const hexMode = "hex";
774
- if (format.includes(hexMode)) {
775
- return normalizeHex(color.round()[hexMode]());
776
- }
777
- if (format.includes("-css")) {
778
- return color[format.replace("-css", "").replace("a", "")]().round().string();
779
- }
780
- const colorObject = color[format]().round().object();
781
- if (format.endsWith("a")) {
782
- // normalize alpha prop
783
- colorObject.a = colorObject.alpha;
784
- delete colorObject.alpha;
785
- }
786
- return colorObject;
787
- }
788
- getSliderCapSpacing() {
789
- const { dimensions: { slider: { height }, thumb: { radius } } } = this;
790
- return radius * 2 - height;
791
- }
792
- updateDimensions(scale = "m") {
793
- this.dimensions = DIMENSIONS[scale];
794
- }
795
- drawColorField() {
796
- const context = this.fieldAndSliderRenderingContext;
797
- const { dimensions: { colorField: { height, width } } } = this;
798
- context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
799
- context.fillRect(0, 0, width, height);
800
- const whiteGradient = context.createLinearGradient(0, 0, width, 0);
801
- whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
802
- whiteGradient.addColorStop(1, "rgba(255,255,255,0)");
803
- context.fillStyle = whiteGradient;
804
- context.fillRect(0, 0, width, height);
805
- const blackGradient = context.createLinearGradient(0, 0, 0, height);
806
- blackGradient.addColorStop(0, "rgba(0,0,0,0)");
807
- blackGradient.addColorStop(1, "rgba(0,0,0,1)");
808
- context.fillStyle = blackGradient;
809
- context.fillRect(0, 0, width, height);
810
- this.drawActiveColorFieldColor();
811
- }
812
- setCanvasContextSize(canvas, { height, width }) {
813
- const devicePixelRatio = window.devicePixelRatio || 1;
814
- canvas.width = width * devicePixelRatio;
815
- canvas.height = height * devicePixelRatio;
816
- canvas.style.height = `${height}px`;
817
- canvas.style.width = `${width}px`;
818
- const context = canvas.getContext("2d");
819
- context.scale(devicePixelRatio, devicePixelRatio);
820
- }
821
- updateCanvasSize(canvas) {
822
- if (!canvas) {
823
- return;
824
- }
825
- this.setCanvasContextSize(canvas, {
826
- width: this.dimensions.colorField.width,
827
- height: this.dimensions.colorField.height +
828
- this.dimensions.slider.height +
829
- this.getSliderCapSpacing() * 2
830
- });
831
- this.drawColorFieldAndSlider();
832
- }
833
- containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
834
- return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
835
- Math.pow(boundsRadius, 2));
836
- }
837
- drawActiveColorFieldColor() {
838
- const { color } = this;
839
- if (!color) {
840
- return;
841
- }
842
- const hsvColor = color.hsv();
843
- const { dimensions: { colorField: { height, width }, thumb: { radius } } } = this;
844
- const x = hsvColor.saturationv() / (HSV_LIMITS.s / width);
845
- const y = height - hsvColor.value() / (HSV_LIMITS.v / height);
846
- requestAnimationFrame(() => {
847
- this.colorFieldScopeLeft = x;
848
- this.colorFieldScopeTop = y;
849
- });
850
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
851
- }
852
- drawThumb(context, radius, x, y, color, state) {
853
- const startAngle = 0;
854
- const endAngle = 2 * Math.PI;
855
- context.beginPath();
856
- context.arc(x, y, radius, startAngle, endAngle);
857
- context.shadowBlur = state === "hover" ? 32 : 16;
858
- context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
859
- context.fillStyle = "#fff";
860
- context.fill();
861
- context.beginPath();
862
- context.arc(x, y, radius - 3, startAngle, endAngle);
863
- context.shadowBlur = 0;
864
- context.shadowColor = "transparent";
865
- context.fillStyle = color.rgb().string();
866
- context.fill();
867
- }
868
- drawActiveHueSliderColor() {
869
- const { color } = this;
870
- if (!color) {
871
- return;
872
- }
873
- const hsvColor = color.hsv().saturationv(100).value(100);
874
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
875
- const x = hsvColor.hue() / (360 / width);
876
- const y = height / 2 + colorFieldHeight;
877
- requestAnimationFrame(() => {
878
- this.hueScopeLeft = x;
879
- this.hueScopeTop = y;
880
- });
881
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
882
- }
883
- drawHueSlider() {
884
- const context = this.fieldAndSliderRenderingContext;
885
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
886
- const gradient = context.createLinearGradient(0, 0, width, 0);
887
- const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
888
- const offset = 1 / (hueSliderColorStopKeywords.length - 1);
889
- let currentOffset = 0;
890
- hueSliderColorStopKeywords.forEach((keyword) => {
891
- gradient.addColorStop(currentOffset, color(keyword).string());
892
- currentOffset += offset;
893
- });
894
- context.fillStyle = gradient;
895
- context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
896
- context.fillRect(0, colorFieldHeight, width, height);
897
- this.drawActiveHueSliderColor();
898
- }
899
- updateColorFromChannels(channels) {
900
- this.internalColorSet(color(channels, this.channelMode));
901
- }
902
- updateChannelsFromColor(color) {
903
- this.channels = color ? this.toChannels(color) : [null, null, null];
904
- }
905
- toChannels(color) {
906
- const { channelMode } = this;
907
- return color[channelMode]()
908
- .array()
909
- .map((value) => Math.floor(value));
910
- }
911
- get el() { return this; }
912
- static get watchers() { return {
913
- "color": ["handleColorChange"],
914
- "format": ["handleFormatChange"],
915
- "scale": ["handleScaleChange"],
916
- "value": ["handleValueChange"]
917
- }; }
918
- static get style() { return colorPickerCss; }
919
- }, [1, "calcite-color-picker", {
920
- "allowEmpty": [516, "allow-empty"],
921
- "appearance": [513],
922
- "color": [1040],
923
- "disabled": [516],
924
- "format": [513],
925
- "hideHex": [516, "hide-hex"],
926
- "hideChannels": [516, "hide-channels"],
927
- "hideSaved": [516, "hide-saved"],
928
- "intlB": [1, "intl-b"],
929
- "intlBlue": [1, "intl-blue"],
930
- "intlDeleteColor": [1, "intl-delete-color"],
931
- "intlG": [1, "intl-g"],
932
- "intlGreen": [1, "intl-green"],
933
- "intlH": [1, "intl-h"],
934
- "intlHsv": [1, "intl-hsv"],
935
- "intlHex": [1, "intl-hex"],
936
- "intlHue": [1, "intl-hue"],
937
- "intlNoColor": [1, "intl-no-color"],
938
- "intlR": [1, "intl-r"],
939
- "intlRed": [1, "intl-red"],
940
- "intlRgb": [1, "intl-rgb"],
941
- "intlS": [1, "intl-s"],
942
- "intlSaturation": [1, "intl-saturation"],
943
- "intlSaveColor": [1, "intl-save-color"],
944
- "intlSaved": [1, "intl-saved"],
945
- "intlV": [1, "intl-v"],
946
- "intlValue": [1, "intl-value"],
947
- "scale": [513],
948
- "storageId": [513, "storage-id"],
949
- "numberingSystem": [513, "numbering-system"],
950
- "value": [1025],
951
- "colorFieldAndSliderInteractive": [32],
952
- "channelMode": [32],
953
- "channels": [32],
954
- "dimensions": [32],
955
- "savedColors": [32],
956
- "colorFieldScopeTop": [32],
957
- "colorFieldScopeLeft": [32],
958
- "scopeOrientation": [32],
959
- "hueScopeLeft": [32],
960
- "hueScopeTop": [32],
961
- "setFocus": [64]
962
- }, [[2, "keydown", "handleChannelKeyUpOrDown"], [2, "keyup", "handleChannelKeyUpOrDown"]]]);
963
- function defineCustomElement$1() {
964
- if (typeof customElements === "undefined") {
965
- return;
966
- }
967
- const components = ["calcite-color-picker", "calcite-button", "calcite-color-picker-hex-input", "calcite-color-picker-swatch", "calcite-icon", "calcite-input", "calcite-loader", "calcite-progress", "calcite-tab", "calcite-tab-nav", "calcite-tab-title", "calcite-tabs"];
968
- components.forEach(tagName => { switch (tagName) {
969
- case "calcite-color-picker":
970
- if (!customElements.get(tagName)) {
971
- customElements.define(tagName, ColorPicker);
972
- }
973
- break;
974
- case "calcite-button":
975
- if (!customElements.get(tagName)) {
976
- defineCustomElement$c();
977
- }
978
- break;
979
- case "calcite-color-picker-hex-input":
980
- if (!customElements.get(tagName)) {
981
- defineCustomElement$b();
982
- }
983
- break;
984
- case "calcite-color-picker-swatch":
985
- if (!customElements.get(tagName)) {
986
- defineCustomElement$a();
987
- }
988
- break;
989
- case "calcite-icon":
990
- if (!customElements.get(tagName)) {
991
- defineCustomElement$9();
992
- }
993
- break;
994
- case "calcite-input":
995
- if (!customElements.get(tagName)) {
996
- defineCustomElement$8();
997
- }
998
- break;
999
- case "calcite-loader":
1000
- if (!customElements.get(tagName)) {
1001
- defineCustomElement$7();
1002
- }
1003
- break;
1004
- case "calcite-progress":
1005
- if (!customElements.get(tagName)) {
1006
- defineCustomElement$6();
1007
- }
1008
- break;
1009
- case "calcite-tab":
1010
- if (!customElements.get(tagName)) {
1011
- defineCustomElement$5();
1012
- }
1013
- break;
1014
- case "calcite-tab-nav":
1015
- if (!customElements.get(tagName)) {
1016
- defineCustomElement$4();
1017
- }
1018
- break;
1019
- case "calcite-tab-title":
1020
- if (!customElements.get(tagName)) {
1021
- defineCustomElement$3();
1022
- }
1023
- break;
1024
- case "calcite-tabs":
1025
- if (!customElements.get(tagName)) {
1026
- defineCustomElement$2();
1027
- }
1028
- break;
1029
- } });
1030
- }
1031
- defineCustomElement$1();
1032
-
1033
- const CalciteColorPicker = ColorPicker;
1034
- const defineCustomElement = defineCustomElement$1;
1035
-
1036
- export { CalciteColorPicker, defineCustomElement };
1037
-
1038
- //# sourceMappingURL=calcite-color-picker.js.map