@esri/solutions-components 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_6.cjs.entry.js +8 -5
- 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/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 +16 -10
- 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/collection/components/buffer-tools/buffer-tools.js +2 -2
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
- package/dist/collection/components/public-notification/public-notification.js +14 -8
- 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 +2 -1
- package/dist/collection/utils/interfaces.js +1 -1
- package/dist/collection/utils/interfaces.ts +2 -2
- package/dist/components/interfaces3.js +1 -1
- package/dist/components/map-draw-tools2.js +2 -1
- package/dist/components/public-notification.js +14 -8
- 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 +8 -5
- 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/map-card.entry.js +1 -1
- package/dist/esm/{mapViewUtils-e5d8a1e1.js → mapViewUtils-541e7a3c.js} +1 -1
- package/dist/esm/public-notification.entry.js +16 -10
- 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/solutions-components/demos/new-public-notification.html +2 -1
- 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 +2 -2
- package/dist/types/components/buffer-tools/buffer-tools.d.ts +2 -2
- package/dist/types/components/public-notification/public-notification.d.ts +9 -1
- package/dist/types/components.d.ts +2 -2
- 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-3649acb3.entry.js +0 -18
- 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-851e04ae.entry.js +0 -6
- 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-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,212 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './p-c023e6a1.js';
|
7
|
+
import { g as getElementProp, a as getSlotted, b as getElementDir, t as toAriaBoolean } from './p-83166522.js';
|
8
|
+
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './p-ea534300.js';
|
9
|
+
import { C as CSS_UTILITY } from './p-729708a3.js';
|
10
|
+
import './p-a80b3880.js';
|
11
|
+
import './p-9a9955db.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 SLOTS = {
|
19
|
+
actionsStart: "actions-start",
|
20
|
+
actionsEnd: "actions-end"
|
21
|
+
};
|
22
|
+
const CSS = {
|
23
|
+
icon: "icon",
|
24
|
+
header: "header",
|
25
|
+
headerContent: "header-content",
|
26
|
+
actionsStart: "actions-start",
|
27
|
+
actionsEnd: "actions-end",
|
28
|
+
headerText: "header-text",
|
29
|
+
heading: "heading",
|
30
|
+
description: "description",
|
31
|
+
expandIcon: "expand-icon",
|
32
|
+
content: "content",
|
33
|
+
iconStart: "icon--start",
|
34
|
+
iconEnd: "icon--end",
|
35
|
+
headerContainer: "header-container"
|
36
|
+
};
|
37
|
+
|
38
|
+
const accordionItemCss = "@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}.icon-position--end,.icon-position--start{--calcite-accordion-item-icon-rotation:calc(90deg * -1);--calcite-accordion-item-active-icon-rotation:0deg;--calcite-accordion-item-icon-rotation-rtl:90deg;--calcite-accordion-item-active-icon-rotation-rtl:0deg}.icon-position--start{--calcite-accordion-item-flex-direction:row-reverse;--calcite-accordion-item-icon-spacing-start:0;--calcite-accordion-item-icon-spacing-end:var(--calcite-accordion-icon-margin)}.icon-position--end{--calcite-accordion-item-flex-direction:row;--calcite-accordion-item-icon-spacing-start:var(--calcite-accordion-icon-margin);--calcite-accordion-item-icon-spacing-end:0}.icon-position--end:not(.icon-type--plus-minus){--calcite-accordion-item-icon-rotation:0deg;--calcite-accordion-item-active-icon-rotation:180deg;--calcite-accordion-item-icon-rotation-rtl:0deg;--calcite-accordion-item-active-icon-rotation-rtl:calc(180deg * -1)}:host{position:relative;display:flex;flex-direction:column;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;background-color:var(--calcite-accordion-item-background, var(--calcite-ui-foreground-1))}:host .header-content{outline-color:transparent}:host(:focus) .header-content{outline:2px solid transparent;outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([expanded]){color:var(--calcite-ui-text-1)}:host([expanded]) .content{display:block;color:var(--calcite-ui-text-1)}:host([expanded]) .header{border-block-end-color:transparent}:host .header{display:flex;align-items:stretch}:host .icon{position:relative;margin:0px;display:inline-flex;color:var(--calcite-ui-text-3);transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-margin-end:var(--calcite-accordion-item-icon-spacing-start);margin-inline-end:var(--calcite-accordion-item-icon-spacing-start);-webkit-margin-start:var(--calcite-accordion-item-icon-spacing-end);margin-inline-start:var(--calcite-accordion-item-icon-spacing-end)}.icon--start{display:flex;align-items:center;-webkit-margin-end:var(--calcite-accordion-icon-margin);margin-inline-end:var(--calcite-accordion-icon-margin)}.icon--end{display:flex;align-items:center;-webkit-margin-end:var(--calcite-accordion-icon-margin);margin-inline-end:var(--calcite-accordion-icon-margin);-webkit-margin-start:var(--calcite-accordion-icon-margin);margin-inline-start:var(--calcite-accordion-icon-margin)}.header-container{inline-size:100%}.content{padding:var(--calcite-accordion-item-padding)}:host .content,:host .header{-webkit-border-after:1px solid var(--calcite-accordion-item-border, var(--calcite-ui-border-2));border-block-end:1px solid var(--calcite-accordion-item-border, var(--calcite-ui-border-2))}:host .header *{display:inline-flex;align-items:center;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host .content{display:none;-webkit-padding-before:0px;padding-block-start:0px;color:var(--calcite-ui-text-3);text-align:initial}:host .expand-icon{color:var(--calcite-ui-text-3);-webkit-margin-start:var(--calcite-accordion-item-icon-spacing-start);margin-inline-start:var(--calcite-accordion-item-icon-spacing-start);-webkit-margin-end:var(--calcite-accordion-item-icon-spacing-end);margin-inline-end:var(--calcite-accordion-item-icon-spacing-end);transform:rotate(var(--calcite-accordion-item-icon-rotation))}.calcite--rtl .expand-icon{transform:rotate(var(--calcite-accordion-item-icon-rotation-rtl))}:host([expanded]) .expand-icon{color:var(--calcite-ui-text-1);transform:rotate(var(--calcite-accordion-item-active-icon-rotation))}:host([expanded]) .calcite--rtl .expand-icon{transform:rotate(var(--calcite-accordion-item-active-icon-rotation-rtl))}:host .header-text{margin-block:0px;flex-grow:1;flex-direction:column;padding-block:0px;text-align:initial;-webkit-margin-end:auto;margin-inline-end:auto}:host .heading,:host .description{display:flex;inline-size:100%}:host .heading{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}:host .description{-webkit-margin-before:0.25rem;margin-block-start:0.25rem;color:var(--calcite-ui-text-3)}:host(:focus) .heading,:host(:hover) .heading{color:var(--calcite-ui-text-1)}:host(:focus) .icon,:host(:hover) .icon{color:var(--calcite-ui-text-1)}:host(:focus) .expand-icon,:host(:hover) .expand-icon{color:var(--calcite-ui-text-1)}:host(:focus) .description,:host(:hover) .description{color:var(--calcite-ui-text-2)}:host(:focus) .heading,:host(:active) .heading,:host([expanded]) .heading{color:var(--calcite-ui-text-1)}:host(:focus) .icon,:host(:active) .icon,:host([expanded]) .icon{color:var(--calcite-ui-text-1)}:host(:focus) .expand-icon,:host(:active) .expand-icon,:host([expanded]) .expand-icon{color:var(--calcite-ui-text-1)}:host(:focus) .description,:host(:active) .description,:host([expanded]) .description{color:var(--calcite-ui-text-2)}.header-content{flex-grow:1;cursor:pointer;padding:var(--calcite-accordion-item-padding);flex-direction:var(--calcite-accordion-item-flex-direction)}.actions-start,.actions-end{display:flex;align-items:center}@media (forced-colors: active){:host([expanded]) .header{-webkit-border-after:none;border-block-end:none}:host([expanded]) .heading{font-weight:bolder}:host(:hover) .heading,:host(:focus) .heading{text-decoration:underline}}";
|
39
|
+
|
40
|
+
const AccordionItem = class {
|
41
|
+
constructor(hostRef) {
|
42
|
+
registerInstance(this, hostRef);
|
43
|
+
this.calciteInternalAccordionItemKeyEvent = createEvent(this, "calciteInternalAccordionItemKeyEvent", 6);
|
44
|
+
this.calciteInternalAccordionItemSelect = createEvent(this, "calciteInternalAccordionItemSelect", 6);
|
45
|
+
this.calciteInternalAccordionItemClose = createEvent(this, "calciteInternalAccordionItemClose", 6);
|
46
|
+
this.calciteInternalAccordionItemRegister = createEvent(this, "calciteInternalAccordionItemRegister", 6);
|
47
|
+
//--------------------------------------------------------------------------
|
48
|
+
//
|
49
|
+
// Public Properties
|
50
|
+
//
|
51
|
+
//--------------------------------------------------------------------------
|
52
|
+
/**
|
53
|
+
* When `true`, the component is active.
|
54
|
+
*
|
55
|
+
* @deprecated use `expanded` instead.
|
56
|
+
*/
|
57
|
+
this.active = false;
|
58
|
+
/** When `true`, the component is expanded. */
|
59
|
+
this.expanded = false;
|
60
|
+
/** what icon position does the parent accordion specify */
|
61
|
+
this.iconPosition = "end";
|
62
|
+
/** handle clicks on item header */
|
63
|
+
this.itemHeaderClickHandler = () => this.emitRequestedItem();
|
64
|
+
}
|
65
|
+
activeHandler(value) {
|
66
|
+
this.expanded = value;
|
67
|
+
}
|
68
|
+
expandedHandler(value) {
|
69
|
+
this.active = value;
|
70
|
+
}
|
71
|
+
iconHandler(value) {
|
72
|
+
this.iconStart = value;
|
73
|
+
}
|
74
|
+
iconStartHandler(value) {
|
75
|
+
this.icon = value;
|
76
|
+
}
|
77
|
+
//--------------------------------------------------------------------------
|
78
|
+
//
|
79
|
+
// Lifecycle
|
80
|
+
//
|
81
|
+
//--------------------------------------------------------------------------
|
82
|
+
connectedCallback() {
|
83
|
+
this.parent = this.el.parentElement;
|
84
|
+
this.selectionMode = getElementProp(this.el, "selection-mode", "multi");
|
85
|
+
this.iconType = getElementProp(this.el, "icon-type", "chevron");
|
86
|
+
this.iconPosition = getElementProp(this.el, "icon-position", this.iconPosition);
|
87
|
+
const isExpanded = this.active || this.expanded;
|
88
|
+
if (isExpanded) {
|
89
|
+
this.activeHandler(isExpanded);
|
90
|
+
this.expandedHandler(isExpanded);
|
91
|
+
}
|
92
|
+
if (this.iconStart) {
|
93
|
+
this.icon = this.iconStart;
|
94
|
+
}
|
95
|
+
else if (this.icon) {
|
96
|
+
this.iconStart = this.icon;
|
97
|
+
}
|
98
|
+
connectConditionalSlotComponent(this);
|
99
|
+
}
|
100
|
+
componentDidLoad() {
|
101
|
+
this.itemPosition = this.getItemPosition();
|
102
|
+
this.calciteInternalAccordionItemRegister.emit({
|
103
|
+
parent: this.parent,
|
104
|
+
position: this.itemPosition
|
105
|
+
});
|
106
|
+
}
|
107
|
+
disconnectedCallback() {
|
108
|
+
disconnectConditionalSlotComponent(this);
|
109
|
+
}
|
110
|
+
// --------------------------------------------------------------------------
|
111
|
+
//
|
112
|
+
// Render Methods
|
113
|
+
//
|
114
|
+
// --------------------------------------------------------------------------
|
115
|
+
renderActionsStart() {
|
116
|
+
const { el } = this;
|
117
|
+
return getSlotted(el, SLOTS.actionsStart) ? (h("div", { class: CSS.actionsStart }, h("slot", { name: SLOTS.actionsStart }))) : null;
|
118
|
+
}
|
119
|
+
renderActionsEnd() {
|
120
|
+
const { el } = this;
|
121
|
+
return getSlotted(el, SLOTS.actionsEnd) ? (h("div", { class: CSS.actionsEnd }, h("slot", { name: SLOTS.actionsEnd }))) : null;
|
122
|
+
}
|
123
|
+
render() {
|
124
|
+
const dir = getElementDir(this.el);
|
125
|
+
const iconStartEl = this.iconStart ? (h("calcite-icon", { class: CSS.iconStart, icon: this.iconStart, key: "icon-start", scale: "s" })) : null;
|
126
|
+
const iconEndEl = this.iconEnd ? (h("calcite-icon", { class: CSS.iconEnd, icon: this.iconEnd, key: "icon-end", scale: "s" })) : null;
|
127
|
+
const description = this.description || this.itemSubtitle;
|
128
|
+
return (h(Host, null, h("div", { class: {
|
129
|
+
[`icon-position--${this.iconPosition}`]: true,
|
130
|
+
[`icon-type--${this.iconType}`]: true
|
131
|
+
} }, h("div", { class: { [CSS.header]: true, [CSS_UTILITY.rtl]: dir === "rtl" } }, this.renderActionsStart(), h("div", { "aria-expanded": toAriaBoolean(this.active || this.expanded), class: CSS.headerContent, onClick: this.itemHeaderClickHandler, role: "button", tabindex: "0" }, h("div", { class: CSS.headerContainer }, iconStartEl, h("div", { class: CSS.headerText }, h("span", { class: CSS.heading }, this.heading || this.itemTitle), description ? h("span", { class: CSS.description }, description) : null), iconEndEl), h("calcite-icon", { class: CSS.expandIcon, icon: this.iconType === "chevron"
|
132
|
+
? "chevronDown"
|
133
|
+
: this.iconType === "caret"
|
134
|
+
? "caretDown"
|
135
|
+
: this.expanded || this.active
|
136
|
+
? "minus"
|
137
|
+
: "plus", scale: "s" })), this.renderActionsEnd()), h("div", { class: CSS.content }, h("slot", null)))));
|
138
|
+
}
|
139
|
+
//--------------------------------------------------------------------------
|
140
|
+
//
|
141
|
+
// Event Listeners
|
142
|
+
//
|
143
|
+
//--------------------------------------------------------------------------
|
144
|
+
keyDownHandler(event) {
|
145
|
+
if (event.target === this.el) {
|
146
|
+
switch (event.key) {
|
147
|
+
case " ":
|
148
|
+
case "Enter":
|
149
|
+
this.emitRequestedItem();
|
150
|
+
event.preventDefault();
|
151
|
+
break;
|
152
|
+
case "ArrowUp":
|
153
|
+
case "ArrowDown":
|
154
|
+
case "Home":
|
155
|
+
case "End":
|
156
|
+
this.calciteInternalAccordionItemKeyEvent.emit({
|
157
|
+
parent: this.parent,
|
158
|
+
item: event
|
159
|
+
});
|
160
|
+
event.preventDefault();
|
161
|
+
break;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
updateActiveItemOnChange(event) {
|
166
|
+
this.requestedAccordionItem = event.detail
|
167
|
+
.requestedAccordionItem;
|
168
|
+
if (this.el.parentNode !== this.requestedAccordionItem.parentNode) {
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
this.determineActiveItem();
|
172
|
+
event.stopPropagation();
|
173
|
+
}
|
174
|
+
//--------------------------------------------------------------------------
|
175
|
+
//
|
176
|
+
// Private Methods
|
177
|
+
//
|
178
|
+
//--------------------------------------------------------------------------
|
179
|
+
determineActiveItem() {
|
180
|
+
switch (this.selectionMode) {
|
181
|
+
case "multi":
|
182
|
+
if (this.el === this.requestedAccordionItem) {
|
183
|
+
this.expanded = !this.expanded;
|
184
|
+
}
|
185
|
+
break;
|
186
|
+
case "single":
|
187
|
+
this.expanded = this.el === this.requestedAccordionItem ? !this.expanded : false;
|
188
|
+
break;
|
189
|
+
case "single-persist":
|
190
|
+
this.expanded = this.el === this.requestedAccordionItem;
|
191
|
+
break;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
emitRequestedItem() {
|
195
|
+
this.calciteInternalAccordionItemSelect.emit({
|
196
|
+
requestedAccordionItem: this.el
|
197
|
+
});
|
198
|
+
}
|
199
|
+
getItemPosition() {
|
200
|
+
return Array.prototype.indexOf.call(this.parent.querySelectorAll("calcite-accordion-item"), this.el);
|
201
|
+
}
|
202
|
+
get el() { return getElement(this); }
|
203
|
+
static get watchers() { return {
|
204
|
+
"active": ["activeHandler"],
|
205
|
+
"expanded": ["expandedHandler"],
|
206
|
+
"icon": ["iconHandler"],
|
207
|
+
"iconStart": ["iconStartHandler"]
|
208
|
+
}; }
|
209
|
+
};
|
210
|
+
AccordionItem.style = accordionItemCss;
|
211
|
+
|
212
|
+
export { AccordionItem as calcite_accordion_item };
|
@@ -0,0 +1,248 @@
|
|
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 { g as getElementProp, a as getSlotted } from './p-83166522.js';
|
8
|
+
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from './p-bd67334c.js';
|
9
|
+
import { c as createObserver } from './p-9a9955db.js';
|
10
|
+
import { u as updateHostInteraction } from './p-7daea1df.js';
|
11
|
+
import './p-729708a3.js';
|
12
|
+
import './p-a80b3880.js';
|
13
|
+
|
14
|
+
/*!
|
15
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
16
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
17
|
+
* v1.0.0-beta.97
|
18
|
+
*/
|
19
|
+
const CSS = {
|
20
|
+
wrapper: "wrapper",
|
21
|
+
confirmChangesButton: "confirm-changes-button",
|
22
|
+
cancelEditingButton: "cancel-editing-button",
|
23
|
+
inputWrapper: "input-wrapper",
|
24
|
+
cancelEditingButtonWrapper: "cancel-editing-button-wrapper",
|
25
|
+
enableEditingButton: "enable-editing-button",
|
26
|
+
controlsWrapper: "controls-wrapper"
|
27
|
+
};
|
28
|
+
const TEXT = {
|
29
|
+
intlEnablingEditing: "Click to edit",
|
30
|
+
intlCancelEditing: "Cancel",
|
31
|
+
intlConfirmChanges: "Save"
|
32
|
+
};
|
33
|
+
|
34
|
+
const inlineEditableCss = "@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:block}:host([scale=s]) .controls-wrapper{block-size:1.5rem}:host([scale=m]) .controls-wrapper{block-size:2rem}:host([scale=l]) .controls-wrapper{block-size:2.75rem}:host(:not([editing-enabled]):not([disabled])) .wrapper:hover{background-color:var(--calcite-ui-foreground-2)}.wrapper{box-sizing:border-box;display:flex;justify-content:space-between;background-color:var(--calcite-ui-foreground-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.wrapper .input-wrapper{flex:1 1 0%}.controls-wrapper{display:flex}:host([disabled]) .cancel-editing-button-wrapper{border-color:var(--calcite-ui-border-2)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}";
|
35
|
+
|
36
|
+
const InlineEditable = class {
|
37
|
+
constructor(hostRef) {
|
38
|
+
registerInstance(this, hostRef);
|
39
|
+
this.calciteInlineEditableEditCancel = createEvent(this, "calciteInlineEditableEditCancel", 6);
|
40
|
+
this.calciteInlineEditableEditConfirm = createEvent(this, "calciteInlineEditableEditConfirm", 6);
|
41
|
+
this.calciteInternalInlineEditableEnableEditingChange = createEvent(this, "calciteInternalInlineEditableEnableEditingChange", 6);
|
42
|
+
//--------------------------------------------------------------------------
|
43
|
+
//
|
44
|
+
// Props
|
45
|
+
//
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
/** specify whether editing can be enabled */
|
48
|
+
this.disabled = false;
|
49
|
+
/** specify whether the wrapped input element is editable, defaults to false */
|
50
|
+
this.editingEnabled = false;
|
51
|
+
/** specify whether the confirm button should display a loading state, defaults to false */
|
52
|
+
this.loading = false;
|
53
|
+
/** specify whether save/cancel controls should be displayed when editingEnabled is true, defaults to false */
|
54
|
+
this.controls = false;
|
55
|
+
/**
|
56
|
+
* specify text to be user for the enable editing button's aria-label, defaults to `Click to edit`
|
57
|
+
*
|
58
|
+
* @default "Click to edit"
|
59
|
+
*/
|
60
|
+
this.intlEnableEditing = TEXT.intlEnablingEditing;
|
61
|
+
/**
|
62
|
+
* specify text to be user for the cancel editing button's aria-label, defaults to `Cancel`
|
63
|
+
*
|
64
|
+
* @default "Cancel"
|
65
|
+
*/
|
66
|
+
this.intlCancelEditing = TEXT.intlCancelEditing;
|
67
|
+
/**
|
68
|
+
* specify text to be user for the confirm changes button's aria-label, defaults to `Save`
|
69
|
+
*
|
70
|
+
* @default "Save"
|
71
|
+
*/
|
72
|
+
this.intlConfirmChanges = TEXT.intlConfirmChanges;
|
73
|
+
this.mutationObserver = createObserver("mutation", () => this.mutationObserverCallback());
|
74
|
+
this.enableEditing = () => {
|
75
|
+
var _a, _b;
|
76
|
+
this.valuePriorToEditing = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value;
|
77
|
+
this.editingEnabled = true;
|
78
|
+
(_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.setFocus();
|
79
|
+
this.calciteInternalInlineEditableEnableEditingChange.emit();
|
80
|
+
};
|
81
|
+
this.disableEditing = () => {
|
82
|
+
this.editingEnabled = false;
|
83
|
+
};
|
84
|
+
this.cancelEditing = () => {
|
85
|
+
if (this.inputElement) {
|
86
|
+
this.inputElement.value = this.valuePriorToEditing;
|
87
|
+
}
|
88
|
+
this.disableEditing();
|
89
|
+
this.enableEditingButton.setFocus();
|
90
|
+
if (!this.editingEnabled && !!this.shouldEmitCancel) {
|
91
|
+
this.calciteInlineEditableEditCancel.emit();
|
92
|
+
}
|
93
|
+
};
|
94
|
+
this.escapeKeyHandler = async (event) => {
|
95
|
+
var _a;
|
96
|
+
if (event.defaultPrevented) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
if (event.key === "Escape") {
|
100
|
+
event.preventDefault();
|
101
|
+
this.cancelEditing();
|
102
|
+
}
|
103
|
+
if (event.key === "Tab" && this.shouldShowControls) {
|
104
|
+
if (!event.shiftKey && event.target === this.inputElement) {
|
105
|
+
event.preventDefault();
|
106
|
+
this.cancelEditingButton.setFocus();
|
107
|
+
}
|
108
|
+
if (!!event.shiftKey && event.target === this.cancelEditingButton) {
|
109
|
+
event.preventDefault();
|
110
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.setFocus();
|
111
|
+
}
|
112
|
+
}
|
113
|
+
};
|
114
|
+
this.cancelEditingHandler = async (event) => {
|
115
|
+
event.preventDefault();
|
116
|
+
this.cancelEditing();
|
117
|
+
};
|
118
|
+
this.enableEditingHandler = async (event) => {
|
119
|
+
if (this.disabled ||
|
120
|
+
event.target === this.cancelEditingButton ||
|
121
|
+
event.target === this.confirmEditingButton) {
|
122
|
+
return;
|
123
|
+
}
|
124
|
+
event.preventDefault();
|
125
|
+
if (!this.editingEnabled) {
|
126
|
+
this.enableEditing();
|
127
|
+
}
|
128
|
+
};
|
129
|
+
this.confirmChangesHandler = async (event) => {
|
130
|
+
event.preventDefault();
|
131
|
+
this.calciteInlineEditableEditConfirm.emit();
|
132
|
+
try {
|
133
|
+
if (this.afterConfirm) {
|
134
|
+
this.loading = true;
|
135
|
+
await this.afterConfirm();
|
136
|
+
this.disableEditing();
|
137
|
+
this.enableEditingButton.setFocus();
|
138
|
+
}
|
139
|
+
}
|
140
|
+
catch (error) {
|
141
|
+
}
|
142
|
+
finally {
|
143
|
+
this.loading = false;
|
144
|
+
}
|
145
|
+
};
|
146
|
+
}
|
147
|
+
disabledWatcher(disabled) {
|
148
|
+
if (this.inputElement) {
|
149
|
+
this.inputElement.disabled = disabled;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
editingEnabledWatcher(newValue, oldValue) {
|
153
|
+
if (this.inputElement) {
|
154
|
+
this.inputElement.editingEnabled = newValue;
|
155
|
+
}
|
156
|
+
if (!newValue && !!oldValue) {
|
157
|
+
this.shouldEmitCancel = true;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
//--------------------------------------------------------------------------
|
161
|
+
//
|
162
|
+
// Lifecycle
|
163
|
+
//
|
164
|
+
//--------------------------------------------------------------------------
|
165
|
+
connectedCallback() {
|
166
|
+
var _a;
|
167
|
+
connectLabel(this);
|
168
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true });
|
169
|
+
this.mutationObserverCallback();
|
170
|
+
}
|
171
|
+
disconnectedCallback() {
|
172
|
+
var _a;
|
173
|
+
disconnectLabel(this);
|
174
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
175
|
+
}
|
176
|
+
componentDidRender() {
|
177
|
+
updateHostInteraction(this);
|
178
|
+
}
|
179
|
+
render() {
|
180
|
+
return (h("div", { class: CSS.wrapper, onClick: this.enableEditingHandler, onKeyDown: this.escapeKeyHandler }, h("div", { class: CSS.inputWrapper }, h("slot", null)), h("div", { class: CSS.controlsWrapper }, h("calcite-button", { appearance: "transparent", class: CSS.enableEditingButton, color: "neutral", disabled: this.disabled, iconStart: "pencil", label: this.intlEnableEditing, onClick: this.enableEditingHandler, ref: (el) => (this.enableEditingButton = el), scale: this.scale, style: {
|
181
|
+
opacity: this.editingEnabled ? "0" : "1",
|
182
|
+
width: this.editingEnabled ? "0" : "inherit"
|
183
|
+
}, type: "button" }), this.shouldShowControls && [
|
184
|
+
h("div", { class: CSS.cancelEditingButtonWrapper }, h("calcite-button", { appearance: "transparent", class: CSS.cancelEditingButton, color: "neutral", disabled: this.disabled, iconStart: "x", label: this.intlCancelEditing, onClick: this.cancelEditingHandler, ref: (el) => (this.cancelEditingButton = el), scale: this.scale, type: "button" })),
|
185
|
+
h("calcite-button", { appearance: "solid", class: CSS.confirmChangesButton, color: "blue", disabled: this.disabled, iconStart: "check", label: this.intlConfirmChanges, loading: this.loading, onClick: this.confirmChangesHandler, ref: (el) => (this.confirmEditingButton = el), scale: this.scale, type: "button" })
|
186
|
+
])));
|
187
|
+
}
|
188
|
+
//--------------------------------------------------------------------------
|
189
|
+
//
|
190
|
+
// Event Listeners
|
191
|
+
//
|
192
|
+
//--------------------------------------------------------------------------
|
193
|
+
blurHandler() {
|
194
|
+
if (!this.controls) {
|
195
|
+
this.disableEditing();
|
196
|
+
}
|
197
|
+
}
|
198
|
+
//--------------------------------------------------------------------------
|
199
|
+
//
|
200
|
+
// Public Methods
|
201
|
+
//
|
202
|
+
//--------------------------------------------------------------------------
|
203
|
+
async setFocus() {
|
204
|
+
var _a, _b;
|
205
|
+
if (this.editingEnabled) {
|
206
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.setFocus();
|
207
|
+
}
|
208
|
+
else {
|
209
|
+
(_b = this.enableEditingButton) === null || _b === void 0 ? void 0 : _b.setFocus();
|
210
|
+
}
|
211
|
+
}
|
212
|
+
//--------------------------------------------------------------------------
|
213
|
+
//
|
214
|
+
// Private Methods
|
215
|
+
//
|
216
|
+
//--------------------------------------------------------------------------
|
217
|
+
mutationObserverCallback() {
|
218
|
+
var _a;
|
219
|
+
this.updateSlottedInput();
|
220
|
+
this.scale =
|
221
|
+
this.scale || ((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.scale) || getElementProp(this.el, "scale", undefined);
|
222
|
+
}
|
223
|
+
onLabelClick() {
|
224
|
+
this.setFocus();
|
225
|
+
}
|
226
|
+
updateSlottedInput() {
|
227
|
+
const inputElement = getSlotted(this.el, {
|
228
|
+
matches: "calcite-input"
|
229
|
+
});
|
230
|
+
this.inputElement = inputElement;
|
231
|
+
if (!inputElement) {
|
232
|
+
return;
|
233
|
+
}
|
234
|
+
this.inputElement.disabled = this.disabled;
|
235
|
+
this.inputElement.label = this.inputElement.label || getLabelText(this);
|
236
|
+
}
|
237
|
+
get shouldShowControls() {
|
238
|
+
return this.editingEnabled && this.controls;
|
239
|
+
}
|
240
|
+
get el() { return getElement(this); }
|
241
|
+
static get watchers() { return {
|
242
|
+
"disabled": ["disabledWatcher"],
|
243
|
+
"editingEnabled": ["editingEnabledWatcher"]
|
244
|
+
}; }
|
245
|
+
};
|
246
|
+
InlineEditable.style = inlineEditableCss;
|
247
|
+
|
248
|
+
export { InlineEditable as calcite_inline_editable };
|