@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,149 @@
|
|
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, h, Fragment } from '@stencil/core/internal/client';
|
7
|
+
import { b as getSlotted } from './dom.js';
|
8
|
+
import { S as SLOTS$1, d as defineCustomElement$4 } from './action-menu.js';
|
9
|
+
import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot.js';
|
10
|
+
import { d as defineCustomElement$5 } from './action.js';
|
11
|
+
import { d as defineCustomElement$3 } from './icon.js';
|
12
|
+
import { d as defineCustomElement$2 } from './loader.js';
|
13
|
+
import { d as defineCustomElement$1 } from './popover.js';
|
14
|
+
|
15
|
+
/*!
|
16
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
17
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
18
|
+
* v1.0.0-beta.97
|
19
|
+
*/
|
20
|
+
const SLOTS = {
|
21
|
+
menuActions: "menu-actions",
|
22
|
+
menuTooltip: "menu-tooltip"
|
23
|
+
};
|
24
|
+
const TEXT = {
|
25
|
+
more: "More"
|
26
|
+
};
|
27
|
+
const ICONS = {
|
28
|
+
menu: "ellipsis"
|
29
|
+
};
|
30
|
+
|
31
|
+
const actionGroupCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:flex;flex-direction:column;padding:0px;--calcite-action-group-columns:3}:host([columns=\"1\"]){--calcite-action-group-columns:1}:host([columns=\"2\"]){--calcite-action-group-columns:2}:host([columns=\"3\"]){--calcite-action-group-columns:3}:host([columns=\"4\"]){--calcite-action-group-columns:4}:host([columns=\"5\"]){--calcite-action-group-columns:5}:host([columns=\"6\"]){--calcite-action-group-columns:6}:host(:first-child){-webkit-padding-before:0px;padding-block-start:0px}:host([layout=horizontal]){flex-direction:row}:host([layout=grid]){display:grid;place-content:stretch;gap:1px;background-color:var(--calcite-ui-background);padding:1px;grid-template-columns:repeat(var(--calcite-action-group-columns), auto)}";
|
32
|
+
|
33
|
+
const ActionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
34
|
+
constructor() {
|
35
|
+
super();
|
36
|
+
this.__registerHost();
|
37
|
+
this.__attachShadow();
|
38
|
+
// --------------------------------------------------------------------------
|
39
|
+
//
|
40
|
+
// Properties
|
41
|
+
//
|
42
|
+
// --------------------------------------------------------------------------
|
43
|
+
/**
|
44
|
+
* When `true`, the component is expanded.
|
45
|
+
*/
|
46
|
+
this.expanded = false;
|
47
|
+
/**
|
48
|
+
* Indicates the layout of the component.
|
49
|
+
*/
|
50
|
+
this.layout = "vertical";
|
51
|
+
/**
|
52
|
+
* When `true`, the `calcite-action-menu` is open.
|
53
|
+
*/
|
54
|
+
this.menuOpen = false;
|
55
|
+
// --------------------------------------------------------------------------
|
56
|
+
//
|
57
|
+
// Private Methods
|
58
|
+
//
|
59
|
+
// --------------------------------------------------------------------------
|
60
|
+
this.setMenuOpen = (event) => {
|
61
|
+
this.menuOpen = !!event.detail;
|
62
|
+
};
|
63
|
+
}
|
64
|
+
expandedHandler() {
|
65
|
+
this.menuOpen = false;
|
66
|
+
}
|
67
|
+
// --------------------------------------------------------------------------
|
68
|
+
//
|
69
|
+
// Lifecycle
|
70
|
+
//
|
71
|
+
// --------------------------------------------------------------------------
|
72
|
+
connectedCallback() {
|
73
|
+
connectConditionalSlotComponent(this);
|
74
|
+
}
|
75
|
+
disconnectedCallback() {
|
76
|
+
disconnectConditionalSlotComponent(this);
|
77
|
+
}
|
78
|
+
// --------------------------------------------------------------------------
|
79
|
+
//
|
80
|
+
// Component Methods
|
81
|
+
//
|
82
|
+
// --------------------------------------------------------------------------
|
83
|
+
renderTooltip() {
|
84
|
+
const { el } = this;
|
85
|
+
const hasTooltip = getSlotted(el, SLOTS.menuTooltip);
|
86
|
+
return hasTooltip ? h("slot", { name: SLOTS.menuTooltip, slot: SLOTS$1.tooltip }) : null;
|
87
|
+
}
|
88
|
+
renderMenu() {
|
89
|
+
const { el, expanded, intlMore, menuOpen, scale, layout } = this;
|
90
|
+
const hasMenuItems = getSlotted(el, SLOTS.menuActions);
|
91
|
+
return hasMenuItems ? (h("calcite-action-menu", { expanded: expanded, flipPlacements: ["left", "right"], label: intlMore || TEXT.more, onCalciteActionMenuOpenChange: this.setMenuOpen, open: menuOpen, placement: layout === "horizontal" ? "bottom-leading" : "leading-start", scale: scale }, h("calcite-action", { icon: ICONS.menu, scale: scale, slot: SLOTS$1.trigger, text: intlMore || TEXT.more, textEnabled: expanded }), h("slot", { name: SLOTS.menuActions }), this.renderTooltip())) : null;
|
92
|
+
}
|
93
|
+
render() {
|
94
|
+
return (h(Fragment, null, h("slot", null), this.renderMenu()));
|
95
|
+
}
|
96
|
+
get el() { return this; }
|
97
|
+
static get watchers() { return {
|
98
|
+
"expanded": ["expandedHandler"]
|
99
|
+
}; }
|
100
|
+
static get style() { return actionGroupCss; }
|
101
|
+
}, [1, "calcite-action-group", {
|
102
|
+
"expanded": [516],
|
103
|
+
"layout": [513],
|
104
|
+
"columns": [514],
|
105
|
+
"intlMore": [1, "intl-more"],
|
106
|
+
"menuOpen": [1540, "menu-open"],
|
107
|
+
"scale": [513]
|
108
|
+
}]);
|
109
|
+
function defineCustomElement() {
|
110
|
+
if (typeof customElements === "undefined") {
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
const components = ["calcite-action-group", "calcite-action", "calcite-action-menu", "calcite-icon", "calcite-loader", "calcite-popover"];
|
114
|
+
components.forEach(tagName => { switch (tagName) {
|
115
|
+
case "calcite-action-group":
|
116
|
+
if (!customElements.get(tagName)) {
|
117
|
+
customElements.define(tagName, ActionGroup);
|
118
|
+
}
|
119
|
+
break;
|
120
|
+
case "calcite-action":
|
121
|
+
if (!customElements.get(tagName)) {
|
122
|
+
defineCustomElement$5();
|
123
|
+
}
|
124
|
+
break;
|
125
|
+
case "calcite-action-menu":
|
126
|
+
if (!customElements.get(tagName)) {
|
127
|
+
defineCustomElement$4();
|
128
|
+
}
|
129
|
+
break;
|
130
|
+
case "calcite-icon":
|
131
|
+
if (!customElements.get(tagName)) {
|
132
|
+
defineCustomElement$3();
|
133
|
+
}
|
134
|
+
break;
|
135
|
+
case "calcite-loader":
|
136
|
+
if (!customElements.get(tagName)) {
|
137
|
+
defineCustomElement$2();
|
138
|
+
}
|
139
|
+
break;
|
140
|
+
case "calcite-popover":
|
141
|
+
if (!customElements.get(tagName)) {
|
142
|
+
defineCustomElement$1();
|
143
|
+
}
|
144
|
+
break;
|
145
|
+
} });
|
146
|
+
}
|
147
|
+
defineCustomElement();
|
148
|
+
|
149
|
+
export { ActionGroup as A, SLOTS as S, defineCustomElement as d };
|
@@ -0,0 +1,356 @@
|
|
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, Fragment } from '@stencil/core/internal/client';
|
7
|
+
import { t as toAriaBoolean, i as isPrimaryPointerButton, f as focusElement } from './dom.js';
|
8
|
+
import { g as getRoundRobinIndex } from './array.js';
|
9
|
+
import { g as guid } from './guid.js';
|
10
|
+
import { i as isActivationKey } from './key.js';
|
11
|
+
import { d as defineCustomElement$4 } from './action.js';
|
12
|
+
import { d as defineCustomElement$3 } from './icon.js';
|
13
|
+
import { d as defineCustomElement$2 } from './loader.js';
|
14
|
+
import { d as defineCustomElement$1 } from './popover.js';
|
15
|
+
|
16
|
+
/*!
|
17
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
18
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
19
|
+
* v1.0.0-beta.97
|
20
|
+
*/
|
21
|
+
const CSS = {
|
22
|
+
menu: "menu",
|
23
|
+
defaultTrigger: "default-trigger"
|
24
|
+
};
|
25
|
+
const SLOTS = {
|
26
|
+
tooltip: "tooltip",
|
27
|
+
trigger: "trigger"
|
28
|
+
};
|
29
|
+
const ICONS = {
|
30
|
+
menu: "ellipsis"
|
31
|
+
};
|
32
|
+
|
33
|
+
const actionMenuCss = "@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{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size-1);color:var(--calcite-ui-text-2)}.menu ::slotted(calcite-action){margin:0.125rem;display:flex;outline-color:transparent}.menu ::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{flex-direction:column;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}";
|
34
|
+
|
35
|
+
const SUPPORTED_MENU_NAV_KEYS = ["ArrowUp", "ArrowDown", "End", "Home"];
|
36
|
+
const ActionMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
37
|
+
constructor() {
|
38
|
+
super();
|
39
|
+
this.__registerHost();
|
40
|
+
this.__attachShadow();
|
41
|
+
this.calciteActionMenuOpenChange = createEvent(this, "calciteActionMenuOpenChange", 6);
|
42
|
+
// --------------------------------------------------------------------------
|
43
|
+
//
|
44
|
+
// Properties
|
45
|
+
//
|
46
|
+
// --------------------------------------------------------------------------
|
47
|
+
/**
|
48
|
+
* When `true`, the component is expanded.
|
49
|
+
*/
|
50
|
+
this.expanded = false;
|
51
|
+
/**
|
52
|
+
* When `true`, the component is open.
|
53
|
+
*/
|
54
|
+
this.open = false;
|
55
|
+
/**
|
56
|
+
* Determines the type of positioning to use for the overlaid content.
|
57
|
+
*
|
58
|
+
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
|
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
|
+
/**
|
64
|
+
* Determines where the component will be positioned relative to the `referenceElement`.
|
65
|
+
*
|
66
|
+
* @see [LogicalPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/floating-ui.ts#L25)
|
67
|
+
*/
|
68
|
+
this.placement = "auto";
|
69
|
+
this.actionElements = [];
|
70
|
+
this.guid = `calcite-action-menu-${guid()}`;
|
71
|
+
this.menuId = `${this.guid}-menu`;
|
72
|
+
this.menuButtonId = `${this.guid}-menu-button`;
|
73
|
+
this.activeMenuItemIndex = -1;
|
74
|
+
// --------------------------------------------------------------------------
|
75
|
+
//
|
76
|
+
// Component Methods
|
77
|
+
//
|
78
|
+
// --------------------------------------------------------------------------
|
79
|
+
this.connectMenuButtonEl = () => {
|
80
|
+
const { menuButtonId, menuId, open, label } = this;
|
81
|
+
const menuButtonEl = this.slottedMenuButtonEl || this.defaultMenuButtonEl;
|
82
|
+
if (this.menuButtonEl === menuButtonEl) {
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
this.disconnectMenuButtonEl();
|
86
|
+
this.menuButtonEl = menuButtonEl;
|
87
|
+
this.setTooltipReferenceElement();
|
88
|
+
if (!menuButtonEl) {
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
menuButtonEl.active = open;
|
92
|
+
menuButtonEl.setAttribute("aria-controls", menuId);
|
93
|
+
menuButtonEl.setAttribute("aria-expanded", toAriaBoolean(open));
|
94
|
+
menuButtonEl.setAttribute("aria-haspopup", "true");
|
95
|
+
if (!menuButtonEl.id) {
|
96
|
+
menuButtonEl.id = menuButtonId;
|
97
|
+
}
|
98
|
+
if (!menuButtonEl.label) {
|
99
|
+
menuButtonEl.label = label;
|
100
|
+
}
|
101
|
+
if (!menuButtonEl.text) {
|
102
|
+
menuButtonEl.text = label;
|
103
|
+
}
|
104
|
+
menuButtonEl.addEventListener("pointerdown", this.menuButtonClick);
|
105
|
+
menuButtonEl.addEventListener("keydown", this.menuButtonKeyDown);
|
106
|
+
};
|
107
|
+
this.disconnectMenuButtonEl = () => {
|
108
|
+
const { menuButtonEl } = this;
|
109
|
+
if (!menuButtonEl) {
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
menuButtonEl.removeEventListener("pointerdown", this.menuButtonClick);
|
113
|
+
menuButtonEl.removeEventListener("keydown", this.menuButtonKeyDown);
|
114
|
+
};
|
115
|
+
this.setMenuButtonEl = (event) => {
|
116
|
+
const actions = event.target
|
117
|
+
.assignedElements({
|
118
|
+
flatten: true
|
119
|
+
})
|
120
|
+
.filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-action"));
|
121
|
+
this.slottedMenuButtonEl = actions[0];
|
122
|
+
this.connectMenuButtonEl();
|
123
|
+
};
|
124
|
+
this.setDefaultMenuButtonEl = (el) => {
|
125
|
+
this.defaultMenuButtonEl = el;
|
126
|
+
this.connectMenuButtonEl();
|
127
|
+
};
|
128
|
+
// --------------------------------------------------------------------------
|
129
|
+
//
|
130
|
+
// Private Methods
|
131
|
+
//
|
132
|
+
// --------------------------------------------------------------------------
|
133
|
+
this.handleCalciteActionClick = () => {
|
134
|
+
this.open = false;
|
135
|
+
this.setFocus();
|
136
|
+
};
|
137
|
+
this.menuButtonClick = (event) => {
|
138
|
+
if (!isPrimaryPointerButton(event)) {
|
139
|
+
return;
|
140
|
+
}
|
141
|
+
this.toggleOpen();
|
142
|
+
};
|
143
|
+
this.updateTooltip = (event) => {
|
144
|
+
const tooltips = event.target
|
145
|
+
.assignedElements({
|
146
|
+
flatten: true
|
147
|
+
})
|
148
|
+
.filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-tooltip"));
|
149
|
+
this.tooltipEl = tooltips[0];
|
150
|
+
this.setTooltipReferenceElement();
|
151
|
+
};
|
152
|
+
this.setTooltipReferenceElement = () => {
|
153
|
+
const { tooltipEl, expanded, menuButtonEl, open } = this;
|
154
|
+
if (tooltipEl) {
|
155
|
+
tooltipEl.referenceElement = !expanded && !open ? menuButtonEl : null;
|
156
|
+
}
|
157
|
+
};
|
158
|
+
this.updateAction = (action, index) => {
|
159
|
+
const { guid, activeMenuItemIndex } = this;
|
160
|
+
const id = `${guid}-action-${index}`;
|
161
|
+
action.tabIndex = -1;
|
162
|
+
action.setAttribute("role", "menuitem");
|
163
|
+
if (!action.id) {
|
164
|
+
action.id = id;
|
165
|
+
}
|
166
|
+
action.active = index === activeMenuItemIndex;
|
167
|
+
};
|
168
|
+
this.updateActions = (actions) => {
|
169
|
+
actions === null || actions === void 0 ? void 0 : actions.forEach(this.updateAction);
|
170
|
+
};
|
171
|
+
this.handleDefaultSlotChange = (event) => {
|
172
|
+
const actions = event.target
|
173
|
+
.assignedElements({
|
174
|
+
flatten: true
|
175
|
+
})
|
176
|
+
.filter((el) => el === null || el === void 0 ? void 0 : el.matches("calcite-action"));
|
177
|
+
this.actionElements = actions;
|
178
|
+
};
|
179
|
+
this.menuButtonKeyDown = (event) => {
|
180
|
+
const { key } = event;
|
181
|
+
const { actionElements, activeMenuItemIndex, open } = this;
|
182
|
+
if (!actionElements.length) {
|
183
|
+
return;
|
184
|
+
}
|
185
|
+
if (isActivationKey(key)) {
|
186
|
+
event.preventDefault();
|
187
|
+
if (!open) {
|
188
|
+
this.toggleOpen();
|
189
|
+
return;
|
190
|
+
}
|
191
|
+
const action = actionElements[activeMenuItemIndex];
|
192
|
+
action ? action.click() : this.toggleOpen(false);
|
193
|
+
}
|
194
|
+
if (key === "Tab") {
|
195
|
+
this.open = false;
|
196
|
+
return;
|
197
|
+
}
|
198
|
+
if (key === "Escape") {
|
199
|
+
this.toggleOpen(false);
|
200
|
+
event.preventDefault();
|
201
|
+
return;
|
202
|
+
}
|
203
|
+
this.handleActionNavigation(event, key, actionElements);
|
204
|
+
};
|
205
|
+
this.handleActionNavigation = (event, key, actions) => {
|
206
|
+
if (!this.isValidKey(key, SUPPORTED_MENU_NAV_KEYS)) {
|
207
|
+
return;
|
208
|
+
}
|
209
|
+
event.preventDefault();
|
210
|
+
if (!this.open) {
|
211
|
+
this.toggleOpen();
|
212
|
+
if (key === "Home" || key === "ArrowDown") {
|
213
|
+
this.activeMenuItemIndex = 0;
|
214
|
+
}
|
215
|
+
if (key === "End" || key === "ArrowUp") {
|
216
|
+
this.activeMenuItemIndex = actions.length - 1;
|
217
|
+
}
|
218
|
+
return;
|
219
|
+
}
|
220
|
+
if (key === "Home") {
|
221
|
+
this.activeMenuItemIndex = 0;
|
222
|
+
}
|
223
|
+
if (key === "End") {
|
224
|
+
this.activeMenuItemIndex = actions.length - 1;
|
225
|
+
}
|
226
|
+
const currentIndex = this.activeMenuItemIndex;
|
227
|
+
if (key === "ArrowUp") {
|
228
|
+
this.activeMenuItemIndex = getRoundRobinIndex(Math.max(currentIndex - 1, -1), actions.length);
|
229
|
+
}
|
230
|
+
if (key === "ArrowDown") {
|
231
|
+
this.activeMenuItemIndex = getRoundRobinIndex(currentIndex + 1, actions.length);
|
232
|
+
}
|
233
|
+
};
|
234
|
+
this.toggleOpenEnd = () => {
|
235
|
+
this.setFocus();
|
236
|
+
this.el.removeEventListener("calcitePopoverOpen", this.toggleOpenEnd);
|
237
|
+
};
|
238
|
+
this.toggleOpen = (value = !this.open) => {
|
239
|
+
this.el.addEventListener("calcitePopoverOpen", this.toggleOpenEnd);
|
240
|
+
this.open = value;
|
241
|
+
};
|
242
|
+
}
|
243
|
+
// --------------------------------------------------------------------------
|
244
|
+
//
|
245
|
+
// Lifecycle
|
246
|
+
//
|
247
|
+
// --------------------------------------------------------------------------
|
248
|
+
disconnectedCallback() {
|
249
|
+
this.disconnectMenuButtonEl();
|
250
|
+
}
|
251
|
+
expandedHandler() {
|
252
|
+
this.open = false;
|
253
|
+
this.setTooltipReferenceElement();
|
254
|
+
}
|
255
|
+
openHandler(open) {
|
256
|
+
this.activeMenuItemIndex = this.open ? 0 : -1;
|
257
|
+
if (this.menuButtonEl) {
|
258
|
+
this.menuButtonEl.active = open;
|
259
|
+
}
|
260
|
+
this.calciteActionMenuOpenChange.emit(open);
|
261
|
+
this.setTooltipReferenceElement();
|
262
|
+
}
|
263
|
+
closeCalciteActionMenuOnClick(event) {
|
264
|
+
if (!isPrimaryPointerButton(event)) {
|
265
|
+
return;
|
266
|
+
}
|
267
|
+
const composedPath = event.composedPath();
|
268
|
+
if (composedPath.includes(this.el)) {
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
this.open = false;
|
272
|
+
}
|
273
|
+
activeMenuItemIndexHandler() {
|
274
|
+
this.updateActions(this.actionElements);
|
275
|
+
}
|
276
|
+
// --------------------------------------------------------------------------
|
277
|
+
//
|
278
|
+
// Methods
|
279
|
+
//
|
280
|
+
// --------------------------------------------------------------------------
|
281
|
+
/** Sets focus on the component. */
|
282
|
+
async setFocus() {
|
283
|
+
focusElement(this.menuButtonEl);
|
284
|
+
}
|
285
|
+
renderMenuButton() {
|
286
|
+
const { label, scale, expanded } = this;
|
287
|
+
const menuButtonSlot = (h("slot", { name: SLOTS.trigger, onSlotchange: this.setMenuButtonEl }, h("calcite-action", { class: CSS.defaultTrigger, icon: ICONS.menu, ref: this.setDefaultMenuButtonEl, scale: scale, text: label, textEnabled: expanded })));
|
288
|
+
return menuButtonSlot;
|
289
|
+
}
|
290
|
+
renderMenuItems() {
|
291
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
292
|
+
const activeAction = actionElements[activeMenuItemIndex];
|
293
|
+
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
294
|
+
return (h("calcite-popover", { disablePointer: true, flipPlacements: flipPlacements, label: label, offsetDistance: 0, open: open, overlayPositioning: overlayPositioning, placement: placement, referenceElement: menuButtonEl }, h("div", { "aria-activedescendant": activeDescendantId, "aria-labelledby": menuButtonEl === null || menuButtonEl === void 0 ? void 0 : menuButtonEl.id, class: CSS.menu, id: menuId, onClick: this.handleCalciteActionClick, role: "menu", tabIndex: -1 }, h("slot", { onSlotchange: this.handleDefaultSlotChange }))));
|
295
|
+
}
|
296
|
+
render() {
|
297
|
+
return (h(Fragment, null, this.renderMenuButton(), this.renderMenuItems(), h("slot", { name: SLOTS.tooltip, onSlotchange: this.updateTooltip })));
|
298
|
+
}
|
299
|
+
isValidKey(key, supportedKeys) {
|
300
|
+
return !!supportedKeys.find((k) => k === key);
|
301
|
+
}
|
302
|
+
get el() { return this; }
|
303
|
+
static get watchers() { return {
|
304
|
+
"expanded": ["expandedHandler"],
|
305
|
+
"open": ["openHandler"],
|
306
|
+
"activeMenuItemIndex": ["activeMenuItemIndexHandler"]
|
307
|
+
}; }
|
308
|
+
static get style() { return actionMenuCss; }
|
309
|
+
}, [1, "calcite-action-menu", {
|
310
|
+
"expanded": [516],
|
311
|
+
"flipPlacements": [16],
|
312
|
+
"label": [1],
|
313
|
+
"open": [1540],
|
314
|
+
"overlayPositioning": [513, "overlay-positioning"],
|
315
|
+
"placement": [513],
|
316
|
+
"scale": [513],
|
317
|
+
"menuButtonEl": [32],
|
318
|
+
"activeMenuItemIndex": [32],
|
319
|
+
"setFocus": [64]
|
320
|
+
}, [[9, "pointerdown", "closeCalciteActionMenuOnClick"]]]);
|
321
|
+
function defineCustomElement() {
|
322
|
+
if (typeof customElements === "undefined") {
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
const components = ["calcite-action-menu", "calcite-action", "calcite-icon", "calcite-loader", "calcite-popover"];
|
326
|
+
components.forEach(tagName => { switch (tagName) {
|
327
|
+
case "calcite-action-menu":
|
328
|
+
if (!customElements.get(tagName)) {
|
329
|
+
customElements.define(tagName, ActionMenu);
|
330
|
+
}
|
331
|
+
break;
|
332
|
+
case "calcite-action":
|
333
|
+
if (!customElements.get(tagName)) {
|
334
|
+
defineCustomElement$4();
|
335
|
+
}
|
336
|
+
break;
|
337
|
+
case "calcite-icon":
|
338
|
+
if (!customElements.get(tagName)) {
|
339
|
+
defineCustomElement$3();
|
340
|
+
}
|
341
|
+
break;
|
342
|
+
case "calcite-loader":
|
343
|
+
if (!customElements.get(tagName)) {
|
344
|
+
defineCustomElement$2();
|
345
|
+
}
|
346
|
+
break;
|
347
|
+
case "calcite-popover":
|
348
|
+
if (!customElements.get(tagName)) {
|
349
|
+
defineCustomElement$1();
|
350
|
+
}
|
351
|
+
break;
|
352
|
+
} });
|
353
|
+
}
|
354
|
+
defineCustomElement();
|
355
|
+
|
356
|
+
export { ActionMenu as A, SLOTS as S, defineCustomElement as d };
|