@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,165 @@
|
|
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 { u as updateHostInteraction } from './interactive.js';
|
8
|
+
import { d as defineCustomElement$4 } from './button.js';
|
9
|
+
import { d as defineCustomElement$3 } from './dropdown.js';
|
10
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
11
|
+
import { d as defineCustomElement$1 } from './loader.js';
|
12
|
+
|
13
|
+
/*!
|
14
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
15
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
16
|
+
* v1.0.0-beta.97
|
17
|
+
*/
|
18
|
+
const CSS = {
|
19
|
+
container: "split-button__container",
|
20
|
+
dividerContainer: "split-button__divider-container",
|
21
|
+
divider: "split-button__divider",
|
22
|
+
widthAuto: "width-auto",
|
23
|
+
widthHalf: "width-half",
|
24
|
+
widthFull: "width-full"
|
25
|
+
};
|
26
|
+
|
27
|
+
const splitButtonCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:inline-block}:host .split-button__container{display:flex;align-items:stretch}:host .split-button__container>calcite-dropdown>calcite-button{block-size:100%;vertical-align:top}:host:host([color=blue]){--calcite-split-button-background:var(--calcite-ui-brand);--calcite-split-button-divider:var(--calcite-ui-foreground-1)}:host:host([color=red]){--calcite-split-button-background:var(--calcite-ui-danger);--calcite-split-button-divider:var(--calcite-ui-foreground-1)}:host:host([color=neutral]){--calcite-split-button-background:var(--calcite-ui-foreground-3);--calcite-split-button-divider:var(--calcite-ui-text-1)}:host:host([color=inverse]){--calcite-split-button-background:var(--calcite-ui-inverse);--calcite-split-button-divider:var(--calcite-ui-foreground-1)}:host([appearance=transparent]):host([color=blue]){--calcite-split-button-divider:var(--calcite-ui-brand)}:host([appearance=transparent]):host([color=red]){--calcite-split-button-divider:var(--calcite-ui-danger)}:host([appearance=transparent]):host([color=neutral]){--calcite-split-button-divider:var(--calcite-ui-text-1)}:host([appearance=transparent]):host([color=inverse]){--calcite-split-button-divider:var(--calcite-ui-foreground-1)}:host([appearance=clear]),:host([appearance=transparent]){--calcite-split-button-background:transparent}:host([appearance=outline]){--calcite-split-button-background:var(--calcite-ui-foreground-1)}:host([appearance=clear]):host([color=blue]),:host([appearance=outline]):host([color=blue]){--calcite-split-button-divider:var(--calcite-ui-brand)}:host([appearance=clear]):host([color=red]),:host([appearance=outline]):host([color=red]){--calcite-split-button-divider:var(--calcite-ui-danger)}:host([appearance=clear]):host([color=neutral]),:host([appearance=outline]):host([color=neutral]){--calcite-split-button-divider:var(--calcite-ui-foreground-3)}:host([appearance=clear]):host([color=inverse]),:host([appearance=outline]):host([color=inverse]){--calcite-split-button-divider:var(--calcite-ui-inverse)}.width-auto{inline-size:auto}.width-half{inline-size:50%}.width-full{inline-size:100%}.split-button__divider-container{display:flex;inline-size:1px;align-items:stretch;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background-color:var(--calcite-split-button-background)}.split-button__divider{margin-block:0.25rem;display:inline-block;inline-size:1px;background-color:var(--calcite-split-button-divider)}:host([appearance=outline]) .split-button__divider-container,:host([appearance=clear]) .split-button__divider-container,:host([appearance=minimal]) .split-button__divider-container{border-block:1px solid var(--calcite-split-button-divider)}:host([appearance=outline]):hover .split-button__divider-container,:host([appearance=clear]):hover .split-button__divider-container,:host([appearance=minimal]):hover .split-button__divider-container{background-color:var(--calcite-split-button-divider)}:host([appearance=outline]:hover) .split-button__divider-container,:host([appearance=clear]:hover) .split-button__divider-container,:host([appearance=minimal]):hover .split-button__divider-container{background-color:var(--calcite-split-button-divider)}:host([appearance=outline]:focus-within):host([color=blue]),:host([appearance=clear]:focus-within):host([color=blue]),:host([appearance=minimal]:focus-within):host([color=blue]){--calcite-split-button-divider:var(--calcite-ui-brand-press)}:host([appearance=outline]:focus-within):host([color=red]),:host([appearance=clear]:focus-within):host([color=red]),:host([appearance=minimal]:focus-within):host([color=red]){--calcite-split-button-divider:var(--calcite-ui-danger-press)}:host([appearance=outline]:focus-within) .split-button__divider-container,:host([appearance=clear]:focus-within) .split-button__divider-container,:host([appearance=minimal]:focus-within) .split-button__divider-container{background-color:var(--calcite-split-button-divider)}:host([disabled]) .split-button__divider-container{opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) calcite-dropdown>calcite-button{pointer-events:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}";
|
28
|
+
|
29
|
+
const SplitButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
30
|
+
constructor() {
|
31
|
+
super();
|
32
|
+
this.__registerHost();
|
33
|
+
this.__attachShadow();
|
34
|
+
this.calciteSplitButtonPrimaryClick = createEvent(this, "calciteSplitButtonPrimaryClick", 6);
|
35
|
+
this.calciteSplitButtonSecondaryClick = createEvent(this, "calciteSplitButtonSecondaryClick", 6);
|
36
|
+
/** Specifies the appearance style of the component. */
|
37
|
+
this.appearance = "solid";
|
38
|
+
/** Specifies the color of the component. */
|
39
|
+
this.color = "blue";
|
40
|
+
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
|
41
|
+
this.disabled = false;
|
42
|
+
/**
|
43
|
+
* When `true`, the component is active.
|
44
|
+
*
|
45
|
+
* @internal
|
46
|
+
*/
|
47
|
+
this.active = false;
|
48
|
+
/** Specifies the icon used for the dropdown menu. */
|
49
|
+
this.dropdownIconType = "chevron";
|
50
|
+
/**
|
51
|
+
When `true`, a busy indicator is displayed on the primary button.
|
52
|
+
*/
|
53
|
+
this.loading = false;
|
54
|
+
/**
|
55
|
+
* Determines the type of positioning to use for the overlaid content.
|
56
|
+
*
|
57
|
+
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
|
58
|
+
*
|
59
|
+
* `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
|
60
|
+
*
|
61
|
+
*/
|
62
|
+
this.overlayPositioning = "absolute";
|
63
|
+
/** Specifies the size of the component. */
|
64
|
+
this.scale = "m";
|
65
|
+
/** Specifies the width of the component. */
|
66
|
+
this.width = "auto";
|
67
|
+
this.calciteSplitButtonPrimaryClickHandler = (event) => this.calciteSplitButtonPrimaryClick.emit(event);
|
68
|
+
this.calciteSplitButtonSecondaryClickHandler = (event) => this.calciteSplitButtonSecondaryClick.emit(event);
|
69
|
+
}
|
70
|
+
handleDisabledChange(value) {
|
71
|
+
if (!value) {
|
72
|
+
this.active = false;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
activeHandler() {
|
76
|
+
if (this.disabled) {
|
77
|
+
this.active = false;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
//--------------------------------------------------------------------------
|
81
|
+
//
|
82
|
+
// Lifecycle
|
83
|
+
//
|
84
|
+
//--------------------------------------------------------------------------
|
85
|
+
componentDidRender() {
|
86
|
+
updateHostInteraction(this);
|
87
|
+
}
|
88
|
+
render() {
|
89
|
+
const widthClasses = {
|
90
|
+
[CSS.container]: true,
|
91
|
+
[CSS.widthAuto]: this.width === "auto",
|
92
|
+
[CSS.widthHalf]: this.width === "half",
|
93
|
+
[CSS.widthFull]: this.width === "full"
|
94
|
+
};
|
95
|
+
const buttonWidth = this.width === "auto" ? "auto" : "full";
|
96
|
+
return (h("div", { class: widthClasses }, h("calcite-button", { appearance: this.appearance, color: this.color, disabled: this.disabled, "icon-end": this.primaryIconEnd ? this.primaryIconEnd : null, "icon-start": this.primaryIconStart ? this.primaryIconStart : null, iconFlipRtl: this.primaryIconFlipRtl ? this.primaryIconFlipRtl : null, label: this.primaryLabel, loading: this.loading, onClick: this.calciteSplitButtonPrimaryClickHandler, scale: this.scale, splitChild: "primary", type: "button", width: buttonWidth }, this.primaryText), h("div", { class: CSS.dividerContainer }, h("div", { class: CSS.divider })), h("calcite-dropdown", { active: this.active, disabled: this.disabled, onClick: this.calciteSplitButtonSecondaryClickHandler, overlayPositioning: this.overlayPositioning, placement: "bottom-end", scale: this.scale, width: this.scale }, h("calcite-button", { appearance: this.appearance, color: this.color, disabled: this.disabled, "icon-start": this.dropdownIcon, label: this.dropdownLabel, scale: this.scale, slot: "dropdown-trigger", splitChild: "secondary", type: "button" }), h("slot", null))));
|
97
|
+
}
|
98
|
+
get dropdownIcon() {
|
99
|
+
return this.dropdownIconType === "chevron"
|
100
|
+
? "chevronDown"
|
101
|
+
: this.dropdownIconType === "caret"
|
102
|
+
? "caretDown"
|
103
|
+
: this.dropdownIconType === "ellipsis"
|
104
|
+
? "ellipsis"
|
105
|
+
: "handle-vertical";
|
106
|
+
}
|
107
|
+
get el() { return this; }
|
108
|
+
static get watchers() { return {
|
109
|
+
"disabled": ["handleDisabledChange"],
|
110
|
+
"active": ["activeHandler"]
|
111
|
+
}; }
|
112
|
+
static get style() { return splitButtonCss; }
|
113
|
+
}, [1, "calcite-split-button", {
|
114
|
+
"appearance": [513],
|
115
|
+
"color": [513],
|
116
|
+
"disabled": [516],
|
117
|
+
"active": [1540],
|
118
|
+
"dropdownIconType": [513, "dropdown-icon-type"],
|
119
|
+
"dropdownLabel": [513, "dropdown-label"],
|
120
|
+
"loading": [516],
|
121
|
+
"overlayPositioning": [513, "overlay-positioning"],
|
122
|
+
"primaryIconEnd": [513, "primary-icon-end"],
|
123
|
+
"primaryIconFlipRtl": [513, "primary-icon-flip-rtl"],
|
124
|
+
"primaryIconStart": [513, "primary-icon-start"],
|
125
|
+
"primaryLabel": [513, "primary-label"],
|
126
|
+
"primaryText": [513, "primary-text"],
|
127
|
+
"scale": [513],
|
128
|
+
"width": [513]
|
129
|
+
}]);
|
130
|
+
function defineCustomElement() {
|
131
|
+
if (typeof customElements === "undefined") {
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
const components = ["calcite-split-button", "calcite-button", "calcite-dropdown", "calcite-icon", "calcite-loader"];
|
135
|
+
components.forEach(tagName => { switch (tagName) {
|
136
|
+
case "calcite-split-button":
|
137
|
+
if (!customElements.get(tagName)) {
|
138
|
+
customElements.define(tagName, SplitButton);
|
139
|
+
}
|
140
|
+
break;
|
141
|
+
case "calcite-button":
|
142
|
+
if (!customElements.get(tagName)) {
|
143
|
+
defineCustomElement$4();
|
144
|
+
}
|
145
|
+
break;
|
146
|
+
case "calcite-dropdown":
|
147
|
+
if (!customElements.get(tagName)) {
|
148
|
+
defineCustomElement$3();
|
149
|
+
}
|
150
|
+
break;
|
151
|
+
case "calcite-icon":
|
152
|
+
if (!customElements.get(tagName)) {
|
153
|
+
defineCustomElement$2();
|
154
|
+
}
|
155
|
+
break;
|
156
|
+
case "calcite-loader":
|
157
|
+
if (!customElements.get(tagName)) {
|
158
|
+
defineCustomElement$1();
|
159
|
+
}
|
160
|
+
break;
|
161
|
+
} });
|
162
|
+
}
|
163
|
+
defineCustomElement();
|
164
|
+
|
165
|
+
export { SplitButton as S, defineCustomElement as d };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface StoreManager extends Components.StoreManager, HTMLElement {}
|
4
|
+
export const StoreManager: {
|
5
|
+
prototype: StoreManager;
|
6
|
+
new (): StoreManager;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|
@@ -0,0 +1,83 @@
|
|
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 } from '@stencil/core/internal/client';
|
7
|
+
|
8
|
+
const StoreManager$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
this.__registerHost();
|
12
|
+
this.stateLoaded = createEvent(this, "stateLoaded", 7);
|
13
|
+
this.value = "";
|
14
|
+
this.templates = [];
|
15
|
+
this.authentication = undefined;
|
16
|
+
}
|
17
|
+
//--------------------------------------------------------------------------
|
18
|
+
//
|
19
|
+
// Lifecycle
|
20
|
+
//
|
21
|
+
//--------------------------------------------------------------------------
|
22
|
+
connectedCallback() {
|
23
|
+
this._initValueObserver();
|
24
|
+
}
|
25
|
+
/**
|
26
|
+
* Renders the component.
|
27
|
+
*/
|
28
|
+
render() {
|
29
|
+
return (null);
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Initialize the observer that will monitor and respond to changes in the value.
|
33
|
+
* When we get a new value we are dealinmg with a new solution and need to fetch the items data and load the state.
|
34
|
+
*/
|
35
|
+
_initValueObserver() {
|
36
|
+
//const self = this;
|
37
|
+
this._valueObserver = new MutationObserver(ml => {
|
38
|
+
ml.some(mutation => {
|
39
|
+
const newValue = mutation.target[mutation.attributeName];
|
40
|
+
if (mutation.type === 'attributes' && mutation.attributeName === "value" &&
|
41
|
+
newValue !== mutation.oldValue && newValue !== "") {
|
42
|
+
/*
|
43
|
+
const v = JSON.parse(newValue);
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
45
|
+
getItemDataAsJson(v, self.authentication).then(data => {
|
46
|
+
state.models = getModels(Array.isArray(v) ? v : [v], self.authentication, v);
|
47
|
+
state.featureServices = getFeatureServices(Array.isArray(v) ? v : [v])
|
48
|
+
state.get("spatialReferenceInfo") = getSpatialReferenceInfo(state.featureServices, data);
|
49
|
+
self.templates = v;
|
50
|
+
self.stateLoaded.emit(state);
|
51
|
+
});
|
52
|
+
*/
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
});
|
56
|
+
});
|
57
|
+
this._valueObserver.observe(this.el, { attributes: true, attributeOldValue: true });
|
58
|
+
}
|
59
|
+
get el() { return this; }
|
60
|
+
}, [0, "store-manager", {
|
61
|
+
"value": [1537],
|
62
|
+
"templates": [1040],
|
63
|
+
"authentication": [1040]
|
64
|
+
}]);
|
65
|
+
function defineCustomElement$1() {
|
66
|
+
if (typeof customElements === "undefined") {
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
const components = ["store-manager"];
|
70
|
+
components.forEach(tagName => { switch (tagName) {
|
71
|
+
case "store-manager":
|
72
|
+
if (!customElements.get(tagName)) {
|
73
|
+
customElements.define(tagName, StoreManager$1);
|
74
|
+
}
|
75
|
+
break;
|
76
|
+
} });
|
77
|
+
}
|
78
|
+
defineCustomElement$1();
|
79
|
+
|
80
|
+
const StoreManager = StoreManager$1;
|
81
|
+
const defineCustomElement = defineCustomElement$1;
|
82
|
+
|
83
|
+
export { StoreManager, defineCustomElement };
|
@@ -0,0 +1,139 @@
|
|
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 { f as focusElement, t as toAriaBoolean } from './dom.js';
|
8
|
+
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from './label2.js';
|
9
|
+
import { c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from './form.js';
|
10
|
+
import { u as updateHostInteraction } from './interactive.js';
|
11
|
+
import { i as isActivationKey } from './key.js';
|
12
|
+
|
13
|
+
const switchCss = "@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([scale=s]) .container{block-size:0.75rem}:host([scale=s]) .track{block-size:0.75rem;inline-size:1.5rem}:host([scale=s]) .handle{block-size:0.5rem;inline-size:0.5rem}:host([scale=m]) .container{block-size:1rem}:host([scale=m]) .track{block-size:1rem;inline-size:2rem}:host([scale=m]) .handle{block-size:0.75rem;inline-size:0.75rem}:host([scale=l]) .container{block-size:1.5rem}:host([scale=l]) .track{block-size:1.5rem;inline-size:3rem}:host([scale=l]) .handle{block-size:1.25rem;inline-size:1.25rem}:host{position:relative;display:inline-block;inline-size:auto;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;tap-highlight-color:transparent}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host{inline-size:auto;outline-color:transparent}.track{pointer-events:none;position:relative;box-sizing:border-box;display:inline-block;border-radius:9999px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-2);background-color:var(--calcite-ui-foreground-2);vertical-align:top;transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.handle{pointer-events:none;position:absolute;display:block;border-radius:9999px;border-width:2px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);inset-block-start:-1px;inset-inline:-1px auto}:host(:hover) .handle,:host(:focus) .handle{border-color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand)}:host([checked]) .track{border-color:var(--calcite-ui-brand-hover);background-color:var(--calcite-ui-brand)}:host([checked]) .handle{border-color:var(--calcite-ui-brand);inset-inline:auto -1px}:host([checked]:hover) .track{border-color:var(--calcite-ui-brand-hover);background-color:var(--calcite-ui-brand)}:host([checked]:hover) .handle{border-color:var(--calcite-ui-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand-hover)}@media (forced-colors: active){:host([checked]) .track{background-color:canvasText}}.container:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
|
14
|
+
|
15
|
+
const Switch = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
16
|
+
constructor() {
|
17
|
+
super();
|
18
|
+
this.__registerHost();
|
19
|
+
this.__attachShadow();
|
20
|
+
this.calciteSwitchChange = createEvent(this, "calciteSwitchChange", 6);
|
21
|
+
//--------------------------------------------------------------------------
|
22
|
+
//
|
23
|
+
// Properties
|
24
|
+
//
|
25
|
+
//--------------------------------------------------------------------------
|
26
|
+
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
|
27
|
+
this.disabled = false;
|
28
|
+
/** Specifies the size of the component. */
|
29
|
+
this.scale = "m";
|
30
|
+
/**
|
31
|
+
* When `true`, the component is checked.
|
32
|
+
*
|
33
|
+
* @deprecated use `checked` instead.
|
34
|
+
*/
|
35
|
+
this.switched = false;
|
36
|
+
/** When `true`, the component is checked. */
|
37
|
+
this.checked = false;
|
38
|
+
//--------------------------------------------------------------------------
|
39
|
+
//
|
40
|
+
// Private Methods
|
41
|
+
//
|
42
|
+
//--------------------------------------------------------------------------
|
43
|
+
this.keyDownHandler = (event) => {
|
44
|
+
if (!this.disabled && isActivationKey(event.key)) {
|
45
|
+
this.toggle();
|
46
|
+
event.preventDefault();
|
47
|
+
}
|
48
|
+
};
|
49
|
+
this.clickHandler = () => {
|
50
|
+
this.toggle();
|
51
|
+
};
|
52
|
+
this.setSwitchEl = (el) => {
|
53
|
+
this.switchEl = el;
|
54
|
+
};
|
55
|
+
}
|
56
|
+
switchedWatcher(switched) {
|
57
|
+
this.checked = switched;
|
58
|
+
}
|
59
|
+
//--------------------------------------------------------------------------
|
60
|
+
//
|
61
|
+
// Public Methods
|
62
|
+
//
|
63
|
+
//--------------------------------------------------------------------------
|
64
|
+
/** Sets focus on the component. */
|
65
|
+
async setFocus() {
|
66
|
+
focusElement(this.switchEl);
|
67
|
+
}
|
68
|
+
onLabelClick() {
|
69
|
+
if (!this.disabled) {
|
70
|
+
this.toggle();
|
71
|
+
this.setFocus();
|
72
|
+
}
|
73
|
+
}
|
74
|
+
toggle() {
|
75
|
+
this.checked = !this.checked;
|
76
|
+
this.calciteSwitchChange.emit({
|
77
|
+
switched: this.checked
|
78
|
+
});
|
79
|
+
}
|
80
|
+
//--------------------------------------------------------------------------
|
81
|
+
//
|
82
|
+
// Lifecycle
|
83
|
+
//
|
84
|
+
//--------------------------------------------------------------------------
|
85
|
+
connectedCallback() {
|
86
|
+
const initiallyChecked = this.checked || this.switched;
|
87
|
+
if (initiallyChecked) {
|
88
|
+
// if either prop is set, we ensure both are synced initially
|
89
|
+
this.switched = this.checked = initiallyChecked;
|
90
|
+
}
|
91
|
+
connectLabel(this);
|
92
|
+
connectForm(this);
|
93
|
+
}
|
94
|
+
disconnectedCallback() {
|
95
|
+
disconnectLabel(this);
|
96
|
+
disconnectForm(this);
|
97
|
+
}
|
98
|
+
componentDidRender() {
|
99
|
+
updateHostInteraction(this);
|
100
|
+
}
|
101
|
+
// --------------------------------------------------------------------------
|
102
|
+
//
|
103
|
+
// Render Methods
|
104
|
+
//
|
105
|
+
// --------------------------------------------------------------------------
|
106
|
+
render() {
|
107
|
+
return (h(Host, { onClick: this.clickHandler, onKeyDown: this.keyDownHandler }, h("div", { "aria-checked": toAriaBoolean(this.checked), "aria-label": getLabelText(this), class: "container", ref: this.setSwitchEl, role: "switch", tabIndex: 0 }, h("div", { class: "track" }, h("div", { class: "handle" })), h(HiddenFormInputSlot, { component: this }))));
|
108
|
+
}
|
109
|
+
get el() { return this; }
|
110
|
+
static get watchers() { return {
|
111
|
+
"switched": ["switchedWatcher"]
|
112
|
+
}; }
|
113
|
+
static get style() { return switchCss; }
|
114
|
+
}, [1, "calcite-switch", {
|
115
|
+
"disabled": [516],
|
116
|
+
"label": [1],
|
117
|
+
"name": [513],
|
118
|
+
"scale": [513],
|
119
|
+
"switched": [1540],
|
120
|
+
"checked": [1540],
|
121
|
+
"value": [8],
|
122
|
+
"setFocus": [64]
|
123
|
+
}]);
|
124
|
+
function defineCustomElement() {
|
125
|
+
if (typeof customElements === "undefined") {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
const components = ["calcite-switch"];
|
129
|
+
components.forEach(tagName => { switch (tagName) {
|
130
|
+
case "calcite-switch":
|
131
|
+
if (!customElements.get(tagName)) {
|
132
|
+
customElements.define(tagName, Switch);
|
133
|
+
}
|
134
|
+
break;
|
135
|
+
} });
|
136
|
+
}
|
137
|
+
defineCustomElement();
|
138
|
+
|
139
|
+
export { Switch as S, defineCustomElement as d };
|
@@ -0,0 +1,241 @@
|
|
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 { c as getElementDir, m as filterDirectChildren } from './dom.js';
|
8
|
+
import { c as createObserver } from './observers.js';
|
9
|
+
|
10
|
+
const tabNavCss = "@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{position:relative;display:flex}:host([scale=s]){min-block-size:1.5rem}:host([scale=m]){min-block-size:2rem}:host([scale=l]){min-block-size:2.75rem}.tab-nav{display:flex;inline-size:100%;justify-content:flex-start;overflow:auto}.tab-nav-active-indicator-container{position:absolute;inset-inline:0px;inset-block-end:0px;block-size:0.125rem;inline-size:100%;overflow:hidden}.tab-nav-active-indicator{position:absolute;inset-block-end:0px;display:block;block-size:0.125rem;background-color:var(--calcite-ui-brand);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}:host([position=below]) .tab-nav-active-indicator{inset-block-end:unset;inset-block-start:0px}:host([position=bottom]) .tab-nav-active-indicator{inset-block-end:unset;inset-block-start:0px}:host([position=below]) .tab-nav-active-indicator-container{inset-block-start:0px;inset-block-end:unset}:host([position=bottom]) .tab-nav-active-indicator-container{inset-block-end:unset;inset-block-start:0px}:host([bordered]) .tab-nav-active-indicator-container{inset-block-end:unset}:host([bordered][position=below]) .tab-nav-active-indicator-container{inset-block-end:0;inset-block-start:unset}:host([bordered][position=bottom]) .tab-nav-active-indicator-container{inset-block-end:0;inset-block-start:unset}@media (forced-colors: active){.tab-nav-active-indicator{background-color:highlight}}";
|
11
|
+
|
12
|
+
const TabNav = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
13
|
+
constructor() {
|
14
|
+
super();
|
15
|
+
this.__registerHost();
|
16
|
+
this.__attachShadow();
|
17
|
+
this.calciteTabChange = createEvent(this, "calciteTabChange", 6);
|
18
|
+
this.calciteInternalTabChange = createEvent(this, "calciteInternalTabChange", 6);
|
19
|
+
/**
|
20
|
+
* @internal
|
21
|
+
*/
|
22
|
+
this.scale = "m";
|
23
|
+
/**
|
24
|
+
* @internal
|
25
|
+
*/
|
26
|
+
this.layout = "inline";
|
27
|
+
/**
|
28
|
+
* @internal
|
29
|
+
*/
|
30
|
+
this.position = "bottom";
|
31
|
+
/**
|
32
|
+
* @internal
|
33
|
+
*/
|
34
|
+
this.bordered = false;
|
35
|
+
this.animationActiveDuration = 0.3;
|
36
|
+
this.resizeObserver = createObserver("resize", () => {
|
37
|
+
// remove active indicator transition duration during resize to prevent wobble
|
38
|
+
this.activeIndicatorEl.style.transitionDuration = "0s";
|
39
|
+
this.updateActiveWidth();
|
40
|
+
this.updateOffsetPosition();
|
41
|
+
});
|
42
|
+
//--------------------------------------------------------------------------
|
43
|
+
//
|
44
|
+
// Private Methods
|
45
|
+
//
|
46
|
+
//--------------------------------------------------------------------------
|
47
|
+
this.handleContainerScroll = () => {
|
48
|
+
// remove active indicator transition duration while container is scrolling to prevent wobble
|
49
|
+
this.activeIndicatorEl.style.transitionDuration = "0s";
|
50
|
+
this.updateOffsetPosition();
|
51
|
+
};
|
52
|
+
}
|
53
|
+
async selectedTabChanged() {
|
54
|
+
if (localStorage &&
|
55
|
+
this.storageId &&
|
56
|
+
this.selectedTab !== undefined &&
|
57
|
+
this.selectedTab !== null) {
|
58
|
+
localStorage.setItem(`calcite-tab-nav-${this.storageId}`, JSON.stringify(this.selectedTab));
|
59
|
+
}
|
60
|
+
this.calciteInternalTabChange.emit({
|
61
|
+
tab: this.selectedTab
|
62
|
+
});
|
63
|
+
this.selectedTabEl = await this.getTabTitleById(this.selectedTab);
|
64
|
+
}
|
65
|
+
selectedTabElChanged() {
|
66
|
+
this.updateOffsetPosition();
|
67
|
+
this.updateActiveWidth();
|
68
|
+
// reset the animation time on tab selection
|
69
|
+
this.activeIndicatorEl.style.transitionDuration = `${this.animationActiveDuration}s`;
|
70
|
+
}
|
71
|
+
//--------------------------------------------------------------------------
|
72
|
+
//
|
73
|
+
// Lifecycle
|
74
|
+
//
|
75
|
+
//--------------------------------------------------------------------------
|
76
|
+
connectedCallback() {
|
77
|
+
var _a;
|
78
|
+
this.parentTabsEl = this.el.closest("calcite-tabs");
|
79
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el);
|
80
|
+
}
|
81
|
+
disconnectedCallback() {
|
82
|
+
var _a;
|
83
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
84
|
+
}
|
85
|
+
componentWillLoad() {
|
86
|
+
const storageKey = `calcite-tab-nav-${this.storageId}`;
|
87
|
+
if (localStorage && this.storageId && localStorage.getItem(storageKey)) {
|
88
|
+
const storedTab = JSON.parse(localStorage.getItem(storageKey));
|
89
|
+
this.selectedTab = storedTab;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
componentWillRender() {
|
93
|
+
const { parentTabsEl } = this;
|
94
|
+
this.layout = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.layout;
|
95
|
+
this.position = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.position;
|
96
|
+
this.scale = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.scale;
|
97
|
+
this.bordered = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.bordered;
|
98
|
+
// fix issue with active tab-title not lining up with blue indicator
|
99
|
+
if (this.selectedTabEl) {
|
100
|
+
this.updateOffsetPosition();
|
101
|
+
}
|
102
|
+
}
|
103
|
+
componentDidRender() {
|
104
|
+
// if every tab title is active select the first tab.
|
105
|
+
if (this.tabTitles.length &&
|
106
|
+
this.tabTitles.every((title) => !title.active) &&
|
107
|
+
!this.selectedTab) {
|
108
|
+
this.tabTitles[0].getTabIdentifier().then((tab) => {
|
109
|
+
this.calciteInternalTabChange.emit({
|
110
|
+
tab
|
111
|
+
});
|
112
|
+
});
|
113
|
+
}
|
114
|
+
}
|
115
|
+
render() {
|
116
|
+
const dir = getElementDir(this.el);
|
117
|
+
const width = `${this.indicatorWidth}px`;
|
118
|
+
const offset = `${this.indicatorOffset}px`;
|
119
|
+
const indicatorStyle = dir !== "rtl" ? { width, left: offset } : { width, right: offset };
|
120
|
+
return (h(Host, { role: "tablist" }, h("div", { class: "tab-nav", onScroll: this.handleContainerScroll, ref: (el) => (this.tabNavEl = el) }, h("div", { class: "tab-nav-active-indicator-container", ref: (el) => (this.activeIndicatorContainerEl = el) }, h("div", { class: "tab-nav-active-indicator", ref: (el) => (this.activeIndicatorEl = el), style: indicatorStyle })), h("slot", null))));
|
121
|
+
}
|
122
|
+
//--------------------------------------------------------------------------
|
123
|
+
//
|
124
|
+
// Event Listeners
|
125
|
+
//
|
126
|
+
//--------------------------------------------------------------------------
|
127
|
+
focusPreviousTabHandler(event) {
|
128
|
+
const currentIndex = this.getIndexOfTabTitle(event.target, this.enabledTabTitles);
|
129
|
+
const previousTab = this.enabledTabTitles[currentIndex - 1] ||
|
130
|
+
this.enabledTabTitles[this.enabledTabTitles.length - 1];
|
131
|
+
previousTab === null || previousTab === void 0 ? void 0 : previousTab.focus();
|
132
|
+
event.stopPropagation();
|
133
|
+
event.preventDefault();
|
134
|
+
}
|
135
|
+
focusNextTabHandler(event) {
|
136
|
+
const currentIndex = this.getIndexOfTabTitle(event.target, this.enabledTabTitles);
|
137
|
+
const nextTab = this.enabledTabTitles[currentIndex + 1] || this.enabledTabTitles[0];
|
138
|
+
nextTab === null || nextTab === void 0 ? void 0 : nextTab.focus();
|
139
|
+
event.stopPropagation();
|
140
|
+
event.preventDefault();
|
141
|
+
}
|
142
|
+
internalActivateTabHandler(event) {
|
143
|
+
this.selectedTab = event.detail.tab
|
144
|
+
? event.detail.tab
|
145
|
+
: this.getIndexOfTabTitle(event.target);
|
146
|
+
event.stopPropagation();
|
147
|
+
event.preventDefault();
|
148
|
+
}
|
149
|
+
activateTabHandler(event) {
|
150
|
+
this.calciteTabChange.emit({
|
151
|
+
tab: this.selectedTab
|
152
|
+
});
|
153
|
+
event.stopPropagation();
|
154
|
+
event.preventDefault();
|
155
|
+
}
|
156
|
+
/**
|
157
|
+
* Check for active tabs on register and update selected
|
158
|
+
*
|
159
|
+
* @param event
|
160
|
+
*/
|
161
|
+
updateTabTitles(event) {
|
162
|
+
if (event.target.active) {
|
163
|
+
this.selectedTab = event.detail;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
globalInternalTabChangeHandler(event) {
|
167
|
+
if (this.syncId &&
|
168
|
+
event.target !== this.el &&
|
169
|
+
event.target.syncId === this.syncId &&
|
170
|
+
this.selectedTab !== event.detail.tab) {
|
171
|
+
this.selectedTab = event.detail.tab;
|
172
|
+
}
|
173
|
+
event.stopPropagation();
|
174
|
+
}
|
175
|
+
iconStartChangeHandler() {
|
176
|
+
this.updateActiveWidth();
|
177
|
+
}
|
178
|
+
updateOffsetPosition() {
|
179
|
+
var _a, _b, _c, _d, _e;
|
180
|
+
const dir = getElementDir(this.el);
|
181
|
+
const navWidth = (_a = this.activeIndicatorContainerEl) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
182
|
+
const tabLeft = (_b = this.selectedTabEl) === null || _b === void 0 ? void 0 : _b.offsetLeft;
|
183
|
+
const tabWidth = (_c = this.selectedTabEl) === null || _c === void 0 ? void 0 : _c.offsetWidth;
|
184
|
+
const offsetRight = navWidth - (tabLeft + tabWidth);
|
185
|
+
this.indicatorOffset =
|
186
|
+
dir !== "rtl" ? tabLeft - ((_d = this.tabNavEl) === null || _d === void 0 ? void 0 : _d.scrollLeft) : offsetRight + ((_e = this.tabNavEl) === null || _e === void 0 ? void 0 : _e.scrollLeft);
|
187
|
+
}
|
188
|
+
updateActiveWidth() {
|
189
|
+
var _a;
|
190
|
+
this.indicatorWidth = (_a = this.selectedTabEl) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
191
|
+
}
|
192
|
+
getIndexOfTabTitle(el, tabTitles = this.tabTitles) {
|
193
|
+
// In most cases, since these indexes correlate with tab contents, we want to consider all tab titles.
|
194
|
+
// However, when doing relative index operations, it makes sense to pass in this.enabledTabTitles as the 2nd arg.
|
195
|
+
return tabTitles.indexOf(el);
|
196
|
+
}
|
197
|
+
async getTabTitleById(id) {
|
198
|
+
return Promise.all(this.tabTitles.map((el) => el.getTabIdentifier())).then((ids) => {
|
199
|
+
return this.tabTitles[ids.indexOf(id)];
|
200
|
+
});
|
201
|
+
}
|
202
|
+
get tabTitles() {
|
203
|
+
return filterDirectChildren(this.el, "calcite-tab-title");
|
204
|
+
}
|
205
|
+
get enabledTabTitles() {
|
206
|
+
return filterDirectChildren(this.el, "calcite-tab-title:not([disabled])");
|
207
|
+
}
|
208
|
+
get el() { return this; }
|
209
|
+
static get watchers() { return {
|
210
|
+
"selectedTab": ["selectedTabChanged"],
|
211
|
+
"selectedTabEl": ["selectedTabElChanged"]
|
212
|
+
}; }
|
213
|
+
static get style() { return tabNavCss; }
|
214
|
+
}, [1, "calcite-tab-nav", {
|
215
|
+
"storageId": [513, "storage-id"],
|
216
|
+
"syncId": [513, "sync-id"],
|
217
|
+
"scale": [1537],
|
218
|
+
"layout": [1537],
|
219
|
+
"position": [1537],
|
220
|
+
"bordered": [1540],
|
221
|
+
"indicatorOffset": [1026, "indicator-offset"],
|
222
|
+
"indicatorWidth": [1026, "indicator-width"],
|
223
|
+
"selectedTab": [32],
|
224
|
+
"selectedTabEl": [32]
|
225
|
+
}, [[0, "calciteInternalTabsFocusPrevious", "focusPreviousTabHandler"], [0, "calciteInternalTabsFocusNext", "focusNextTabHandler"], [0, "calciteInternalTabsActivate", "internalActivateTabHandler"], [0, "calciteTabsActivate", "activateTabHandler"], [0, "calciteInternalTabTitleRegister", "updateTabTitles"], [16, "calciteInternalTabChange", "globalInternalTabChangeHandler"], [0, "calciteInternalTabIconChanged", "iconStartChangeHandler"]]]);
|
226
|
+
function defineCustomElement() {
|
227
|
+
if (typeof customElements === "undefined") {
|
228
|
+
return;
|
229
|
+
}
|
230
|
+
const components = ["calcite-tab-nav"];
|
231
|
+
components.forEach(tagName => { switch (tagName) {
|
232
|
+
case "calcite-tab-nav":
|
233
|
+
if (!customElements.get(tagName)) {
|
234
|
+
customElements.define(tagName, TabNav);
|
235
|
+
}
|
236
|
+
break;
|
237
|
+
} });
|
238
|
+
}
|
239
|
+
defineCustomElement();
|
240
|
+
|
241
|
+
export { TabNav as T, defineCustomElement as d };
|