{"version":3,"names":["SLOTS","dropdownTrigger","dropdownCss","CalciteDropdownStyle0","Dropdown","this","items","groups","mutationObserver","createObserver","updateItems","resizeObserver","entries","resizeObserverCallback","openTransitionProp","guid","focusLastDropdownItem","setFilteredPlacements","el","flipPlacements","filteredFlipPlacements","filterValidFlipPlacements","updateTriggers","event","triggers","target","assignedElements","flatten","reposition","map","group","Array","from","querySelectorAll","reduce","previousValue","currentValue","updateSelectedItems","forEach","item","scale","updateGroups","filter","matches","updateGroupScale","entry","referenceEl","setDropdownWidth","scrollerEl","setMaxScrollerHeight","referenceElWidth","clientWidth","style","minWidth","maxScrollerHeight","getMaxScrollerHeight","maxHeight","setScrollerAndTransitionEl","observe","transitionEl","setReferenceEl","connectFloatingUI","floatingEl","setFloatingEl","keyDownHandler","composedPath","includes","defaultPrevented","key","closeCalciteDropdown","preventDefault","open","shiftKey","isActivationKey","toggleDropdown","addEventListener","onOpenEnd","focusOnFirstActiveOrDefaultItem","selectedItem","getTraversableItems","find","selected","length","focusElement","removeEventListener","defaultMenuPlacement","openHandler","onToggleOpenCloseComponent","disabled","handleDisabledChange","value","flipPlacementsHandler","maxItemsHandler","overlayPositioningHandler","placementHandler","handlePropsChange","setFocus","componentFocusable","focusFirstTabbable","connectedCallback","childList","subtree","componentWillLoad","setUpLoadableComponent","componentDidLoad","setComponentLoaded","componentDidRender","updateHostInteraction","disconnectedCallback","disconnect","disconnectFloatingUI","render","h","Host","InteractiveContainer","class","id","onClick","onKeyDown","ref","toAriaBoolean","name","onSlotchange","FloatingCSS","animation","animationActive","role","delayed","placement","overlayPositioning","type","closeCalciteDropdownOnClick","closeCalciteDropdownOnEvent","stopPropagation","closeCalciteDropdownOnOpenEvent","pointerEnterHandler","pointerLeaveHandler","hidden","calciteInternalDropdownItemKeyEvent","keyboardEvent","detail","traversableItems","updateTabIndexOfItems","focusElementInGroup","handleItemSelect","calciteDropdownSelect","emit","closeOnSelectDisabled","requestedDropdownGroup","selectionMode","onBeforeOpen","calciteDropdownBeforeOpen","onOpen","calciteDropdownOpen","onBeforeClose","calciteDropdownBeforeClose","onClose","calciteDropdownClose","selectedItems","maxItems","itemsToProcess","groupHeaderHeight","children","index","isNaN","offsetTop","offsetHeight","focusTrigger","tabIndex","CSS","container","containerNone","icon","iconEnd","iconStart","itemContent","link","dropdownGroupCss","CalciteDropdownGroupStyle0","DropdownGroup","groupPosition","getGroupPosition","groupTitle","dropdownSeparator","updateActiveItemOnChange","requestedDropdownItem","calciteInternalDropdownItemChange","prototype","indexOf","call","parentElement","dropdownItemCss","CalciteDropdownItemStyle0","DropdownItem","focus","initialize","href","label","iconFlipRtl","iconStartEl","flipRtl","getIconScale","contentNode","iconEndEl","slottedContent","contentEl","childLink","rel","itemRole","itemAria","emitRequestedItem","click","calciteInternalDropdownCloseRequest","parentEmittedChange","parentDropdownGroupEl","determineActiveItem","closest","calciteDropdownItemSelect","calciteInternalDropdownItemSelect"],"sources":["src/components/dropdown/resources.ts","src/components/dropdown/dropdown.scss?tag=calcite-dropdown&encapsulation=shadow","src/components/dropdown/dropdown.tsx","src/components/dropdown-item/resources.ts","src/components/dropdown-group/dropdown-group.scss?tag=calcite-dropdown-group&encapsulation=shadow","src/components/dropdown-group/dropdown-group.tsx","src/components/dropdown-item/dropdown-item.scss?tag=calcite-dropdown-item&encapsulation=shadow","src/components/dropdown-item/dropdown-item.tsx"],"sourcesContent":["export const SLOTS = {\n dropdownTrigger: \"trigger\",\n};\n","/**\n * CSS Custom Properties\n *\n * These properties can be overridden using the component's tag as selector.\n *\n * @prop --calcite-dropdown-width: Specifies the width of the component's wrapper.\n */\n\n:host {\n @apply inline-block;\n}\n\n@include disabled();\n\n:host .calcite-dropdown-wrapper {\n --calcite-floating-ui-z-index: theme(\"zIndex.dropdown\");\n @include floating-ui-container();\n @include floating-ui-wrapper();\n}\n\n@include floating-ui-elem-anim(\".calcite-dropdown-wrapper\");\n:host([open]) .calcite-dropdown-wrapper {\n @include floating-ui-wrapper-active();\n}\n\n:host .calcite-dropdown-content {\n @apply bg-foreground-1\n w-auto\n overflow-y-auto\n overflow-x-hidden\n max-h-menu;\n inline-size: var(--calcite-dropdown-width);\n}\n.calcite-trigger-container {\n @apply relative flex flex-auto h-full;\n @include word-break;\n}\n\n@media (forced-colors: active) {\n /* use real border since box-shadow is removed in high contrast mode */\n :host([open]) .calcite-dropdown-wrapper {\n border: 1px solid canvasText;\n }\n}\n\n// width\n:host([width-scale=\"s\"]) {\n --calcite-dropdown-width: theme(\"spacing.48\");\n}\n:host([width-scale=\"m\"]) {\n --calcite-dropdown-width: theme(\"spacing.56\");\n}\n:host([width-scale=\"l\"]) {\n --calcite-dropdown-width: theme(\"spacing.64\");\n}\n\n@include base-component();\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Method,\n Prop,\n VNode,\n Watch,\n} from \"@stencil/core\";\nimport {\n focusElement,\n focusElementInGroup,\n focusFirstTabbable,\n toAriaBoolean,\n} from \"../../utils/dom\";\nimport {\n connectFloatingUI,\n defaultMenuPlacement,\n disconnectFloatingUI,\n filterValidFlipPlacements,\n FlipPlacement,\n FloatingCSS,\n FloatingUIComponent,\n MenuPlacement,\n OverlayPositioning,\n reposition,\n} from \"../../utils/floating-ui\";\nimport { guid } from \"../../utils/guid\";\nimport {\n InteractiveComponent,\n InteractiveContainer,\n updateHostInteraction,\n} from \"../../utils/interactive\";\nimport { isActivationKey } from \"../../utils/key\";\nimport {\n componentFocusable,\n LoadableComponent,\n setComponentLoaded,\n setUpLoadableComponent,\n} from \"../../utils/loadable\";\nimport { createObserver } from \"../../utils/observers\";\nimport { onToggleOpenCloseComponent, OpenCloseComponent } from \"../../utils/openCloseComponent\";\nimport { RequestedItem } from \"../dropdown-group/interfaces\";\nimport { Scale } from \"../interfaces\";\nimport { ItemKeyboardEvent } from \"./interfaces\";\nimport { SLOTS } from \"./resources\";\n\n/**\n * @slot - A slot for adding `calcite-dropdown-group` elements. Every `calcite-dropdown-item` must have a parent `calcite-dropdown-group`, even if the `groupTitle` property is not set.\n * @slot trigger - A slot for the element that triggers the `calcite-dropdown`.\n */\n@Component({\n tag: \"calcite-dropdown\",\n styleUrl: \"dropdown.scss\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Dropdown\n implements InteractiveComponent, LoadableComponent, OpenCloseComponent, FloatingUIComponent\n{\n //--------------------------------------------------------------------------\n //\n // Public Properties\n //\n //--------------------------------------------------------------------------\n\n /**\n * When `true`, displays and positions the component.\n */\n @Prop({ reflect: true, mutable: true }) open = false;\n\n @Watch(\"open\")\n openHandler(): void {\n onToggleOpenCloseComponent(this);\n\n if (this.disabled) {\n this.open = false;\n return;\n }\n\n this.reposition(true);\n }\n\n /**\n * When `true`, the component will remain open after a selection is made.\n *\n * If the `selectionMode` of the selected `calcite-dropdown-item`'s containing `calcite-dropdown-group` is `\"none\"`, the component will always close.\n *\n */\n @Prop({ reflect: true }) closeOnSelectDisabled = false;\n\n /**\n * When `true`, interaction is prevented and the component is displayed with lower opacity.\n */\n @Prop({ reflect: true }) disabled = false;\n\n @Watch(\"disabled\")\n handleDisabledChange(value: boolean): void {\n if (!value) {\n this.open = false;\n }\n }\n\n /**\n * Specifies the component's fallback `calcite-dropdown-item` `placement` when it's initial or specified `placement` has insufficient space available.\n */\n @Prop() flipPlacements: FlipPlacement[];\n\n @Watch(\"flipPlacements\")\n flipPlacementsHandler(): void {\n this.setFilteredPlacements();\n this.reposition(true);\n }\n\n /**\n * Specifies the maximum number of `calcite-dropdown-item`s to display before showing a scroller.\n * Value must be greater than `0`, and does not include `groupTitle`'s from `calcite-dropdown-group`.\n */\n @Prop({ reflect: true }) maxItems = 0;\n\n @Watch(\"maxItems\")\n maxItemsHandler(): void {\n this.setMaxScrollerHeight();\n }\n\n /**\n * Determines the type of positioning to use for the overlaid content.\n *\n * Using `\"absolute\"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.\n *\n * `\"fixed\"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `\"fixed\"`.\n *\n */\n @Prop({ reflect: true }) overlayPositioning: OverlayPositioning = \"absolute\";\n\n @Watch(\"overlayPositioning\")\n overlayPositioningHandler(): void {\n this.reposition(true);\n }\n\n /**\n * Determines where the component will be positioned relative to the container element.\n *\n * @default \"bottom-start\"\n */\n @Prop({ reflect: true }) placement: MenuPlacement = defaultMenuPlacement;\n\n @Watch(\"placement\")\n placementHandler(): void {\n this.reposition(true);\n }\n\n /**\n * Specifies the component's selected items.\n *\n * @readonly\n */\n @Prop({ mutable: true }) selectedItems: HTMLCalciteDropdownItemElement[] = [];\n\n /**\n * Specifies the action to open the component from the container element.\n */\n @Prop({ reflect: true }) type: \"hover\" | \"click\" = \"click\";\n\n /**\n * Specifies the width of the component.\n */\n @Prop({ reflect: true }) widthScale: Scale;\n\n /** Specifies the size of the component. */\n @Prop({ reflect: true }) scale: Scale = \"m\";\n\n @Watch(\"scale\")\n handlePropsChange(): void {\n this.updateItems();\n this.updateGroupScale();\n }\n\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n\n /** Sets focus on the component's first focusable element. */\n @Method()\n async setFocus(): Promise {\n await componentFocusable(this);\n focusFirstTabbable(this.referenceEl);\n }\n\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n\n connectedCallback(): void {\n this.mutationObserver?.observe(this.el, { childList: true, subtree: true });\n this.setFilteredPlacements();\n if (this.open) {\n this.openHandler();\n onToggleOpenCloseComponent(this);\n }\n this.updateItems();\n connectFloatingUI(this, this.referenceEl, this.floatingEl);\n }\n\n componentWillLoad(): void {\n setUpLoadableComponent(this);\n }\n\n componentDidLoad(): void {\n setComponentLoaded(this);\n connectFloatingUI(this, this.referenceEl, this.floatingEl);\n }\n\n componentDidRender(): void {\n updateHostInteraction(this);\n }\n\n disconnectedCallback(): void {\n this.mutationObserver?.disconnect();\n this.resizeObserver?.disconnect();\n disconnectFloatingUI(this, this.referenceEl, this.floatingEl);\n }\n\n render(): VNode {\n const { open, guid } = this;\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n );\n }\n\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n\n /**\n * Updates the position of the component.\n *\n * @param delayed\n */\n @Method()\n async reposition(delayed = false): Promise {\n const { floatingEl, referenceEl, placement, overlayPositioning, filteredFlipPlacements } = this;\n\n return reposition(\n this,\n {\n floatingEl,\n referenceEl,\n overlayPositioning,\n placement,\n flipPlacements: filteredFlipPlacements,\n type: \"menu\",\n },\n delayed,\n );\n }\n\n //--------------------------------------------------------------------------\n //\n // Events\n //\n //--------------------------------------------------------------------------\n\n /** Fires when a `calcite-dropdown-item`'s selection changes. */\n @Event({ cancelable: false }) calciteDropdownSelect: EventEmitter;\n\n /** Fires when the component is requested to be closed and before the closing transition begins. */\n @Event({ cancelable: false }) calciteDropdownBeforeClose: EventEmitter;\n\n /** Fires when the component is closed and animation is complete. */\n @Event({ cancelable: false }) calciteDropdownClose: EventEmitter;\n\n /** Fires when the component is added to the DOM but not rendered, and before the opening transition begins. */\n @Event({ cancelable: false }) calciteDropdownBeforeOpen: EventEmitter;\n\n /** Fires when the component is open and animation is complete. */\n @Event({ cancelable: false }) calciteDropdownOpen: EventEmitter;\n\n @Listen(\"click\", { target: \"window\" })\n closeCalciteDropdownOnClick(event: PointerEvent): void {\n if (this.disabled || !this.open || event.composedPath().includes(this.el)) {\n return;\n }\n\n this.closeCalciteDropdown(false);\n }\n\n @Listen(\"calciteInternalDropdownCloseRequest\")\n closeCalciteDropdownOnEvent(event: Event): void {\n this.closeCalciteDropdown();\n event.stopPropagation();\n }\n\n @Listen(\"calciteDropdownOpen\", { target: \"window\" })\n closeCalciteDropdownOnOpenEvent(event: Event): void {\n if (event.composedPath().includes(this.el)) {\n return;\n }\n\n this.open = false;\n }\n\n @Listen(\"pointerenter\")\n pointerEnterHandler(): void {\n if (this.disabled || this.type !== \"hover\") {\n return;\n }\n\n this.toggleDropdown();\n }\n\n @Listen(\"pointerleave\")\n pointerLeaveHandler(): void {\n if (this.disabled || this.type !== \"hover\") {\n return;\n }\n\n this.closeCalciteDropdown();\n }\n\n private getTraversableItems(): HTMLCalciteDropdownItemElement[] {\n return this.items.filter((item) => !item.disabled && !item.hidden);\n }\n\n @Listen(\"calciteInternalDropdownItemKeyEvent\")\n calciteInternalDropdownItemKeyEvent(event: CustomEvent): void {\n const { keyboardEvent } = event.detail;\n const target = keyboardEvent.target as HTMLCalciteDropdownItemElement;\n const traversableItems = this.getTraversableItems();\n\n switch (keyboardEvent.key) {\n case \"Tab\":\n this.open = false;\n this.updateTabIndexOfItems(target);\n break;\n case \"ArrowDown\":\n focusElementInGroup(traversableItems, target, \"next\");\n break;\n case \"ArrowUp\":\n focusElementInGroup(traversableItems, target, \"previous\");\n break;\n case \"Home\":\n focusElementInGroup(traversableItems, target, \"first\");\n break;\n case \"End\":\n focusElementInGroup(traversableItems, target, \"last\");\n break;\n }\n\n event.stopPropagation();\n }\n\n @Listen(\"calciteInternalDropdownItemSelect\")\n handleItemSelect(event: CustomEvent): void {\n this.updateSelectedItems();\n event.stopPropagation();\n this.calciteDropdownSelect.emit();\n if (\n !this.closeOnSelectDisabled ||\n event.detail.requestedDropdownGroup.selectionMode === \"none\"\n ) {\n this.closeCalciteDropdown();\n }\n event.stopPropagation();\n }\n\n //--------------------------------------------------------------------------\n //\n // Private State/Props\n //\n //--------------------------------------------------------------------------\n\n @Element() el: HTMLCalciteDropdownElement;\n\n filteredFlipPlacements: FlipPlacement[];\n\n private items: HTMLCalciteDropdownItemElement[] = [];\n\n private groups: HTMLCalciteDropdownGroupElement[] = [];\n\n /** trigger elements */\n private triggers: HTMLElement[];\n\n floatingEl: HTMLDivElement;\n\n referenceEl: HTMLDivElement;\n\n private scrollerEl: HTMLDivElement;\n\n mutationObserver = createObserver(\"mutation\", () => this.updateItems());\n\n resizeObserver = createObserver(\"resize\", (entries) => this.resizeObserverCallback(entries));\n\n openTransitionProp = \"opacity\";\n\n transitionEl: HTMLDivElement;\n\n guid = `calcite-dropdown-${guid()}`;\n\n private focusLastDropdownItem = false;\n\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n\n setFilteredPlacements = (): void => {\n const { el, flipPlacements } = this;\n\n this.filteredFlipPlacements = flipPlacements\n ? filterValidFlipPlacements(flipPlacements, el)\n : null;\n };\n\n updateTriggers = (event: Event): void => {\n this.triggers = (event.target as HTMLSlotElement).assignedElements({\n flatten: true,\n }) as HTMLElement[];\n\n this.reposition(true);\n };\n\n updateItems = (): void => {\n this.items = this.groups\n .map((group) => Array.from(group?.querySelectorAll(\"calcite-dropdown-item\")))\n .reduce((previousValue, currentValue) => [...previousValue, ...currentValue], []);\n\n this.updateSelectedItems();\n\n this.reposition(true);\n\n this.items.forEach((item) => (item.scale = this.scale));\n };\n\n updateGroups = (event: Event): void => {\n const groups = (event.target as HTMLSlotElement)\n .assignedElements({ flatten: true })\n .filter((el): el is HTMLCalciteDropdownGroupElement => el?.matches(\"calcite-dropdown-group\"));\n\n this.groups = groups;\n\n this.updateItems();\n this.updateGroupScale();\n };\n\n private updateGroupScale(): void {\n this.groups?.forEach((group) => (group.scale = this.scale));\n }\n\n resizeObserverCallback = (entries: ResizeObserverEntry[]): void => {\n entries.forEach((entry) => {\n const { target } = entry;\n if (target === this.referenceEl) {\n this.setDropdownWidth();\n } else if (target === this.scrollerEl) {\n this.setMaxScrollerHeight();\n }\n });\n };\n\n setDropdownWidth = (): void => {\n const { referenceEl, scrollerEl } = this;\n const referenceElWidth = referenceEl?.clientWidth;\n\n if (!referenceElWidth || !scrollerEl) {\n return;\n }\n\n scrollerEl.style.minWidth = `${referenceElWidth}px`;\n };\n\n setMaxScrollerHeight = (): void => {\n const { scrollerEl } = this;\n if (!scrollerEl) {\n return;\n }\n\n this.reposition(true);\n const maxScrollerHeight = this.getMaxScrollerHeight();\n scrollerEl.style.maxHeight = maxScrollerHeight > 0 ? `${maxScrollerHeight}px` : \"\";\n this.reposition(true);\n };\n\n setScrollerAndTransitionEl = (el: HTMLDivElement): void => {\n this.resizeObserver.observe(el);\n this.scrollerEl = el;\n\n this.transitionEl = el;\n };\n\n onBeforeOpen(): void {\n this.calciteDropdownBeforeOpen.emit();\n }\n\n onOpen(): void {\n this.calciteDropdownOpen.emit();\n }\n\n onBeforeClose(): void {\n this.calciteDropdownBeforeClose.emit();\n }\n\n onClose(): void {\n this.calciteDropdownClose.emit();\n }\n\n setReferenceEl = (el: HTMLDivElement): void => {\n this.referenceEl = el;\n connectFloatingUI(this, this.referenceEl, this.floatingEl);\n this.resizeObserver.observe(el);\n };\n\n setFloatingEl = (el: HTMLDivElement): void => {\n this.floatingEl = el;\n connectFloatingUI(this, this.referenceEl, this.floatingEl);\n };\n\n private keyDownHandler = (event: KeyboardEvent): void => {\n if (!event.composedPath().includes(this.referenceEl)) {\n return;\n }\n\n const { defaultPrevented, key } = event;\n\n if (defaultPrevented) {\n return;\n }\n\n if (key === \"Escape\") {\n this.closeCalciteDropdown();\n event.preventDefault();\n return;\n }\n\n if (this.open && event.shiftKey && key === \"Tab\") {\n this.closeCalciteDropdown();\n event.preventDefault();\n return;\n }\n\n if (isActivationKey(key)) {\n this.toggleDropdown();\n event.preventDefault();\n } else if (key === \"ArrowDown\" || key === \"ArrowUp\") {\n this.focusLastDropdownItem = key === \"ArrowUp\";\n this.open = true;\n this.el.addEventListener(\"calciteDropdownOpen\", this.onOpenEnd);\n }\n };\n\n private updateSelectedItems(): void {\n this.selectedItems = this.items.filter((item) => item.selected);\n }\n\n private getMaxScrollerHeight(): number {\n const { maxItems, items } = this;\n let itemsToProcess = 0;\n let maxScrollerHeight = 0;\n let groupHeaderHeight: number;\n\n this.groups.forEach((group) => {\n if (maxItems > 0 && itemsToProcess < maxItems) {\n Array.from(group.children).forEach((item: HTMLCalciteDropdownItemElement, index) => {\n if (index === 0) {\n if (isNaN(groupHeaderHeight)) {\n groupHeaderHeight = item.offsetTop;\n }\n\n maxScrollerHeight += groupHeaderHeight;\n }\n\n if (itemsToProcess < maxItems) {\n maxScrollerHeight += item.offsetHeight;\n itemsToProcess += 1;\n }\n });\n }\n });\n\n return items.length > maxItems ? maxScrollerHeight : 0;\n }\n\n private closeCalciteDropdown(focusTrigger = true) {\n this.open = false;\n\n if (focusTrigger) {\n focusElement(this.triggers[0]);\n }\n }\n\n private focusOnFirstActiveOrDefaultItem = (): void => {\n const selectedItem = this.getTraversableItems().find((item) => item.selected);\n const target: HTMLCalciteDropdownItemElement =\n selectedItem ||\n (this.focusLastDropdownItem ? this.items[this.items.length - 1] : this.items[0]);\n\n this.focusLastDropdownItem = false;\n\n if (!target) {\n return;\n }\n\n focusElement(target);\n };\n\n private onOpenEnd = (): void => {\n this.focusOnFirstActiveOrDefaultItem();\n this.el.removeEventListener(\"calciteDropdownOpen\", this.onOpenEnd);\n };\n\n private toggleDropdown = () => {\n this.open = !this.open;\n if (this.open) {\n this.el.addEventListener(\"calciteDropdownOpen\", this.onOpenEnd);\n }\n };\n\n private updateTabIndexOfItems(target: HTMLCalciteDropdownItemElement): void {\n this.items.forEach((item: HTMLCalciteDropdownItemElement) => {\n item.tabIndex = target !== item ? -1 : 0;\n });\n }\n}\n","export const CSS = {\n container: \"container\",\n containerNone: \"container--none-selection\",\n icon: \"dropdown-item-icon\",\n iconEnd: \"dropdown-item-icon--end\",\n iconStart: \"dropdown-item-icon--start\",\n itemContent: \"dropdown-item-content\",\n link: \"dropdown-link\",\n};\n",":host {\n // we make the host relative, so items can consistently compute their offsetTop based on the group\n @apply block relative;\n}\n\n.container {\n @apply text-start;\n}\n\n.dropdown-title {\n @apply border-color-3\n text-color-2\n -mb-px\n block\n cursor-default\n break-words\n border-0\n border-b\n border-solid\n font-bold;\n}\n\n.dropdown-separator {\n @apply block h-px;\n background-color: theme(\"borderColor.color.3\");\n}\n\n:host([scale=\"s\"]) {\n @apply text-n2h;\n .dropdown-title {\n @apply p-2;\n }\n}\n\n:host([scale=\"m\"]) {\n @apply text-n1h;\n .dropdown-title {\n @apply p-3;\n }\n}\n\n:host([scale=\"l\"]) {\n @apply text-0h;\n .dropdown-title {\n @apply p-4;\n }\n}\n\n@include base-component();\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n VNode,\n Watch,\n} from \"@stencil/core\";\nimport { Scale, SelectionMode } from \"../interfaces\";\nimport { createObserver } from \"../../utils/observers\";\nimport { CSS } from \"../dropdown-item/resources\";\nimport { RequestedItem } from \"./interfaces\";\n\n/**\n * @slot - A slot for adding `calcite-dropdown-item`s.\n */\n@Component({\n tag: \"calcite-dropdown-group\",\n styleUrl: \"dropdown-group.scss\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class DropdownGroup {\n //--------------------------------------------------------------------------\n //\n // Public Properties\n //\n //--------------------------------------------------------------------------\n\n /** Specifies and displays a group title. */\n @Prop({ reflect: true }) groupTitle: string;\n\n /**\n * Specifies the size of the component inherited from the parent `calcite-dropdown`, defaults to `m`.\n *\n * @internal\n */\n @Prop({ reflect: true }) scale: Scale = \"m\";\n\n /**\n * Specifies the selection mode of the component, where:\n *\n * `\"multiple\"` allows any number of selections,\n *\n * `\"single\"` allows only one selection, and\n *\n * `\"none\"` does not allow any selections.\n */\n @Prop({ reflect: true }) selectionMode: Extract<\"none\" | \"single\" | \"multiple\", SelectionMode> =\n \"single\";\n\n @Watch(\"selectionMode\")\n handlePropsChange(): void {\n this.updateItems();\n }\n\n //--------------------------------------------------------------------------\n //\n // Events\n //\n //--------------------------------------------------------------------------\n\n /**\n * @internal\n */\n @Event({ cancelable: false }) calciteInternalDropdownItemChange: EventEmitter;\n\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n\n connectedCallback(): void {\n this.updateItems();\n this.mutationObserver?.observe(this.el, { childList: true });\n }\n\n componentWillLoad(): void {\n this.groupPosition = this.getGroupPosition();\n }\n\n disconnectedCallback(): void {\n this.mutationObserver?.disconnect();\n }\n\n render(): VNode {\n const groupTitle = this.groupTitle ? (\n \n {this.groupTitle}\n \n ) : null;\n\n const dropdownSeparator =\n this.groupPosition > 0 ?
: null;\n\n return (\n \n \n {dropdownSeparator}\n {groupTitle}\n \n
\n \n );\n }\n\n //--------------------------------------------------------------------------\n //\n // Event Listeners\n //\n //--------------------------------------------------------------------------\n\n @Listen(\"calciteInternalDropdownItemSelect\")\n updateActiveItemOnChange(event: CustomEvent): void {\n this.requestedDropdownGroup = event.detail.requestedDropdownGroup;\n this.requestedDropdownItem = event.detail.requestedDropdownItem;\n this.calciteInternalDropdownItemChange.emit({\n requestedDropdownGroup: this.requestedDropdownGroup,\n requestedDropdownItem: this.requestedDropdownItem,\n });\n }\n\n //--------------------------------------------------------------------------\n //\n // Private State/Props\n //\n //--------------------------------------------------------------------------\n\n @Element() el: HTMLCalciteDropdownGroupElement;\n\n /** position of group within a dropdown */\n private groupPosition: number;\n\n /** the requested group */\n private requestedDropdownGroup: HTMLCalciteDropdownGroupElement;\n\n /** the requested item */\n private requestedDropdownItem: HTMLCalciteDropdownItemElement;\n\n private updateItems = (): void => {\n Array.from(this.el.querySelectorAll(\"calcite-dropdown-item\")).forEach(\n (item) => (item.selectionMode = this.selectionMode),\n );\n };\n\n mutationObserver = createObserver(\"mutation\", () => this.updateItems());\n\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n\n private getGroupPosition(): number {\n return Array.prototype.indexOf.call(\n this.el.parentElement.querySelectorAll(\"calcite-dropdown-group\"),\n this.el,\n );\n }\n}\n","@mixin item-styling {\n @apply text-color-3\n relative\n flex\n flex-grow\n cursor-pointer\n items-center\n no-underline\n duration-150\n ease-in-out;\n}\n\n:host {\n @apply relative\n flex\n flex-grow\n items-center\n focus-base;\n}\n\n.container {\n @include item-styling;\n @apply text-start;\n\n & a {\n @include item-styling;\n @apply focus-base;\n }\n}\n\n.dropdown-item-content {\n @apply flex-auto py-0.5;\n}\n\n// item icon\n.dropdown-item-icon {\n @apply relative\n opacity-0\n duration-150\n ease-in-out;\n transform: scale(0.9);\n}\n\n:host([scale=\"s\"]) {\n .container {\n @apply text-n2h py-1 px-2;\n }\n\n .dropdown-item-icon,\n .dropdown-item-icon--start {\n padding-inline-end: var(--calcite-spacing-sm);\n }\n\n .dropdown-item-icon--end {\n padding-inline-start: var(--calcite-spacing-sm);\n }\n}\n\n:host([scale=\"m\"]) {\n .container {\n @apply text-n1h py-2 px-3;\n }\n\n .dropdown-item-icon,\n .dropdown-item-icon--start {\n padding-inline-end: var(--calcite-spacing-md);\n }\n\n .dropdown-item-icon--end {\n padding-inline-start: var(--calcite-spacing-md);\n }\n}\n\n:host([scale=\"l\"]) {\n .container {\n @apply text-0h py-2.5 px-4;\n }\n\n .dropdown-item-icon,\n .dropdown-item-icon--start {\n padding-inline-end: var(--calcite-spacing-xl);\n }\n\n .dropdown-item-icon--end {\n padding-inline-start: var(--calcite-spacing-xl);\n }\n}\n\n//focus\n:host(:focus) {\n @apply focus-inset outline-none;\n\n .container {\n @apply text-color-1 no-underline;\n }\n}\n\n:host(:hover:not([disabled])),\n:host(:active:not([disabled])) {\n .container {\n @apply bg-foreground-2 text-color-1 no-underline;\n }\n\n .dropdown-link {\n @apply text-color-1;\n }\n}\n\n:host(:active:not([disabled])) .container {\n @apply bg-foreground-3;\n}\n\n:host([selected]) .container:not(.container--none-selection),\n:host([selected]) .dropdown-link {\n @apply text-color-1 font-medium;\n & calcite-icon {\n color: theme(\"backgroundColor.brand\");\n }\n}\n\n:host(:hover:not([disabled])) .dropdown-item-icon {\n color: theme(\"borderColor.color.1\");\n @apply opacity-100;\n}\n\n:host([selected]) .dropdown-item-icon {\n color: theme(\"backgroundColor.brand\");\n @apply opacity-100;\n}\n\n@include base-component();\n@include disabled();\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Method,\n Prop,\n VNode,\n} from \"@stencil/core\";\nimport { toAriaBoolean } from \"../../utils/dom\";\nimport { ItemKeyboardEvent } from \"../dropdown/interfaces\";\nimport { RequestedItem } from \"../dropdown-group/interfaces\";\nimport { FlipContext, Scale, SelectionMode } from \"../interfaces\";\nimport {\n componentFocusable,\n LoadableComponent,\n setComponentLoaded,\n setUpLoadableComponent,\n} from \"../../utils/loadable\";\nimport { getIconScale } from \"../../utils/component\";\nimport {\n InteractiveComponent,\n InteractiveContainer,\n updateHostInteraction,\n} from \"../../utils/interactive\";\nimport { IconNameOrString } from \"../icon/interfaces\";\nimport { CSS } from \"./resources\";\n\n/**\n * @slot - A slot for adding text.\n */\n@Component({\n tag: \"calcite-dropdown-item\",\n styleUrl: \"dropdown-item.scss\",\n shadow: true,\n})\nexport class DropdownItem implements InteractiveComponent, LoadableComponent {\n //--------------------------------------------------------------------------\n //\n // Public Properties\n //\n //--------------------------------------------------------------------------\n\n /**\n * When `true`, interaction is prevented and the component is displayed with lower opacity.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Specifies the URL of the linked resource, which can be set as an absolute or relative path.\n *\n * Determines if the component will render as an anchor.\n */\n @Prop({ reflect: true }) href: string;\n\n /** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`\"rtl\"`). */\n @Prop({ reflect: true }) iconFlipRtl: FlipContext;\n\n /** Specifies an icon to display at the start of the component. */\n @Prop({ reflect: true }) iconStart: IconNameOrString;\n\n /** Specifies an icon to display at the end of the component. */\n @Prop({ reflect: true }) iconEnd: IconNameOrString;\n\n /** Accessible name for the component. */\n @Prop() label: string;\n\n /** Specifies the relationship to the linked document defined in `href`. */\n @Prop({ reflect: true }) rel: string;\n\n /** When `true`, the component is selected. */\n @Prop({ reflect: true, mutable: true }) selected = false;\n\n /** Specifies the frame or window to open the linked document. */\n @Prop({ reflect: true }) target: string;\n\n //--------------------------------------------------------------------------\n //\n // Events\n //\n //--------------------------------------------------------------------------\n\n /** Fires when the component is selected. */\n @Event({ cancelable: false }) calciteDropdownItemSelect: EventEmitter;\n\n /**\n * @internal\n */\n @Event({ cancelable: false }) calciteInternalDropdownItemSelect: EventEmitter;\n\n /** @internal */\n @Event({ cancelable: false })\n calciteInternalDropdownItemKeyEvent: EventEmitter;\n\n /** @internal */\n @Event({ cancelable: false }) calciteInternalDropdownCloseRequest: EventEmitter;\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n\n /** Sets focus on the component. */\n @Method()\n async setFocus(): Promise {\n await componentFocusable(this);\n\n this.el?.focus();\n }\n\n /**\n * Specifies the selection mode inherited from `calcite-dropdown-group`, defaults to `single`:\n * - `multiple` allows any number of selected items,\n * - `single` allows only one selection (default),\n * - `none` doesn't allow for any selection.\n *\n * @internal\n */\n @Prop() selectionMode: Extract<\"none\" | \"single\" | \"multiple\", SelectionMode> = \"single\";\n\n /**\n * Specifies the size of the component inherited from `calcite-dropdown`, defaults to `m`.\n *\n * @internal\n */\n @Prop({ reflect: true }) scale: Scale = \"m\";\n\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n\n componentWillLoad(): void {\n setUpLoadableComponent(this);\n this.initialize();\n }\n\n componentDidLoad(): void {\n setComponentLoaded(this);\n }\n\n connectedCallback(): void {\n this.initialize();\n }\n\n componentDidRender(): void {\n updateHostInteraction(this);\n }\n\n render(): VNode {\n const { href, selectionMode, label, iconFlipRtl } = this;\n\n const iconStartEl = (\n \n );\n const contentNode = (\n \n \n \n );\n const iconEndEl = (\n \n );\n\n const slottedContent =\n this.iconStart && this.iconEnd\n ? [iconStartEl, contentNode, iconEndEl]\n : this.iconStart\n ? [iconStartEl, contentNode]\n : this.iconEnd\n ? [contentNode, iconEndEl]\n : contentNode;\n\n const contentEl = !href ? (\n slottedContent\n ) : (\n (this.childLink = el)}\n rel={this.rel}\n tabIndex={-1}\n target={this.target}\n >\n {slottedContent}\n \n );\n\n const itemRole = href\n ? null\n : selectionMode === \"single\"\n ? \"menuitemradio\"\n : selectionMode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\";\n\n const itemAria = selectionMode !== \"none\" ? toAriaBoolean(this.selected) : null;\n const { disabled } = this;\n\n return (\n \n \n \n {selectionMode !== \"none\" ? (\n \n ) : null}\n {contentEl}\n \n \n \n );\n }\n\n //--------------------------------------------------------------------------\n //\n // Event Listeners\n //\n //--------------------------------------------------------------------------\n\n @Listen(\"click\") onClick(): void {\n this.emitRequestedItem();\n }\n\n @Listen(\"keydown\")\n keyDownHandler(event: KeyboardEvent): void {\n switch (event.key) {\n case \" \":\n case \"Enter\":\n this.emitRequestedItem();\n if (this.href) {\n this.childLink.click();\n }\n event.preventDefault();\n break;\n case \"Escape\":\n this.calciteInternalDropdownCloseRequest.emit();\n event.preventDefault();\n break;\n case \"Tab\":\n this.calciteInternalDropdownItemKeyEvent.emit({ keyboardEvent: event });\n break;\n case \"ArrowUp\":\n case \"ArrowDown\":\n case \"Home\":\n case \"End\":\n event.preventDefault();\n this.calciteInternalDropdownItemKeyEvent.emit({ keyboardEvent: event });\n break;\n }\n }\n\n @Listen(\"calciteInternalDropdownItemChange\", { target: \"body\" })\n updateActiveItemOnChange(event: CustomEvent): void {\n const parentEmittedChange = event.composedPath().includes(this.parentDropdownGroupEl);\n\n if (parentEmittedChange) {\n this.requestedDropdownGroup = event.detail.requestedDropdownGroup;\n this.requestedDropdownItem = event.detail.requestedDropdownItem;\n this.determineActiveItem();\n }\n event.stopPropagation();\n }\n\n //--------------------------------------------------------------------------\n //\n // Private State/Props\n //\n //--------------------------------------------------------------------------\n\n @Element() el: HTMLCalciteDropdownItemElement;\n\n /** id of containing group */\n private parentDropdownGroupEl: HTMLCalciteDropdownGroupElement;\n\n /** requested group */\n private requestedDropdownGroup: HTMLCalciteDropdownGroupElement;\n\n /** requested item */\n private requestedDropdownItem: HTMLCalciteDropdownItemElement;\n\n /** if href is requested, track the rendered child link*/\n private childLink: HTMLAnchorElement;\n\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n\n private initialize(): void {\n this.parentDropdownGroupEl = this.el.closest(\"calcite-dropdown-group\");\n if (this.selectionMode === \"none\") {\n this.selected = false;\n }\n }\n\n private determineActiveItem(): void {\n switch (this.selectionMode) {\n case \"multiple\":\n if (this.el === this.requestedDropdownItem) {\n this.selected = !this.selected;\n }\n break;\n\n case \"single\":\n if (this.el === this.requestedDropdownItem) {\n this.selected = true;\n } else if (this.requestedDropdownGroup === this.parentDropdownGroupEl) {\n this.selected = false;\n }\n break;\n\n case \"none\":\n this.selected = false;\n break;\n }\n }\n\n private emitRequestedItem(): void {\n this.calciteDropdownItemSelect.emit();\n this.calciteInternalDropdownItemSelect.emit({\n requestedDropdownItem: this.el,\n requestedDropdownGroup: this.parentDropdownGroupEl,\n });\n }\n}\n"],"mappings":";;;;;yhBAAO,MAAMA,EAAQ,CACnBC,gBAAiB,WCDnB,MAAMC,EAAc,u8DACpB,MAAAC,EAAeD,E,MC6DFE,EAAQ,M,sVA0WXC,KAAAC,MAA0C,GAE1CD,KAAAE,OAA4C,GAWpDF,KAAAG,iBAAmBC,EAAe,YAAY,IAAMJ,KAAKK,gBAEzDL,KAAAM,eAAiBF,EAAe,UAAWG,GAAYP,KAAKQ,uBAAuBD,KAEnFP,KAAAS,mBAAqB,UAIrBT,KAAAU,KAAO,oBAAoBA,MAEnBV,KAAAW,sBAAwB,MAQhCX,KAAAY,sBAAwB,KACtB,MAAMC,GAAEA,EAAEC,eAAEA,GAAmBd,KAE/BA,KAAKe,uBAAyBD,EAC1BE,EAA0BF,EAAgBD,GAC1C,IAAI,EAGVb,KAAAiB,eAAkBC,IAChBlB,KAAKmB,SAAYD,EAAME,OAA2BC,iBAAiB,CACjEC,QAAS,OAGXtB,KAAKuB,WAAW,KAAK,EAGvBvB,KAAAK,YAAc,KACZL,KAAKC,MAAQD,KAAKE,OACfsB,KAAKC,GAAUC,MAAMC,KAAKF,GAAOG,iBAAiB,4BAClDC,QAAO,CAACC,EAAeC,IAAiB,IAAID,KAAkBC,IAAe,IAEhF/B,KAAKgC,sBAELh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