@esri/solutions-components 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +26 -8
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-message_5.cjs.entry.js +6 -4
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
- package/dist/cjs/{csvUtils-83af7ae1.js → csvUtils-34666909.js} +1 -1
- package/dist/cjs/{interfaces-772edf61.js → interfaces-17c631bf.js} +1 -1
- package/dist/cjs/layer-table.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-card.cjs.entry.js +1 -1
- package/dist/cjs/{mapViewUtils-55ac76cb.js → mapViewUtils-24d1d859.js} +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +41 -7
- package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
- package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
- package/dist/cjs/{solution-store-39726b81.js → solution-store-2dbab624.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/components/buffer-tools/buffer-tools.js +48 -0
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +10 -4
- package/dist/collection/components/public-notification/public-notification.css +12 -12
- package/dist/collection/components/public-notification/public-notification.js +50 -4
- package/dist/collection/components/refine-selection/refine-selection.js +4 -2
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.css +1 -0
- package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +3 -1
- package/dist/collection/demos/new-public-notification.html +7 -6
- package/dist/collection/utils/interfaces.js +1 -1
- package/dist/collection/utils/interfaces.ts +7 -2
- package/dist/components/buffer-tools2.js +10 -0
- package/dist/components/interfaces3.js +1 -1
- package/dist/components/map-draw-tools2.js +10 -4
- package/dist/components/public-notification.js +40 -6
- package/dist/components/refine-selection-tools2.js +4 -2
- package/dist/components/refine-selection2.js +4 -2
- package/dist/esm/buffer-tools_6.entry.js +26 -8
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-input-message_5.entry.js +6 -4
- package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
- package/dist/esm/{csvUtils-eb231cfb.js → csvUtils-ae3004b9.js} +1 -1
- package/dist/esm/{interfaces-3b23a5f9.js → interfaces-d0d83efa.js} +1 -1
- package/dist/esm/layer-table.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-card.entry.js +1 -1
- package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
- package/dist/esm/public-notification.entry.js +41 -7
- package/dist/esm/solution-configuration.entry.js +2 -2
- package/dist/esm/solution-contents_3.entry.js +2 -2
- package/dist/esm/{solution-store-c0bf9200.js → solution-store-41e15f1c.js} +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +7 -6
- package/dist/solutions-components/p-05e64bd1.js +498 -2
- package/dist/solutions-components/p-08a95b33.entry.js +138 -0
- package/dist/solutions-components/p-0da5bbdf.entry.js +91 -0
- package/dist/solutions-components/p-0ef91144.entry.js +913 -0
- package/dist/solutions-components/p-0f523243.entry.js +1916 -0
- package/dist/solutions-components/p-11b9510e.entry.js +173 -0
- package/dist/solutions-components/p-1b875d94.entry.js +58 -0
- package/dist/solutions-components/p-1c567f3a.js +23 -16
- package/dist/solutions-components/p-1c883db9.entry.js +43 -0
- package/dist/solutions-components/p-1f225056.js +322 -0
- package/dist/solutions-components/p-1f499e67.entry.js +72 -0
- package/dist/solutions-components/p-20d3d758.entry.js +881 -0
- package/dist/solutions-components/p-2274ac9e.entry.js +160 -0
- package/dist/solutions-components/p-23ec5ac5.entry.js +93 -0
- package/dist/solutions-components/p-2447798c.entry.js +155 -0
- package/dist/solutions-components/p-2525e691.entry.js +432 -0
- package/dist/solutions-components/p-2561f5b5.js +4092 -0
- package/dist/solutions-components/p-29f887c0.entry.js +234 -0
- package/dist/solutions-components/p-2a0d8047.entry.js +345 -0
- package/dist/solutions-components/p-2c177e6a.entry.js +101 -0
- package/dist/solutions-components/p-2e9ed892.js +46 -1
- package/dist/solutions-components/p-316f56db.js +219 -2
- package/dist/solutions-components/p-327f3ebf.entry.js +98 -0
- package/dist/solutions-components/p-356f8b54.entry.js +138 -0
- package/dist/solutions-components/p-359c58de.entry.js +172 -0
- package/dist/solutions-components/p-37336c0d.entry.js +116 -0
- package/dist/solutions-components/p-374a5031.js +105 -2
- package/dist/solutions-components/p-39ea6ef4.entry.js +71 -0
- package/dist/solutions-components/p-3b010ce1.js +17 -1
- package/dist/solutions-components/p-4307dacd.js +194 -1
- package/dist/solutions-components/p-44da2507.js +405 -14
- package/dist/solutions-components/p-46bdffe8.entry.js +54 -0
- package/dist/solutions-components/p-4894bbeb.js +53 -2
- package/dist/solutions-components/p-4cd569f1.entry.js +1298 -0
- package/dist/solutions-components/p-4d4160f9.entry.js +121 -0
- package/dist/solutions-components/p-4e32bf8c.js +482 -1
- package/dist/solutions-components/p-4e9cbd32.entry.js +184 -0
- package/dist/solutions-components/p-508317b3.js +13 -2
- package/dist/solutions-components/p-54697d58.entry.js +198 -0
- package/dist/solutions-components/p-55c79103.entry.js +311 -0
- package/dist/solutions-components/p-57fd19c0.entry.js +706 -0
- package/dist/solutions-components/p-59b48fde.entry.js +443 -0
- package/dist/solutions-components/p-60e0e6a0.entry.js +214 -0
- package/dist/solutions-components/p-621d0534.entry.js +123 -0
- package/dist/solutions-components/p-63f6e8f1.js +14 -1
- package/dist/solutions-components/p-66aeec57.entry.js +61 -0
- package/dist/solutions-components/p-69834f46.entry.js +618 -0
- package/dist/solutions-components/p-6d9da8e5.entry.js +21530 -0
- package/dist/solutions-components/p-6e0da576.js +13 -1
- package/dist/solutions-components/p-6ec3f294.entry.js +106 -0
- package/dist/solutions-components/p-6fe17794.js +9 -1
- package/dist/solutions-components/p-7024cb16.entry.js +72 -0
- package/dist/solutions-components/p-70535506.entry.js +226 -0
- package/dist/solutions-components/p-708a63a8.js +12 -1
- package/dist/solutions-components/p-729708a3.js +14 -1
- package/dist/solutions-components/p-73e23995.js +6 -1
- package/dist/solutions-components/p-74b29d75.entry.js +231 -0
- package/dist/solutions-components/p-74b7ee25.entry.js +711 -0
- package/dist/solutions-components/p-77182c3a.js +3015 -1
- package/dist/solutions-components/p-78b3ef80.entry.js +456 -0
- package/dist/solutions-components/p-79709c19.js +60 -3
- package/dist/solutions-components/p-7a46ef97.js +181 -2
- package/dist/solutions-components/p-7be159e6.entry.js +175 -0
- package/dist/solutions-components/p-7d4451c2.entry.js +71 -0
- package/dist/solutions-components/p-7daea1df.js +41 -1
- package/dist/solutions-components/p-7e39e5ad.entry.js +102 -0
- package/dist/solutions-components/p-7fb45059.entry.js +43 -0
- package/dist/solutions-components/p-815533de.js +306 -3
- package/dist/solutions-components/p-816622ca.entry.js +248 -0
- package/dist/solutions-components/p-83166522.js +205 -2
- package/dist/solutions-components/p-83bd1991.entry.js +36 -0
- package/dist/solutions-components/p-856464d7.entry.js +572 -0
- package/dist/solutions-components/p-8c349bad.entry.js +347 -0
- package/dist/solutions-components/p-8dccb390.entry.js +1986 -0
- package/dist/solutions-components/p-904c185a.entry.js +228 -0
- package/dist/solutions-components/p-9092f8b3.entry.js +156 -0
- package/dist/solutions-components/p-9371145a.entry.js +477 -0
- package/dist/solutions-components/p-93d3119d.js +1948 -1
- package/dist/solutions-components/p-95ec8062.entry.js +173 -0
- package/dist/solutions-components/p-991ee695.js +109 -1
- package/dist/solutions-components/p-9a57dab7.entry.js +213 -0
- package/dist/solutions-components/p-9a9955db.js +41 -1
- package/dist/solutions-components/p-9c1ebc90.js +35 -16
- package/dist/solutions-components/p-9eba5c66.js +399 -3
- package/dist/solutions-components/p-a033a507.entry.js +252 -0
- package/dist/solutions-components/p-a3773415.entry.js +1132 -0
- package/dist/solutions-components/p-a44fe40f.entry.js +94 -0
- package/dist/solutions-components/p-a5b1ab03.js +33 -3
- package/dist/solutions-components/p-a5b2c13d.entry.js +723 -0
- package/dist/solutions-components/p-a6d729b7.entry.js +85 -0
- package/dist/solutions-components/p-a8005026.entry.js +565 -0
- package/dist/solutions-components/p-a80b3880.js +14 -1
- package/dist/solutions-components/p-a89198a3.entry.js +2620 -0
- package/dist/solutions-components/p-aa04bd1f.entry.js +95 -0
- package/dist/solutions-components/p-aa0a0922.entry.js +80 -0
- package/dist/solutions-components/p-ae1fd76b.js +11 -1
- package/dist/solutions-components/p-b2cf435e.entry.js +87 -0
- package/dist/solutions-components/p-b359dc78.js +41 -1
- package/dist/solutions-components/p-b57bc4eb.entry.js +71 -0
- package/dist/solutions-components/p-b75cc407.entry.js +145 -0
- package/dist/solutions-components/p-b911cb75.entry.js +71 -0
- package/dist/solutions-components/p-b965e177.entry.js +335 -0
- package/dist/solutions-components/p-b978636e.js +14 -1
- package/dist/solutions-components/p-ba10a5c8.entry.js +42 -0
- package/dist/solutions-components/p-bd67334c.js +122 -2
- package/dist/solutions-components/p-bde20dba.entry.js +212 -0
- package/dist/solutions-components/p-be0b5a94.entry.js +248 -0
- package/dist/solutions-components/p-c023e6a1.js +2028 -2
- package/dist/solutions-components/p-c27b0c2d.entry.js +150 -0
- package/dist/solutions-components/p-c579ed60.entry.js +447 -0
- package/dist/solutions-components/p-c92bc231.js +101 -2
- package/dist/solutions-components/p-cc815aca.js +839 -16
- package/dist/solutions-components/p-cc8beabb.entry.js +695 -0
- package/dist/solutions-components/p-cdc46c0c.js +1751 -2
- package/dist/solutions-components/p-d12e6992.entry.js +118 -0
- package/dist/solutions-components/p-d1dfed6b.entry.js +179 -0
- package/dist/solutions-components/p-d48a24e6.js +754 -2
- package/dist/solutions-components/p-d96ee3ef.entry.js +579 -0
- package/dist/solutions-components/p-dbc9a5a8.js +80 -0
- package/dist/solutions-components/p-dcdbe712.entry.js +278 -0
- package/dist/solutions-components/p-de39206f.entry.js +113 -0
- package/dist/solutions-components/p-de5416e8.js +28 -1
- package/dist/solutions-components/p-df420d54.entry.js +213 -0
- package/dist/solutions-components/p-e3138cf0.entry.js +20 -0
- package/dist/solutions-components/p-e4845fec.entry.js +152 -0
- package/dist/solutions-components/p-e611d8c8.js +28 -1
- package/dist/solutions-components/p-e947d3b0.js +5 -1
- package/dist/solutions-components/p-ea534300.js +41 -2
- package/dist/solutions-components/p-ec84ee85.entry.js +55 -0
- package/dist/solutions-components/p-ed36c637.entry.js +85 -0
- package/dist/solutions-components/p-f0add71c.js +74 -0
- package/dist/solutions-components/p-f42e014b.js +171 -2
- package/dist/solutions-components/p-fc02e7de.entry.js +308 -0
- package/dist/solutions-components/p-fc884dd6.js +28 -16
- package/dist/solutions-components/p-fcbfa59c.entry.js +181 -0
- package/dist/solutions-components/p-fdc5cf5f.entry.js +138 -0
- package/dist/solutions-components/solutions-components.esm.js +20 -1
- package/dist/solutions-components/utils/interfaces.ts +7 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +9 -1
- package/dist/types/components/public-notification/public-notification.d.ts +26 -0
- package/dist/types/components.d.ts +9 -1
- package/dist/types/preact.d.ts +3 -1
- package/dist/types/utils/interfaces.d.ts +4 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-021432b8.entry.js +0 -12
- package/dist/solutions-components/p-03440b1e.entry.js +0 -11
- package/dist/solutions-components/p-0512635b.entry.js +0 -6
- package/dist/solutions-components/p-086ef115.entry.js +0 -29
- package/dist/solutions-components/p-0b4bf57f.entry.js +0 -6
- package/dist/solutions-components/p-0c088725.entry.js +0 -6
- package/dist/solutions-components/p-0f820c08.entry.js +0 -6
- package/dist/solutions-components/p-164780a0.entry.js +0 -6
- package/dist/solutions-components/p-179a68a0.entry.js +0 -6
- package/dist/solutions-components/p-184b5005.entry.js +0 -11
- package/dist/solutions-components/p-1d082fee.entry.js +0 -11
- package/dist/solutions-components/p-1e6c02a2.entry.js +0 -11
- package/dist/solutions-components/p-20a58e62.entry.js +0 -17
- package/dist/solutions-components/p-20b2458c.entry.js +0 -11
- package/dist/solutions-components/p-245d47c1.entry.js +0 -6
- package/dist/solutions-components/p-2cb057a9.entry.js +0 -11
- package/dist/solutions-components/p-2cc72806.entry.js +0 -23
- package/dist/solutions-components/p-2de1db9c.entry.js +0 -11
- package/dist/solutions-components/p-2e9c7055.entry.js +0 -11
- package/dist/solutions-components/p-2ed5e6c8.entry.js +0 -11
- package/dist/solutions-components/p-3109d940.entry.js +0 -6
- package/dist/solutions-components/p-31a8bcfa.entry.js +0 -6
- package/dist/solutions-components/p-3f88ba73.entry.js +0 -6
- package/dist/solutions-components/p-3fa9b3c8.js +0 -36
- package/dist/solutions-components/p-40c41709.entry.js +0 -6
- package/dist/solutions-components/p-40e963c7.entry.js +0 -11
- package/dist/solutions-components/p-40f480da.entry.js +0 -11
- package/dist/solutions-components/p-49d5d2d3.entry.js +0 -11
- package/dist/solutions-components/p-4f7049a4.entry.js +0 -11
- package/dist/solutions-components/p-506e4d78.entry.js +0 -6
- package/dist/solutions-components/p-576fdcab.entry.js +0 -6
- package/dist/solutions-components/p-5bd0cf34.entry.js +0 -23
- package/dist/solutions-components/p-65e177f1.entry.js +0 -6
- package/dist/solutions-components/p-67d710c2.entry.js +0 -6
- package/dist/solutions-components/p-7268b445.entry.js +0 -11
- package/dist/solutions-components/p-75ea4667.entry.js +0 -6
- package/dist/solutions-components/p-778c0a36.entry.js +0 -17
- package/dist/solutions-components/p-7a22509b.entry.js +0 -12
- package/dist/solutions-components/p-7bff51db.entry.js +0 -6
- package/dist/solutions-components/p-7d2d0d5d.entry.js +0 -6
- package/dist/solutions-components/p-7f0036f1.entry.js +0 -11
- package/dist/solutions-components/p-8060fb94.entry.js +0 -6
- package/dist/solutions-components/p-80a1b305.entry.js +0 -6
- package/dist/solutions-components/p-81eae877.entry.js +0 -12
- package/dist/solutions-components/p-84e86b8b.entry.js +0 -6
- package/dist/solutions-components/p-877dd0dc.entry.js +0 -18
- package/dist/solutions-components/p-9106950a.entry.js +0 -11
- package/dist/solutions-components/p-979804a4.entry.js +0 -11
- package/dist/solutions-components/p-9862baa8.entry.js +0 -11
- package/dist/solutions-components/p-9b5a9117.entry.js +0 -12
- package/dist/solutions-components/p-9deff0c2.entry.js +0 -6
- package/dist/solutions-components/p-9f400eeb.entry.js +0 -6
- package/dist/solutions-components/p-a0639ad1.entry.js +0 -11
- package/dist/solutions-components/p-a33c044e.entry.js +0 -6
- package/dist/solutions-components/p-a516c658.entry.js +0 -6
- package/dist/solutions-components/p-aa0ef36d.entry.js +0 -11
- package/dist/solutions-components/p-aaccbdf3.entry.js +0 -18
- package/dist/solutions-components/p-ab03a5c9.entry.js +0 -11
- package/dist/solutions-components/p-ad469b92.entry.js +0 -11
- package/dist/solutions-components/p-adc86ac3.entry.js +0 -6
- package/dist/solutions-components/p-addc1156.entry.js +0 -11
- package/dist/solutions-components/p-ae846934.entry.js +0 -11
- package/dist/solutions-components/p-b0572fc4.entry.js +0 -37
- package/dist/solutions-components/p-b4e476b7.js +0 -257
- package/dist/solutions-components/p-b668daf8.js +0 -21
- package/dist/solutions-components/p-b6e6eae1.entry.js +0 -6
- package/dist/solutions-components/p-bc317a7f.entry.js +0 -6
- package/dist/solutions-components/p-bd4d0773.entry.js +0 -6
- package/dist/solutions-components/p-be41429f.js +0 -21
- package/dist/solutions-components/p-bf6b6353.entry.js +0 -11
- package/dist/solutions-components/p-c2e3dfbb.entry.js +0 -11
- package/dist/solutions-components/p-c4afae53.entry.js +0 -12
- package/dist/solutions-components/p-c9da1c26.entry.js +0 -6
- package/dist/solutions-components/p-cbf8cd49.entry.js +0 -6
- package/dist/solutions-components/p-cc1a064a.entry.js +0 -11
- package/dist/solutions-components/p-d09a168c.entry.js +0 -6
- package/dist/solutions-components/p-d377f913.entry.js +0 -11
- package/dist/solutions-components/p-d4cefead.entry.js +0 -37
- package/dist/solutions-components/p-d7bc0baf.entry.js +0 -16
- package/dist/solutions-components/p-d8968487.entry.js +0 -11
- package/dist/solutions-components/p-e00a0b86.entry.js +0 -11
- package/dist/solutions-components/p-e9a7ed49.entry.js +0 -11
- package/dist/solutions-components/p-ec27e493.entry.js +0 -11
- package/dist/solutions-components/p-ed6404eb.entry.js +0 -6
- package/dist/solutions-components/p-ef21e195.entry.js +0 -23
- package/dist/solutions-components/p-f6068a2d.entry.js +0 -11
- package/dist/solutions-components/p-f6c4cff3.entry.js +0 -11
- package/dist/solutions-components/p-f847291f.entry.js +0 -6
- package/dist/solutions-components/p-f90fd262.entry.js +0 -11
- package/dist/solutions-components/p-fc973005.entry.js +0 -6
- 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
|
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
|
-
|
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
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
|
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 };
|