@esri/solutions-components 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/{pciUtils-6a806ba4.js → pciUtils-423cfc68.js} +25 -7
- package/dist/collection/demos/deduct-calculator.html +2 -5
- package/dist/collection/demos/new-public-notification.html +6 -4
- package/dist/collection/utils/pciUtils.js +25 -7
- package/dist/collection/utils/pciUtils.ts +30 -7
- package/dist/components/ExpandToggle.js +110 -0
- package/dist/components/Heading.js +22 -0
- package/dist/components/_commonjsHelpers.js +22 -0
- package/dist/components/action-bar.js +276 -0
- package/dist/components/action-group.js +149 -0
- package/dist/components/action-menu.js +356 -0
- package/dist/components/action.js +214 -0
- package/dist/components/add-record-modal.d.ts +11 -0
- package/dist/components/add-record-modal.js +171 -0
- package/dist/components/array.js +15 -0
- package/dist/components/block.js +272 -0
- package/dist/components/buffer-tools.d.ts +11 -0
- package/dist/components/buffer-tools.js +11 -0
- package/dist/components/buffer-tools2.js +262 -0
- package/dist/components/button.js +263 -0
- package/dist/components/calcite-accordion-item.js +244 -0
- package/dist/components/calcite-accordion.js +180 -0
- package/dist/components/calcite-action-bar.js +11 -0
- package/dist/components/calcite-action-group.js +11 -0
- package/dist/components/calcite-action-menu.js +11 -0
- package/dist/components/calcite-action-pad.js +197 -0
- package/dist/components/calcite-action.js +11 -0
- package/dist/components/calcite-alert.js +297 -0
- package/dist/components/calcite-avatar.js +182 -0
- package/dist/components/calcite-block-section.js +155 -0
- package/dist/components/calcite-block.js +11 -0
- package/dist/components/calcite-button.js +11 -0
- package/dist/components/calcite-card.js +187 -0
- package/dist/components/calcite-checkbox.js +11 -0
- package/dist/components/calcite-chip.js +11 -0
- package/dist/components/calcite-color-picker-hex-input.js +11 -0
- package/dist/components/calcite-color-picker-swatch.js +11 -0
- package/dist/components/calcite-color-picker.js +1036 -0
- package/dist/components/calcite-combobox-item-group.js +75 -0
- package/dist/components/calcite-combobox-item.js +11 -0
- package/dist/components/calcite-combobox.js +11 -0
- package/dist/components/calcite-date-picker-day.js +11 -0
- package/dist/components/calcite-date-picker-month-header.js +11 -0
- package/dist/components/calcite-date-picker-month.js +11 -0
- package/dist/components/calcite-date-picker.js +11 -0
- package/dist/components/calcite-dropdown-group.js +11 -0
- package/dist/components/calcite-dropdown-item.js +11 -0
- package/dist/components/calcite-dropdown.js +11 -0
- package/dist/components/calcite-fab.js +144 -0
- package/dist/components/calcite-filter.js +195 -0
- package/dist/components/calcite-flow-item.js +243 -0
- package/dist/components/calcite-flow.js +147 -0
- package/dist/components/calcite-graph.js +11 -0
- package/dist/components/calcite-handle.js +11 -0
- package/dist/components/calcite-icon.js +11 -0
- package/dist/components/calcite-inline-editable.js +294 -0
- package/dist/components/calcite-input-date-picker.js +713 -0
- package/dist/components/calcite-input-message.js +11 -0
- package/dist/components/calcite-input-number.js +637 -0
- package/dist/components/calcite-input-text.js +400 -0
- package/dist/components/calcite-input-time-picker.js +434 -0
- package/dist/components/calcite-input.js +11 -0
- package/dist/components/calcite-label.js +11 -0
- package/dist/components/calcite-link.js +11 -0
- package/dist/components/calcite-list-item-group.js +65 -0
- package/dist/components/calcite-list-item.js +11 -0
- package/dist/components/calcite-list.js +11 -0
- package/dist/components/calcite-loader.js +11 -0
- package/dist/components/calcite-modal.js +11 -0
- package/dist/components/calcite-notice.js +11 -0
- package/dist/components/calcite-option-group.js +64 -0
- package/dist/components/calcite-option.js +11 -0
- package/dist/components/calcite-pagination.js +258 -0
- package/dist/components/calcite-panel.js +11 -0
- package/dist/components/calcite-pick-list-group.js +74 -0
- package/dist/components/calcite-pick-list-item.js +11 -0
- package/dist/components/calcite-pick-list.js +11 -0
- package/dist/components/calcite-popover-manager.js +94 -0
- package/dist/components/calcite-popover.js +11 -0
- package/dist/components/calcite-progress.js +11 -0
- package/dist/components/calcite-radio-button-group.js +132 -0
- package/dist/components/calcite-radio-button.js +310 -0
- package/dist/components/calcite-radio-group-item.js +11 -0
- package/dist/components/calcite-radio-group.js +11 -0
- package/dist/components/calcite-rating.js +201 -0
- package/dist/components/calcite-scrim.js +11 -0
- package/dist/components/calcite-select.js +11 -0
- package/dist/components/calcite-shell-center-row.js +100 -0
- package/dist/components/calcite-shell-panel.js +11 -0
- package/dist/components/calcite-shell.js +11 -0
- package/dist/components/calcite-slider.js +11 -0
- package/dist/components/calcite-sortable-list.js +202 -0
- package/dist/components/calcite-split-button.js +11 -0
- package/dist/components/calcite-stepper-item.js +271 -0
- package/dist/components/calcite-stepper.js +256 -0
- package/dist/components/calcite-switch.js +11 -0
- package/dist/components/calcite-tab-nav.js +11 -0
- package/dist/components/calcite-tab-title.js +11 -0
- package/dist/components/calcite-tab.js +11 -0
- package/dist/components/calcite-tabs.js +11 -0
- package/dist/components/calcite-tile-select-group.js +65 -0
- package/dist/components/calcite-tile-select.js +266 -0
- package/dist/components/calcite-tile.js +11 -0
- package/dist/components/calcite-time-picker.js +11 -0
- package/dist/components/calcite-tip-group.js +41 -0
- package/dist/components/calcite-tip-manager.js +223 -0
- package/dist/components/calcite-tip.js +162 -0
- package/dist/components/calcite-tooltip-manager.js +57 -0
- package/dist/components/calcite-tooltip.js +11 -0
- package/dist/components/calcite-tree-item.js +11 -0
- package/dist/components/calcite-tree.js +11 -0
- package/dist/components/calcite-value-list-item.js +11 -0
- package/dist/components/calcite-value-list.js +11 -0
- package/dist/components/card-manager.d.ts +11 -0
- package/dist/components/card-manager.js +143 -0
- package/dist/components/check-list.d.ts +11 -0
- package/dist/components/check-list.js +11 -0
- package/dist/components/check-list2.js +131 -0
- package/dist/components/checkbox.js +165 -0
- package/dist/components/chip.js +170 -0
- package/dist/components/color-picker-hex-input.js +363 -0
- package/dist/components/color-picker-swatch.js +2034 -0
- package/dist/components/combobox-item.js +182 -0
- package/dist/components/combobox.js +912 -0
- package/dist/components/comment-card.d.ts +11 -0
- package/dist/components/comment-card.js +90 -0
- package/dist/components/conditionalSlot.js +50 -0
- package/dist/components/config-buffer-tools.d.ts +11 -0
- package/dist/components/config-buffer-tools.js +187 -0
- package/dist/components/config-draw-tools.d.ts +11 -0
- package/dist/components/config-draw-tools.js +121 -0
- package/dist/components/config-layer-picker.d.ts +11 -0
- package/dist/components/config-layer-picker.js +163 -0
- package/dist/components/config-pdf-download.d.ts +11 -0
- package/dist/components/config-pdf-download.js +154 -0
- package/dist/components/crowdsource-manager.d.ts +11 -0
- package/dist/components/crowdsource-manager.js +90 -0
- package/dist/components/crowdsource-reporter.d.ts +11 -0
- package/dist/components/crowdsource-reporter.js +90 -0
- package/dist/components/csvUtils.js +74 -0
- package/dist/components/date-picker-day.js +111 -0
- package/dist/components/date-picker-month-header.js +224 -0
- package/dist/components/date-picker-month.js +344 -0
- package/dist/components/date-picker.js +575 -0
- package/dist/components/date.js +180 -0
- package/dist/components/debounce.js +487 -0
- package/dist/components/deduct-calculator.d.ts +11 -0
- package/dist/components/deduct-calculator.js +11 -0
- package/dist/components/deduct-calculator2.js +1002 -0
- package/dist/components/dom.js +231 -0
- package/dist/components/dropdown-group.js +96 -0
- package/dist/components/dropdown-item.js +232 -0
- package/dist/components/dropdown.js +505 -0
- package/dist/components/edit-record-modal.d.ts +11 -0
- package/dist/components/edit-record-modal.js +11 -0
- package/dist/components/edit-record-modal2.js +161 -0
- package/dist/components/filter.js +763 -0
- package/dist/components/floating-ui.js +1768 -0
- package/dist/components/form.js +228 -0
- package/dist/components/graph.js +254 -0
- package/dist/components/guid.js +24 -0
- package/dist/components/handle.js +119 -0
- package/dist/components/icon.js +202 -0
- package/dist/components/index.d.ts +61 -0
- package/dist/components/index.js +196 -0
- package/dist/components/index2.js +199 -0
- package/dist/components/info-card.d.ts +11 -0
- package/dist/components/info-card.js +11 -0
- package/dist/components/info-card2.js +97 -0
- package/dist/components/input-message.js +101 -0
- package/dist/components/input.js +740 -0
- package/dist/components/interactive.js +51 -0
- package/dist/components/interfaces.js +19 -0
- package/dist/components/interfaces2.js +21 -0
- package/dist/components/interfaces3.js +80 -0
- package/dist/components/json-editor.d.ts +11 -0
- package/dist/components/json-editor.js +11 -0
- package/dist/components/json-editor2.js +441 -0
- package/dist/components/key.js +16 -0
- package/dist/components/label.js +106 -0
- package/dist/components/label2.js +131 -0
- package/dist/components/labelFormats.js +210 -0
- package/dist/components/layer-table.d.ts +11 -0
- package/dist/components/layer-table.js +453 -0
- package/dist/components/link.js +123 -0
- package/dist/components/list-item.d.ts +11 -0
- package/dist/components/list-item.js +90 -0
- package/dist/components/list-item2.js +149 -0
- package/dist/components/list.js +83 -0
- package/dist/components/loadModules.js +28 -0
- package/dist/components/loader.js +116 -0
- package/dist/components/locale.js +412 -0
- package/dist/components/locale2.js +413 -0
- package/dist/components/map-card.d.ts +11 -0
- package/dist/components/map-card.js +354 -0
- package/dist/components/map-draw-tools.d.ts +11 -0
- package/dist/components/map-draw-tools.js +11 -0
- package/dist/components/map-draw-tools2.js +228 -0
- package/dist/components/map-layer-picker.d.ts +11 -0
- package/dist/components/map-layer-picker.js +11 -0
- package/dist/components/map-layer-picker2.js +188 -0
- package/dist/components/map-search.d.ts +11 -0
- package/dist/components/map-search.js +155 -0
- package/dist/components/map-select-tools.d.ts +11 -0
- package/dist/components/map-select-tools.js +11 -0
- package/dist/components/map-select-tools2.js +588 -0
- package/dist/components/mapViewUtils.js +129 -0
- package/dist/components/math.js +24 -0
- package/dist/components/media-card.d.ts +11 -0
- package/dist/components/media-card.js +11 -0
- package/dist/components/media-card2.js +177 -0
- package/dist/components/modal.js +495 -0
- package/dist/components/nonChromiumPlatformUtils.js +503 -0
- package/dist/components/notice.js +192 -0
- package/dist/components/observers.js +56 -0
- package/dist/components/openCloseComponent.js +56 -0
- package/dist/components/option.js +109 -0
- package/dist/components/panel.js +459 -0
- package/dist/components/pci-calculator.d.ts +11 -0
- package/dist/components/pci-calculator.js +193 -0
- package/dist/components/pdf-download.d.ts +11 -0
- package/dist/components/pdf-download.js +11 -0
- package/dist/components/pdf-download2.js +189 -0
- package/dist/components/pick-list-item.js +255 -0
- package/dist/components/pick-list.js +170 -0
- package/dist/components/popover.js +500 -0
- package/dist/components/progress.js +60 -0
- package/dist/components/public-notification.d.ts +11 -0
- package/dist/components/public-notification.js +825 -0
- package/dist/components/publicNotificationStore.js +38 -0
- package/dist/components/queryUtils.js +187 -0
- package/dist/components/radio-group-item.js +101 -0
- package/dist/components/radio-group.js +235 -0
- package/dist/components/refine-selection-tools.d.ts +11 -0
- package/dist/components/refine-selection-tools.js +11 -0
- package/dist/components/refine-selection-tools2.js +492 -0
- package/dist/components/refine-selection.d.ts +11 -0
- package/dist/components/refine-selection.js +11 -0
- package/dist/components/refine-selection2.js +376 -0
- package/dist/components/resources.js +24 -0
- package/dist/components/resources2.js +21 -0
- package/dist/components/resources3.js +38 -0
- package/dist/components/scrim.js +83 -0
- package/dist/components/select.js +259 -0
- package/dist/components/shared-list-render.js +319 -0
- package/dist/components/shell-panel.js +281 -0
- package/dist/components/shell.js +121 -0
- package/dist/components/slider.js +896 -0
- package/dist/components/solution-configuration.d.ts +11 -0
- package/dist/components/solution-configuration.js +2233 -0
- package/dist/components/solution-contents.d.ts +11 -0
- package/dist/components/solution-contents.js +11 -0
- package/dist/components/solution-contents2.js +128 -0
- package/dist/components/solution-item-details.d.ts +11 -0
- package/dist/components/solution-item-details.js +11 -0
- package/dist/components/solution-item-details2.js +234 -0
- package/dist/components/solution-item-icon.d.ts +11 -0
- package/dist/components/solution-item-icon.js +11 -0
- package/dist/components/solution-item-icon2.js +342 -0
- package/dist/components/solution-item-sharing.d.ts +11 -0
- package/dist/components/solution-item-sharing.js +11 -0
- package/dist/components/solution-item-sharing2.js +167 -0
- package/dist/components/solution-item.d.ts +11 -0
- package/dist/components/solution-item.js +11 -0
- package/dist/components/solution-item2.js +315 -0
- package/dist/components/solution-organization-variables.d.ts +11 -0
- package/dist/components/solution-organization-variables.js +11 -0
- package/dist/components/solution-organization-variables2.js +132 -0
- package/dist/components/solution-resource-item.d.ts +11 -0
- package/dist/components/solution-resource-item.js +11 -0
- package/dist/components/solution-resource-item2.js +356 -0
- package/dist/components/solution-spatial-ref.d.ts +11 -0
- package/dist/components/solution-spatial-ref.js +11 -0
- package/dist/components/solution-spatial-ref2.js +21446 -0
- package/dist/components/solution-store.js +4092 -0
- package/dist/components/solution-template-data.d.ts +11 -0
- package/dist/components/solution-template-data.js +11 -0
- package/dist/components/solution-template-data2.js +233 -0
- package/dist/components/solution-variables.d.ts +11 -0
- package/dist/components/solution-variables.js +11 -0
- package/dist/components/solution-variables2.js +150 -0
- package/dist/components/sortable.esm.js +3026 -0
- package/dist/components/split-button.js +165 -0
- package/dist/components/store-manager.d.ts +11 -0
- package/dist/components/store-manager.js +83 -0
- package/dist/components/switch.js +139 -0
- package/dist/components/tab-nav.js +241 -0
- package/dist/components/tab-title.js +276 -0
- package/dist/components/tab.js +154 -0
- package/dist/components/tabs.js +188 -0
- package/dist/components/tile.js +129 -0
- package/dist/components/time-picker.js +943 -0
- package/dist/components/tooltip.js +399 -0
- package/dist/components/tree-item.js +294 -0
- package/dist/components/tree.js +327 -0
- package/dist/components/utils.js +119 -0
- package/dist/components/utils2.js +51 -0
- package/dist/components/value-list-item.js +204 -0
- package/dist/components/value-list.js +333 -0
- package/dist/esm/deduct-calculator.entry.js +1 -1
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/{pciUtils-e3007a1c.js → pciUtils-ecda46e5.js} +25 -7
- package/dist/solutions-components/demos/deduct-calculator.html +2 -5
- package/dist/solutions-components/demos/new-public-notification.html +6 -4
- package/dist/solutions-components/{p-ff80ffbb.entry.js → p-0512635b.entry.js} +1 -1
- package/dist/solutions-components/{p-5ec407c2.entry.js → p-0c088725.entry.js} +1 -1
- package/dist/solutions-components/p-cc815aca.js +21 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/pciUtils.ts +30 -7
- package/dist/types/utils/pciUtils.d.ts +2 -1
- package/package.json +4 -3
- package/dist/solutions-components/p-647bbd18.js +0 -21
@@ -0,0 +1,11 @@
|
|
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 { S as ShellPanel, d as defineCustomElement$1 } from './shell-panel.js';
|
7
|
+
|
8
|
+
const CalciteShellPanel = ShellPanel;
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
10
|
+
|
11
|
+
export { CalciteShellPanel, defineCustomElement };
|
@@ -0,0 +1,11 @@
|
|
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 { S as Shell, d as defineCustomElement$1 } from './shell.js';
|
7
|
+
|
8
|
+
const CalciteShell = Shell;
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
10
|
+
|
11
|
+
export { CalciteShell, defineCustomElement };
|
@@ -0,0 +1,11 @@
|
|
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 { S as Slider, d as defineCustomElement$1 } from './slider.js';
|
7
|
+
|
8
|
+
const CalciteSlider = Slider;
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
10
|
+
|
11
|
+
export { CalciteSlider, defineCustomElement };
|
@@ -0,0 +1,202 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
7
|
+
import { S as Sortable } from './sortable.esm.js';
|
8
|
+
import { c as createObserver } from './observers.js';
|
9
|
+
import { u as updateHostInteraction } from './interactive.js';
|
10
|
+
|
11
|
+
/*!
|
12
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
13
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
14
|
+
* v1.0.0-beta.97
|
15
|
+
*/
|
16
|
+
const CSS = {
|
17
|
+
sortItem: "sort-item",
|
18
|
+
container: "container",
|
19
|
+
containerHorizontal: "container--horizontal",
|
20
|
+
containerVertical: "container--vertical"
|
21
|
+
};
|
22
|
+
|
23
|
+
const sortableListCss = "@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:flex}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;flex:1 1 auto}.container--vertical{flex-direction:column}.container--horizontal{flex-direction:row}";
|
24
|
+
|
25
|
+
const SortableList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
26
|
+
constructor() {
|
27
|
+
super();
|
28
|
+
this.__registerHost();
|
29
|
+
this.__attachShadow();
|
30
|
+
this.calciteListOrderChange = createEvent(this, "calciteListOrderChange", 6);
|
31
|
+
/**
|
32
|
+
* The selector for the handle elements.
|
33
|
+
*/
|
34
|
+
this.handleSelector = "calcite-handle";
|
35
|
+
/**
|
36
|
+
* Indicates the horizontal or vertical orientation of the component.
|
37
|
+
*/
|
38
|
+
this.layout = "vertical";
|
39
|
+
/**
|
40
|
+
* When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
|
41
|
+
*/
|
42
|
+
this.disabled = false;
|
43
|
+
/**
|
44
|
+
* When true, content is waiting to be loaded. This state shows a busy indicator.
|
45
|
+
*/
|
46
|
+
this.loading = false;
|
47
|
+
this.handleActivated = false;
|
48
|
+
this.items = [];
|
49
|
+
this.mutationObserver = createObserver("mutation", () => {
|
50
|
+
this.cleanUpDragAndDrop();
|
51
|
+
this.items = Array.from(this.el.children);
|
52
|
+
this.setUpDragAndDrop();
|
53
|
+
});
|
54
|
+
}
|
55
|
+
// --------------------------------------------------------------------------
|
56
|
+
//
|
57
|
+
// Lifecycle
|
58
|
+
//
|
59
|
+
// --------------------------------------------------------------------------
|
60
|
+
connectedCallback() {
|
61
|
+
this.items = Array.from(this.el.children);
|
62
|
+
this.setUpDragAndDrop();
|
63
|
+
this.beginObserving();
|
64
|
+
}
|
65
|
+
disconnectedCallback() {
|
66
|
+
var _a;
|
67
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
68
|
+
this.cleanUpDragAndDrop();
|
69
|
+
}
|
70
|
+
componentDidRender() {
|
71
|
+
updateHostInteraction(this);
|
72
|
+
}
|
73
|
+
calciteHandleNudgeHandler(event) {
|
74
|
+
var _a;
|
75
|
+
const sortItem = this.items.find((item) => {
|
76
|
+
return item.contains(event.detail.handle) || event.composedPath().includes(item);
|
77
|
+
});
|
78
|
+
const lastIndex = this.items.length - 1;
|
79
|
+
const startingIndex = this.items.indexOf(sortItem);
|
80
|
+
let appendInstead = false;
|
81
|
+
let buddyIndex;
|
82
|
+
switch (event.detail.direction) {
|
83
|
+
case "up":
|
84
|
+
event.preventDefault();
|
85
|
+
if (startingIndex === 0) {
|
86
|
+
appendInstead = true;
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
buddyIndex = startingIndex - 1;
|
90
|
+
}
|
91
|
+
break;
|
92
|
+
case "down":
|
93
|
+
event.preventDefault();
|
94
|
+
if (startingIndex === lastIndex) {
|
95
|
+
buddyIndex = 0;
|
96
|
+
}
|
97
|
+
else if (startingIndex === lastIndex - 1) {
|
98
|
+
appendInstead = true;
|
99
|
+
}
|
100
|
+
else {
|
101
|
+
buddyIndex = startingIndex + 2;
|
102
|
+
}
|
103
|
+
break;
|
104
|
+
default:
|
105
|
+
return;
|
106
|
+
}
|
107
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
108
|
+
if (appendInstead) {
|
109
|
+
sortItem.parentElement.appendChild(sortItem);
|
110
|
+
}
|
111
|
+
else {
|
112
|
+
sortItem.parentElement.insertBefore(sortItem, this.items[buddyIndex]);
|
113
|
+
}
|
114
|
+
this.items = Array.from(this.el.children);
|
115
|
+
event.detail.handle.activated = true;
|
116
|
+
event.detail.handle.setFocus();
|
117
|
+
this.beginObserving();
|
118
|
+
}
|
119
|
+
// --------------------------------------------------------------------------
|
120
|
+
//
|
121
|
+
// Private Methods
|
122
|
+
//
|
123
|
+
// --------------------------------------------------------------------------
|
124
|
+
setUpDragAndDrop() {
|
125
|
+
this.cleanUpDragAndDrop();
|
126
|
+
const options = {
|
127
|
+
dataIdAttr: "id",
|
128
|
+
group: this.group,
|
129
|
+
handle: this.handleSelector,
|
130
|
+
// Changed sorting within list
|
131
|
+
onUpdate: () => {
|
132
|
+
this.items = Array.from(this.el.children);
|
133
|
+
this.calciteListOrderChange.emit();
|
134
|
+
},
|
135
|
+
// Element dragging started
|
136
|
+
onStart: () => {
|
137
|
+
var _a;
|
138
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
139
|
+
},
|
140
|
+
// Element dragging ended
|
141
|
+
onEnd: () => {
|
142
|
+
this.beginObserving();
|
143
|
+
}
|
144
|
+
};
|
145
|
+
if (this.dragSelector) {
|
146
|
+
options.draggable = this.dragSelector;
|
147
|
+
}
|
148
|
+
this.sortable = Sortable.create(this.el, options);
|
149
|
+
}
|
150
|
+
cleanUpDragAndDrop() {
|
151
|
+
var _a;
|
152
|
+
(_a = this.sortable) === null || _a === void 0 ? void 0 : _a.destroy();
|
153
|
+
this.sortable = null;
|
154
|
+
}
|
155
|
+
beginObserving() {
|
156
|
+
var _a;
|
157
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
|
158
|
+
}
|
159
|
+
// --------------------------------------------------------------------------
|
160
|
+
//
|
161
|
+
// Render Methods
|
162
|
+
//
|
163
|
+
// --------------------------------------------------------------------------
|
164
|
+
render() {
|
165
|
+
const { layout } = this;
|
166
|
+
const horizontal = layout === "horizontal" || false;
|
167
|
+
return (h("div", { class: {
|
168
|
+
[CSS.container]: true,
|
169
|
+
[CSS.containerVertical]: !horizontal,
|
170
|
+
[CSS.containerHorizontal]: horizontal
|
171
|
+
} }, h("slot", null)));
|
172
|
+
}
|
173
|
+
get el() { return this; }
|
174
|
+
static get style() { return sortableListCss; }
|
175
|
+
}, [1, "calcite-sortable-list", {
|
176
|
+
"dragSelector": [513, "drag-selector"],
|
177
|
+
"group": [513],
|
178
|
+
"handleSelector": [513, "handle-selector"],
|
179
|
+
"layout": [513],
|
180
|
+
"disabled": [516],
|
181
|
+
"loading": [516],
|
182
|
+
"handleActivated": [32]
|
183
|
+
}, [[0, "calciteHandleNudge", "calciteHandleNudgeHandler"]]]);
|
184
|
+
function defineCustomElement$1() {
|
185
|
+
if (typeof customElements === "undefined") {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
const components = ["calcite-sortable-list"];
|
189
|
+
components.forEach(tagName => { switch (tagName) {
|
190
|
+
case "calcite-sortable-list":
|
191
|
+
if (!customElements.get(tagName)) {
|
192
|
+
customElements.define(tagName, SortableList);
|
193
|
+
}
|
194
|
+
break;
|
195
|
+
} });
|
196
|
+
}
|
197
|
+
defineCustomElement$1();
|
198
|
+
|
199
|
+
const CalciteSortableList = SortableList;
|
200
|
+
const defineCustomElement = defineCustomElement$1;
|
201
|
+
|
202
|
+
export { CalciteSortableList, defineCustomElement };
|
@@ -0,0 +1,11 @@
|
|
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 { S as SplitButton, d as defineCustomElement$1 } from './split-button.js';
|
7
|
+
|
8
|
+
const CalciteSplitButton = SplitButton;
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
10
|
+
|
11
|
+
export { CalciteSplitButton, defineCustomElement };
|
@@ -0,0 +1,271 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
7
|
+
import { g as getElementProp, t as toAriaBoolean } from './dom.js';
|
8
|
+
import { u as updateHostInteraction } from './interactive.js';
|
9
|
+
import { n as numberStringFormatter, c as connectLocalized, d as disconnectLocalized } from './locale2.js';
|
10
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
11
|
+
|
12
|
+
const stepperItemCss = "@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([layout=horizontal][disabled]) .stepper-item-header,: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([scale=s]){--calcite-stepper-item-spacing-unit-s:0.25rem;--calcite-stepper-item-spacing-unit-m:0.75rem;--calcite-stepper-item-spacing-unit-l:1rem;font-size:var(--calcite-font-size--1);line-height:1rem;-webkit-margin-end:0.25rem;margin-inline-end:0.25rem}:host([scale=s]) .stepper-item-description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-stepper-item-spacing-unit-s:0.5rem;--calcite-stepper-item-spacing-unit-m:1rem;--calcite-stepper-item-spacing-unit-l:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([scale=m]) .stepper-item-description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-stepper-item-spacing-unit-s:0.75rem;--calcite-stepper-item-spacing-unit-m:1.25rem;--calcite-stepper-item-spacing-unit-l:1.5rem;font-size:var(--calcite-font-size-1);line-height:1.5rem;-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([scale=l]) .stepper-item-description{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host{position:relative;display:flex;flex-grow:1;flex-direction:column;align-self:flex-start;-webkit-margin-after:var(--calcite-stepper-item-spacing-unit-s);margin-block-end:var(--calcite-stepper-item-spacing-unit-s)}:host .container{position:relative;display:flex;flex-grow:1;cursor:pointer;flex-direction:column;border-width:0px;border-block-start-width:2px;border-style:solid;border-color:var(--calcite-ui-border-3);color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;outline:2px solid transparent;outline-offset:2px;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host{outline-color:transparent}:host(:focus){outline:2px solid var(--calcite-ui-brand);outline-offset:2px}:host .stepper-item-header{display:flex;cursor:pointer;align-items:flex-start}:host .stepper-item-content,:host .stepper-item-header{transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);padding-block:var(--calcite-stepper-item-spacing-unit-l);-webkit-padding-end:var(--calcite-stepper-item-spacing-unit-m);padding-inline-end:var(--calcite-stepper-item-spacing-unit-m);text-align:start}:host .stepper-item-header *{display:inline-flex;align-items:center;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host .stepper-item-content{display:none;inline-size:100%;flex-direction:column;font-size:var(--calcite-font-size--2);line-height:1.375}:host .stepper-item-icon{-webkit-margin-end:var(--calcite-stepper-item-spacing-unit-m);margin-inline-end:var(--calcite-stepper-item-spacing-unit-m);-webkit-margin-before:1px;margin-block-start:1px;display:inline-flex;block-size:0.75rem;flex-shrink:0;align-self:flex-start;color:var(--calcite-ui-text-3);opacity:var(--calcite-ui-opacity-disabled);transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host .stepper-item-header-text{flex-direction:column;text-align:initial;-webkit-margin-end:auto;margin-inline-end:auto}:host .stepper-item-heading,:host .stepper-item-description{display:flex;inline-size:100%}:host .stepper-item-heading{-webkit-margin-after:0.25rem;margin-block-end:0.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}:host .stepper-item-description{color:var(--calcite-ui-text-3)}:host .stepper-item-number{font-weight:var(--calcite-font-weight-medium);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-stepper-item-spacing-unit-m);margin-inline-end:var(--calcite-stepper-item-spacing-unit-m)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([complete]) .container{border-color:rgba(0, 122, 194, 0.5)}:host([complete]) .container .stepper-item-icon{color:var(--calcite-ui-brand)}:host([error]) .container{border-block-start-color:var(--calcite-ui-danger)}:host([error]) .container .stepper-item-number{color:var(--calcite-ui-danger)}:host([error]) .container .stepper-item-icon{opacity:1;color:var(--calcite-ui-danger)}:host(:hover:not([disabled]):not([selected])) .container,:host(:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-ui-brand)}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-heading,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-heading{color:var(--calcite-ui-text-1)}:host(:hover:not([disabled]):not([selected])) .container .stepper-item-description,:host(:focus:not([disabled]):not([selected])) .container .stepper-item-description{color:var(--calcite-ui-text-2)}:host([error]:hover:not([disabled]):not([selected])) .container,:host([error]:focus:not([disabled]):not([selected])) .container{border-block-start-color:var(--calcite-ui-danger-hover)}:host([selected]) .container{border-block-start-color:var(--calcite-ui-brand)}:host([selected]) .container .stepper-item-heading{color:var(--calcite-ui-text-1)}:host([selected]) .container .stepper-item-description{color:var(--calcite-ui-text-2)}:host([selected]) .container .stepper-item-number{color:var(--calcite-ui-brand)}:host([selected]) .container .stepper-item-icon{color:var(--calcite-ui-brand);opacity:1}:host([selected]) .container .stepper-item-content{display:flex}:host([layout=vertical]) .container{margin-inline:0px;-webkit-margin-before:0px;margin-block-start:0px;flex:1 1 auto;border-block-start-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);padding-block:0px;border-inline-start-width:2px;-webkit-padding-start:var(--calcite-stepper-item-spacing-unit-l);padding-inline-start:var(--calcite-stepper-item-spacing-unit-l)}:host([layout=vertical]) .container .stepper-item-icon{order:3;margin-block:1px 0px;-webkit-padding-start:var(--calcite-stepper-item-spacing-unit-s);padding-inline-start:var(--calcite-stepper-item-spacing-unit-s);-webkit-margin-start:auto;margin-inline-start:auto}:host([layout=vertical]) .container .stepper-item-header{-webkit-padding-end:0px;padding-inline-end:0px}:host([layout=vertical]) .container .stepper-item-content{padding:0px}:host([layout=vertical][complete]) .container{border-color:rgba(0, 122, 194, 0.5)}:host([layout=vertical][complete]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][complete]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-ui-brand)}:host([layout=vertical][error]) .container{border-color:var(--calcite-ui-danger)}:host([layout=vertical][selected]) .container{border-color:var(--calcite-ui-brand)}:host([layout=vertical][selected]) .container .stepper-item-content ::slotted(:last-child){-webkit-margin-after:var(--calcite-stepper-item-spacing-unit-l);margin-block-end:var(--calcite-stepper-item-spacing-unit-l)}:host([layout=vertical]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical]:focus:not([disabled]):not([selected])) .container{border-color:rgba(0, 122, 194, 0.5)}:host([layout=vertical][error]:hover:not([disabled]):not([selected])) .container,:host([layout=vertical][error]:focus:not([disabled]):not([selected])) .container{border-color:var(--calcite-ui-danger-hover)}:host([layout=horizontal]){display:contents}:host([layout=horizontal]) .container{display:contents}:host([layout=horizontal]) .stepper-item-header{border-width:0px;border-block-start-width:2px;border-style:solid;border-color:var(--calcite-ui-border-3);outline-color:transparent;grid-row:items;-webkit-margin-end:0.5rem;margin-inline-end:0.5rem;-webkit-margin-after:var(--calcite-stepper-item-spacing-unit-s);margin-block-end:var(--calcite-stepper-item-spacing-unit-s)}:host([layout=horizontal]) .stepper-item-header:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}:host([layout=horizontal]) .stepper-item-content{cursor:auto;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);padding-block:0;-webkit-padding-end:var(--calcite-stepper-item-spacing-unit-m);padding-inline-end:var(--calcite-stepper-item-spacing-unit-m);text-align:start}:host([layout=horizontal][selected]) .stepper-item-content{grid-area:2/1/2/-1}:host([layout=horizontal][scale=s]) .stepper-item-header{-webkit-margin-end:0.25rem;margin-inline-end:0.25rem;-webkit-margin-after:var(--calcite-stepper-item-spacing-unit-s);margin-block-end:var(--calcite-stepper-item-spacing-unit-s)}:host([layout=horizontal][scale=l]) .stepper-item-header{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem;-webkit-margin-after:var(--calcite-stepper-item-spacing-unit-s);margin-block-end:var(--calcite-stepper-item-spacing-unit-s)}:host([layout=horizontal][complete]) .stepper-item-header{border-color:rgba(0, 122, 194, 0.5)}:host([layout=horizontal][complete]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][complete]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-ui-brand)}:host([layout=horizontal][error]) .stepper-item-header{border-color:var(--calcite-ui-danger)}:host([layout=horizontal][selected]) .stepper-item-header{border-color:var(--calcite-ui-brand)}:host([layout=horizontal]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:rgba(0, 122, 194, 0.5)}:host([layout=horizontal][error]:hover:not([disabled]):not([selected])) .stepper-item-header,:host([layout=horizontal][error]:focus:not([disabled]):not([selected])) .stepper-item-header{border-color:var(--calcite-ui-danger-hover)}@media (forced-colors: active){:host .container{outline-width:0;outline-offset:0}:host(:focus),:host(:focus-visible){outline-color:canvasText}:host([selected]) .container{border-block-start-color:highlight}:host([selected]) .container .stepper-item-number{color:highlight}:host([selected]) .container .stepper-item-icon{color:highlight}:host([layout=vertical][selected]) .container{border-color:highlight}}";
|
13
|
+
|
14
|
+
const StepperItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
15
|
+
constructor() {
|
16
|
+
super();
|
17
|
+
this.__registerHost();
|
18
|
+
this.__attachShadow();
|
19
|
+
this.calciteInternalStepperItemKeyEvent = createEvent(this, "calciteInternalStepperItemKeyEvent", 6);
|
20
|
+
this.calciteInternalStepperItemSelect = createEvent(this, "calciteInternalStepperItemSelect", 6);
|
21
|
+
this.calciteInternalUserRequestedStepperItemSelect = createEvent(this, "calciteInternalUserRequestedStepperItemSelect", 6);
|
22
|
+
this.calciteInternalStepperItemRegister = createEvent(this, "calciteInternalStepperItemRegister", 6);
|
23
|
+
//--------------------------------------------------------------------------
|
24
|
+
//
|
25
|
+
// Public Properties
|
26
|
+
//
|
27
|
+
//--------------------------------------------------------------------------
|
28
|
+
/**
|
29
|
+
* When `true`, the component is selected.
|
30
|
+
*
|
31
|
+
* @deprecated Use `selected` instead.
|
32
|
+
*/
|
33
|
+
this.active = false;
|
34
|
+
/**
|
35
|
+
* When `true`, the component is selected.
|
36
|
+
*/
|
37
|
+
this.selected = false;
|
38
|
+
/** When `true`, the step has been completed. */
|
39
|
+
this.complete = false;
|
40
|
+
/** When `true`, the component contains an error that requires resolution from the user. */
|
41
|
+
this.error = false;
|
42
|
+
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
|
43
|
+
this.disabled = false;
|
44
|
+
// internal props inherited from wrapping calcite-stepper
|
45
|
+
/** Defines the layout of the component. */
|
46
|
+
/** @internal */
|
47
|
+
this.layout = "horizontal";
|
48
|
+
/** When `true`, displays a status icon in the component's heading. */
|
49
|
+
/** @internal */
|
50
|
+
this.icon = false;
|
51
|
+
/** When `true`, displays the step number in the component's heading. */
|
52
|
+
/** @internal */
|
53
|
+
this.numbered = false;
|
54
|
+
/** Specifies the size of the component. */
|
55
|
+
/** @internal */
|
56
|
+
this.scale = "m";
|
57
|
+
//--------------------------------------------------------------------------
|
58
|
+
//
|
59
|
+
// Internal State/Props
|
60
|
+
//
|
61
|
+
//--------------------------------------------------------------------------
|
62
|
+
this.effectiveLocale = "";
|
63
|
+
//--------------------------------------------------------------------------
|
64
|
+
//
|
65
|
+
// Private Methods
|
66
|
+
//
|
67
|
+
//--------------------------------------------------------------------------
|
68
|
+
this.keyDownHandler = (event) => {
|
69
|
+
if (!this.disabled && event.target === this.el) {
|
70
|
+
switch (event.key) {
|
71
|
+
case " ":
|
72
|
+
case "Enter":
|
73
|
+
this.emitUserRequestedItem();
|
74
|
+
event.preventDefault();
|
75
|
+
break;
|
76
|
+
case "ArrowUp":
|
77
|
+
case "ArrowDown":
|
78
|
+
case "ArrowLeft":
|
79
|
+
case "ArrowRight":
|
80
|
+
case "Home":
|
81
|
+
case "End":
|
82
|
+
this.calciteInternalStepperItemKeyEvent.emit({ item: event });
|
83
|
+
event.preventDefault();
|
84
|
+
break;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
};
|
88
|
+
this.handleItemClick = (event) => {
|
89
|
+
if (this.layout === "horizontal" &&
|
90
|
+
event
|
91
|
+
.composedPath()
|
92
|
+
.some((el) => { var _a; return (_a = el.classList) === null || _a === void 0 ? void 0 : _a.contains("stepper-item-content"); })) {
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
this.emitUserRequestedItem();
|
96
|
+
};
|
97
|
+
this.emitUserRequestedItem = () => {
|
98
|
+
this.emitRequestedItem();
|
99
|
+
if (!this.disabled) {
|
100
|
+
const position = this.itemPosition;
|
101
|
+
this.calciteInternalUserRequestedStepperItemSelect.emit({
|
102
|
+
position
|
103
|
+
});
|
104
|
+
}
|
105
|
+
};
|
106
|
+
this.emitRequestedItem = () => {
|
107
|
+
if (!this.disabled) {
|
108
|
+
const position = this.itemPosition;
|
109
|
+
this.calciteInternalStepperItemSelect.emit({
|
110
|
+
position
|
111
|
+
});
|
112
|
+
}
|
113
|
+
};
|
114
|
+
}
|
115
|
+
activeHandler(value) {
|
116
|
+
this.selected = value;
|
117
|
+
}
|
118
|
+
selectedHandler(value) {
|
119
|
+
this.active = value;
|
120
|
+
if (this.selected) {
|
121
|
+
this.emitRequestedItem();
|
122
|
+
}
|
123
|
+
}
|
124
|
+
// watch for removal of disabled to register step
|
125
|
+
disabledWatcher() {
|
126
|
+
this.registerStepperItem();
|
127
|
+
}
|
128
|
+
effectiveLocaleWatcher(locale) {
|
129
|
+
var _a;
|
130
|
+
numberStringFormatter.numberFormatOptions = {
|
131
|
+
locale,
|
132
|
+
numberingSystem: (_a = this.parentStepperEl) === null || _a === void 0 ? void 0 : _a.numberingSystem,
|
133
|
+
useGrouping: false
|
134
|
+
};
|
135
|
+
}
|
136
|
+
//--------------------------------------------------------------------------
|
137
|
+
//
|
138
|
+
// Lifecycle
|
139
|
+
//
|
140
|
+
//--------------------------------------------------------------------------
|
141
|
+
connectedCallback() {
|
142
|
+
connectLocalized(this);
|
143
|
+
const { selected, active } = this;
|
144
|
+
if (selected) {
|
145
|
+
this.active = selected;
|
146
|
+
}
|
147
|
+
else if (active) {
|
148
|
+
this.selected = active;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
componentWillLoad() {
|
152
|
+
var _a;
|
153
|
+
this.icon = getElementProp(this.el, "icon", false);
|
154
|
+
this.numbered = getElementProp(this.el, "numbered", false);
|
155
|
+
this.layout = getElementProp(this.el, "layout", false);
|
156
|
+
this.scale = getElementProp(this.el, "scale", "m");
|
157
|
+
this.parentStepperEl = this.el.parentElement;
|
158
|
+
this.itemPosition = this.getItemPosition();
|
159
|
+
this.registerStepperItem();
|
160
|
+
if (this.selected) {
|
161
|
+
this.emitRequestedItem();
|
162
|
+
}
|
163
|
+
numberStringFormatter.numberFormatOptions = {
|
164
|
+
locale: this.effectiveLocale,
|
165
|
+
numberingSystem: (_a = this.parentStepperEl) === null || _a === void 0 ? void 0 : _a.numberingSystem,
|
166
|
+
useGrouping: false
|
167
|
+
};
|
168
|
+
}
|
169
|
+
componentDidRender() {
|
170
|
+
updateHostInteraction(this, true);
|
171
|
+
}
|
172
|
+
disconnectedCallback() {
|
173
|
+
disconnectLocalized(this);
|
174
|
+
}
|
175
|
+
render() {
|
176
|
+
return (h(Host, { "aria-expanded": toAriaBoolean(this.active), onClick: this.handleItemClick, onKeyDown: this.keyDownHandler }, h("div", { class: "container" }, h("div", { class: "stepper-item-header", ref: (el) => (this.headerEl = el), tabIndex:
|
177
|
+
/* additional tab index logic needed because of display: contents */
|
178
|
+
this.layout === "horizontal" && !this.disabled ? 0 : null }, this.icon ? this.renderIcon() : null, this.numbered ? (h("div", { class: "stepper-item-number" }, numberStringFormatter.numberFormatter.format(this.itemPosition + 1), ".")) : null, h("div", { class: "stepper-item-header-text" }, h("span", { class: "stepper-item-heading" }, this.heading || this.itemTitle), h("span", { class: "stepper-item-description" }, this.description || this.itemSubtitle))), h("div", { class: "stepper-item-content" }, h("slot", null)))));
|
179
|
+
}
|
180
|
+
//--------------------------------------------------------------------------
|
181
|
+
//
|
182
|
+
// Event Listeners
|
183
|
+
//
|
184
|
+
//--------------------------------------------------------------------------
|
185
|
+
updateActiveItemOnChange(event) {
|
186
|
+
if (event.target === this.parentStepperEl ||
|
187
|
+
event.composedPath().includes(this.parentStepperEl)) {
|
188
|
+
this.selectedPosition = event.detail.position;
|
189
|
+
this.determineSelectedItem();
|
190
|
+
}
|
191
|
+
}
|
192
|
+
//--------------------------------------------------------------------------
|
193
|
+
//
|
194
|
+
// Public Methods
|
195
|
+
//
|
196
|
+
//--------------------------------------------------------------------------
|
197
|
+
async setFocus() {
|
198
|
+
var _a;
|
199
|
+
(_a = (this.layout === "vertical" ? this.el : this.headerEl)) === null || _a === void 0 ? void 0 : _a.focus();
|
200
|
+
}
|
201
|
+
renderIcon() {
|
202
|
+
const path = this.selected
|
203
|
+
? "circleF"
|
204
|
+
: this.error
|
205
|
+
? "exclamationMarkCircleF"
|
206
|
+
: this.complete
|
207
|
+
? "checkCircleF"
|
208
|
+
: "circle";
|
209
|
+
return h("calcite-icon", { class: "stepper-item-icon", icon: path, scale: "s" });
|
210
|
+
}
|
211
|
+
determineSelectedItem() {
|
212
|
+
this.selected = !this.disabled && this.itemPosition === this.selectedPosition;
|
213
|
+
}
|
214
|
+
registerStepperItem() {
|
215
|
+
this.calciteInternalStepperItemRegister.emit({
|
216
|
+
position: this.itemPosition
|
217
|
+
});
|
218
|
+
}
|
219
|
+
getItemPosition() {
|
220
|
+
var _a;
|
221
|
+
return Array.from((_a = this.parentStepperEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll("calcite-stepper-item")).indexOf(this.el);
|
222
|
+
}
|
223
|
+
get el() { return this; }
|
224
|
+
static get watchers() { return {
|
225
|
+
"active": ["activeHandler"],
|
226
|
+
"selected": ["selectedHandler"],
|
227
|
+
"disabled": ["disabledWatcher"],
|
228
|
+
"effectiveLocale": ["effectiveLocaleWatcher"]
|
229
|
+
}; }
|
230
|
+
static get style() { return stepperItemCss; }
|
231
|
+
}, [1, "calcite-stepper-item", {
|
232
|
+
"active": [1540],
|
233
|
+
"selected": [1540],
|
234
|
+
"complete": [516],
|
235
|
+
"error": [516],
|
236
|
+
"disabled": [516],
|
237
|
+
"itemTitle": [1, "item-title"],
|
238
|
+
"heading": [1],
|
239
|
+
"itemSubtitle": [1, "item-subtitle"],
|
240
|
+
"description": [1],
|
241
|
+
"layout": [1537],
|
242
|
+
"icon": [1028],
|
243
|
+
"numbered": [1028],
|
244
|
+
"scale": [1537],
|
245
|
+
"effectiveLocale": [32],
|
246
|
+
"setFocus": [64]
|
247
|
+
}, [[16, "calciteInternalStepperItemChange", "updateActiveItemOnChange"]]]);
|
248
|
+
function defineCustomElement$1() {
|
249
|
+
if (typeof customElements === "undefined") {
|
250
|
+
return;
|
251
|
+
}
|
252
|
+
const components = ["calcite-stepper-item", "calcite-icon"];
|
253
|
+
components.forEach(tagName => { switch (tagName) {
|
254
|
+
case "calcite-stepper-item":
|
255
|
+
if (!customElements.get(tagName)) {
|
256
|
+
customElements.define(tagName, StepperItem);
|
257
|
+
}
|
258
|
+
break;
|
259
|
+
case "calcite-icon":
|
260
|
+
if (!customElements.get(tagName)) {
|
261
|
+
defineCustomElement$2();
|
262
|
+
}
|
263
|
+
break;
|
264
|
+
} });
|
265
|
+
}
|
266
|
+
defineCustomElement$1();
|
267
|
+
|
268
|
+
const CalciteStepperItem = StepperItem;
|
269
|
+
const defineCustomElement = defineCustomElement$1;
|
270
|
+
|
271
|
+
export { CalciteStepperItem, defineCustomElement };
|