ng-primitives 0.84.0 → 0.86.0
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/fesm2022/ng-primitives-combobox.mjs +4 -1
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +9 -1
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +30 -6
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +2 -1
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +30 -13
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/package.json +5 -5
- package/popover/popover-trigger/popover-trigger.d.ts +6 -1
- package/portal/overlay.d.ts +2 -0
- package/portal/portal.d.ts +11 -1
- package/slider/slider-thumb/slider-thumb.d.ts +4 -0
- package/toast/toast/toast.d.ts +1 -1
|
@@ -987,7 +987,10 @@ class NgpCombobox {
|
|
|
987
987
|
break;
|
|
988
988
|
case 'Enter':
|
|
989
989
|
if (this.open()) {
|
|
990
|
-
this.
|
|
990
|
+
const activeItem = this.activeDescendantManager.activeItem();
|
|
991
|
+
if (activeItem) {
|
|
992
|
+
this.toggleOption(activeItem);
|
|
993
|
+
}
|
|
991
994
|
}
|
|
992
995
|
event.preventDefault();
|
|
993
996
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-combobox.mjs","sources":["../../../../packages/ng-primitives/combobox/src/combobox/combobox-state.ts","../../../../packages/ng-primitives/combobox/src/combobox-button/combobox-button.ts","../../../../packages/ng-primitives/combobox/src/combobox-dropdown/combobox-dropdown.ts","../../../../packages/ng-primitives/combobox/src/combobox-input/combobox-input.ts","../../../../packages/ng-primitives/combobox/src/utils.ts","../../../../packages/ng-primitives/combobox/src/combobox-option/combobox-option.ts","../../../../packages/ng-primitives/combobox/src/combobox-portal/combobox-portal.ts","../../../../packages/ng-primitives/combobox/src/config/combobox-config.ts","../../../../packages/ng-primitives/combobox/src/combobox/combobox.ts","../../../../packages/ng-primitives/combobox/src/ng-primitives-combobox.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpCombobox } from './combobox';\n\n/**\n * The state token for the Combobox primitive.\n */\nexport const NgpComboboxStateToken = createStateToken<NgpCombobox>('Combobox');\n\n/**\n * Provides the Combobox state.\n */\nexport const provideComboboxState = createStateProvider(NgpComboboxStateToken);\n\n/**\n * Injects the Combobox state.\n */\nexport const injectComboboxState = createStateInjector<NgpCombobox>(NgpComboboxStateToken);\n\n/**\n * The Combobox state registration function.\n */\nexport const comboboxState = createState(NgpComboboxStateToken);\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxButton]',\n exportAs: 'ngpComboboxButton',\n host: {\n type: 'button',\n tabindex: '-1',\n 'aria-haspopup': 'listbox',\n '[id]': 'id()',\n '[attr.aria-controls]': 'dropdownId()',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxButton {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLButtonElement>();\n\n /** The id of the button. */\n readonly id = input<string>(uniqueId('ngp-combobox-button'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerButton(this);\n }\n\n @HostListener('click')\n protected async toggleDropdown(): Promise<void> {\n await this.state().toggleDropdown();\n this.state().input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxDropdown]',\n exportAs: 'ngpComboboxDropdown',\n host: {\n role: 'listbox',\n '[id]': 'id()',\n '[style.left.px]': 'state().overlay()?.position()?.x',\n '[style.top.px]': 'state().overlay()?.position()?.y',\n '[style.--ngp-combobox-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-combobox-width.px]': 'comboboxDimensions().width',\n '[style.--ngp-combobox-input-width.px]': 'inputDimensions().width',\n '[style.--ngp-combobox-button-width.px]': 'buttonDimensions().width',\n },\n})\nexport class NgpComboboxDropdown {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /** The dimensions of the combobox. */\n protected readonly comboboxDimensions = observeResize(\n () => this.state().elementRef.nativeElement,\n );\n\n /** The dimensions of the combobox. */\n protected readonly inputDimensions = observeResize(\n () => this.state().input()?.elementRef.nativeElement,\n );\n\n /** Store the combobox button dimensions. */\n protected readonly buttonDimensions = observeResize(\n () => this.state().button()?.elementRef.nativeElement,\n );\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-combobox-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\n }\n}\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: 'input[ngpComboboxInput]',\n exportAs: 'ngpComboboxInput',\n host: {\n role: 'combobox',\n type: 'text',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-haspopup': 'listbox',\n 'aria-autocomplete': 'list',\n '[id]': 'id()',\n '[attr.aria-controls]': 'state().open() ? dropdownId() : undefined',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxInput {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /** The id of the input. */\n readonly id = input<string>(uniqueId('ngp-combobox-input'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n /** The id of the active descendant. */\n protected readonly activeDescendant = computed(() =>\n this.state().activeDescendantManager.activeDescendant(),\n );\n\n /** Determine if the pointer was used to focus the input. */\n protected pointerFocused = false;\n\n /**\n * The control status - this is required as we apply them to the combobox element as well as the input element.\n * @internal\n */\n readonly controlStatus = setupFormControl({ id: this.id, disabled: this.state().disabled });\n\n constructor() {\n ngpInteractions({\n focus: true,\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerInput(this);\n }\n\n /** Handle keydown events for accessibility. */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (this.state().open()) {\n this.state().activateNextOption();\n } else {\n this.state().openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.state().open()) {\n this.state().activatePreviousOption();\n } else {\n this.state().openDropdown();\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.state().open()) {\n this.state().activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.state().open()) {\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.state().open()) {\n const activeItem = this.state().activeDescendantManager.activeItem();\n if (activeItem) {\n this.state().toggleOption(activeItem);\n }\n }\n event.preventDefault();\n break;\n case 'Escape':\n this.state().closeDropdown();\n event.preventDefault();\n break;\n case 'Backspace':\n // if the input is not empty then open the dropdown\n if (this.elementRef.nativeElement.value.length > 0) {\n this.state().openDropdown();\n }\n break;\n default:\n // Ignore keys with length > 1 (e.g., 'Shift', 'ArrowLeft', 'Enter', etc.)\n // Filter out control/meta key combos (e.g., Ctrl+C)\n if (\n event.key !== 'Unidentified' &&\n (event.key.length > 1 || event.ctrlKey || event.metaKey || event.altKey)\n ) {\n return;\n }\n\n // if this was a character key, we want to open the dropdown\n this.state().openDropdown();\n }\n }\n\n @HostListener('blur', ['$event'])\n protected closeDropdown(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (\n relatedTarget &&\n this.state().dropdown()?.elementRef.nativeElement.contains(relatedTarget)\n ) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.state().button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.state().closeDropdown();\n event.preventDefault();\n }\n\n /**\n * Focus the input field\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus({ preventScroll: true });\n }\n\n @HostListener('focus', ['$event'])\n protected highlightText(): void {\n if (this.pointerFocused) {\n this.pointerFocused = false;\n return;\n }\n\n // highlight the text in the input\n this.elementRef.nativeElement.setSelectionRange(0, this.elementRef.nativeElement.value.length);\n }\n\n @HostListener('pointerdown', ['$event'])\n protected handlePointerDown(): void {\n this.pointerFocused = true;\n }\n}\n","import type { NgpComboboxOption } from './combobox-option/combobox-option';\n\n/**\n * Check if all regular options (excluding 'all' and undefined) are selected.\n * @param options All available options\n * @param selectedValues Currently selected values\n * @param compareWith Comparison function\n * @returns true if all regular options are selected\n */\nexport function areAllOptionsSelected(\n options: NgpComboboxOption[],\n selectedValues: any[],\n compareWith: (a: any, b: any) => boolean,\n): boolean {\n const regularOptions = options.filter(opt => opt.value() !== 'all' && opt.value() !== undefined);\n return (\n regularOptions.length > 0 &&\n regularOptions.every(opt => selectedValues.some(val => compareWith(val, opt.value())))\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { NgpActivatable } from 'ng-primitives/a11y';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\nimport { areAllOptionsSelected } from '../utils';\n\n@Directive({\n selector: '[ngpComboboxOption]',\n exportAs: 'ngpComboboxOption',\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.tabindex]': '-1',\n '[attr.aria-selected]': 'selected() ? \"true\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(click)': 'select()',\n },\n})\nexport class NgpComboboxOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * The element reference of the option.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-combobox-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpComboboxOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n protected readonly active = computed(\n () => this.state().activeDescendantManager.activeDescendant() === this.id(),\n );\n\n /** Whether this option is selected. */\n protected readonly selected = computed(() => {\n const value = this.value();\n const stateValue = this.state().value();\n\n if (!value) {\n return false;\n }\n\n // Handle select all functionality - only works in multiple selection mode\n if (value === 'all') {\n if (!this.state().multiple()) {\n return false; // Never selected in single selection mode\n }\n\n const selectedValues = Array.isArray(stateValue) ? stateValue : [];\n return areAllOptionsSelected(\n this.state().options(),\n selectedValues,\n this.state().compareWith(),\n );\n }\n\n if (!stateValue) {\n return false;\n }\n\n if (this.state().multiple()) {\n return (\n Array.isArray(stateValue) && stateValue.some(v => this.state().compareWith()(value, v))\n );\n }\n\n return this.state().compareWith()(value, stateValue);\n });\n\n constructor() {\n this.state().registerOption(this);\n\n ngpInteractions({\n hover: true,\n press: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error(\n 'ngpComboboxOption: The value input is required. Please provide a value for the option.',\n );\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterOption(this);\n }\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n if (this.disabled()) {\n return;\n }\n\n this.state().toggleOption(this);\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n }\n\n /**\n * Whenever the pointer enters the option, activate it.\n * @internal\n */\n @HostListener('pointerenter')\n protected onPointerEnter(): void {\n this.state().activeDescendantManager.activate(this);\n }\n\n /**\n * Whenever the pointer leaves the option, deactivate it.\n * @internal\n */\n @HostListener('pointerleave')\n protected onPointerLeave(): void {\n this.state().activeDescendantManager.activate(undefined);\n }\n}\n","import {\n Directive,\n inject,\n Injector,\n OnDestroy,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxPortal]',\n exportAs: 'ngpComboboxPortal',\n})\nexport class NgpComboboxPortal implements OnDestroy {\n /** Access the combobox state. */\n private readonly state = injectComboboxState();\n /** Access the view container reference. */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the template reference. */\n private readonly templateRef = inject(TemplateRef);\n\n /** Access the injector. */\n private readonly injector = inject(Injector);\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<void> | null>(null);\n\n constructor() {\n this.state().registerPortal(this);\n }\n\n /** Cleanup the portal. */\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n return this.overlay()!.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n async detach(): Promise<void> {\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the dropdown\n */\n private createOverlay(): void {\n // Create config for the overlay\n const config: NgpOverlayConfig<void> = {\n content: this.templateRef,\n viewContainerRef: this.viewContainerRef,\n triggerElement: this.state().elementRef.nativeElement,\n injector: this.injector,\n placement: this.state().placement,\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n container: this.state().container(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type NgpComboboxPlacement } from '../combobox/combobox';\n\nexport interface NgpComboboxConfig {\n /**\n * The default placement for the combobox dropdown.\n * @default 'bottom'\n */\n placement: NgpComboboxPlacement;\n\n /**\n * The container element or selector for the combobox dropdown.\n * This can be used to control where the dropdown is rendered in the DOM.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n}\n\nexport const defaultComboboxConfig: NgpComboboxConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpComboboxConfigToken = new InjectionToken<NgpComboboxConfig>(\n 'NgpComboboxConfigToken',\n);\n\n/**\n * Provide the default Combobox configuration\n * @param config The Combobox configuration\n * @returns The provider\n */\nexport function provideComboboxConfig(config: Partial<NgpComboboxConfig>): Provider[] {\n return [\n {\n provide: NgpComboboxConfigToken,\n useValue: { ...defaultComboboxConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Combobox configuration\n * @returns The global Combobox configuration\n */\nexport function injectComboboxConfig(): NgpComboboxConfig {\n return inject(NgpComboboxConfigToken, { optional: true }) ?? defaultComboboxConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport type { NgpComboboxButton } from '../combobox-button/combobox-button';\nimport type { NgpComboboxDropdown } from '../combobox-dropdown/combobox-dropdown';\nimport type { NgpComboboxInput } from '../combobox-input/combobox-input';\nimport { NgpComboboxOption } from '../combobox-option/combobox-option';\nimport type { NgpComboboxPortal } from '../combobox-portal/combobox-portal';\nimport { injectComboboxConfig } from '../config/combobox-config';\nimport { areAllOptionsSelected } from '../utils';\nimport { comboboxState, provideComboboxState } from './combobox-state';\n\n/**\n * Ideally we would use a generic type here, unfortunately, unlike in React,\n * we cannot infer the type based on another input. For example, if multiple\n * is true, we cannot infer that the value is an array of T. Using a union\n * type is not ideal either because it requires the user to handle multiple cases.\n * Using a generic also isn't ideal because we need to use T as both an array and\n * a single value.\n *\n * Any seems to be used by Angular Material, ng-select, and other libraries\n * so we will use it here as well.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype T = any;\n\n@Directive({\n selector: '[ngpCombobox]',\n exportAs: 'ngpCombobox',\n providers: [provideComboboxState()],\n host: {\n '[attr.tabindex]': 'input() ? -1 : (state.disabled() ? -1 : 0)',\n '[attr.data-open]': 'state.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n '[attr.data-invalid]': 'controlStatus()?.invalid ? \"\" : undefined',\n '[attr.data-valid]': 'controlStatus()?.valid ? \"\" : undefined',\n '[attr.data-touched]': 'controlStatus()?.touched ? \"\" : undefined',\n '[attr.data-pristine]': 'controlStatus()?.pristine ? \"\" : undefined',\n '[attr.data-dirty]': 'controlStatus()?.dirty ? \"\" : undefined',\n '[attr.data-pending]': 'controlStatus()?.pending ? \"\" : undefined',\n },\n})\nexport class NgpCombobox {\n /** Access the combobox configuration. */\n protected readonly config = injectComboboxConfig();\n\n /** @internal Access the combobox element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The value of the combobox. */\n readonly value = input<T>(undefined, {\n alias: 'ngpComboboxValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpComboboxValueChange',\n });\n\n /** Whether the combobox is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxDisabled',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox allows deselection in single selection mode. */\n readonly allowDeselect = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxAllowDeselect',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpComboboxOpenChange',\n });\n\n /** The comparator function used to compare options. */\n readonly compareWith = input<(a: T | undefined, b: T | undefined) => boolean>(Object.is, {\n alias: 'ngpComboboxCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<NgpComboboxPlacement>(this.config.placement, {\n alias: 'ngpComboboxDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpComboboxDropdownContainer',\n });\n\n /**\n * Store the combobox input\n * @internal\n */\n readonly input = signal<NgpComboboxInput | undefined>(undefined);\n\n /**\n * Store the combobox button.\n * @internal\n */\n readonly button = signal<NgpComboboxButton | undefined>(undefined);\n\n /**\n * Store the combobox portal.\n * @internal\n */\n readonly portal = signal<NgpComboboxPortal | undefined>(undefined);\n\n /**\n * Store the combobox dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpComboboxDropdown | undefined>(undefined);\n\n /**\n * Store the combobox options.\n * @internal\n */\n readonly options = signal<NgpComboboxOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the combobox.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => this.state.disabled()),\n items: this.options,\n });\n\n /** The control status */\n protected readonly controlStatus = computed(() => this.input()?.controlStatus());\n\n /** The state of the combobox. */\n protected readonly state = comboboxState<NgpCombobox>(this);\n\n constructor() {\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n // any time the active descendant changes, ensure we scroll it into view\n // perform after next render to ensure the DOM is updated\n // e.g. the dropdown is open before the option is scrolled into view\n afterRenderEffect({\n write: () => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n }\n\n /**\n * Open the dropdown.\n * @internal\n */\n async openDropdown(): Promise<void> {\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n this.openChange.emit(true);\n await this.portal()?.show();\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const selectedOption = this.options().find(option => this.isOptionSelected(option));\n\n // if there is no selected option, set the active descendant to the first option\n const targetOption = selectedOption ?? this.options()[0];\n\n // if there is no target option, do nothing\n if (!targetOption) {\n return;\n }\n\n // activate the selected option or the first option\n this.activeDescendantManager.activate(targetOption);\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n if (!this.open()) {\n return;\n }\n\n this.openChange.emit(false);\n this.portal()?.detach();\n\n // clear the active descendant\n this.activeDescendantManager.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async toggleDropdown(): Promise<void> {\n if (this.open()) {\n this.closeDropdown();\n } else {\n await this.openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param option The option to select.\n * @internal\n */\n selectOption(option: NgpComboboxOption | undefined): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (!option) {\n this.state.value.set(undefined);\n this.closeDropdown();\n return;\n }\n\n // Handle select all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n // Get currently visible regular options (respects filtering)\n const regularOptions = this.options().filter(\n opt => opt.value() !== 'all' && opt.value() !== undefined,\n );\n const allValues = regularOptions.map(opt => opt.value());\n\n this.state.value.set(allValues as T);\n this.valueChange.emit(allValues as T);\n return;\n }\n\n if (this.state.multiple()) {\n // if the option is already selected, do nothing\n if (this.isOptionSelected(option)) {\n return;\n }\n\n const value = [...(this.state.value() as T[]), option.value() as T];\n\n // add the option to the value\n this.state.value.set(value as T);\n this.valueChange.emit(value as T);\n } else {\n this.state.value.set(option.value() as T);\n this.valueChange.emit(option.value() as T);\n\n // close the dropdown on single selection\n this.closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpComboboxOption): void {\n // if the combobox is disabled or the option is not selected, do nothing\n if (this.state.disabled() || !this.isOptionSelected(option)) {\n return;\n }\n\n // in single selection mode, only allow deselecting if allowDeselect is true\n if (!this.state.multiple() && !this.state.allowDeselect()) {\n return;\n }\n\n // Handle select all for deselect all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n this.state.value.set([] as T);\n this.valueChange.emit([] as T);\n return;\n }\n\n if (this.state.multiple()) {\n const values = (this.state.value() as T[]) ?? [];\n const newValue = values.filter(v => !this.state.compareWith()(v, option.value() as T));\n\n // remove the option from the value\n this.state.value.set(newValue as T);\n this.valueChange.emit(newValue as T);\n } else {\n // in single selection mode with allowDeselect enabled, set value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n }\n }\n\n /**\n * Toggle the selection of an option.\n * @param option The option to toggle.\n * @internal\n */\n toggleOption(option: NgpComboboxOption): void {\n if (this.state.disabled()) {\n return;\n }\n\n // Handle select all for select/deselect all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n return;\n }\n\n if (this.state.multiple()) {\n // In multiple selection mode, always allow toggling\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n } else {\n // In single selection mode, check if deselection is allowed\n if (this.isOptionSelected(option) && this.state.allowDeselect()) {\n // Deselect the option by setting value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n } else {\n // Select the option (works even if already selected to update the input)\n this.selectOption(option);\n }\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: NgpComboboxOption): boolean {\n if (this.state.disabled()) {\n return false;\n }\n\n const optionValue = option.value();\n const value = this.state.value();\n\n // Handle select all functionality - only works in multiple selection mode\n if (optionValue === 'all') {\n if (!this.state.multiple()) {\n return false; // Never selected in single selection mode\n }\n\n const selectedValues = Array.isArray(value) ? value : [];\n return areAllOptionsSelected(this.options(), selectedValues, this.state.compareWith());\n }\n\n if (!value) {\n return false;\n }\n\n if (this.state.multiple()) {\n return value && (value as T[]).some(v => this.state.compareWith()(optionValue, v));\n }\n\n return this.state.compareWith()(optionValue, value);\n }\n\n /**\n * Activate the next option in the list if there is one.\n * If there is no option currently active, activate the selected option or the first option.\n * @internal\n */\n activateNextOption(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const options = this.options();\n\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[0];\n\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n\n // otherwise activate the next option\n this.activeDescendantManager.next();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n if (this.state.disabled()) {\n return;\n }\n const options = this.options();\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[options.length - 1];\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n // otherwise activate the previous option\n this.activeDescendantManager.previous();\n }\n\n /**\n * Register the dropdown portal with the combobox.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpComboboxPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the combobox input with the combobox.\n * @param input The combobox input.\n * @internal\n */\n registerInput(input: NgpComboboxInput): void {\n this.input.set(input);\n }\n\n /**\n * Register the combobox button with the combobox.\n * @param button The combobox button.\n * @internal\n */\n registerButton(button: NgpComboboxButton): void {\n this.button.set(button);\n }\n\n /**\n * Register the dropdown with the combobox.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpComboboxDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the combobox.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpComboboxOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the combobox.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpComboboxOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n\n /**\n * Focus the combobox.\n * When an input element is present, it will be focused.\n * Otherwise, the combobox element itself will be focused.\n * This enables keyboard navigation for comboboxes without input elements.\n * @internal\n */\n focus(): void {\n if (this.input()) {\n this.input()?.focus();\n } else {\n this.elementRef.nativeElement.focus();\n }\n }\n\n /**\n * Handle keydown events for keyboard navigation and accessibility.\n * Supports:\n * - Arrow Down: Open dropdown or navigate to next option\n * - Arrow Up: Open dropdown or navigate to previous option\n * - Home: Navigate to first option\n * - End: Navigate to last option\n * - Enter: Select the currently active option\n * - Escape: Close the dropdown\n * @param event - The keyboard event\n * @internal\n */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n // If the event originated from the input element, let the input handle it\n if (this.input() && event.target === this.input()?.elementRef.nativeElement) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n if (this.open()) {\n this.activateNextOption();\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.open()) {\n this.activatePreviousOption();\n } else {\n this.openDropdown();\n // Use setTimeout to ensure dropdown is rendered before selecting last item\n setTimeout(() => this.activeDescendantManager.last());\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.open()) {\n this.activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.open()) {\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.open()) {\n this.selectOption(this.activeDescendantManager.activeItem());\n }\n event.preventDefault();\n break;\n case 'Escape':\n if (this.open()) {\n this.closeDropdown();\n }\n event.preventDefault();\n break;\n }\n }\n\n /**\n * Handle blur events to manage dropdown closing behavior.\n * The dropdown will remain open if focus moves to:\n * - The dropdown itself\n * - The combobox button\n * - The combobox input\n * Otherwise, the dropdown will be closed.\n * @param event - The focus event\n * @internal\n */\n @HostListener('blur', ['$event'])\n protected onBlur(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (relatedTarget && this.dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n // if the blur was caused by focus moving to the input, don't close\n if (relatedTarget && this.input()?.elementRef.nativeElement === relatedTarget) {\n return;\n }\n\n this.closeDropdown();\n }\n}\n\nexport type NgpComboboxPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCJlD,iBAAiB,CAAA;AAgB5B,IAAA,WAAA,GAAA;;QAdmB,IAAA,CAAA,KAAK,GAAG,mBAAmB,EAAE;AAEhD;;;AAGG;QACM,IAAA,CAAA,UAAU,GAAG,gBAAgB,EAAqB;;QAGlD,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,qBAAqB,CAAC,CAAC;;AAGnD,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EA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-combobox.mjs","sources":["../../../../packages/ng-primitives/combobox/src/combobox/combobox-state.ts","../../../../packages/ng-primitives/combobox/src/combobox-button/combobox-button.ts","../../../../packages/ng-primitives/combobox/src/combobox-dropdown/combobox-dropdown.ts","../../../../packages/ng-primitives/combobox/src/combobox-input/combobox-input.ts","../../../../packages/ng-primitives/combobox/src/utils.ts","../../../../packages/ng-primitives/combobox/src/combobox-option/combobox-option.ts","../../../../packages/ng-primitives/combobox/src/combobox-portal/combobox-portal.ts","../../../../packages/ng-primitives/combobox/src/config/combobox-config.ts","../../../../packages/ng-primitives/combobox/src/combobox/combobox.ts","../../../../packages/ng-primitives/combobox/src/ng-primitives-combobox.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpCombobox } from './combobox';\n\n/**\n * The state token for the Combobox primitive.\n */\nexport const NgpComboboxStateToken = createStateToken<NgpCombobox>('Combobox');\n\n/**\n * Provides the Combobox state.\n */\nexport const provideComboboxState = createStateProvider(NgpComboboxStateToken);\n\n/**\n * Injects the Combobox state.\n */\nexport const injectComboboxState = createStateInjector<NgpCombobox>(NgpComboboxStateToken);\n\n/**\n * The Combobox state registration function.\n */\nexport const comboboxState = createState(NgpComboboxStateToken);\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxButton]',\n exportAs: 'ngpComboboxButton',\n host: {\n type: 'button',\n tabindex: '-1',\n 'aria-haspopup': 'listbox',\n '[id]': 'id()',\n '[attr.aria-controls]': 'dropdownId()',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxButton {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLButtonElement>();\n\n /** The id of the button. */\n readonly id = input<string>(uniqueId('ngp-combobox-button'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerButton(this);\n }\n\n @HostListener('click')\n protected async toggleDropdown(): Promise<void> {\n await this.state().toggleDropdown();\n this.state().input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxDropdown]',\n exportAs: 'ngpComboboxDropdown',\n host: {\n role: 'listbox',\n '[id]': 'id()',\n '[style.left.px]': 'state().overlay()?.position()?.x',\n '[style.top.px]': 'state().overlay()?.position()?.y',\n '[style.--ngp-combobox-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-combobox-width.px]': 'comboboxDimensions().width',\n '[style.--ngp-combobox-input-width.px]': 'inputDimensions().width',\n '[style.--ngp-combobox-button-width.px]': 'buttonDimensions().width',\n },\n})\nexport class NgpComboboxDropdown {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /** The dimensions of the combobox. */\n protected readonly comboboxDimensions = observeResize(\n () => this.state().elementRef.nativeElement,\n );\n\n /** The dimensions of the combobox. */\n protected readonly inputDimensions = observeResize(\n () => this.state().input()?.elementRef.nativeElement,\n );\n\n /** Store the combobox button dimensions. */\n protected readonly buttonDimensions = observeResize(\n () => this.state().button()?.elementRef.nativeElement,\n );\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-combobox-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\n }\n}\n","import { computed, Directive, HostListener, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: 'input[ngpComboboxInput]',\n exportAs: 'ngpComboboxInput',\n host: {\n role: 'combobox',\n type: 'text',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n 'aria-haspopup': 'listbox',\n 'aria-autocomplete': 'list',\n '[id]': 'id()',\n '[attr.aria-controls]': 'state().open() ? dropdownId() : undefined',\n '[attr.aria-expanded]': 'state().open()',\n '[attr.data-open]': 'state().open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state().disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state().multiple() ? \"\" : undefined',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '[disabled]': 'state().disabled()',\n },\n})\nexport class NgpComboboxInput {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /** The id of the input. */\n readonly id = input<string>(uniqueId('ngp-combobox-input'));\n\n /** The id of the dropdown. */\n readonly dropdownId = computed(() => this.state().dropdown()?.id());\n\n /** The id of the active descendant. */\n protected readonly activeDescendant = computed(() =>\n this.state().activeDescendantManager.activeDescendant(),\n );\n\n /** Determine if the pointer was used to focus the input. */\n protected pointerFocused = false;\n\n /**\n * The control status - this is required as we apply them to the combobox element as well as the input element.\n * @internal\n */\n readonly controlStatus = setupFormControl({ id: this.id, disabled: this.state().disabled });\n\n constructor() {\n ngpInteractions({\n focus: true,\n hover: true,\n press: true,\n disabled: this.state().disabled,\n });\n\n this.state().registerInput(this);\n }\n\n /** Handle keydown events for accessibility. */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (this.state().open()) {\n this.state().activateNextOption();\n } else {\n this.state().openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.state().open()) {\n this.state().activatePreviousOption();\n } else {\n this.state().openDropdown();\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.state().open()) {\n this.state().activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.state().open()) {\n this.state().activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.state().open()) {\n const activeItem = this.state().activeDescendantManager.activeItem();\n if (activeItem) {\n this.state().toggleOption(activeItem);\n }\n }\n event.preventDefault();\n break;\n case 'Escape':\n this.state().closeDropdown();\n event.preventDefault();\n break;\n case 'Backspace':\n // if the input is not empty then open the dropdown\n if (this.elementRef.nativeElement.value.length > 0) {\n this.state().openDropdown();\n }\n break;\n default:\n // Ignore keys with length > 1 (e.g., 'Shift', 'ArrowLeft', 'Enter', etc.)\n // Filter out control/meta key combos (e.g., Ctrl+C)\n if (\n event.key !== 'Unidentified' &&\n (event.key.length > 1 || event.ctrlKey || event.metaKey || event.altKey)\n ) {\n return;\n }\n\n // if this was a character key, we want to open the dropdown\n this.state().openDropdown();\n }\n }\n\n @HostListener('blur', ['$event'])\n protected closeDropdown(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (\n relatedTarget &&\n this.state().dropdown()?.elementRef.nativeElement.contains(relatedTarget)\n ) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.state().button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.state().closeDropdown();\n event.preventDefault();\n }\n\n /**\n * Focus the input field\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus({ preventScroll: true });\n }\n\n @HostListener('focus', ['$event'])\n protected highlightText(): void {\n if (this.pointerFocused) {\n this.pointerFocused = false;\n return;\n }\n\n // highlight the text in the input\n this.elementRef.nativeElement.setSelectionRange(0, this.elementRef.nativeElement.value.length);\n }\n\n @HostListener('pointerdown', ['$event'])\n protected handlePointerDown(): void {\n this.pointerFocused = true;\n }\n}\n","import type { NgpComboboxOption } from './combobox-option/combobox-option';\n\n/**\n * Check if all regular options (excluding 'all' and undefined) are selected.\n * @param options All available options\n * @param selectedValues Currently selected values\n * @param compareWith Comparison function\n * @returns true if all regular options are selected\n */\nexport function areAllOptionsSelected(\n options: NgpComboboxOption[],\n selectedValues: any[],\n compareWith: (a: any, b: any) => boolean,\n): boolean {\n const regularOptions = options.filter(opt => opt.value() !== 'all' && opt.value() !== undefined);\n return (\n regularOptions.length > 0 &&\n regularOptions.every(opt => selectedValues.some(val => compareWith(val, opt.value())))\n );\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { NgpActivatable } from 'ng-primitives/a11y';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectComboboxState } from '../combobox/combobox-state';\nimport { areAllOptionsSelected } from '../utils';\n\n@Directive({\n selector: '[ngpComboboxOption]',\n exportAs: 'ngpComboboxOption',\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.tabindex]': '-1',\n '[attr.aria-selected]': 'selected() ? \"true\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(click)': 'select()',\n },\n})\nexport class NgpComboboxOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the combobox state. */\n protected readonly state = injectComboboxState();\n\n /**\n * The element reference of the option.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-combobox-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpComboboxOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n protected readonly active = computed(\n () => this.state().activeDescendantManager.activeDescendant() === this.id(),\n );\n\n /** Whether this option is selected. */\n protected readonly selected = computed(() => {\n const value = this.value();\n const stateValue = this.state().value();\n\n if (!value) {\n return false;\n }\n\n // Handle select all functionality - only works in multiple selection mode\n if (value === 'all') {\n if (!this.state().multiple()) {\n return false; // Never selected in single selection mode\n }\n\n const selectedValues = Array.isArray(stateValue) ? stateValue : [];\n return areAllOptionsSelected(\n this.state().options(),\n selectedValues,\n this.state().compareWith(),\n );\n }\n\n if (!stateValue) {\n return false;\n }\n\n if (this.state().multiple()) {\n return (\n Array.isArray(stateValue) && stateValue.some(v => this.state().compareWith()(value, v))\n );\n }\n\n return this.state().compareWith()(value, stateValue);\n });\n\n constructor() {\n this.state().registerOption(this);\n\n ngpInteractions({\n hover: true,\n press: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error(\n 'ngpComboboxOption: The value input is required. Please provide a value for the option.',\n );\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterOption(this);\n }\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n if (this.disabled()) {\n return;\n }\n\n this.state().toggleOption(this);\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n }\n\n /**\n * Whenever the pointer enters the option, activate it.\n * @internal\n */\n @HostListener('pointerenter')\n protected onPointerEnter(): void {\n this.state().activeDescendantManager.activate(this);\n }\n\n /**\n * Whenever the pointer leaves the option, deactivate it.\n * @internal\n */\n @HostListener('pointerleave')\n protected onPointerLeave(): void {\n this.state().activeDescendantManager.activate(undefined);\n }\n}\n","import {\n Directive,\n inject,\n Injector,\n OnDestroy,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { injectComboboxState } from '../combobox/combobox-state';\n\n@Directive({\n selector: '[ngpComboboxPortal]',\n exportAs: 'ngpComboboxPortal',\n})\nexport class NgpComboboxPortal implements OnDestroy {\n /** Access the combobox state. */\n private readonly state = injectComboboxState();\n /** Access the view container reference. */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the template reference. */\n private readonly templateRef = inject(TemplateRef);\n\n /** Access the injector. */\n private readonly injector = inject(Injector);\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<void> | null>(null);\n\n constructor() {\n this.state().registerPortal(this);\n }\n\n /** Cleanup the portal. */\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n return this.overlay()!.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n async detach(): Promise<void> {\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the dropdown\n */\n private createOverlay(): void {\n // Create config for the overlay\n const config: NgpOverlayConfig<void> = {\n content: this.templateRef,\n viewContainerRef: this.viewContainerRef,\n triggerElement: this.state().elementRef.nativeElement,\n injector: this.injector,\n placement: this.state().placement,\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n container: this.state().container(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type NgpComboboxPlacement } from '../combobox/combobox';\n\nexport interface NgpComboboxConfig {\n /**\n * The default placement for the combobox dropdown.\n * @default 'bottom'\n */\n placement: NgpComboboxPlacement;\n\n /**\n * The container element or selector for the combobox dropdown.\n * This can be used to control where the dropdown is rendered in the DOM.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n}\n\nexport const defaultComboboxConfig: NgpComboboxConfig = {\n placement: 'bottom',\n container: 'body',\n};\n\nexport const NgpComboboxConfigToken = new InjectionToken<NgpComboboxConfig>(\n 'NgpComboboxConfigToken',\n);\n\n/**\n * Provide the default Combobox configuration\n * @param config The Combobox configuration\n * @returns The provider\n */\nexport function provideComboboxConfig(config: Partial<NgpComboboxConfig>): Provider[] {\n return [\n {\n provide: NgpComboboxConfigToken,\n useValue: { ...defaultComboboxConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Combobox configuration\n * @returns The global Combobox configuration\n */\nexport function injectComboboxConfig(): NgpComboboxConfig {\n return inject(NgpComboboxConfigToken, { optional: true }) ?? defaultComboboxConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport type { NgpComboboxButton } from '../combobox-button/combobox-button';\nimport type { NgpComboboxDropdown } from '../combobox-dropdown/combobox-dropdown';\nimport type { NgpComboboxInput } from '../combobox-input/combobox-input';\nimport { NgpComboboxOption } from '../combobox-option/combobox-option';\nimport type { NgpComboboxPortal } from '../combobox-portal/combobox-portal';\nimport { injectComboboxConfig } from '../config/combobox-config';\nimport { areAllOptionsSelected } from '../utils';\nimport { comboboxState, provideComboboxState } from './combobox-state';\n\n/**\n * Ideally we would use a generic type here, unfortunately, unlike in React,\n * we cannot infer the type based on another input. For example, if multiple\n * is true, we cannot infer that the value is an array of T. Using a union\n * type is not ideal either because it requires the user to handle multiple cases.\n * Using a generic also isn't ideal because we need to use T as both an array and\n * a single value.\n *\n * Any seems to be used by Angular Material, ng-select, and other libraries\n * so we will use it here as well.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype T = any;\n\n@Directive({\n selector: '[ngpCombobox]',\n exportAs: 'ngpCombobox',\n providers: [provideComboboxState()],\n host: {\n '[attr.tabindex]': 'input() ? -1 : (state.disabled() ? -1 : 0)',\n '[attr.data-open]': 'state.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n '[attr.data-invalid]': 'controlStatus()?.invalid ? \"\" : undefined',\n '[attr.data-valid]': 'controlStatus()?.valid ? \"\" : undefined',\n '[attr.data-touched]': 'controlStatus()?.touched ? \"\" : undefined',\n '[attr.data-pristine]': 'controlStatus()?.pristine ? \"\" : undefined',\n '[attr.data-dirty]': 'controlStatus()?.dirty ? \"\" : undefined',\n '[attr.data-pending]': 'controlStatus()?.pending ? \"\" : undefined',\n },\n})\nexport class NgpCombobox {\n /** Access the combobox configuration. */\n protected readonly config = injectComboboxConfig();\n\n /** @internal Access the combobox element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\n\n /** The value of the combobox. */\n readonly value = input<T>(undefined, {\n alias: 'ngpComboboxValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpComboboxValueChange',\n });\n\n /** Whether the combobox is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxDisabled',\n transform: booleanAttribute,\n });\n\n /** Whether the combobox allows deselection in single selection mode. */\n readonly allowDeselect = input<boolean, BooleanInput>(false, {\n alias: 'ngpComboboxAllowDeselect',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpComboboxOpenChange',\n });\n\n /** The comparator function used to compare options. */\n readonly compareWith = input<(a: T | undefined, b: T | undefined) => boolean>(Object.is, {\n alias: 'ngpComboboxCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<NgpComboboxPlacement>(this.config.placement, {\n alias: 'ngpComboboxDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpComboboxDropdownContainer',\n });\n\n /**\n * Store the combobox input\n * @internal\n */\n readonly input = signal<NgpComboboxInput | undefined>(undefined);\n\n /**\n * Store the combobox button.\n * @internal\n */\n readonly button = signal<NgpComboboxButton | undefined>(undefined);\n\n /**\n * Store the combobox portal.\n * @internal\n */\n readonly portal = signal<NgpComboboxPortal | undefined>(undefined);\n\n /**\n * Store the combobox dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpComboboxDropdown | undefined>(undefined);\n\n /**\n * Store the combobox options.\n * @internal\n */\n readonly options = signal<NgpComboboxOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the combobox.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => this.state.disabled()),\n items: this.options,\n });\n\n /** The control status */\n protected readonly controlStatus = computed(() => this.input()?.controlStatus());\n\n /** The state of the combobox. */\n protected readonly state = comboboxState<NgpCombobox>(this);\n\n constructor() {\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n // any time the active descendant changes, ensure we scroll it into view\n // perform after next render to ensure the DOM is updated\n // e.g. the dropdown is open before the option is scrolled into view\n afterRenderEffect({\n write: () => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n }\n\n /**\n * Open the dropdown.\n * @internal\n */\n async openDropdown(): Promise<void> {\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n this.openChange.emit(true);\n await this.portal()?.show();\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const selectedOption = this.options().find(option => this.isOptionSelected(option));\n\n // if there is no selected option, set the active descendant to the first option\n const targetOption = selectedOption ?? this.options()[0];\n\n // if there is no target option, do nothing\n if (!targetOption) {\n return;\n }\n\n // activate the selected option or the first option\n this.activeDescendantManager.activate(targetOption);\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n if (!this.open()) {\n return;\n }\n\n this.openChange.emit(false);\n this.portal()?.detach();\n\n // clear the active descendant\n this.activeDescendantManager.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async toggleDropdown(): Promise<void> {\n if (this.open()) {\n this.closeDropdown();\n } else {\n await this.openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param option The option to select.\n * @internal\n */\n selectOption(option: NgpComboboxOption | undefined): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (!option) {\n this.state.value.set(undefined);\n this.closeDropdown();\n return;\n }\n\n // Handle select all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n // Get currently visible regular options (respects filtering)\n const regularOptions = this.options().filter(\n opt => opt.value() !== 'all' && opt.value() !== undefined,\n );\n const allValues = regularOptions.map(opt => opt.value());\n\n this.state.value.set(allValues as T);\n this.valueChange.emit(allValues as T);\n return;\n }\n\n if (this.state.multiple()) {\n // if the option is already selected, do nothing\n if (this.isOptionSelected(option)) {\n return;\n }\n\n const value = [...(this.state.value() as T[]), option.value() as T];\n\n // add the option to the value\n this.state.value.set(value as T);\n this.valueChange.emit(value as T);\n } else {\n this.state.value.set(option.value() as T);\n this.valueChange.emit(option.value() as T);\n\n // close the dropdown on single selection\n this.closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpComboboxOption): void {\n // if the combobox is disabled or the option is not selected, do nothing\n if (this.state.disabled() || !this.isOptionSelected(option)) {\n return;\n }\n\n // in single selection mode, only allow deselecting if allowDeselect is true\n if (!this.state.multiple() && !this.state.allowDeselect()) {\n return;\n }\n\n // Handle select all for deselect all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n this.state.value.set([] as T);\n this.valueChange.emit([] as T);\n return;\n }\n\n if (this.state.multiple()) {\n const values = (this.state.value() as T[]) ?? [];\n const newValue = values.filter(v => !this.state.compareWith()(v, option.value() as T));\n\n // remove the option from the value\n this.state.value.set(newValue as T);\n this.valueChange.emit(newValue as T);\n } else {\n // in single selection mode with allowDeselect enabled, set value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n }\n }\n\n /**\n * Toggle the selection of an option.\n * @param option The option to toggle.\n * @internal\n */\n toggleOption(option: NgpComboboxOption): void {\n if (this.state.disabled()) {\n return;\n }\n\n // Handle select all for select/deselect all functionality - only works in multiple selection mode\n if (option.value() === 'all') {\n if (!this.state.multiple()) {\n return; // Do nothing in single selection mode\n }\n\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n return;\n }\n\n if (this.state.multiple()) {\n // In multiple selection mode, always allow toggling\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n } else {\n // In single selection mode, check if deselection is allowed\n if (this.isOptionSelected(option) && this.state.allowDeselect()) {\n // Deselect the option by setting value to undefined\n this.state.value.set(undefined);\n this.valueChange.emit(undefined);\n } else {\n // Select the option (works even if already selected to update the input)\n this.selectOption(option);\n }\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: NgpComboboxOption): boolean {\n if (this.state.disabled()) {\n return false;\n }\n\n const optionValue = option.value();\n const value = this.state.value();\n\n // Handle select all functionality - only works in multiple selection mode\n if (optionValue === 'all') {\n if (!this.state.multiple()) {\n return false; // Never selected in single selection mode\n }\n\n const selectedValues = Array.isArray(value) ? value : [];\n return areAllOptionsSelected(this.options(), selectedValues, this.state.compareWith());\n }\n\n if (!value) {\n return false;\n }\n\n if (this.state.multiple()) {\n return value && (value as T[]).some(v => this.state.compareWith()(optionValue, v));\n }\n\n return this.state.compareWith()(optionValue, value);\n }\n\n /**\n * Activate the next option in the list if there is one.\n * If there is no option currently active, activate the selected option or the first option.\n * @internal\n */\n activateNextOption(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const options = this.options();\n\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[0];\n\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n\n // otherwise activate the next option\n this.activeDescendantManager.next();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n if (this.state.disabled()) {\n return;\n }\n const options = this.options();\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[options.length - 1];\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n // otherwise activate the previous option\n this.activeDescendantManager.previous();\n }\n\n /**\n * Register the dropdown portal with the combobox.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpComboboxPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the combobox input with the combobox.\n * @param input The combobox input.\n * @internal\n */\n registerInput(input: NgpComboboxInput): void {\n this.input.set(input);\n }\n\n /**\n * Register the combobox button with the combobox.\n * @param button The combobox button.\n * @internal\n */\n registerButton(button: NgpComboboxButton): void {\n this.button.set(button);\n }\n\n /**\n * Register the dropdown with the combobox.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpComboboxDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the combobox.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpComboboxOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the combobox.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpComboboxOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n\n /**\n * Focus the combobox.\n * When an input element is present, it will be focused.\n * Otherwise, the combobox element itself will be focused.\n * This enables keyboard navigation for comboboxes without input elements.\n * @internal\n */\n focus(): void {\n if (this.input()) {\n this.input()?.focus();\n } else {\n this.elementRef.nativeElement.focus();\n }\n }\n\n /**\n * Handle keydown events for keyboard navigation and accessibility.\n * Supports:\n * - Arrow Down: Open dropdown or navigate to next option\n * - Arrow Up: Open dropdown or navigate to previous option\n * - Home: Navigate to first option\n * - End: Navigate to last option\n * - Enter: Select the currently active option\n * - Escape: Close the dropdown\n * @param event - The keyboard event\n * @internal\n */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n // If the event originated from the input element, let the input handle it\n if (this.input() && event.target === this.input()?.elementRef.nativeElement) {\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n if (this.open()) {\n this.activateNextOption();\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.open()) {\n this.activatePreviousOption();\n } else {\n this.openDropdown();\n // Use setTimeout to ensure dropdown is rendered before selecting last item\n setTimeout(() => this.activeDescendantManager.last());\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.open()) {\n this.activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.open()) {\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.open()) {\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (activeItem) {\n this.toggleOption(activeItem);\n }\n }\n event.preventDefault();\n break;\n case 'Escape':\n if (this.open()) {\n this.closeDropdown();\n }\n event.preventDefault();\n break;\n }\n }\n\n /**\n * Handle blur events to manage dropdown closing behavior.\n * The dropdown will remain open if focus moves to:\n * - The dropdown itself\n * - The combobox button\n * - The combobox input\n * Otherwise, the dropdown will be closed.\n * @param event - The focus event\n * @internal\n */\n @HostListener('blur', ['$event'])\n protected onBlur(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (relatedTarget && this.dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n // if the blur was caused by focus moving to the button, don't close\n if (relatedTarget && this.button()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n // if the blur was caused by focus moving to the input, don't close\n if (relatedTarget && this.input()?.elementRef.nativeElement === relatedTarget) {\n return;\n }\n\n this.closeDropdown();\n }\n}\n\nexport type NgpComboboxPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,q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yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,mBAAmB,EAAE,yCAAyC;AAC9D,wBAAA,qBAAqB,EAAE,2CAA2C;AACnE,qBAAA;AACF,iBAAA;wDA6fW,aAAa,EAAA,CAAA;sBADtB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;gBAoEzB,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;;;ACtnBlC;;AAEG;;;;"}
|
|
@@ -183,6 +183,13 @@ class NgpPopoverTrigger {
|
|
|
183
183
|
this.context = input(undefined, {
|
|
184
184
|
alias: 'ngpPopoverTriggerContext',
|
|
185
185
|
});
|
|
186
|
+
/**
|
|
187
|
+
* Define an anchor element for positioning the popover.
|
|
188
|
+
* If provided, the popover will be positioned relative to this element instead of the trigger.
|
|
189
|
+
*/
|
|
190
|
+
this.anchor = input(null, {
|
|
191
|
+
alias: 'ngpPopoverTriggerAnchor',
|
|
192
|
+
});
|
|
186
193
|
/**
|
|
187
194
|
* The overlay that manages the popover
|
|
188
195
|
* @internal
|
|
@@ -267,6 +274,7 @@ class NgpPopoverTrigger {
|
|
|
267
274
|
const config = {
|
|
268
275
|
content: popover,
|
|
269
276
|
triggerElement: this.trigger.nativeElement,
|
|
277
|
+
anchorElement: this.state.anchor(),
|
|
270
278
|
injector: this.injector,
|
|
271
279
|
context: this.state.context,
|
|
272
280
|
container: this.state.container(),
|
|
@@ -284,7 +292,7 @@ class NgpPopoverTrigger {
|
|
|
284
292
|
this.overlay.set(createOverlay(config));
|
|
285
293
|
}
|
|
286
294
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
287
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPopoverTrigger, isStandalone: true, selector: "[ngpPopoverTrigger]", inputs: { popover: { classPropertyName: "popover", publicName: "ngpPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPopoverTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpPopoverTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpPopoverTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpPopoverTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpPopoverTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpPopoverTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpPopoverTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpPopoverTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpPopoverTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpPopoverTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpPopoverTriggerContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "ngpPopoverTriggerOpenChange" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [providePopoverTriggerState({ inherit: false })], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
295
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpPopoverTrigger, isStandalone: true, selector: "[ngpPopoverTrigger]", inputs: { popover: { classPropertyName: "popover", publicName: "ngpPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpPopoverTriggerDisabled", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "ngpPopoverTriggerPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "ngpPopoverTriggerOffset", isSignal: true, isRequired: false, transformFunction: null }, showDelay: { classPropertyName: "showDelay", publicName: "ngpPopoverTriggerShowDelay", isSignal: true, isRequired: false, transformFunction: null }, hideDelay: { classPropertyName: "hideDelay", publicName: "ngpPopoverTriggerHideDelay", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "ngpPopoverTriggerFlip", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "ngpPopoverTriggerContainer", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "ngpPopoverTriggerCloseOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "ngpPopoverTriggerCloseOnEscape", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "ngpPopoverTriggerScrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ngpPopoverTriggerContext", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "ngpPopoverTriggerAnchor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "ngpPopoverTriggerOpenChange" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.data-open": "open() ? \"\" : null", "attr.data-placement": "state.placement()", "attr.data-disabled": "state.disabled() ? \"\" : null", "attr.aria-describedby": "overlay()?.ariaDescribedBy()" } }, providers: [providePopoverTriggerState({ inherit: false })], exportAs: ["ngpPopoverTrigger"], ngImport: i0 }); }
|
|
288
296
|
}
|
|
289
297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpPopoverTrigger, decorators: [{
|
|
290
298
|
type: Directive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-popover.mjs","sources":["../../../../packages/ng-primitives/popover/src/config/popover-config.ts","../../../../packages/ng-primitives/popover/src/popover-arrow/popover-arrow.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger-state.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger.ts","../../../../packages/ng-primitives/popover/src/popover/popover.ts","../../../../packages/ng-primitives/popover/src/ng-primitives-popover.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * Define the delay before the popover is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the popover should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n closeOnOutsideClick: boolean;\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n closeOnEscape: boolean;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultPopoverConfig: NgpPopoverConfig = {\n offset: 4,\n placement: 'bottom',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: 'body',\n closeOnOutsideClick: true,\n closeOnEscape: true,\n scrollBehavior: 'reposition',\n};\n\nexport const NgpPopoverConfigToken = new InjectionToken<NgpPopoverConfig>('NgpPopoverConfigToken');\n\n/**\n * Provide the default Popover configuration\n * @param config The Popover configuration\n * @returns The provider\n */\nexport function providePopoverConfig(config: Partial<NgpPopoverConfig>): Provider[] {\n return [\n {\n provide: NgpPopoverConfigToken,\n useValue: { ...defaultPopoverConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Popover configuration\n * @returns The global Popover configuration\n */\nexport function injectPopoverConfig(): NgpPopoverConfig {\n return inject(NgpPopoverConfigToken, { optional: true }) ?? defaultPopoverConfig;\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n})\nexport class NgpPopoverArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { InjectOptions, Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpPopoverTrigger } from './popover-trigger';\n\n/**\n * The state token for the PopoverTrigger primitive.\n */\nexport const NgpPopoverTriggerStateToken = createStateToken<NgpPopoverTrigger>('PopoverTrigger');\n\n/**\n * Provides the PopoverTrigger state.\n */\nexport const providePopoverTriggerState = createStateProvider(NgpPopoverTriggerStateToken);\n\n/**\n * Injects the PopoverTrigger state.\n */\nexport const injectPopoverTriggerState = createStateInjector<NgpPopoverTrigger>(\n NgpPopoverTriggerStateToken,\n) as <T>(options?: InjectOptions) => Signal<State<NgpPopoverTrigger<T>>>;\n\n/**\n * The PopoverTrigger state registration function.\n */\nexport const popoverTriggerState = createState(NgpPopoverTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n output,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport { popoverTriggerState, providePopoverTriggerState } from './popover-trigger-state';\n\n/**\n * Apply the `ngpPopoverTrigger` directive to an element that triggers the popover to show.\n */\n@Directive({\n selector: '[ngpPopoverTrigger]',\n exportAs: 'ngpPopoverTrigger',\n providers: [providePopoverTriggerState({ inherit: false })],\n host: {\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global popover configuration.\n */\n private readonly config = injectPopoverConfig();\n\n /**\n * Access the popover template ref.\n */\n readonly popover = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpPopoverTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPopoverTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpPopoverPlacement>(this.config.placement, {\n alias: 'ngpPopoverTriggerPlacement',\n });\n\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpPopoverTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpPopoverTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpPopoverTriggerContainer',\n });\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n readonly closeOnOutsideClick = input<boolean, BooleanInput>(this.config.closeOnOutsideClick, {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: booleanAttribute,\n });\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n readonly closeOnEscape = input<boolean, BooleanInput>(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: booleanAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpPopoverTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpPopoverTriggerContext',\n });\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Event emitted when the popover open state changes.\n */\n readonly openChange = output<boolean>({\n alias: 'ngpPopoverTriggerOpenChange',\n });\n\n /**\n * The popover trigger state.\n */\n readonly state = popoverTriggerState<NgpPopoverTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the popover is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n async show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n await this.overlay()?.show();\n\n if (this.open()) {\n this.openChange.emit(true);\n }\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n async hide(origin: FocusOrigin = 'program'): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n await this.overlay()?.hide({ origin });\n\n this.openChange.emit(false);\n }\n\n /**\n * Create the overlay that will contain the popover\n */\n private createOverlay(): void {\n const popover = this.state.popover();\n\n if (!popover) {\n throw new Error('Popover must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: popover,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement,\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnOutsideClick: this.state.closeOnOutsideClick(),\n closeOnEscape: this.state.closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n\nexport type NgpPopoverPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpPopover]',\n exportAs: 'ngpPopover',\n hostDirectives: [NgpFocusTrap],\n host: {\n role: 'dialog',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-popover-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-popover-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpPopover {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA6DO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;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AAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,sCAAA,EAAA,wBAAA,EAAA,sCAAA,EAAA,2BAAA,EAAA,qBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,YAAY,CAAC;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACrE,wBAAA,uBAAuB,EAAE,0BAA0B;AACnD,wBAAA,cAAc,EAAE,EAAE;AACnB,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-popover.mjs","sources":["../../../../packages/ng-primitives/popover/src/config/popover-config.ts","../../../../packages/ng-primitives/popover/src/popover-arrow/popover-arrow.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger-state.ts","../../../../packages/ng-primitives/popover/src/popover-trigger/popover-trigger.ts","../../../../packages/ng-primitives/popover/src/popover/popover.ts","../../../../packages/ng-primitives/popover/src/ng-primitives-popover.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { type Placement } from '@floating-ui/dom';\nimport { NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpPopoverConfig {\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 4\n */\n offset: NgpOffset;\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * Define the delay before the popover is shown.\n * @default 0\n */\n showDelay: number;\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n hideDelay: number;\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container element or selector in to which the popover should be attached.\n * @default 'body'\n */\n container: HTMLElement | string | null;\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n closeOnOutsideClick: boolean;\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n closeOnEscape: boolean;\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultPopoverConfig: NgpPopoverConfig = {\n offset: 4,\n placement: 'bottom',\n showDelay: 0,\n hideDelay: 0,\n flip: true,\n container: 'body',\n closeOnOutsideClick: true,\n closeOnEscape: true,\n scrollBehavior: 'reposition',\n};\n\nexport const NgpPopoverConfigToken = new InjectionToken<NgpPopoverConfig>('NgpPopoverConfigToken');\n\n/**\n * Provide the default Popover configuration\n * @param config The Popover configuration\n * @returns The provider\n */\nexport function providePopoverConfig(config: Partial<NgpPopoverConfig>): Provider[] {\n return [\n {\n provide: NgpPopoverConfigToken,\n useValue: { ...defaultPopoverConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Popover configuration\n * @returns The global Popover configuration\n */\nexport function injectPopoverConfig(): NgpPopoverConfig {\n return inject(NgpPopoverConfigToken, { optional: true }) ?? defaultPopoverConfig;\n}\n","import { Directive } from '@angular/core';\nimport { setupOverlayArrow } from 'ng-primitives/portal';\n\n@Directive({\n selector: '[ngpPopoverArrow]',\n exportAs: 'ngpPopoverArrow',\n})\nexport class NgpPopoverArrow {\n constructor() {\n setupOverlayArrow();\n }\n}\n","import { InjectOptions, Signal } from '@angular/core';\nimport {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n State,\n} from 'ng-primitives/state';\nimport type { NgpPopoverTrigger } from './popover-trigger';\n\n/**\n * The state token for the PopoverTrigger primitive.\n */\nexport const NgpPopoverTriggerStateToken = createStateToken<NgpPopoverTrigger>('PopoverTrigger');\n\n/**\n * Provides the PopoverTrigger state.\n */\nexport const providePopoverTriggerState = createStateProvider(NgpPopoverTriggerStateToken);\n\n/**\n * Injects the PopoverTrigger state.\n */\nexport const injectPopoverTriggerState = createStateInjector<NgpPopoverTrigger>(\n NgpPopoverTriggerStateToken,\n) as <T>(options?: InjectOptions) => Signal<State<NgpPopoverTrigger<T>>>;\n\n/**\n * The PopoverTrigger state registration function.\n */\nexport const popoverTriggerState = createState(NgpPopoverTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n output,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n coerceOffset,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { injectPopoverConfig } from '../config/popover-config';\nimport { popoverTriggerState, providePopoverTriggerState } from './popover-trigger-state';\n\n/**\n * Apply the `ngpPopoverTrigger` directive to an element that triggers the popover to show.\n */\n@Directive({\n selector: '[ngpPopoverTrigger]',\n exportAs: 'ngpPopoverTrigger',\n providers: [providePopoverTriggerState({ inherit: false })],\n host: {\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : null',\n '[attr.aria-describedby]': 'overlay()?.ariaDescribedBy()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpPopoverTrigger<T = null> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global popover configuration.\n */\n private readonly config = injectPopoverConfig();\n\n /**\n * Access the popover template ref.\n */\n readonly popover = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpPopoverTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPopoverTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the popover relative to the trigger.\n * @default 'top'\n */\n readonly placement = input<NgpPopoverPlacement>(this.config.placement, {\n alias: 'ngpPopoverTriggerPlacement',\n });\n\n /**\n * Define the offset of the popover relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n * @default 0\n */\n readonly offset = input<NgpOffset, NgpOffsetInput>(this.config.offset, {\n alias: 'ngpPopoverTriggerOffset',\n transform: coerceOffset,\n });\n\n /**\n * Define the delay before the popover is displayed.\n * @default 0\n */\n readonly showDelay = input<number, NumberInput>(this.config.showDelay, {\n alias: 'ngpPopoverTriggerShowDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define the delay before the popover is hidden.\n * @default 0\n */\n readonly hideDelay = input<number, NumberInput>(this.config.hideDelay, {\n alias: 'ngpPopoverTriggerHideDelay',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the popover should flip when there is not enough space for the popover.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpPopoverTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the popover should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpPopoverTriggerContainer',\n });\n\n /**\n * Define whether the popover should close when clicking outside of it.\n * @default true\n */\n readonly closeOnOutsideClick = input<boolean, BooleanInput>(this.config.closeOnOutsideClick, {\n alias: 'ngpPopoverTriggerCloseOnOutsideClick',\n transform: booleanAttribute,\n });\n\n /**\n * Define whether the popover should close when the escape key is pressed.\n * @default true\n */\n readonly closeOnEscape = input<boolean, BooleanInput>(this.config.closeOnEscape, {\n alias: 'ngpPopoverTriggerCloseOnEscape',\n transform: booleanAttribute,\n });\n\n /**\n * Defines how the popover behaves when the window is scrolled.\n * @default 'reposition'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpPopoverTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the popover. This can be used to pass data to the popover content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpPopoverTriggerContext',\n });\n\n /**\n * Define an anchor element for positioning the popover.\n * If provided, the popover will be positioned relative to this element instead of the trigger.\n */\n readonly anchor = input<HTMLElement | null>(null, {\n alias: 'ngpPopoverTriggerAnchor',\n });\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the popover.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Event emitted when the popover open state changes.\n */\n readonly openChange = output<boolean>({\n alias: 'ngpPopoverTriggerOpenChange',\n });\n\n /**\n * The popover trigger state.\n */\n readonly state = popoverTriggerState<NgpPopoverTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the popover\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the popover is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the popover.\n * @returns A promise that resolves when the popover has been shown\n */\n async show(): Promise<void> {\n // If the trigger is disabled, don't show the popover\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n await this.overlay()?.show();\n\n if (this.open()) {\n this.openChange.emit(true);\n }\n }\n\n /**\n * @internal\n * Hide the popover.\n * @returns A promise that resolves when the popover has been hidden\n */\n async hide(origin: FocusOrigin = 'program'): Promise<void> {\n // If the trigger is disabled or the popover is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n await this.overlay()?.hide({ origin });\n\n this.openChange.emit(false);\n }\n\n /**\n * Create the overlay that will contain the popover\n */\n private createOverlay(): void {\n const popover = this.state.popover();\n\n if (!popover) {\n throw new Error('Popover must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: popover,\n triggerElement: this.trigger.nativeElement,\n anchorElement: this.state.anchor(),\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement,\n offset: this.state.offset(),\n flip: this.state.flip(),\n showDelay: this.state.showDelay(),\n hideDelay: this.state.hideDelay(),\n closeOnOutsideClick: this.state.closeOnOutsideClick(),\n closeOnEscape: this.state.closeOnEscape(),\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n\nexport type NgpPopoverPlacement =\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'top-start'\n | 'top-end'\n | 'right-start'\n | 'right-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end';\n","import { Directive, input } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectOverlay } from 'ng-primitives/portal';\n\n/**\n * Apply the `ngpPopover` directive to an element that represents the popover. This typically would be a `div` inside an `ng-template`.\n */\n@Directive({\n selector: '[ngpPopover]',\n exportAs: 'ngpPopover',\n hostDirectives: [NgpFocusTrap],\n host: {\n role: 'dialog',\n '[id]': 'id()',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-popover-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-popover-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n 'data-overlay': '',\n },\n})\nexport class NgpPopover {\n /**\n * Access the overlay.\n */\n protected readonly overlay = injectOverlay();\n\n /**\n * The unique id of the tooltip.\n */\n readonly id = input(this.overlay.id());\n\n constructor() {\n explicitEffect([this.id], ([id]) => this.overlay.id.set(id));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA6DO,MAAM,oBAAoB,GAAqB;AACpD,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,MAAM;AACjB,IAAA,mBAAmB,EAAE,IAAI;AACzB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,cAAc,EAAE,YAAY;CAC7B;AAEM,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB,CAAC;AAElG;;;;AAIG;AACG,SAAU,oBAAoB,CAAC,MAAiC,EAAA;IACpE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,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A,EAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,eAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,sCAAA,EAAA,wBAAA,EAAA,sCAAA,EAAA,2BAAA,EAAA,qBAAA,EAAA,0BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,cAAc,EAAE,CAAC,YAAY,CAAC;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,wCAAwC,EAAE,wBAAwB;AAClE,wBAAA,wCAAwC,EAAE,2BAA2B;AACrE,wBAAA,uBAAuB,EAAE,0BAA0B;AACnD,wBAAA,cAAc,EAAE,EAAE;AACnB,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -6,6 +6,7 @@ import { autoUpdate, offset, shift, flip, arrow, computePosition } from '@floati
|
|
|
6
6
|
import { setupExitAnimation, explicitEffect, fromResizeEvent, injectElementRef } from 'ng-primitives/internal';
|
|
7
7
|
import { isObject, isFunction, injectDisposables, uniqueId, safeTakeUntilDestroyed, isNil } from 'ng-primitives/utils';
|
|
8
8
|
import { Subject, fromEvent } from 'rxjs';
|
|
9
|
+
import { VERSION } from '@angular/cdk';
|
|
9
10
|
import { ComponentPortal, DomPortalOutlet, TemplatePortal } from '@angular/cdk/portal';
|
|
10
11
|
import { coerceCssPixelValue, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
11
12
|
|
|
@@ -31,6 +32,21 @@ class NgpPortal {
|
|
|
31
32
|
this.viewContainerRef = viewContainerRef;
|
|
32
33
|
this.injector = injector;
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Angular v20 removes `_unusedComponentFactoryResolver` and `_document` from DomPortalOutlet's
|
|
37
|
+
* constructor signature as they have been deprecated since v18, and replaced with optional
|
|
38
|
+
* `_appRef` and `_defaultInjector` params.
|
|
39
|
+
* This temporary change ensures consistent behaviour for consumers using ng v20+.
|
|
40
|
+
* @see {@link https://github.com/angular/components/pull/24504 The implementing PR} for the new implementation.
|
|
41
|
+
* @see {@link https://github.com/angular/components/blob/732a0d7ab69ec25925cc06a0fb17b0fb16a4b0ae/src/cdk/portal/dom-portal-outlet.ts#L27 The latest v20 version comments}
|
|
42
|
+
* describe the importance of passing the `_appRef` and `_defaultInjector` when it comes to component portals
|
|
43
|
+
*/
|
|
44
|
+
// todo: remove this compat fix once support for v19 is dropped when v21 is released
|
|
45
|
+
// - should aim to add appRef also to prevent unforeseen issues in certain edge cases
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
_getDomPortalOutletCtorParamsCompat() {
|
|
48
|
+
return Number(VERSION.major) >= 20 ? [this.injector] : [undefined, this.injector];
|
|
49
|
+
}
|
|
34
50
|
}
|
|
35
51
|
class NgpComponentPortal extends NgpPortal {
|
|
36
52
|
constructor(component, viewContainerRef, injector) {
|
|
@@ -45,7 +61,7 @@ class NgpComponentPortal extends NgpPortal {
|
|
|
45
61
|
* @param container The DOM element to attach the portal to.
|
|
46
62
|
*/
|
|
47
63
|
attach(container) {
|
|
48
|
-
const domOutlet = new DomPortalOutlet(container, undefined,
|
|
64
|
+
const domOutlet = new DomPortalOutlet(container, undefined, ...this._getDomPortalOutletCtorParamsCompat());
|
|
49
65
|
this.viewRef = domOutlet.attach(this.componentPortal);
|
|
50
66
|
const element = this.viewRef.location.nativeElement;
|
|
51
67
|
this.exitAnimationRef = setupExitAnimation({ element });
|
|
@@ -98,7 +114,7 @@ class NgpTemplatePortal extends NgpPortal {
|
|
|
98
114
|
* @param container The DOM element to attach the portal to.
|
|
99
115
|
*/
|
|
100
116
|
attach(container) {
|
|
101
|
-
const domOutlet = new DomPortalOutlet(container, undefined,
|
|
117
|
+
const domOutlet = new DomPortalOutlet(container, undefined, ...this._getDomPortalOutletCtorParamsCompat());
|
|
102
118
|
this.viewRef = domOutlet.attach(this.templatePortal);
|
|
103
119
|
for (const rootNode of this.viewRef.rootNodes) {
|
|
104
120
|
if (rootNode instanceof HTMLElement) {
|
|
@@ -341,7 +357,8 @@ class NgpOverlay {
|
|
|
341
357
|
// this must be done after the config is set
|
|
342
358
|
this.transformOrigin.set(this.getTransformOrigin());
|
|
343
359
|
// Monitor trigger element resize
|
|
344
|
-
|
|
360
|
+
const elementToMonitor = this.config.anchorElement || this.config.triggerElement;
|
|
361
|
+
fromResizeEvent(elementToMonitor)
|
|
345
362
|
.pipe(safeTakeUntilDestroyed(this.destroyRef))
|
|
346
363
|
.subscribe(({ width, height }) => {
|
|
347
364
|
this.triggerWidth.set(width);
|
|
@@ -370,7 +387,10 @@ class NgpOverlay {
|
|
|
370
387
|
const path = event.composedPath();
|
|
371
388
|
const isInsideOverlay = overlay.getElements().some(el => path.includes(el));
|
|
372
389
|
const isInsideTrigger = path.includes(this.config.triggerElement);
|
|
373
|
-
|
|
390
|
+
const isInsideAnchor = this.config.anchorElement
|
|
391
|
+
? path.includes(this.config.anchorElement)
|
|
392
|
+
: false;
|
|
393
|
+
if (!isInsideOverlay && !isInsideTrigger && !isInsideAnchor) {
|
|
374
394
|
this.hide();
|
|
375
395
|
}
|
|
376
396
|
});
|
|
@@ -560,8 +580,10 @@ class NgpOverlay {
|
|
|
560
580
|
const strategy = getComputedStyle(overlayElement).position === 'fixed'
|
|
561
581
|
? 'fixed'
|
|
562
582
|
: this.config.strategy || 'absolute';
|
|
583
|
+
// Use anchor element for positioning if provided, otherwise use trigger element
|
|
584
|
+
const referenceElement = this.config.anchorElement || this.config.triggerElement;
|
|
563
585
|
// Setup auto-update for positioning
|
|
564
|
-
this.disposePositioning = autoUpdate(
|
|
586
|
+
this.disposePositioning = autoUpdate(referenceElement, overlayElement, () => this.computePosition(overlayElement, strategy));
|
|
565
587
|
}
|
|
566
588
|
/**
|
|
567
589
|
* Compute the overlay position using floating-ui
|
|
@@ -583,7 +605,9 @@ class NgpOverlay {
|
|
|
583
605
|
}
|
|
584
606
|
// Compute the position
|
|
585
607
|
const placement = this.config.placement?.() ?? 'top';
|
|
586
|
-
|
|
608
|
+
// Use anchor element for positioning if provided, otherwise use trigger element
|
|
609
|
+
const referenceElement = this.config.anchorElement || this.config.triggerElement;
|
|
610
|
+
const position = await computePosition(referenceElement, overlayElement, {
|
|
587
611
|
placement,
|
|
588
612
|
middleware,
|
|
589
613
|
strategy,
|