@esri/calcite-components 1.0.0-next.417 → 1.0.0-next.418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calcite/calcite.esm.js +1 -1
- package/dist/calcite/p-366004f7.system.entry.js +5 -0
- package/dist/calcite/p-5f6e35f3.entry.js +5 -0
- package/dist/calcite/{p-3ea157ba.system.entry.js → p-edf1e815.system.entry.js} +1 -1
- package/dist/calcite/p-fe9380a0.system.js +1 -1
- package/dist/cjs/calcite-action-menu.cjs.entry.js +2 -2
- package/dist/cjs/calcite-popover_2.cjs.entry.js +2 -1
- package/dist/collection/components/action-menu/action-menu.js +6 -6
- package/dist/collection/components/popover/popover.js +7 -7
- package/dist/collection/components/popover/resources.js +1 -0
- package/dist/components/action-menu.js +2 -2
- package/dist/components/popover.js +2 -2
- package/dist/components/resources.js +2 -1
- package/dist/custom-elements/index.js +4 -3
- package/dist/esm/calcite-action-menu.entry.js +2 -2
- package/dist/esm/calcite-popover_2.entry.js +2 -1
- package/dist/esm-es5/calcite-action-menu.entry.js +1 -1
- package/dist/esm-es5/calcite-popover_2.entry.js +1 -1
- package/dist/extras/docs-json.json +6 -6
- package/dist/types/components/action-menu/action-menu.d.ts +2 -3
- package/dist/types/components/popover/popover.d.ts +3 -3
- package/dist/types/components/popover/resources.d.ts +1 -0
- package/dist/types/components.d.ts +4 -5
- package/hydrate/index.js +4 -3
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/calcite/p-58adb34d.system.entry.js +0 -5
- package/dist/calcite/p-73d23656.entry.js +0 -5
|
@@ -263,10 +263,10 @@ export class ActionMenu {
|
|
|
263
263
|
return getSlotted(el, SLOTS.tooltip) ? (h("calcite-tooltip-manager", null, menuButtonSlot)) : (menuButtonSlot);
|
|
264
264
|
}
|
|
265
265
|
renderMenuItems() {
|
|
266
|
-
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning } = this;
|
|
266
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
|
267
267
|
const activeAction = actionElements[activeMenuItemIndex];
|
|
268
268
|
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
|
269
|
-
return (h("calcite-popover", { disablePointer: true, label: label, offsetDistance: 0, open: open, overlayPositioning: overlayPositioning, placement: placement, referenceElement: menuButtonEl },
|
|
269
|
+
return (h("calcite-popover", { disablePointer: true, flipPlacements: flipPlacements, label: label, offsetDistance: 0, open: open, overlayPositioning: overlayPositioning, placement: placement, referenceElement: menuButtonEl },
|
|
270
270
|
h("div", { "aria-activedescendant": activeDescendantId, "aria-labelledby": menuButtonEl === null || menuButtonEl === void 0 ? void 0 : menuButtonEl.id, class: CSS.menu, id: menuId, onClick: this.handleCalciteActionClick, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 },
|
|
271
271
|
h("slot", null))));
|
|
272
272
|
}
|
|
@@ -315,12 +315,12 @@ export class ActionMenu {
|
|
|
315
315
|
"type": "unknown",
|
|
316
316
|
"mutable": false,
|
|
317
317
|
"complexType": {
|
|
318
|
-
"original": "
|
|
319
|
-
"resolved": "
|
|
318
|
+
"original": "ComputedPlacement[]",
|
|
319
|
+
"resolved": "ComputedPlacement[]",
|
|
320
320
|
"references": {
|
|
321
|
-
"
|
|
321
|
+
"ComputedPlacement": {
|
|
322
322
|
"location": "import",
|
|
323
|
-
"path": "
|
|
323
|
+
"path": "../../utils/popper"
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
4
|
*/
|
|
5
5
|
import { Component, Element, Event, forceUpdate, Host, Method, Prop, State, Watch, h } from "@stencil/core";
|
|
6
|
-
import { CSS, ARIA_CONTROLS, ARIA_EXPANDED, HEADING_LEVEL, POPOVER_REFERENCE, TEXT } from "./resources";
|
|
6
|
+
import { CSS, ARIA_CONTROLS, ARIA_EXPANDED, HEADING_LEVEL, POPOVER_REFERENCE, TEXT, defaultPopoverPlacement } from "./resources";
|
|
7
7
|
import { defaultOffsetDistance, createPopper, updatePopper, CSS as PopperCSS } from "../../utils/popper";
|
|
8
8
|
import { guid } from "../../utils/guid";
|
|
9
9
|
import { queryElementRoots } from "../../utils/dom";
|
|
@@ -54,7 +54,7 @@ export class Popover {
|
|
|
54
54
|
* Determines where the component will be positioned relative to the referenceElement.
|
|
55
55
|
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
56
56
|
*/
|
|
57
|
-
this.placement =
|
|
57
|
+
this.placement = defaultPopoverPlacement;
|
|
58
58
|
/** Text for close button.
|
|
59
59
|
* @default "Close"
|
|
60
60
|
*/
|
|
@@ -364,12 +364,12 @@ export class Popover {
|
|
|
364
364
|
"type": "unknown",
|
|
365
365
|
"mutable": false,
|
|
366
366
|
"complexType": {
|
|
367
|
-
"original": "
|
|
368
|
-
"resolved": "
|
|
367
|
+
"original": "ComputedPlacement[]",
|
|
368
|
+
"resolved": "ComputedPlacement[]",
|
|
369
369
|
"references": {
|
|
370
|
-
"
|
|
370
|
+
"ComputedPlacement": {
|
|
371
371
|
"location": "import",
|
|
372
|
-
"path": "
|
|
372
|
+
"path": "../../utils/popper"
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
},
|
|
@@ -540,7 +540,7 @@ export class Popover {
|
|
|
540
540
|
},
|
|
541
541
|
"attribute": "placement",
|
|
542
542
|
"reflect": true,
|
|
543
|
-
"defaultValue": "
|
|
543
|
+
"defaultValue": "defaultPopoverPlacement"
|
|
544
544
|
},
|
|
545
545
|
"referenceElement": {
|
|
546
546
|
"type": "string",
|
|
@@ -17,6 +17,7 @@ export const CSS = {
|
|
|
17
17
|
export const TEXT = {
|
|
18
18
|
close: "Close"
|
|
19
19
|
};
|
|
20
|
+
export const defaultPopoverPlacement = "auto";
|
|
20
21
|
export const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
21
22
|
export const ARIA_CONTROLS = "aria-controls";
|
|
22
23
|
export const ARIA_EXPANDED = "aria-expanded";
|
|
@@ -279,10 +279,10 @@ const ActionMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
279
279
|
return getSlotted(el, SLOTS.tooltip) ? (h("calcite-tooltip-manager", null, menuButtonSlot)) : (menuButtonSlot);
|
|
280
280
|
}
|
|
281
281
|
renderMenuItems() {
|
|
282
|
-
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning } = this;
|
|
282
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
|
283
283
|
const activeAction = actionElements[activeMenuItemIndex];
|
|
284
284
|
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
|
285
|
-
return (h("calcite-popover", { disablePointer: true, 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, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
285
|
+
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, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
286
286
|
}
|
|
287
287
|
render() {
|
|
288
288
|
return (h(Fragment, null, this.renderMenuButton(), this.renderMenuItems(), h("slot", { name: SLOTS.tooltip })));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
4
|
*/
|
|
5
5
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
6
|
-
import { T as TEXT, A as ARIA_EXPANDED, P as POPOVER_REFERENCE, a as ARIA_CONTROLS, C as CSS, H as HEADING_LEVEL } from './resources.js';
|
|
6
|
+
import { d as defaultPopoverPlacement, T as TEXT, A as ARIA_EXPANDED, P as POPOVER_REFERENCE, a as ARIA_CONTROLS, C as CSS, H as HEADING_LEVEL } from './resources.js';
|
|
7
7
|
import { d as defaultOffsetDistance, u as updatePopper, c as createPopper, C as CSS$1 } from './popper.js';
|
|
8
8
|
import { g as guid } from './guid.js';
|
|
9
9
|
import { q as queryElementRoots } from './dom.js';
|
|
@@ -62,7 +62,7 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
62
62
|
* Determines where the component will be positioned relative to the referenceElement.
|
|
63
63
|
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
64
64
|
*/
|
|
65
|
-
this.placement =
|
|
65
|
+
this.placement = defaultPopoverPlacement;
|
|
66
66
|
/** Text for close button.
|
|
67
67
|
* @default "Close"
|
|
68
68
|
*/
|
|
@@ -17,9 +17,10 @@ const CSS = {
|
|
|
17
17
|
const TEXT = {
|
|
18
18
|
close: "Close"
|
|
19
19
|
};
|
|
20
|
+
const defaultPopoverPlacement = "auto";
|
|
20
21
|
const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
21
22
|
const ARIA_CONTROLS = "aria-controls";
|
|
22
23
|
const ARIA_EXPANDED = "aria-expanded";
|
|
23
24
|
const HEADING_LEVEL = 2;
|
|
24
25
|
|
|
25
|
-
export { ARIA_EXPANDED as A, CSS as C, HEADING_LEVEL as H, POPOVER_REFERENCE as P, TEXT as T, ARIA_CONTROLS as a };
|
|
26
|
+
export { ARIA_EXPANDED as A, CSS as C, HEADING_LEVEL as H, POPOVER_REFERENCE as P, TEXT as T, ARIA_CONTROLS as a, defaultPopoverPlacement as d };
|
|
@@ -2579,10 +2579,10 @@ const ActionMenu = class extends HTMLElement$1 {
|
|
|
2579
2579
|
return getSlotted(el, SLOTS$p.tooltip) ? (h("calcite-tooltip-manager", null, menuButtonSlot)) : (menuButtonSlot);
|
|
2580
2580
|
}
|
|
2581
2581
|
renderMenuItems() {
|
|
2582
|
-
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning } = this;
|
|
2582
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
|
2583
2583
|
const activeAction = actionElements[activeMenuItemIndex];
|
|
2584
2584
|
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
|
2585
|
-
return (h("calcite-popover", { disablePointer: true, 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$O.menu, id: menuId, onClick: this.handleCalciteActionClick, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
2585
|
+
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$O.menu, id: menuId, onClick: this.handleCalciteActionClick, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
2586
2586
|
}
|
|
2587
2587
|
render() {
|
|
2588
2588
|
return (h(Fragment, null, this.renderMenuButton(), this.renderMenuItems(), h("slot", { name: SLOTS$p.tooltip })));
|
|
@@ -16738,6 +16738,7 @@ const CSS$g = {
|
|
|
16738
16738
|
const TEXT$6 = {
|
|
16739
16739
|
close: "Close"
|
|
16740
16740
|
};
|
|
16741
|
+
const defaultPopoverPlacement = "auto";
|
|
16741
16742
|
const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
16742
16743
|
const ARIA_CONTROLS = "aria-controls";
|
|
16743
16744
|
const ARIA_EXPANDED = "aria-expanded";
|
|
@@ -16793,7 +16794,7 @@ const Popover = class extends HTMLElement$1 {
|
|
|
16793
16794
|
* Determines where the component will be positioned relative to the referenceElement.
|
|
16794
16795
|
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
16795
16796
|
*/
|
|
16796
|
-
this.placement =
|
|
16797
|
+
this.placement = defaultPopoverPlacement;
|
|
16797
16798
|
/** Text for close button.
|
|
16798
16799
|
* @default "Close"
|
|
16799
16800
|
*/
|
|
@@ -261,10 +261,10 @@ const ActionMenu = class {
|
|
|
261
261
|
return getSlotted(el, SLOTS.tooltip) ? (h("calcite-tooltip-manager", null, menuButtonSlot)) : (menuButtonSlot);
|
|
262
262
|
}
|
|
263
263
|
renderMenuItems() {
|
|
264
|
-
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning } = this;
|
|
264
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
|
265
265
|
const activeAction = actionElements[activeMenuItemIndex];
|
|
266
266
|
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
|
267
|
-
return (h("calcite-popover", { disablePointer: true, 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, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
267
|
+
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, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, h("slot", null))));
|
|
268
268
|
}
|
|
269
269
|
render() {
|
|
270
270
|
return (h(Fragment, null, this.renderMenuButton(), this.renderMenuItems(), h("slot", { name: SLOTS.tooltip })));
|
|
@@ -23,6 +23,7 @@ const CSS = {
|
|
|
23
23
|
const TEXT = {
|
|
24
24
|
close: "Close"
|
|
25
25
|
};
|
|
26
|
+
const defaultPopoverPlacement = "auto";
|
|
26
27
|
const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
27
28
|
const ARIA_CONTROLS = "aria-controls";
|
|
28
29
|
const ARIA_EXPANDED = "aria-expanded";
|
|
@@ -76,7 +77,7 @@ const Popover = class {
|
|
|
76
77
|
* Determines where the component will be positioned relative to the referenceElement.
|
|
77
78
|
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
78
79
|
*/
|
|
79
|
-
this.placement =
|
|
80
|
+
this.placement = defaultPopoverPlacement;
|
|
80
81
|
/** Text for close button.
|
|
81
82
|
* @default "Close"
|
|
82
83
|
*/
|
|
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(t,e,n,i){function o(t){return t ins
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
5
|
-
*/import{r as registerInstance,c as createEvent,h,F as Fragment,g as getElement}from"./index-bd94948c.js";import{C as CSS,I as ICONS,S as SLOTS}from"./resources-027bd8f9.js";import{g as getSlotted,f as focusElement}from"./dom-e7fa77b9.js";import{g as getRoundRobinIndex}from"./array-91a648e2.js";import{g as guid}from"./guid-196bd5ea.js";import{c as createObserver}from"./observers-46118290.js";import{c as connectConditionalSlotComponent,d as disconnectConditionalSlotComponent}from"./conditionalSlot-67f579ff.js";var actionMenuCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;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:-ms-flexbox;display:flex;outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}.menu{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}";var SUPPORTED_BUTTON_NAV_KEYS=["ArrowUp","ArrowDown"];var SUPPORTED_MENU_NAV_KEYS=["ArrowUp","ArrowDown","End","Home"];var ActionMenu=function(){function t(t){var e=this;registerInstance(this,t);this.calciteActionMenuOpenChange=createEvent(this,"calciteActionMenuOpenChange",7);this.expanded=false;this.open=false;this.overlayPositioning="absolute";this.placement="auto";this.actionElements=[];this.mutationObserver=createObserver("mutation",(function(){return e.getActions()}));this.guid="calcite-action-menu-".concat(guid());this.menuId="".concat(this.guid,"-menu");this.menuButtonId="".concat(this.guid,"-menu-button");this.activeMenuItemIndex=-1;this.connectMenuButtonEl=function(){var t=e,n=t.el,i=t.menuButtonId,o=t.menuId,a=t.open,r=t.label;var l=getSlotted(n,SLOTS.trigger)||e.defaultMenuButtonEl;if(e.menuButtonEl===l){return}e.disconnectMenuButtonEl();e.menuButtonEl=l;e.setTooltipReferenceElement();if(!l){return}l.active=a;l.setAttribute("aria-controls",o);l.setAttribute("aria-expanded",a.toString());l.setAttribute("aria-haspopup","true");if(!l.id){l.id=i}if(!l.label){l.label=r}if(!l.text){l.text=r}l.addEventListener("click",e.menuButtonClick);l.addEventListener("keydown",e.menuButtonKeyDown);l.addEventListener("keyup",e.menuButtonKeyUp)};this.disconnectMenuButtonEl=function(){var t=e.menuButtonEl;if(!t){return}t.removeEventListener("click",e.menuButtonClick);t.removeEventListener("keydown",e.menuButtonKeyDown);t.removeEventListener("keyup",e.menuButtonKeyUp)};this.setDefaultMenuButtonEl=function(t){e.defaultMenuButtonEl=t;e.connectMenuButtonEl()};this.handleCalciteActionClick=function(){e.open=false;e.setFocus()};this.menuButtonClick=function(){e.toggleOpen()};this.setTooltipReferenceElement=function(){var t=e,n=t.el,i=t.expanded,o=t.menuButtonEl;var a=getSlotted(n,SLOTS.tooltip);var r=(a===null||a===void 0?void 0:a.tagName)==="SLOT"?a.assignedElements()[0]:a;if((r===null||r===void 0?void 0:r.tagName)==="CALCITE-TOOLTIP"){r.referenceElement=!i?o:null}};this.updateAction=function(t,n){var i=e,o=i.guid,a=i.activeMenuItemIndex;var r="".concat(o,"-action-").concat(n);t.tabIndex=-1;t.setAttribute("role","menuitem");if(!t.id){t.id=r}t.active=n===a};this.updateActions=function(t){t===null||t===void 0?void 0:t.forEach(e.updateAction)};this.getActions=function(){var t=e.el;var n=getSlotted(t,{all:true,matches:"calcite-action"});e.updateActions(n);e.actionElements=n;e.connectMenuButtonEl()};this.menuButtonKeyUp=function(t){var n=t.key;var i=e.actionElements;if(!e.isValidKey(n,SUPPORTED_BUTTON_NAV_KEYS)){return}t.preventDefault();if(!i.length){return}e.toggleOpen(true);e.handleActionNavigation(n,i)};this.menuButtonKeyDown=function(t){var n=t.key;if(!e.isValidKey(n,SUPPORTED_BUTTON_NAV_KEYS)){return}t.preventDefault()};this.menuActionsContainerKeyDown=function(t){var n=t.key;var i=e,o=i.actionElements,a=i.activeMenuItemIndex;if(n==="Tab"){e.open=false;return}if(n===" "||n==="Enter"){t.preventDefault();var r=o[a];r?r.click():e.toggleOpen(false);return}if(e.isValidKey(n,SUPPORTED_MENU_NAV_KEYS)){t.preventDefault()}};this.menuActionsContainerKeyUp=function(t){var n=t.key;var i=e.actionElements;if(n==="Escape"){e.toggleOpen(false);return}if(!e.isValidKey(n,SUPPORTED_MENU_NAV_KEYS)){return}t.preventDefault();if(!i.length){return}e.handleActionNavigation(n,i)};this.handleActionNavigation=function(t,n){var i=e.activeMenuItemIndex;if(t==="Home"){e.activeMenuItemIndex=0}if(t==="End"){e.activeMenuItemIndex=n.length-1}if(t==="ArrowUp"){e.activeMenuItemIndex=getRoundRobinIndex(Math.max(i-1,-1),n.length)}if(t==="ArrowDown"){e.activeMenuItemIndex=getRoundRobinIndex(i+1,n.length)}};this.toggleOpenEnd=function(){e.setFocus();e.el.removeEventListener("calcitePopoverOpen",e.toggleOpenEnd)};this.toggleOpen=function(t){if(t===void 0){t=!e.open}e.el.addEventListener("calcitePopoverOpen",e.toggleOpenEnd);e.open=t}}t.prototype.connectedCallback=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.observe(this.el,{childList:true,subtree:true});this.getActions();connectConditionalSlotComponent(this)};t.prototype.disconnectedCallback=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.disconnect();this.disconnectMenuButtonEl();disconnectConditionalSlotComponent(this)};t.prototype.expandedHandler=function(){this.open=false;this.setTooltipReferenceElement()};t.prototype.openHandler=function(t){this.activeMenuItemIndex=this.open?0:-1;if(this.menuButtonEl){this.menuButtonEl.active=t}this.calciteActionMenuOpenChange.emit(t)};t.prototype.closeCalciteActionMenuOnClick=function(t){var e=t.composedPath();if(e.includes(this.el)){return}this.open=false};t.prototype.activeMenuItemIndexHandler=function(){this.updateActions(this.actionElements)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){focusElement(this.open?this.menuEl:this.menuButtonEl);return[2]}))}))};t.prototype.renderMenuButton=function(){var t=this,e=t.el,n=t.label,i=t.scale;var o=h("slot",{name:SLOTS.trigger},h("calcite-action",{class:CSS.defaultTrigger,icon:ICONS.menu,ref:this.setDefaultMenuButtonEl,scale:i,text:n}));return getSlotted(e,SLOTS.tooltip)?h("calcite-tooltip-manager",null,o):o};t.prototype.renderMenuItems=function(){var t=this;var e=this,n=e.actionElements,i=e.activeMenuItemIndex,o=e.open,a=e.menuId,r=e.menuButtonEl,l=e.label,c=e.placement,s=e.overlayPositioning;var u=n[i];var m=(u===null||u===void 0?void 0:u.id)||null;return h("calcite-popover",{disablePointer:true,label:l,offsetDistance:0,open:o,overlayPositioning:s,placement:c,referenceElement:r},h("div",{"aria-activedescendant":m,"aria-labelledby":r===null||r===void 0?void 0:r.id,class:CSS.menu,id:a,onClick:this.handleCalciteActionClick,onKeyDown:this.menuActionsContainerKeyDown,onKeyUp:this.menuActionsContainerKeyUp,ref:function(e){return t.menuEl=e},role:"menu",tabIndex:-1},h("slot",null)))};t.prototype.render=function(){return h(Fragment,null,this.renderMenuButton(),this.renderMenuItems(),h("slot",{name:SLOTS.tooltip}))};t.prototype.getAssignedElements=function(){return Array.from(this.el.querySelectorAll("slot")).map((function(t){return t.assignedElements({flatten:true})})).reduce((function(t,e){return t.concat(e)}),[])};t.prototype.isValidKey=function(t,e){return!!e.find((function(e){return e===t}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}},enumerable:false,configurable:true});return t}();ActionMenu.style=actionMenuCss;export{ActionMenu as calcite_action_menu};
|
|
5
|
+
*/import{r as registerInstance,c as createEvent,h,F as Fragment,g as getElement}from"./index-bd94948c.js";import{C as CSS,I as ICONS,S as SLOTS}from"./resources-027bd8f9.js";import{g as getSlotted,f as focusElement}from"./dom-e7fa77b9.js";import{g as getRoundRobinIndex}from"./array-91a648e2.js";import{g as guid}from"./guid-196bd5ea.js";import{c as createObserver}from"./observers-46118290.js";import{c as connectConditionalSlotComponent,d as disconnectConditionalSlotComponent}from"./conditionalSlot-67f579ff.js";var actionMenuCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;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:-ms-flexbox;display:flex;outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}.menu{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}";var SUPPORTED_BUTTON_NAV_KEYS=["ArrowUp","ArrowDown"];var SUPPORTED_MENU_NAV_KEYS=["ArrowUp","ArrowDown","End","Home"];var ActionMenu=function(){function t(t){var e=this;registerInstance(this,t);this.calciteActionMenuOpenChange=createEvent(this,"calciteActionMenuOpenChange",7);this.expanded=false;this.open=false;this.overlayPositioning="absolute";this.placement="auto";this.actionElements=[];this.mutationObserver=createObserver("mutation",(function(){return e.getActions()}));this.guid="calcite-action-menu-".concat(guid());this.menuId="".concat(this.guid,"-menu");this.menuButtonId="".concat(this.guid,"-menu-button");this.activeMenuItemIndex=-1;this.connectMenuButtonEl=function(){var t=e,n=t.el,i=t.menuButtonId,o=t.menuId,a=t.open,r=t.label;var l=getSlotted(n,SLOTS.trigger)||e.defaultMenuButtonEl;if(e.menuButtonEl===l){return}e.disconnectMenuButtonEl();e.menuButtonEl=l;e.setTooltipReferenceElement();if(!l){return}l.active=a;l.setAttribute("aria-controls",o);l.setAttribute("aria-expanded",a.toString());l.setAttribute("aria-haspopup","true");if(!l.id){l.id=i}if(!l.label){l.label=r}if(!l.text){l.text=r}l.addEventListener("click",e.menuButtonClick);l.addEventListener("keydown",e.menuButtonKeyDown);l.addEventListener("keyup",e.menuButtonKeyUp)};this.disconnectMenuButtonEl=function(){var t=e.menuButtonEl;if(!t){return}t.removeEventListener("click",e.menuButtonClick);t.removeEventListener("keydown",e.menuButtonKeyDown);t.removeEventListener("keyup",e.menuButtonKeyUp)};this.setDefaultMenuButtonEl=function(t){e.defaultMenuButtonEl=t;e.connectMenuButtonEl()};this.handleCalciteActionClick=function(){e.open=false;e.setFocus()};this.menuButtonClick=function(){e.toggleOpen()};this.setTooltipReferenceElement=function(){var t=e,n=t.el,i=t.expanded,o=t.menuButtonEl;var a=getSlotted(n,SLOTS.tooltip);var r=(a===null||a===void 0?void 0:a.tagName)==="SLOT"?a.assignedElements()[0]:a;if((r===null||r===void 0?void 0:r.tagName)==="CALCITE-TOOLTIP"){r.referenceElement=!i?o:null}};this.updateAction=function(t,n){var i=e,o=i.guid,a=i.activeMenuItemIndex;var r="".concat(o,"-action-").concat(n);t.tabIndex=-1;t.setAttribute("role","menuitem");if(!t.id){t.id=r}t.active=n===a};this.updateActions=function(t){t===null||t===void 0?void 0:t.forEach(e.updateAction)};this.getActions=function(){var t=e.el;var n=getSlotted(t,{all:true,matches:"calcite-action"});e.updateActions(n);e.actionElements=n;e.connectMenuButtonEl()};this.menuButtonKeyUp=function(t){var n=t.key;var i=e.actionElements;if(!e.isValidKey(n,SUPPORTED_BUTTON_NAV_KEYS)){return}t.preventDefault();if(!i.length){return}e.toggleOpen(true);e.handleActionNavigation(n,i)};this.menuButtonKeyDown=function(t){var n=t.key;if(!e.isValidKey(n,SUPPORTED_BUTTON_NAV_KEYS)){return}t.preventDefault()};this.menuActionsContainerKeyDown=function(t){var n=t.key;var i=e,o=i.actionElements,a=i.activeMenuItemIndex;if(n==="Tab"){e.open=false;return}if(n===" "||n==="Enter"){t.preventDefault();var r=o[a];r?r.click():e.toggleOpen(false);return}if(e.isValidKey(n,SUPPORTED_MENU_NAV_KEYS)){t.preventDefault()}};this.menuActionsContainerKeyUp=function(t){var n=t.key;var i=e.actionElements;if(n==="Escape"){e.toggleOpen(false);return}if(!e.isValidKey(n,SUPPORTED_MENU_NAV_KEYS)){return}t.preventDefault();if(!i.length){return}e.handleActionNavigation(n,i)};this.handleActionNavigation=function(t,n){var i=e.activeMenuItemIndex;if(t==="Home"){e.activeMenuItemIndex=0}if(t==="End"){e.activeMenuItemIndex=n.length-1}if(t==="ArrowUp"){e.activeMenuItemIndex=getRoundRobinIndex(Math.max(i-1,-1),n.length)}if(t==="ArrowDown"){e.activeMenuItemIndex=getRoundRobinIndex(i+1,n.length)}};this.toggleOpenEnd=function(){e.setFocus();e.el.removeEventListener("calcitePopoverOpen",e.toggleOpenEnd)};this.toggleOpen=function(t){if(t===void 0){t=!e.open}e.el.addEventListener("calcitePopoverOpen",e.toggleOpenEnd);e.open=t}}t.prototype.connectedCallback=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.observe(this.el,{childList:true,subtree:true});this.getActions();connectConditionalSlotComponent(this)};t.prototype.disconnectedCallback=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.disconnect();this.disconnectMenuButtonEl();disconnectConditionalSlotComponent(this)};t.prototype.expandedHandler=function(){this.open=false;this.setTooltipReferenceElement()};t.prototype.openHandler=function(t){this.activeMenuItemIndex=this.open?0:-1;if(this.menuButtonEl){this.menuButtonEl.active=t}this.calciteActionMenuOpenChange.emit(t)};t.prototype.closeCalciteActionMenuOnClick=function(t){var e=t.composedPath();if(e.includes(this.el)){return}this.open=false};t.prototype.activeMenuItemIndexHandler=function(){this.updateActions(this.actionElements)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){focusElement(this.open?this.menuEl:this.menuButtonEl);return[2]}))}))};t.prototype.renderMenuButton=function(){var t=this,e=t.el,n=t.label,i=t.scale;var o=h("slot",{name:SLOTS.trigger},h("calcite-action",{class:CSS.defaultTrigger,icon:ICONS.menu,ref:this.setDefaultMenuButtonEl,scale:i,text:n}));return getSlotted(e,SLOTS.tooltip)?h("calcite-tooltip-manager",null,o):o};t.prototype.renderMenuItems=function(){var t=this;var e=this,n=e.actionElements,i=e.activeMenuItemIndex,o=e.open,a=e.menuId,r=e.menuButtonEl,l=e.label,c=e.placement,s=e.overlayPositioning,u=e.flipPlacements;var m=n[i];var f=(m===null||m===void 0?void 0:m.id)||null;return h("calcite-popover",{disablePointer:true,flipPlacements:u,label:l,offsetDistance:0,open:o,overlayPositioning:s,placement:c,referenceElement:r},h("div",{"aria-activedescendant":f,"aria-labelledby":r===null||r===void 0?void 0:r.id,class:CSS.menu,id:a,onClick:this.handleCalciteActionClick,onKeyDown:this.menuActionsContainerKeyDown,onKeyUp:this.menuActionsContainerKeyUp,ref:function(e){return t.menuEl=e},role:"menu",tabIndex:-1},h("slot",null)))};t.prototype.render=function(){return h(Fragment,null,this.renderMenuButton(),this.renderMenuItems(),h("slot",{name:SLOTS.tooltip}))};t.prototype.getAssignedElements=function(){return Array.from(this.el.querySelectorAll("slot")).map((function(t){return t.assignedElements({flatten:true})})).reduce((function(t,e){return t.concat(e)}),[])};t.prototype.isValidKey=function(t,e){return!!e.find((function(e){return e===t}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}},enumerable:false,configurable:true});return t}();ActionMenu.style=actionMenuCss;export{ActionMenu as calcite_action_menu};
|
|
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(e,t,a,r){function n(e){return e ins
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
5
|
-
*/import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,g as getElement}from"./index-bd94948c.js";import{a as defaultOffsetDistance,u as updatePopper,c as createPopper,C as CSS$1}from"./popper-da45ec93.js";import{g as guid}from"./guid-196bd5ea.js";import{q as queryElementRoots,h as queryElementsRoots}from"./dom-e7fa77b9.js";import{H as Heading}from"./Heading-d5f1710a.js";var CSS={container:"container",arrow:"arrow",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"};var TEXT={close:"Close"};var POPOVER_REFERENCE="data-calcite-popover-reference";var ARIA_CONTROLS="aria-controls";var ARIA_EXPANDED="aria-expanded";var HEADING_LEVEL=2;var popoverCss='@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:900;-webkit-transform:scale(0);transform:scale(0)}.calcite-popper-anim{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}:host([data-popper-placement^=bottom]) .calcite-popper-anim{-webkit-transform:translateY(-5px);transform:translateY(-5px)}:host([data-popper-placement^=top]) .calcite-popper-anim{-webkit-transform:translateY(5px);transform:translateY(5px)}:host([data-popper-placement^=left]) .calcite-popper-anim{-webkit-transform:translateX(5px);transform:translateX(5px)}:host([data-popper-placement^=right]) .calcite-popper-anim{-webkit-transform:translateX(-5px);transform:translateX(-5px)}:host([data-popper-placement]) .calcite-popper-anim--active{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}:host([data-popper-placement][data-popper-escaped]),:host([data-popper-placement][data-popper-reference-hidden]){pointer-events:none;opacity:0}.arrow,.arrow::before{position:absolute;width:8px;height:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-popper-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:start;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-bottom-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-item-align:center;align-self:center;white-space:normal;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{-ms-flex-direction:column;flex-direction:column}.content{display:-ms-flexbox;display:flex;height:100%;width:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-item-align:center;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex:0 0 auto;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}';var Popover=function(){function e(e){var t=this;registerInstance(this,e);this.calcitePopoverClose=createEvent(this,"calcitePopoverClose",7);this.calcitePopoverOpen=createEvent(this,"calcitePopoverOpen",7);this.closeButton=false;this.dismissible=false;this.disableFlip=false;this.disablePointer=false;this.offsetDistance=defaultOffsetDistance;this.offsetSkidding=0;this.open=false;this.overlayPositioning="absolute";this.placement="auto";this.intlClose=TEXT.close;this.guid="calcite-popover-".concat(guid());this.activeTransitionProp="opacity";this.setUpReferenceElement=function(){t.removeReferences();t.effectiveReferenceElement=t.getReferenceElement();var e=t,a=e.el,r=e.referenceElement,n=e.effectiveReferenceElement;if(r&&!n){console.warn("".concat(a.tagName,': reference-element id "').concat(r,'" was not found.'),{el:a})}t.addReferences();t.createPopper()};this.getId=function(){return t.el.id||t.guid};this.setExpandedAttr=function(){var e=t,a=e.effectiveReferenceElement,r=e.open;if(!a){return}a.setAttribute(ARIA_EXPANDED,r.toString())};this.addReferences=function(){var e=t.effectiveReferenceElement;if(!e){return}var a=t.getId();e.setAttribute(POPOVER_REFERENCE,a);e.setAttribute(ARIA_CONTROLS,a);t.setExpandedAttr()};this.removeReferences=function(){var e=t.effectiveReferenceElement;if(!e){return}e.removeAttribute(POPOVER_REFERENCE);e.removeAttribute(ARIA_CONTROLS);e.removeAttribute(ARIA_EXPANDED)};this.hide=function(){t.open=false};this.transitionEnd=function(e){if(e.propertyName===t.activeTransitionProp){t.open?t.calcitePopoverOpen.emit():t.calcitePopoverClose.emit()}}}e.prototype.offsetDistanceOffsetHandler=function(){this.reposition()};e.prototype.offsetSkiddingHandler=function(){this.reposition()};e.prototype.openHandler=function(){this.reposition();this.setExpandedAttr()};e.prototype.placementHandler=function(){this.reposition()};e.prototype.referenceElementHandler=function(){this.setUpReferenceElement()};e.prototype.componentWillLoad=function(){this.setUpReferenceElement()};e.prototype.componentDidLoad=function(){this.reposition()};e.prototype.disconnectedCallback=function(){this.removeReferences();this.destroyPopper()};e.prototype.reposition=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,a,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:e=this,t=e.popper,a=e.el,r=e.placement;n=this.getModifiers();if(!t)return[3,2];return[4,updatePopper({el:a,modifiers:n,placement:r,popper:t})];case 1:i=o.sent();return[3,3];case 2:i=this.createPopper();o.label=3;case 3:i;return[2]}}))}))};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a;return __generator(this,(function(r){a=this.closeButtonEl;if(e==="close-button"&&a){forceUpdate(a);a.setFocus();return[2]}(t=this.el)===null||t===void 0?void 0:t.focus();return[2]}))}))};e.prototype.toggle=function(e){if(e===void 0){e=!this.open}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=e;return[2]}))}))};e.prototype.getReferenceElement=function(){var e=this,t=e.referenceElement,a=e.el;return(typeof t==="string"?queryElementRoots(a,{id:t}):t)||null};e.prototype.getModifiers=function(){var e=this,t=e.arrowEl,a=e.flipPlacements,r=e.disableFlip,n=e.disablePointer,i=e.offsetDistance,o=e.offsetSkidding;var s={name:"flip",enabled:!r};if(a){s.options={fallbackPlacements:a}}var l={name:"arrow",enabled:!n};if(t){l.options={element:t}}var c={name:"offset",enabled:true,options:{offset:[o,i]}};var p={name:"eventListeners",enabled:this.open};return[l,s,c,p]};e.prototype.createPopper=function(){this.destroyPopper();var e=this,t=e.el,a=e.placement,r=e.effectiveReferenceElement,n=e.overlayPositioning;var i=this.getModifiers();this.popper=createPopper({el:t,modifiers:i,overlayPositioning:n,placement:a,referenceEl:r})};e.prototype.destroyPopper=function(){var e=this.popper;if(e){e.destroy()}this.popper=null};e.prototype.renderCloseButton=function(){var e=this;var t=this,a=t.dismissible,r=t.closeButton,n=t.intlClose;return a||r?h("div",{class:CSS.closeButtonContainer},h("calcite-action",{class:CSS.closeButton,onClick:this.hide,ref:function(t){return e.closeButtonEl=t},text:n},h("calcite-icon",{icon:"x",scale:"m"}))):null};e.prototype.renderHeader=function(){var e=this,t=e.heading,a=e.headingLevel;var r=t?h(Heading,{class:CSS.heading,level:a||HEADING_LEVEL},t):null;return r?h("div",{class:CSS.header},r,this.renderCloseButton()):null};e.prototype.render=function(){var e,t;var a=this;var r=this,n=r.effectiveReferenceElement,i=r.heading,o=r.label,s=r.open,l=r.disablePointer;var c=n&&s;var p=!c;var f=!l?h("div",{class:CSS.arrow,ref:function(e){return a.arrowEl=e}}):null;return h(Host,{"aria-hidden":p.toString(),"aria-label":o,"calcite-hydrated-hidden":p,id:this.getId(),role:"dialog"},h("div",{class:(e={},e[CSS$1.animation]=true,e[CSS$1.animationActive]=c,e),onTransitionEnd:this.transitionEnd},f,h("div",{class:(t={},t[CSS.hasHeader]=!!i,t[CSS.container]=true,t)},this.renderHeader(),h("div",{class:CSS.content},h("slot",null)),!i?this.renderCloseButton():null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}},enumerable:false,configurable:true});return e}();Popover.style=popoverCss;var popoverManagerCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:block}";var PopoverManager=function(){function e(e){var t=this;registerInstance(this,e);this.selector="[".concat(POPOVER_REFERENCE,"]");this.autoClose=false;this.queryPopover=function(e){var a=t.el;if(!e.includes(a)){return null}var r=e.find((function(e){var t;return(t=e===null||e===void 0?void 0:e.hasAttribute)===null||t===void 0?void 0:t.call(e,POPOVER_REFERENCE)}));if(!r){return null}var n=r.getAttribute(POPOVER_REFERENCE);return queryElementRoots(a,{id:n})}}e.prototype.render=function(){return h("slot",null)};e.prototype.closeOpenPopovers=function(e){var t=this,a=t.autoClose,r=t.el;var n="calcite-popover";var i=e.composedPath();var o=this.queryPopover(i);if(o){o.toggle();return}if(a){queryElementsRoots(r,n).filter((function(e){return e.open&&!i.includes(e)})).forEach((function(e){return e.toggle(false)}))}};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PopoverManager.style=popoverManagerCss;export{Popover as calcite_popover,PopoverManager as calcite_popover_manager};
|
|
5
|
+
*/import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,g as getElement}from"./index-bd94948c.js";import{a as defaultOffsetDistance,u as updatePopper,c as createPopper,C as CSS$1}from"./popper-da45ec93.js";import{g as guid}from"./guid-196bd5ea.js";import{q as queryElementRoots,h as queryElementsRoots}from"./dom-e7fa77b9.js";import{H as Heading}from"./Heading-d5f1710a.js";var CSS={container:"container",arrow:"arrow",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"};var TEXT={close:"Close"};var defaultPopoverPlacement="auto";var POPOVER_REFERENCE="data-calcite-popover-reference";var ARIA_CONTROLS="aria-controls";var ARIA_EXPANDED="aria-expanded";var HEADING_LEVEL=2;var popoverCss='@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:900;-webkit-transform:scale(0);transform:scale(0)}.calcite-popper-anim{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}:host([data-popper-placement^=bottom]) .calcite-popper-anim{-webkit-transform:translateY(-5px);transform:translateY(-5px)}:host([data-popper-placement^=top]) .calcite-popper-anim{-webkit-transform:translateY(5px);transform:translateY(5px)}:host([data-popper-placement^=left]) .calcite-popper-anim{-webkit-transform:translateX(5px);transform:translateX(5px)}:host([data-popper-placement^=right]) .calcite-popper-anim{-webkit-transform:translateX(-5px);transform:translateX(-5px)}:host([data-popper-placement]) .calcite-popper-anim--active{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}:host([data-popper-placement][data-popper-escaped]),:host([data-popper-placement][data-popper-reference-hidden]){pointer-events:none;opacity:0}.arrow,.arrow::before{position:absolute;width:8px;height:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-popper-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:start;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-bottom-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-item-align:center;align-self:center;white-space:normal;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{-ms-flex-direction:column;flex-direction:column}.content{display:-ms-flexbox;display:flex;height:100%;width:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-item-align:center;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex:0 0 auto;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}';var Popover=function(){function e(e){var t=this;registerInstance(this,e);this.calcitePopoverClose=createEvent(this,"calcitePopoverClose",7);this.calcitePopoverOpen=createEvent(this,"calcitePopoverOpen",7);this.closeButton=false;this.dismissible=false;this.disableFlip=false;this.disablePointer=false;this.offsetDistance=defaultOffsetDistance;this.offsetSkidding=0;this.open=false;this.overlayPositioning="absolute";this.placement=defaultPopoverPlacement;this.intlClose=TEXT.close;this.guid="calcite-popover-".concat(guid());this.activeTransitionProp="opacity";this.setUpReferenceElement=function(){t.removeReferences();t.effectiveReferenceElement=t.getReferenceElement();var e=t,a=e.el,r=e.referenceElement,n=e.effectiveReferenceElement;if(r&&!n){console.warn("".concat(a.tagName,': reference-element id "').concat(r,'" was not found.'),{el:a})}t.addReferences();t.createPopper()};this.getId=function(){return t.el.id||t.guid};this.setExpandedAttr=function(){var e=t,a=e.effectiveReferenceElement,r=e.open;if(!a){return}a.setAttribute(ARIA_EXPANDED,r.toString())};this.addReferences=function(){var e=t.effectiveReferenceElement;if(!e){return}var a=t.getId();e.setAttribute(POPOVER_REFERENCE,a);e.setAttribute(ARIA_CONTROLS,a);t.setExpandedAttr()};this.removeReferences=function(){var e=t.effectiveReferenceElement;if(!e){return}e.removeAttribute(POPOVER_REFERENCE);e.removeAttribute(ARIA_CONTROLS);e.removeAttribute(ARIA_EXPANDED)};this.hide=function(){t.open=false};this.transitionEnd=function(e){if(e.propertyName===t.activeTransitionProp){t.open?t.calcitePopoverOpen.emit():t.calcitePopoverClose.emit()}}}e.prototype.offsetDistanceOffsetHandler=function(){this.reposition()};e.prototype.offsetSkiddingHandler=function(){this.reposition()};e.prototype.openHandler=function(){this.reposition();this.setExpandedAttr()};e.prototype.placementHandler=function(){this.reposition()};e.prototype.referenceElementHandler=function(){this.setUpReferenceElement()};e.prototype.componentWillLoad=function(){this.setUpReferenceElement()};e.prototype.componentDidLoad=function(){this.reposition()};e.prototype.disconnectedCallback=function(){this.removeReferences();this.destroyPopper()};e.prototype.reposition=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,a,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:e=this,t=e.popper,a=e.el,r=e.placement;n=this.getModifiers();if(!t)return[3,2];return[4,updatePopper({el:a,modifiers:n,placement:r,popper:t})];case 1:i=o.sent();return[3,3];case 2:i=this.createPopper();o.label=3;case 3:i;return[2]}}))}))};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a;return __generator(this,(function(r){a=this.closeButtonEl;if(e==="close-button"&&a){forceUpdate(a);a.setFocus();return[2]}(t=this.el)===null||t===void 0?void 0:t.focus();return[2]}))}))};e.prototype.toggle=function(e){if(e===void 0){e=!this.open}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=e;return[2]}))}))};e.prototype.getReferenceElement=function(){var e=this,t=e.referenceElement,a=e.el;return(typeof t==="string"?queryElementRoots(a,{id:t}):t)||null};e.prototype.getModifiers=function(){var e=this,t=e.arrowEl,a=e.flipPlacements,r=e.disableFlip,n=e.disablePointer,i=e.offsetDistance,o=e.offsetSkidding;var s={name:"flip",enabled:!r};if(a){s.options={fallbackPlacements:a}}var l={name:"arrow",enabled:!n};if(t){l.options={element:t}}var c={name:"offset",enabled:true,options:{offset:[o,i]}};var p={name:"eventListeners",enabled:this.open};return[l,s,c,p]};e.prototype.createPopper=function(){this.destroyPopper();var e=this,t=e.el,a=e.placement,r=e.effectiveReferenceElement,n=e.overlayPositioning;var i=this.getModifiers();this.popper=createPopper({el:t,modifiers:i,overlayPositioning:n,placement:a,referenceEl:r})};e.prototype.destroyPopper=function(){var e=this.popper;if(e){e.destroy()}this.popper=null};e.prototype.renderCloseButton=function(){var e=this;var t=this,a=t.dismissible,r=t.closeButton,n=t.intlClose;return a||r?h("div",{class:CSS.closeButtonContainer},h("calcite-action",{class:CSS.closeButton,onClick:this.hide,ref:function(t){return e.closeButtonEl=t},text:n},h("calcite-icon",{icon:"x",scale:"m"}))):null};e.prototype.renderHeader=function(){var e=this,t=e.heading,a=e.headingLevel;var r=t?h(Heading,{class:CSS.heading,level:a||HEADING_LEVEL},t):null;return r?h("div",{class:CSS.header},r,this.renderCloseButton()):null};e.prototype.render=function(){var e,t;var a=this;var r=this,n=r.effectiveReferenceElement,i=r.heading,o=r.label,s=r.open,l=r.disablePointer;var c=n&&s;var p=!c;var f=!l?h("div",{class:CSS.arrow,ref:function(e){return a.arrowEl=e}}):null;return h(Host,{"aria-hidden":p.toString(),"aria-label":o,"calcite-hydrated-hidden":p,id:this.getId(),role:"dialog"},h("div",{class:(e={},e[CSS$1.animation]=true,e[CSS$1.animationActive]=c,e),onTransitionEnd:this.transitionEnd},f,h("div",{class:(t={},t[CSS.hasHeader]=!!i,t[CSS.container]=true,t)},this.renderHeader(),h("div",{class:CSS.content},h("slot",null)),!i?this.renderCloseButton():null)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}},enumerable:false,configurable:true});return e}();Popover.style=popoverCss;var popoverManagerCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:block}";var PopoverManager=function(){function e(e){var t=this;registerInstance(this,e);this.selector="[".concat(POPOVER_REFERENCE,"]");this.autoClose=false;this.queryPopover=function(e){var a=t.el;if(!e.includes(a)){return null}var r=e.find((function(e){var t;return(t=e===null||e===void 0?void 0:e.hasAttribute)===null||t===void 0?void 0:t.call(e,POPOVER_REFERENCE)}));if(!r){return null}var n=r.getAttribute(POPOVER_REFERENCE);return queryElementRoots(a,{id:n})}}e.prototype.render=function(){return h("slot",null)};e.prototype.closeOpenPopovers=function(e){var t=this,a=t.autoClose,r=t.el;var n="calcite-popover";var i=e.composedPath();var o=this.queryPopover(i);if(o){o.toggle();return}if(a){queryElementsRoots(r,n).filter((function(e){return e.open&&!i.includes(e)})).forEach((function(e){return e.toggle(false)}))}};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PopoverManager.style=popoverManagerCss;export{Popover as calcite_popover,PopoverManager as calcite_popover_manager};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2022-03-
|
|
2
|
+
"timestamp": "2022-03-15T16:56:20",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "2.14.1",
|
|
@@ -1135,14 +1135,14 @@
|
|
|
1135
1135
|
},
|
|
1136
1136
|
{
|
|
1137
1137
|
"name": "flipPlacements",
|
|
1138
|
-
"type": "
|
|
1138
|
+
"type": "ComputedPlacement[]",
|
|
1139
1139
|
"mutable": false,
|
|
1140
1140
|
"reflectToAttr": false,
|
|
1141
1141
|
"docs": "Defines the available placements that can be used when a flip occurs.",
|
|
1142
1142
|
"docsTags": [],
|
|
1143
1143
|
"values": [
|
|
1144
1144
|
{
|
|
1145
|
-
"type": "
|
|
1145
|
+
"type": "ComputedPlacement[]"
|
|
1146
1146
|
}
|
|
1147
1147
|
],
|
|
1148
1148
|
"optional": true,
|
|
@@ -13368,14 +13368,14 @@
|
|
|
13368
13368
|
},
|
|
13369
13369
|
{
|
|
13370
13370
|
"name": "flipPlacements",
|
|
13371
|
-
"type": "
|
|
13371
|
+
"type": "ComputedPlacement[]",
|
|
13372
13372
|
"mutable": false,
|
|
13373
13373
|
"reflectToAttr": false,
|
|
13374
13374
|
"docs": "Defines the available placements that can be used when a flip occurs.",
|
|
13375
13375
|
"docsTags": [],
|
|
13376
13376
|
"values": [
|
|
13377
13377
|
{
|
|
13378
|
-
"type": "
|
|
13378
|
+
"type": "ComputedPlacement[]"
|
|
13379
13379
|
}
|
|
13380
13380
|
],
|
|
13381
13381
|
"optional": true,
|
|
@@ -13563,7 +13563,7 @@
|
|
|
13563
13563
|
"text": "[PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)"
|
|
13564
13564
|
}
|
|
13565
13565
|
],
|
|
13566
|
-
"default": "
|
|
13566
|
+
"default": "defaultPopoverPlacement",
|
|
13567
13567
|
"values": [
|
|
13568
13568
|
{
|
|
13569
13569
|
"type": "Placement"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
2
|
import { VNode } from "../../stencil-public-runtime";
|
|
3
|
-
import { PopperPlacement, OverlayPositioning } from "../../utils/popper";
|
|
4
|
-
import { Placement } from "@popperjs/core";
|
|
3
|
+
import { PopperPlacement, OverlayPositioning, ComputedPlacement } from "../../utils/popper";
|
|
5
4
|
import { Scale } from "../interfaces";
|
|
6
5
|
import { ConditionalSlotComponent } from "../../utils/conditionalSlot";
|
|
7
6
|
/**
|
|
@@ -20,7 +19,7 @@ export declare class ActionMenu implements ConditionalSlotComponent {
|
|
|
20
19
|
/**
|
|
21
20
|
* Defines the available placements that can be used when a flip occurs.
|
|
22
21
|
*/
|
|
23
|
-
flipPlacements?:
|
|
22
|
+
flipPlacements?: ComputedPlacement[];
|
|
24
23
|
/**
|
|
25
24
|
* Text string for the actions menu.
|
|
26
25
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, VNode } from "../../stencil-public-runtime";
|
|
2
|
-
import { PopperPlacement, OverlayPositioning } from "../../utils/popper";
|
|
3
|
-
import { StrictModifiers,
|
|
2
|
+
import { PopperPlacement, OverlayPositioning, ComputedPlacement } from "../../utils/popper";
|
|
3
|
+
import { StrictModifiers, Instance as Popper } from "@popperjs/core";
|
|
4
4
|
import { HeadingLevel } from "../functional/Heading";
|
|
5
5
|
/**
|
|
6
6
|
* @slot - A slot for adding custom content.
|
|
@@ -26,7 +26,7 @@ export declare class Popover {
|
|
|
26
26
|
/**
|
|
27
27
|
* Defines the available placements that can be used when a flip occurs.
|
|
28
28
|
*/
|
|
29
|
-
flipPlacements?:
|
|
29
|
+
flipPlacements?: ComputedPlacement[];
|
|
30
30
|
/**
|
|
31
31
|
* Heading text.
|
|
32
32
|
*/
|
|
@@ -13,6 +13,7 @@ export declare const CSS: {
|
|
|
13
13
|
export declare const TEXT: {
|
|
14
14
|
close: string;
|
|
15
15
|
};
|
|
16
|
+
export declare const defaultPopoverPlacement = "auto";
|
|
16
17
|
export declare const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
17
18
|
export declare const ARIA_CONTROLS = "aria-controls";
|
|
18
19
|
export declare const ARIA_EXPANDED = "aria-expanded";
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { AccordionAppearance } from "./components/accordion/interfaces";
|
|
9
9
|
import { Alignment, Appearance, Columns, FlipContext, Layout, Position, Scale, Status, Width } from "./components/interfaces";
|
|
10
|
-
import { Placement } from "@popperjs/core";
|
|
11
10
|
import { ComputedPlacement, MenuPlacement, OverlayPositioning, PopperPlacement } from "./utils/popper";
|
|
12
11
|
import { AlertDuration, AlertPlacement, StatusColor } from "./components/alert/interfaces";
|
|
13
12
|
import { HeadingLevel } from "./components/functional/Heading";
|
|
@@ -208,7 +207,7 @@ export namespace Components {
|
|
|
208
207
|
/**
|
|
209
208
|
* Defines the available placements that can be used when a flip occurs.
|
|
210
209
|
*/
|
|
211
|
-
"flipPlacements"?:
|
|
210
|
+
"flipPlacements"?: ComputedPlacement[];
|
|
212
211
|
/**
|
|
213
212
|
* Text string for the actions menu.
|
|
214
213
|
*/
|
|
@@ -2322,7 +2321,7 @@ export namespace Components {
|
|
|
2322
2321
|
/**
|
|
2323
2322
|
* Defines the available placements that can be used when a flip occurs.
|
|
2324
2323
|
*/
|
|
2325
|
-
"flipPlacements"?:
|
|
2324
|
+
"flipPlacements"?: ComputedPlacement[];
|
|
2326
2325
|
/**
|
|
2327
2326
|
* Heading text.
|
|
2328
2327
|
*/
|
|
@@ -4315,7 +4314,7 @@ declare namespace LocalJSX {
|
|
|
4315
4314
|
/**
|
|
4316
4315
|
* Defines the available placements that can be used when a flip occurs.
|
|
4317
4316
|
*/
|
|
4318
|
-
"flipPlacements"?:
|
|
4317
|
+
"flipPlacements"?: ComputedPlacement[];
|
|
4319
4318
|
/**
|
|
4320
4319
|
* Text string for the actions menu.
|
|
4321
4320
|
*/
|
|
@@ -6447,7 +6446,7 @@ declare namespace LocalJSX {
|
|
|
6447
6446
|
/**
|
|
6448
6447
|
* Defines the available placements that can be used when a flip occurs.
|
|
6449
6448
|
*/
|
|
6450
|
-
"flipPlacements"?:
|
|
6449
|
+
"flipPlacements"?: ComputedPlacement[];
|
|
6451
6450
|
/**
|
|
6452
6451
|
* Heading text.
|
|
6453
6452
|
*/
|
package/hydrate/index.js
CHANGED
|
@@ -8200,10 +8200,10 @@ class ActionMenu {
|
|
|
8200
8200
|
return getSlotted(el, SLOTS$p.tooltip) ? (hAsync("calcite-tooltip-manager", null, menuButtonSlot)) : (menuButtonSlot);
|
|
8201
8201
|
}
|
|
8202
8202
|
renderMenuItems() {
|
|
8203
|
-
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning } = this;
|
|
8203
|
+
const { actionElements, activeMenuItemIndex, open, menuId, menuButtonEl, label, placement, overlayPositioning, flipPlacements } = this;
|
|
8204
8204
|
const activeAction = actionElements[activeMenuItemIndex];
|
|
8205
8205
|
const activeDescendantId = (activeAction === null || activeAction === void 0 ? void 0 : activeAction.id) || null;
|
|
8206
|
-
return (hAsync("calcite-popover", { disablePointer: true, label: label, offsetDistance: 0, open: open, overlayPositioning: overlayPositioning, placement: placement, referenceElement: menuButtonEl }, hAsync("div", { "aria-activedescendant": activeDescendantId, "aria-labelledby": menuButtonEl === null || menuButtonEl === void 0 ? void 0 : menuButtonEl.id, class: CSS$O.menu, id: menuId, onClick: this.handleCalciteActionClick, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, hAsync("slot", null))));
|
|
8206
|
+
return (hAsync("calcite-popover", { disablePointer: true, flipPlacements: flipPlacements, label: label, offsetDistance: 0, open: open, overlayPositioning: overlayPositioning, placement: placement, referenceElement: menuButtonEl }, hAsync("div", { "aria-activedescendant": activeDescendantId, "aria-labelledby": menuButtonEl === null || menuButtonEl === void 0 ? void 0 : menuButtonEl.id, class: CSS$O.menu, id: menuId, onClick: this.handleCalciteActionClick, onKeyDown: this.menuActionsContainerKeyDown, onKeyUp: this.menuActionsContainerKeyUp, ref: (el) => (this.menuEl = el), role: "menu", tabIndex: -1 }, hAsync("slot", null))));
|
|
8207
8207
|
}
|
|
8208
8208
|
render() {
|
|
8209
8209
|
return (hAsync(Fragment, null, this.renderMenuButton(), this.renderMenuItems(), hAsync("slot", { name: SLOTS$p.tooltip })));
|
|
@@ -23186,6 +23186,7 @@ const CSS$g = {
|
|
|
23186
23186
|
const TEXT$6 = {
|
|
23187
23187
|
close: "Close"
|
|
23188
23188
|
};
|
|
23189
|
+
const defaultPopoverPlacement = "auto";
|
|
23189
23190
|
const POPOVER_REFERENCE = "data-calcite-popover-reference";
|
|
23190
23191
|
const ARIA_CONTROLS = "aria-controls";
|
|
23191
23192
|
const ARIA_EXPANDED = "aria-expanded";
|
|
@@ -23242,7 +23243,7 @@ class Popover {
|
|
|
23242
23243
|
* Determines where the component will be positioned relative to the referenceElement.
|
|
23243
23244
|
* @see [PopperPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/popper.ts#L25)
|
|
23244
23245
|
*/
|
|
23245
|
-
this.placement =
|
|
23246
|
+
this.placement = defaultPopoverPlacement;
|
|
23246
23247
|
/** Text for close button.
|
|
23247
23248
|
* @default "Close"
|
|
23248
23249
|
*/
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -13,12 +13,12 @@ The most common approach for loading Calcite Components is to use the version ho
|
|
|
13
13
|
```html
|
|
14
14
|
<script
|
|
15
15
|
type="module"
|
|
16
|
-
src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.
|
|
16
|
+
src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.79/dist/calcite/calcite.esm.js"
|
|
17
17
|
></script>
|
|
18
18
|
<link
|
|
19
19
|
rel="stylesheet"
|
|
20
20
|
type="text/css"
|
|
21
|
-
href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.
|
|
21
|
+
href="https://unpkg.com/@esri/calcite-components@1.0.0-beta.79/dist/calcite/calcite.css"
|
|
22
22
|
/>
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,a,n){function i(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n["throw"](e))}catch(e){r(e)}}function c(e){e.done?a(e.value):i(e.value).then(o,s)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;i=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(r=a.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(o[0]===6&&a.label<r[1]){a.label=r[1];r=o;break}if(r&&a.label<r[2]){a.label=r[2];a.ops.push(o);break}if(r[2])a.ops.pop();a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e];i=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
4
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
5
|
-
*/System.register(["./p-65dbbfb5.system.js","./p-f09e27b0.system.js","./p-e020662f.system.js","./p-ec9bab33.system.js","./p-cb57638c.system.js"],(function(e){"use strict";var t,a,n,i,r,o,s,c,l,p,f,m,d,u;return{setters:[function(e){t=e.r;a=e.c;n=e.f;i=e.h;r=e.H;o=e.g},function(e){s=e.a;c=e.u;l=e.c;p=e.C},function(e){f=e.g},function(e){m=e.q;d=e.h},function(e){u=e.H}],execute:function(){var h={container:"container",arrow:"arrow",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"};var b={close:"Close"};var v="data-calcite-popover-reference";var w="aria-controls";var y="aria-expanded";var g=2;var x='@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:900;-webkit-transform:scale(0);transform:scale(0)}.calcite-popper-anim{position:relative;z-index:1;-webkit-transition:var(--calcite-popper-transition);transition:var(--calcite-popper-transition);visibility:hidden;-webkit-transition-property:visibility, opacity, -webkit-transform;transition-property:visibility, opacity, -webkit-transform;transition-property:transform, visibility, opacity;transition-property:transform, visibility, opacity, -webkit-transform;opacity:0;-webkit-box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);border-radius:0.25rem}:host([data-popper-placement^=bottom]) .calcite-popper-anim{-webkit-transform:translateY(-5px);transform:translateY(-5px)}:host([data-popper-placement^=top]) .calcite-popper-anim{-webkit-transform:translateY(5px);transform:translateY(5px)}:host([data-popper-placement^=left]) .calcite-popper-anim{-webkit-transform:translateX(5px);transform:translateX(5px)}:host([data-popper-placement^=right]) .calcite-popper-anim{-webkit-transform:translateX(-5px);transform:translateX(-5px)}:host([data-popper-placement]) .calcite-popper-anim--active{opacity:1;visibility:visible;-webkit-transform:translate(0);transform:translate(0)}:host([data-popper-placement][data-popper-escaped]),:host([data-popper-placement][data-popper-reference-hidden]){pointer-events:none;opacity:0}.arrow,.arrow::before{position:absolute;width:8px;height:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-popper-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:start;justify-content:flex-start;border-width:0px;border-bottom-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-bottom-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-item-align:center;align-self:center;white-space:normal;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{-ms-flex-direction:column;flex-direction:column}.content{display:-ms-flexbox;display:flex;height:100%;width:100%;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-item-align:center;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex:0 0 auto;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){height:100%}';var k=e("calcite_popover",function(){function e(e){var n=this;t(this,e);this.calcitePopoverClose=a(this,"calcitePopoverClose",7);this.calcitePopoverOpen=a(this,"calcitePopoverOpen",7);this.closeButton=false;this.dismissible=false;this.disableFlip=false;this.disablePointer=false;this.offsetDistance=s;this.offsetSkidding=0;this.open=false;this.overlayPositioning="absolute";this.placement="auto";this.intlClose=b.close;this.guid="calcite-popover-".concat(f());this.activeTransitionProp="opacity";this.setUpReferenceElement=function(){n.removeReferences();n.effectiveReferenceElement=n.getReferenceElement();var e=n,t=e.el,a=e.referenceElement,i=e.effectiveReferenceElement;if(a&&!i){console.warn("".concat(t.tagName,': reference-element id "').concat(a,'" was not found.'),{el:t})}n.addReferences();n.createPopper()};this.getId=function(){return n.el.id||n.guid};this.setExpandedAttr=function(){var e=n,t=e.effectiveReferenceElement,a=e.open;if(!t){return}t.setAttribute(y,a.toString())};this.addReferences=function(){var e=n.effectiveReferenceElement;if(!e){return}var t=n.getId();e.setAttribute(v,t);e.setAttribute(w,t);n.setExpandedAttr()};this.removeReferences=function(){var e=n.effectiveReferenceElement;if(!e){return}e.removeAttribute(v);e.removeAttribute(w);e.removeAttribute(y)};this.hide=function(){n.open=false};this.transitionEnd=function(e){if(e.propertyName===n.activeTransitionProp){n.open?n.calcitePopoverOpen.emit():n.calcitePopoverClose.emit()}}}e.prototype.offsetDistanceOffsetHandler=function(){this.reposition()};e.prototype.offsetSkiddingHandler=function(){this.reposition()};e.prototype.openHandler=function(){this.reposition();this.setExpandedAttr()};e.prototype.placementHandler=function(){this.reposition()};e.prototype.referenceElementHandler=function(){this.setUpReferenceElement()};e.prototype.componentWillLoad=function(){this.setUpReferenceElement()};e.prototype.componentDidLoad=function(){this.reposition()};e.prototype.disconnectedCallback=function(){this.removeReferences();this.destroyPopper()};e.prototype.reposition=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,a,n,i,r;return __generator(this,(function(o){switch(o.label){case 0:e=this,t=e.popper,a=e.el,n=e.placement;i=this.getModifiers();if(!t)return[3,2];return[4,c({el:a,modifiers:i,placement:n,popper:t})];case 1:r=o.sent();return[3,3];case 2:r=this.createPopper();o.label=3;case 3:r;return[2]}}))}))};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){var t,a;return __generator(this,(function(i){a=this.closeButtonEl;if(e==="close-button"&&a){n(a);a.setFocus();return[2]}(t=this.el)===null||t===void 0?void 0:t.focus();return[2]}))}))};e.prototype.toggle=function(e){if(e===void 0){e=!this.open}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=e;return[2]}))}))};e.prototype.getReferenceElement=function(){var e=this,t=e.referenceElement,a=e.el;return(typeof t==="string"?m(a,{id:t}):t)||null};e.prototype.getModifiers=function(){var e=this,t=e.arrowEl,a=e.flipPlacements,n=e.disableFlip,i=e.disablePointer,r=e.offsetDistance,o=e.offsetSkidding;var s={name:"flip",enabled:!n};if(a){s.options={fallbackPlacements:a}}var c={name:"arrow",enabled:!i};if(t){c.options={element:t}}var l={name:"offset",enabled:true,options:{offset:[o,r]}};var p={name:"eventListeners",enabled:this.open};return[c,s,l,p]};e.prototype.createPopper=function(){this.destroyPopper();var e=this,t=e.el,a=e.placement,n=e.effectiveReferenceElement,i=e.overlayPositioning;var r=this.getModifiers();this.popper=l({el:t,modifiers:r,overlayPositioning:i,placement:a,referenceEl:n})};e.prototype.destroyPopper=function(){var e=this.popper;if(e){e.destroy()}this.popper=null};e.prototype.renderCloseButton=function(){var e=this;var t=this,a=t.dismissible,n=t.closeButton,r=t.intlClose;return a||n?i("div",{class:h.closeButtonContainer},i("calcite-action",{class:h.closeButton,onClick:this.hide,ref:function(t){return e.closeButtonEl=t},text:r},i("calcite-icon",{icon:"x",scale:"m"}))):null};e.prototype.renderHeader=function(){var e=this,t=e.heading,a=e.headingLevel;var n=t?i(u,{class:h.heading,level:a||g},t):null;return n?i("div",{class:h.header},n,this.renderCloseButton()):null};e.prototype.render=function(){var e,t;var a=this;var n=this,o=n.effectiveReferenceElement,s=n.heading,c=n.label,l=n.open,f=n.disablePointer;var m=o&&l;var d=!m;var u=!f?i("div",{class:h.arrow,ref:function(e){return a.arrowEl=e}}):null;return i(r,{"aria-hidden":d.toString(),"aria-label":c,"calcite-hydrated-hidden":d,id:this.getId(),role:"dialog"},i("div",{class:(e={},e[p.animation]=true,e[p.animationActive]=m,e),onTransitionEnd:this.transitionEnd},u,i("div",{class:(t={},t[h.hasHeader]=!!s,t[h.container]=true,t)},this.renderHeader(),i("div",{class:h.content},i("slot",null)),!s?this.renderCloseButton():null)))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}},enumerable:false,configurable:true});return e}());k.style=x;var D="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:block}";var _=e("calcite_popover_manager",function(){function e(e){var a=this;t(this,e);this.selector="[".concat(v,"]");this.autoClose=false;this.queryPopover=function(e){var t=a.el;if(!e.includes(t)){return null}var n=e.find((function(e){var t;return(t=e===null||e===void 0?void 0:e.hasAttribute)===null||t===void 0?void 0:t.call(e,v)}));if(!n){return null}var i=n.getAttribute(v);return m(t,{id:i})}}e.prototype.render=function(){return i("slot",null)};e.prototype.closeOpenPopovers=function(e){var t=this,a=t.autoClose,n=t.el;var i="calcite-popover";var r=e.composedPath();var o=this.queryPopover(r);if(o){o.toggle();return}if(a){d(n,i).filter((function(e){return e.open&&!r.includes(e)})).forEach((function(e){return e.toggle(false)}))}};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());_.style=D}}}));
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
-
*/
|
|
5
|
-
import{r as t,c as i,h as e,F as a,g as n}from"./p-6b7b23d0.js";import{C as s,I as o,S as r}from"./p-7fc69a9d.js";import{g as l,f as c}from"./p-8f3a3e4e.js";import{g as m}from"./p-accdb0ce.js";import{g as h}from"./p-8a63221d.js";import{c as u}from"./p-0a5d059d.js";import{c as d,d as p}from"./p-a9b3ef39.js";const f=["ArrowUp","ArrowDown"],b=["ArrowUp","ArrowDown","End","Home"],x=class{constructor(e){t(this,e),this.calciteActionMenuOpenChange=i(this,"calciteActionMenuOpenChange",7),this.expanded=!1,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.actionElements=[],this.mutationObserver=u("mutation",(()=>this.getActions())),this.guid=`calcite-action-menu-${h()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.activeMenuItemIndex=-1,this.connectMenuButtonEl=()=>{const{el:t,menuButtonId:i,menuId:e,open:a,label:n}=this,s=l(t,r.trigger)||this.defaultMenuButtonEl;this.menuButtonEl!==s&&(this.disconnectMenuButtonEl(),this.menuButtonEl=s,this.setTooltipReferenceElement(),s&&(s.active=a,s.setAttribute("aria-controls",e),s.setAttribute("aria-expanded",a.toString()),s.setAttribute("aria-haspopup","true"),s.id||(s.id=i),s.label||(s.label=n),s.text||(s.text=n),s.addEventListener("click",this.menuButtonClick),s.addEventListener("keydown",this.menuButtonKeyDown),s.addEventListener("keyup",this.menuButtonKeyUp)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:t}=this;t&&(t.removeEventListener("click",this.menuButtonClick),t.removeEventListener("keydown",this.menuButtonKeyDown),t.removeEventListener("keyup",this.menuButtonKeyUp))},this.setDefaultMenuButtonEl=t=>{this.defaultMenuButtonEl=t,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.setTooltipReferenceElement=()=>{const{el:t,expanded:i,menuButtonEl:e}=this,a=l(t,r.tooltip),n="SLOT"===(null==a?void 0:a.tagName)?a.assignedElements()[0]:a;"CALCITE-TOOLTIP"===(null==n?void 0:n.tagName)&&(n.referenceElement=i?null:e)},this.updateAction=(t,i)=>{const{guid:e,activeMenuItemIndex:a}=this,n=`${e}-action-${i}`;t.tabIndex=-1,t.setAttribute("role","menuitem"),t.id||(t.id=n),t.active=i===a},this.updateActions=t=>{null==t||t.forEach(this.updateAction)},this.getActions=()=>{const{el:t}=this,i=l(t,{all:!0,matches:"calcite-action"});this.updateActions(i),this.actionElements=i,this.connectMenuButtonEl()},this.menuButtonKeyUp=t=>{const{key:i}=t,{actionElements:e}=this;this.isValidKey(i,f)&&(t.preventDefault(),e.length&&(this.toggleOpen(!0),this.handleActionNavigation(i,e)))},this.menuButtonKeyDown=t=>{const{key:i}=t;this.isValidKey(i,f)&&t.preventDefault()},this.menuActionsContainerKeyDown=t=>{const{key:i}=t,{actionElements:e,activeMenuItemIndex:a}=this;if("Tab"!==i)if(" "!==i&&"Enter"!==i)this.isValidKey(i,b)&&t.preventDefault();else{t.preventDefault();const i=e[a];i?i.click():this.toggleOpen(!1)}else this.open=!1},this.menuActionsContainerKeyUp=t=>{const{key:i}=t,{actionElements:e}=this;"Escape"!==i?this.isValidKey(i,b)&&(t.preventDefault(),e.length&&this.handleActionNavigation(i,e)):this.toggleOpen(!1)},this.handleActionNavigation=(t,i)=>{const e=this.activeMenuItemIndex;"Home"===t&&(this.activeMenuItemIndex=0),"End"===t&&(this.activeMenuItemIndex=i.length-1),"ArrowUp"===t&&(this.activeMenuItemIndex=m(Math.max(e-1,-1),i.length)),"ArrowDown"===t&&(this.activeMenuItemIndex=m(e+1,i.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(t=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=t}}connectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0,subtree:!0}),this.getActions(),d(this)}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect(),this.disconnectMenuButtonEl(),p(this)}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(t){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=t),this.calciteActionMenuOpenChange.emit(t)}closeCalciteActionMenuOnClick(t){t.composedPath().includes(this.el)||(this.open=!1)}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){c(this.open?this.menuEl:this.menuButtonEl)}renderMenuButton(){const{el:t,label:i,scale:a}=this,n=e("slot",{name:r.trigger},e("calcite-action",{class:s.defaultTrigger,icon:o.menu,ref:this.setDefaultMenuButtonEl,scale:a,text:i}));return l(t,r.tooltip)?e("calcite-tooltip-manager",null,n):n}renderMenuItems(){const{actionElements:t,activeMenuItemIndex:i,open:a,menuId:n,menuButtonEl:o,label:r,placement:l,overlayPositioning:c}=this,m=t[i];return e("calcite-popover",{disablePointer:!0,label:r,offsetDistance:0,open:a,overlayPositioning:c,placement:l,referenceElement:o},e("div",{"aria-activedescendant":(null==m?void 0:m.id)||null,"aria-labelledby":null==o?void 0:o.id,class:s.menu,id:n,onClick:this.handleCalciteActionClick,onKeyDown:this.menuActionsContainerKeyDown,onKeyUp:this.menuActionsContainerKeyUp,ref:t=>this.menuEl=t,role:"menu",tabIndex:-1},e("slot",null)))}render(){return e(a,null,this.renderMenuButton(),this.renderMenuItems(),e("slot",{name:r.tooltip}))}getAssignedElements(){return Array.from(this.el.querySelectorAll("slot")).map((t=>t.assignedElements({flatten:!0}))).reduce(((t,i)=>t.concat(i)),[])}isValidKey(t,i){return!!i.find((i=>i===t))}get el(){return n(this)}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}};x.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;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:-ms-flexbox;display:flex;outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}.menu{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}";export{x as calcite_action_menu}
|