ng-primitives 0.121.0 → 0.122.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 +13 -3
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-context-menu.mjs +9 -3
- package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +8 -2
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-navigation-menu.mjs +6 -2
- package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +8 -3
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +7 -2
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +15 -12
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +9 -5
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-primitives-combobox.d.ts +11 -1
- package/types/ng-primitives-context-menu.d.ts +16 -3
- package/types/ng-primitives-menu.d.ts +16 -1
- package/types/ng-primitives-navigation-menu.d.ts +22 -9
- package/types/ng-primitives-popover.d.ts +9 -2
- package/types/ng-primitives-select.d.ts +9 -2
- package/types/ng-primitives-toast.d.ts +4 -3
- package/types/ng-primitives-tooltip.d.ts +18 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-select.mjs","sources":["../../../../packages/ng-primitives/select/src/native-select/native-select-state.ts","../../../../packages/ng-primitives/select/src/native-select/native-select.ts","../../../../packages/ng-primitives/select/src/select/select-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown.ts","../../../../packages/ng-primitives/select/src/select-option/select-option-state.ts","../../../../packages/ng-primitives/select/src/select-option/select-option.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal-state.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal.ts","../../../../packages/ng-primitives/select/src/config/select-config.ts","../../../../packages/ng-primitives/select/src/select/select.ts","../../../../packages/ng-primitives/select/src/ng-primitives-select.ts"],"sourcesContent":["import { signal, Signal } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, controlled, createPrimitive, deprecatedSetter } from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\nexport interface NgpNativeSelectState {\n /**\n * Whether the select is disabled.\n */\n readonly disabled: Signal<boolean>;\n\n /**\n * Set the disabled state of the select.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\nexport interface NgpNativeSelectProps {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id?: Signal<string>;\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [\n NgpNativeSelectStateToken,\n ngpNativeSelect,\n injectNativeSelectState,\n provideNativeSelectState,\n] = createPrimitive(\n 'NgpNativeSelect',\n ({\n disabled: _disabled = signal(false),\n id = signal(uniqueId('ngp-native-select')),\n }: NgpNativeSelectProps) => {\n const element = injectElementRef();\n const disabled = controlled(_disabled);\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: disabled,\n });\n ngpFormControl({ id: id, disabled: disabled });\n\n attrBinding(element, 'disabled', disabled);\n\n function setDisabled(value: boolean): void {\n disabled.set(value);\n }\n\n return {\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n setDisabled,\n } satisfies NgpNativeSelectState;\n },\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpNativeSelect, provideNativeSelectState } from './native-select-state';\n\n/**\n * Apply the `ngpNativeSelect` directive to a select element that you want to enhance.\n */\n@Directive({\n selector: 'select[ngpNativeSelect]',\n exportAs: 'ngpNativeSelect',\n providers: [provideNativeSelectState()],\n})\nexport class NgpNativeSelect {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-native-select'));\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpNativeSelectDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n ngpNativeSelect({\n id: this.id,\n disabled: this.disabled,\n });\n }\n}\n","import { computed, ElementRef, Signal, signal, WritableSignal } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { domSort, injectElementRef } from 'ng-primitives/internal';\nimport type { NgpFlip, NgpOffset, NgpOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n listener,\n SetterOptions,\n StateInjectionOptions,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable } from 'rxjs';\nimport type { NgpSelectDropdownState } from '../select-dropdown/select-dropdown-state';\nimport type { NgpSelectOptionState } from '../select-option/select-option-state';\nimport { NgpSelectPortalState } from '../select-portal/select-portal-state';\n\nexport interface NgpSelectState<T> {\n /**\n * @internal Access the select element.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The unique id of the select. */\n readonly id: Signal<string>;\n\n /** The value of the select. */\n readonly value: WritableSignal<T | undefined>;\n\n /** Whether the select is multiple selection. */\n readonly multiple: Signal<boolean>;\n\n /** Whether the select is disabled. */\n readonly disabled: WritableSignal<boolean>;\n\n /** The comparator function used to compare options. */\n readonly compareWith: Signal<(a: T | undefined, b: T | undefined) => boolean>;\n\n /** The position of the dropdown. */\n readonly placement: Signal<Placement>;\n\n /** The container for the dropdown. */\n readonly container: Signal<HTMLElement | string | null>;\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip: Signal<NgpFlip>;\n\n /**\n * Define the offset of the select dropdown relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n */\n readonly offset: Signal<NgpOffset>;\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption: Signal<((index: number) => void) | undefined>;\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions: Signal<T[] | undefined>;\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal: WritableSignal<NgpSelectPortalState | undefined>;\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown: WritableSignal<NgpSelectDropdownState | undefined>;\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options: WritableSignal<NgpSelectOptionState[]>;\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<void> | null | undefined>;\n\n /**\n * The open state of the select.\n * @internal\n */\n readonly open: Signal<boolean>;\n\n /**\n * The options sorted by their index or DOM position.\n * @internal\n */\n readonly sortedOptions: Signal<NgpSelectOptionState[]>;\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager: ReturnType<typeof activeDescendantManager>;\n\n /**\n * Open the dropdown.\n * @internal\n */\n openDropdown(): Promise<void>;\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void;\n\n /**\n * Handle the overlay being closed (e.g. via outside click or Escape).\n * Emits the openChange event and resets the active descendant.\n * @internal\n */\n onOverlayClose(): void;\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n toggleDropdown(): Promise<void>;\n\n /**\n * Select an option.\n * @param index The index of the option to select.\n * @internal\n */\n selectOption(id: string): void;\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpSelectOptionState): void;\n\n /**\n * Toggle the selection of an option.\n * @param id The id of the option to toggle.\n * @internal\n */\n toggleOption(id: string): void;\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: T): boolean;\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\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void;\n\n /**\n * Register the dropdown portal with the select.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpSelectPortalState): void;\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpSelectDropdownState): void;\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpSelectOptionState): void;\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpSelectOptionState): void;\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void;\n\n /**\n * Programmatically set the value of the select. Fires `onValueChange` and\n * emits on `valueChange` by default. Pass `{ emit: false }` for cases like\n * form `writeValue` where the internal state should sync without notifying.\n */\n setValue(value: T | undefined, options?: SetterOptions): void;\n\n /**\n * Programmatically set the disabled state of the select. Used by the form\n * `setDisabledState` integration.\n */\n setDisabled(disabled: boolean): void;\n\n /**\n * Observable that emits whenever the value changes.\n */\n readonly valueChange: Observable<T | undefined>;\n}\n\nexport interface NgpSelectProps<T> {\n /** The unique id of the select. */\n readonly id?: Signal<string>;\n\n /** The value of the select. */\n readonly value?: Signal<T | undefined>;\n\n /** Event emitted when the value changes. */\n readonly onValueChange?: (value: T) => void;\n\n /** Whether the select is multiple selection. */\n readonly multiple?: Signal<boolean>;\n\n /** Whether the select is disabled. */\n readonly disabled?: Signal<boolean>;\n\n /** Emit when the dropdown open state changes. */\n readonly onOpenChange?: (open: boolean) => void;\n\n /** The comparator function used to compare options. */\n readonly compareWith?: Signal<(a: T | undefined, b: T | undefined) => boolean>;\n\n /** The position of the dropdown. */\n readonly placement?: Signal<Placement>;\n\n /** The container for the dropdown. */\n readonly container?: Signal<HTMLElement | string | null>;\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip?: Signal<NgpFlip>;\n\n /**\n * Define the offset of the select dropdown relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n */\n readonly offset?: Signal<NgpOffset>;\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption?: Signal<((index: number) => void) | undefined>;\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions?: Signal<T[] | undefined>;\n}\n\nexport const [NgpSelectStateToken, ngpSelect, _injectSelectState, provideSelectState] =\n createPrimitive(\n 'NgpSelect',\n <T>({\n id = signal(uniqueId('ngp-select')),\n value: _value = signal<T | undefined>(undefined),\n multiple = signal(false),\n disabled: _disabled = signal(false),\n compareWith = signal<(a: T | undefined, b: T | undefined) => boolean>(Object.is),\n placement = signal<Placement>('bottom'),\n container = signal<HTMLElement | string | null>('body'),\n flip = signal<NgpFlip>(true),\n offset = signal<NgpOffset>(0),\n scrollToOption = signal<((index: number) => void) | undefined>(undefined),\n allOptions = signal<T[] | undefined>(undefined),\n onValueChange,\n onOpenChange,\n }: NgpSelectProps<T>): NgpSelectState<T> => {\n const elementRef = injectElementRef<HTMLElement>();\n const value = controlled(_value);\n const disabled = controlled(_disabled, false);\n const valueChangeEmitter = emitter<T | undefined>();\n\n function setValue(newValue: T | undefined, options?: SetterOptions): void {\n value.set(newValue);\n if (options?.emit !== false) {\n onValueChange?.(newValue as T);\n valueChangeEmitter.emit(newValue);\n }\n }\n\n function setDisabled(isDisabled: boolean): void {\n disabled.set(isDisabled);\n }\n\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled,\n });\n\n ngpFormControl({ id, disabled });\n\n const portal = signal<NgpSelectPortalState | undefined>(undefined);\n const dropdown = signal<NgpSelectDropdownState | undefined>(undefined);\n const options = signal<NgpSelectOptionState[]>([]);\n\n const overlay = computed(() => portal()?.overlay());\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n const sortedOptions = computed(() =>\n domSort(\n options(),\n option => option.elementRef.nativeElement,\n option => option.index?.(),\n ),\n );\n\n const activeDescendantManagerInstance = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => disabled()),\n wrap: signal(true),\n count: computed(() => allOptions()?.length ?? options().length),\n getItemId: index => getOptionAtIndex(index)?.id(),\n isItemDisabled: index => getOptionAtIndex(index)?.disabled() ?? false,\n scrollIntoView: index => {\n const isPositioned = portal()?.overlay()?.isPositioned() ?? false;\n\n if (!isPositioned || index === -1) {\n return;\n }\n\n scrollTo(index);\n },\n });\n\n // Host bindings\n attrBinding(elementRef, 'role', 'combobox');\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-expanded', open);\n attrBinding(elementRef, 'aria-controls', () => (open() ? dropdown()?.id() : undefined));\n attrBinding(elementRef, 'aria-activedescendant', () =>\n open() ? activeDescendantManagerInstance.id() : undefined,\n );\n attrBinding(elementRef, 'tabindex', () => (disabled() ? -1 : 0));\n dataBinding(elementRef, 'data-open', () => (open() ? '' : null));\n dataBinding(elementRef, 'data-disabled', () => (disabled() ? '' : null));\n dataBinding(elementRef, 'data-multiple', () => (multiple() ? '' : null));\n\n // Event listeners\n listener(elementRef, 'click', () => void toggleDropdown());\n listener(elementRef, 'keydown', handleKeydown);\n listener(elementRef, 'blur', onBlur);\n\n /**\n * Open the dropdown.\n * @internal\n */\n async function openDropdown(): Promise<void> {\n if (disabled() || open()) {\n return;\n }\n\n onOpenChange?.(true);\n await portal()?.show();\n\n let selectedOptionIdx = -1;\n\n // if we have been provided with allOptions, we need to find the selected option(s) from that list\n if (allOptions()) {\n selectedOptionIdx = allOptions()!.findIndex(option => isOptionSelected(option));\n }\n\n // if we don't have allOptions, find the selected option(s) from the registered options\n if (selectedOptionIdx === -1) {\n // if there is a selected option(s), set the active descendant to the first selected option\n selectedOptionIdx = sortedOptions().findIndex(option => isOptionSelected(option.value()));\n }\n\n // if after checking there is a selected option, set the active descendant to the first option\n if (selectedOptionIdx !== -1) {\n // scroll to and activate the selected option\n scrollTo(selectedOptionIdx);\n activeDescendantManagerInstance.activateByIndex(selectedOptionIdx);\n return;\n }\n\n // activate the selected option or the first option\n activeDescendantManagerInstance.first();\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n function closeDropdown(): void {\n if (!open()) {\n return;\n }\n\n portal()?.hide();\n }\n\n /**\n * Handle the overlay being closed (whether via imperative closeDropdown(),\n * outside click, or Escape). Emits openChange(false) and resets the active\n * descendant. Wired in from select-portal-state.ts via the overlay onClose\n * config — this is the single source of truth for the close-side emit so\n * external close paths (outside click, Escape) also fire openChange.\n * @internal\n */\n function onOverlayClose(): void {\n onOpenChange?.(false);\n activeDescendantManagerInstance.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async function toggleDropdown(): Promise<void> {\n if (open()) {\n closeDropdown();\n } else {\n await openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param index The index of the option to select.\n * @internal\n */\n function selectOption(id: string): void {\n if (disabled()) {\n return;\n }\n\n const option = sortedOptions().find(opt => opt.id() === id);\n\n if (!option) {\n setValue(undefined, { emit: false });\n closeDropdown();\n return;\n }\n\n const optionValue = option.value();\n\n // If the option has no associated value, treat it as non-selectable.\n if (optionValue === undefined) {\n return;\n }\n\n if (multiple()) {\n // if the option is already selected, do nothing\n if (isOptionSelected(optionValue)) {\n return;\n }\n\n const newValue = [...((value() ?? []) as T[]), optionValue as T];\n\n // add the option to the value\n setValue(newValue as T | undefined);\n } else {\n setValue(optionValue as T | undefined);\n\n // close the dropdown on single selection\n closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n function deselectOption(option: NgpSelectOptionState): void {\n const optionValue = option.value();\n\n // Options without values cannot be deselected (and should never be selected).\n if (optionValue === undefined) {\n return;\n }\n\n // if the select is disabled or the option is not selected, do nothing\n // if the select is single selection, we don't allow deselecting\n if (disabled() || !isOptionSelected(optionValue) || !multiple()) {\n return;\n }\n\n const values = (value() as T[]) ?? [];\n\n const newValue = values.filter(v => !compareWith()(v, optionValue as T));\n\n // remove the option from the value\n setValue(newValue as T | undefined);\n }\n\n /**\n * Toggle the selection of an option.\n * @param id The id of the option to toggle.\n * @internal\n */\n function toggleOption(id: string): void {\n if (disabled()) {\n return;\n }\n\n const option = sortedOptions().find(opt => opt.id() === id);\n\n if (!option) {\n return;\n }\n\n const optionValue = option.value();\n\n // Options without values cannot be toggled.\n if (optionValue === undefined) {\n return;\n }\n\n // if the state is single selection, we don't allow toggling\n if (!multiple()) {\n // always select the option in single selection mode even if it is already selected so that we update the input\n selectOption(id);\n return;\n }\n\n // otherwise toggle the option\n if (isOptionSelected(optionValue)) {\n deselectOption(option);\n } else {\n selectOption(id);\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n function isOptionSelected(option: T): boolean {\n if (disabled()) {\n return false;\n }\n\n const currentValue = value();\n\n // Only treat `undefined` as \"no selection\" (allow '', 0, false).\n if (currentValue === undefined) {\n return false;\n }\n\n if (multiple()) {\n return Array.isArray(currentValue) && currentValue.some(v => compareWith()(option, v));\n }\n\n return compareWith()(option, currentValue as T);\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 function activateNextOption(): void {\n if (disabled()) {\n return;\n }\n\n const currentOptions = sortedOptions();\n\n // if there are no options, do nothing\n if (currentOptions.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (activeDescendantManagerInstance.index() === -1) {\n const selectedOption = currentOptions.findIndex(option =>\n isOptionSelected(option.value()),\n );\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption !== -1 ? selectedOption : 0;\n\n activeDescendantManagerInstance.activateByIndex(targetOption, { origin: 'keyboard' });\n return;\n }\n\n // otherwise activate the next option\n activeDescendantManagerInstance.next({ origin: 'keyboard' });\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n function activatePreviousOption(): void {\n if (disabled()) {\n return;\n }\n const currentOptions = sortedOptions();\n // if there are no options, do nothing\n if (currentOptions.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (activeDescendantManagerInstance.index() === -1) {\n const selectedOption = currentOptions.findIndex(option =>\n isOptionSelected(option.value()),\n );\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption !== -1 ? selectedOption : currentOptions.length - 1;\n activeDescendantManagerInstance.activateByIndex(targetOption, { origin: 'keyboard' });\n return;\n }\n // otherwise activate the previous option\n activeDescendantManagerInstance.previous({ origin: 'keyboard' });\n }\n\n /**\n * Register the dropdown portal with the select.\n * @param portal The dropdown portal.\n * @internal\n */\n function registerPortal(portalInstance: NgpSelectPortalState): void {\n portal.set(portalInstance);\n }\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n function registerDropdown(dropdownInstance: NgpSelectDropdownState): void {\n dropdown.set(dropdownInstance);\n }\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n function registerOption(option: NgpSelectOptionState): void {\n options.update(current => [...current, option]);\n }\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n function unregisterOption(option: NgpSelectOptionState): void {\n options.update(current => current.filter(o => o !== option));\n }\n\n /**\n * Focus the select.\n * @internal\n */\n function focus(): void {\n elementRef.nativeElement.focus();\n }\n\n /** Handle keydown events for accessibility. */\n function handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (open()) {\n activateNextOption();\n } else {\n void openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (open()) {\n activatePreviousOption();\n } else {\n void openDropdown();\n activeDescendantManagerInstance.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (open()) {\n activeDescendantManagerInstance.first({ origin: 'keyboard' });\n }\n event.preventDefault();\n break;\n case 'End':\n if (open()) {\n activeDescendantManagerInstance.last({ origin: 'keyboard' });\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (open()) {\n const activeId = activeDescendantManagerInstance.id();\n\n if (activeId) {\n const option = sortedOptions().find(opt => opt.id() === activeId);\n option?.select();\n }\n } else {\n void openDropdown();\n }\n event.preventDefault();\n break;\n case ' ':\n void toggleDropdown();\n event.preventDefault();\n break;\n }\n }\n\n function 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 && dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n closeDropdown();\n event.preventDefault();\n }\n\n function scrollTo(index: number): void {\n const customScrollToOption = scrollToOption();\n\n if (customScrollToOption) {\n customScrollToOption(index);\n return;\n }\n const option = getOptionAtIndex(index);\n if (option) {\n option.scrollIntoView();\n }\n }\n\n function getOptionAtIndex(index: number): NgpSelectOptionState | undefined {\n // if the option has an index, use that to get the option because this is required for virtual scrolling scenarios\n const optionIndex = options().findIndex(opt => opt.index?.() === index);\n\n if (optionIndex !== -1) {\n return options()[optionIndex];\n }\n\n return sortedOptions()[index];\n }\n\n return {\n elementRef,\n id,\n value: deprecatedSetter(value, 'setValue', v => setValue(v)),\n multiple,\n disabled: deprecatedSetter(disabled, 'setDisabled', setDisabled),\n compareWith,\n placement,\n container,\n flip,\n offset,\n scrollToOption,\n allOptions,\n portal,\n dropdown,\n options,\n overlay,\n open,\n sortedOptions,\n activeDescendantManager: activeDescendantManagerInstance,\n openDropdown,\n closeDropdown,\n onOverlayClose,\n toggleDropdown,\n selectOption,\n deselectOption,\n toggleOption,\n isOptionSelected,\n activateNextOption,\n activatePreviousOption,\n setValue,\n setDisabled,\n valueChange: valueChangeEmitter.asObservable(),\n registerPortal,\n registerDropdown,\n registerOption,\n unregisterOption,\n focus,\n } satisfies NgpSelectState<T>;\n },\n );\n\nexport function injectSelectState<T>(options?: StateInjectionOptions): Signal<NgpSelectState<T>> {\n return _injectSelectState(options) as Signal<NgpSelectState<T>>;\n}\n","import { ElementRef, Signal, signal } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n StateInjectionOptions,\n styleBinding,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectDropdownState {\n /**\n * @internal Access the element reference.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The id of the dropdown. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpSelectDropdownProps {\n /** The id of the dropdown. */\n readonly id?: Signal<string>;\n}\n\nexport const [\n NgpSelectDropdownStateToken,\n ngpSelectDropdown,\n _injectSelectDropdownState,\n provideSelectDropdownState,\n] = createPrimitive(\n 'NgpSelectDropdown',\n ({ id: _id = signal(uniqueId('ngp-select-dropdown')) }: NgpSelectDropdownProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n const selectState = injectSelectState();\n\n const selectDimensions = observeResize(() => selectState().elementRef.nativeElement);\n // Host bindings\n attrBinding(elementRef, 'role', 'listbox');\n attrBinding(elementRef, 'id', _id);\n styleBinding(elementRef, 'left.px', () => selectState().overlay()?.position()?.x ?? null);\n styleBinding(elementRef, 'top.px', () => selectState().overlay()?.position()?.y ?? null);\n styleBinding(\n elementRef,\n '--ngp-select-transform-origin',\n () => selectState().overlay()?.transformOrigin() ?? null,\n );\n styleBinding(\n elementRef,\n '--ngp-select-available-width.px',\n () => selectState().overlay()?.availableWidth() ?? null,\n );\n styleBinding(\n elementRef,\n '--ngp-select-available-height.px',\n () => selectState().overlay()?.availableHeight() ?? null,\n );\n styleBinding(elementRef, '--ngp-select-width.px', () => selectDimensions().width ?? null);\n\n const state = {\n elementRef,\n id: _id,\n } satisfies NgpSelectDropdownState;\n\n selectState().registerDropdown(state);\n\n return state;\n },\n);\n\nexport function injectSelectDropdownState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectDropdownState> {\n return _injectSelectDropdownState(options) as Signal<NgpSelectDropdownState>;\n}\n","import { Directive, input } from '@angular/core';\nimport { provideControlContainerIsolation } from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpSelectDropdown } from './select-dropdown-state';\n\n@Directive({\n selector: '[ngpSelectDropdown]',\n exportAs: 'ngpSelectDropdown',\n providers: [provideControlContainerIsolation()],\n})\nexport class NgpSelectDropdown {\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-select-dropdown'));\n\n constructor() {\n ngpSelectDropdown({\n id: this.id,\n });\n }\n}\n","import { computed, ElementRef, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef, scrollIntoViewIfNeeded } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n StateInjectionOptions,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectOptionState {\n /**\n * @internal Access the element reference.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The id of the option. */\n readonly id: Signal<string>;\n\n /** The value of the option. */\n readonly value: Signal<any>;\n\n /** The disabled state of the option. */\n readonly disabled: Signal<boolean>;\n\n /** The index of the option in the list. */\n readonly index: Signal<number | undefined>;\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n readonly active: Signal<boolean>;\n\n /**\n * Whether this option is selected.\n * @internal\n */\n readonly selected: Signal<boolean>;\n\n /**\n * Select the option.\n * @internal\n */\n select(): void;\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void;\n\n /**\n * Activate on pointer enter.\n * @internal\n */\n activateOnPointerEnter(): void;\n\n /**\n * Deactivate on pointer leave.\n * @internal\n */\n deactivateOnPointerLeave(): void;\n\n /**\n * Emit activated event.\n * @internal\n */\n emitActivated(): void;\n}\n\nexport interface NgpSelectOptionProps {\n /** The id of the option. */\n readonly id?: Signal<string>;\n\n /** The value of the option. */\n readonly value?: Signal<any>;\n\n /** The disabled state of the option. */\n readonly disabled?: Signal<boolean>;\n\n /** The index of the option in the list. */\n readonly index?: Signal<number | undefined>;\n\n /** Callback when option is activated. */\n readonly onActivated?: () => void;\n}\n\nexport const [\n NgpSelectOptionStateToken,\n ngpSelectOption,\n _injectSelectOptionState,\n provideSelectOptionState,\n] = createPrimitive(\n 'NgpSelectOption',\n ({\n id = signal(uniqueId('ngp-select-option')),\n value = signal<any>(undefined),\n disabled = signal(false),\n index = signal<number | undefined>(undefined),\n onActivated,\n }: NgpSelectOptionProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n const selectState = injectSelectState();\n\n ngpInteractions({\n hover: true,\n press: true,\n disabled: disabled,\n });\n // Computed states\n const active = computed(() => {\n const idx = index();\n\n if (idx !== undefined) {\n return selectState().activeDescendantManager.index() === idx;\n }\n\n return selectState().activeDescendantManager.id() === id();\n });\n\n const selected = computed(() => {\n const val = value();\n const stateValue = selectState().value();\n\n if (val === undefined) {\n return false;\n }\n\n if (selectState().multiple()) {\n return (\n Array.isArray(stateValue) && stateValue.some(v => selectState().compareWith()(val, v))\n );\n }\n\n if (stateValue === undefined) {\n return false;\n }\n\n return selectState().compareWith()(val, stateValue);\n });\n\n // Host bindings\n attrBinding(elementRef, 'role', 'option');\n attrBinding(elementRef, 'tabindex', -1);\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-selected', () => (selected() ? 'true' : undefined));\n dataBinding(elementRef, 'data-selected', () => (selected() ? '' : null));\n dataBinding(elementRef, 'data-active', () => (active() ? '' : null));\n dataBinding(elementRef, 'data-disabled', () => (disabled() ? '' : null));\n\n // Event listeners\n listener(elementRef, 'click', () => select());\n listener(elementRef, 'pointerenter', () => activateOnPointerEnter());\n listener(elementRef, 'pointerleave', () => deactivateOnPointerLeave());\n\n // Methods\n function select(): void {\n if (disabled()) {\n return;\n }\n\n onActivated?.();\n selectState().toggleOption(id());\n }\n\n function scrollIntoView(): void {\n scrollIntoViewIfNeeded(elementRef.nativeElement);\n }\n\n function activateOnPointerEnter(): void {\n const idx = index();\n\n if (idx !== undefined) {\n selectState().activeDescendantManager.activateByIndex(idx, {\n scroll: false,\n origin: 'pointer',\n });\n return;\n }\n\n selectState().activeDescendantManager.activateById(id(), {\n scroll: false,\n origin: 'pointer',\n });\n }\n\n function deactivateOnPointerLeave(): void {\n if (selectState().activeDescendantManager.id() === id()) {\n selectState().activeDescendantManager.reset({ origin: 'pointer' });\n }\n }\n\n const state = {\n elementRef,\n id,\n value,\n disabled,\n index,\n active,\n selected,\n select,\n scrollIntoView,\n activateOnPointerEnter,\n deactivateOnPointerLeave,\n emitActivated: () => onActivated?.(),\n } satisfies NgpSelectOptionState;\n\n selectState().registerOption(state);\n\n onDestroy(() => {\n selectState().unregisterOption(state);\n });\n\n return state;\n },\n);\n\nexport function injectSelectOptionState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectOptionState> {\n return _injectSelectOptionState(options) as Signal<NgpSelectOptionState>;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\nimport { ngpSelectOption } from './select-option-state';\n\n@Directive({\n selector: '[ngpSelectOption]',\n exportAs: 'ngpSelectOption',\n})\nexport class NgpSelectOption {\n /** Access the select state. */\n protected readonly selectState = injectSelectState();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-select-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpSelectOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectOptionDisabled',\n transform: booleanAttribute,\n });\n\n /** The index of the option in the list. */\n readonly index = input<number | undefined>(undefined, {\n alias: 'ngpSelectOptionIndex',\n });\n\n /**\n * Event emitted when the option is activated via click or keyboard.\n * This is useful for options without values that need custom behavior.\n */\n readonly activated = output<void>({\n alias: 'ngpSelectOptionActivated',\n });\n\n /** Access the select option state */\n protected readonly state = ngpSelectOption({\n id: this.id,\n value: this.value,\n disabled: this.disabled,\n index: this.index,\n onActivated: () => this.activated.emit(),\n });\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n this.state.select();\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.state.scrollIntoView();\n }\n}\n","import { inject, Injector, Signal, signal, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { createPrimitive, StateInjectionOptions } from 'ng-primitives/state';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectPortalState {\n /**\n * The overlay that manages the dropdown.\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<void> | null>;\n\n /**\n * Show the portal.\n * @internal\n */\n show(): Promise<void>;\n\n /**\n * Hide the portal.\n * @internal\n */\n hide(): void;\n\n /**\n * Destroy the overlay. The directive class calls this from ngOnDestroy so\n * the overlay's onClose callback fires while the parent NgpSelect's output\n * bindings are still attached — destroyRef.onDestroy callbacks fire after\n * Angular has already torn those bindings down, which would prevent\n * openChange(false) from reaching the consumer on fixture.destroy().\n * @internal\n */\n destroy(): void;\n}\n\nexport interface NgpSelectPortalProps {\n // No props needed, injected from context\n}\n\nexport const [\n NgpSelectPortalStateToken,\n ngpSelectPortal,\n _injectSelectPortalState,\n provideSelectPortalState,\n] = createPrimitive('NgpSelectPortal', ({}: NgpSelectPortalProps): NgpSelectPortalState => {\n const templateRef = inject(TemplateRef);\n const viewContainerRef = inject(ViewContainerRef);\n const injector = inject(Injector);\n const selectState = injectSelectState();\n const overlay = signal<NgpOverlay<void> | null>(null);\n\n // Methods\n async function show(): Promise<void> {\n if (!overlay()) {\n createOverlayInstance();\n }\n\n return overlay()?.show();\n }\n\n function hide(): void {\n overlay()?.hide();\n }\n\n function destroy(): void {\n overlay()?.destroy();\n }\n\n function createOverlayInstance(): void {\n const overlayConfig: NgpOverlayConfig<void> = {\n content: templateRef,\n viewContainerRef,\n triggerElement: selectState().elementRef.nativeElement,\n injector,\n placement: selectState().placement,\n offset: selectState().offset(),\n flip: selectState().flip(),\n container: selectState().container(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n onClose: () => selectState().onOverlayClose(),\n };\n\n overlay.set(createOverlay(overlayConfig));\n }\n\n const state = {\n overlay,\n show,\n hide,\n destroy,\n } satisfies NgpSelectPortalState;\n\n selectState().registerPortal(state);\n\n return state;\n});\n\nexport function injectSelectPortalState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectPortalState> {\n return _injectSelectPortalState(options) as Signal<NgpSelectPortalState>;\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { ngpSelectPortal } from './select-portal-state';\n\n@Directive({\n selector: '[ngpSelectPortal]',\n exportAs: 'ngpSelectPortal',\n})\nexport class NgpSelectPortal implements OnDestroy {\n protected readonly state = ngpSelectPortal({});\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n return this.state.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n detach(): void {\n this.state.hide();\n }\n\n ngOnDestroy(): void {\n this.state.destroy();\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { NgpFlip, NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpSelectConfig {\n /**\n * The default placement for the select dropdown.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * The container element or selector for the select 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 /**\n * Whether the select dropdown should flip when there is not enough space.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n flip: NgpFlip;\n\n /**\n * Define the offset of the select dropdown 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 offset: NgpOffset;\n}\n\nexport const defaultSelectConfig: NgpSelectConfig = {\n placement: 'bottom',\n container: 'body',\n flip: true,\n offset: 0,\n};\n\nexport const NgpSelectConfigToken = new InjectionToken<NgpSelectConfig>('NgpSelectConfigToken');\n\n/**\n * Provide the default Select configuration\n * @param config The Select configuration\n * @returns The provider\n */\nexport function provideSelectConfig(config: Partial<NgpSelectConfig>): Provider[] {\n return [\n {\n provide: NgpSelectConfigToken,\n useValue: { ...defaultSelectConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Select configuration\n * @returns The global Select configuration\n */\nexport function injectSelectConfig(): NgpSelectConfig {\n return inject(NgpSelectConfigToken, { optional: true }) ?? defaultSelectConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport {\n coerceFlip,\n coerceOffset,\n NgpFlip,\n NgpFlipInput,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectConfig } from '../config/select-config';\nimport { ngpSelect, provideSelectState } from './select-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: '[ngpSelect]',\n exportAs: 'ngpSelect',\n providers: [provideSelectState()],\n})\nexport class NgpSelect {\n /** Access the select configuration. */\n protected readonly config = injectSelectConfig();\n\n /** The unique id of the select. */\n readonly id = input(uniqueId('ngp-select'));\n\n /** The value of the select. */\n readonly value = input<T>(undefined, {\n alias: 'ngpSelectValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpSelectValueChange',\n });\n\n /** Whether the select is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the select is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectDisabled',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpSelectOpenChange',\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: 'ngpSelectCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpSelectDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpSelectDropdownContainer',\n });\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip = input<NgpFlip, NgpFlipInput>(this.config.flip, {\n alias: 'ngpSelectDropdownFlip',\n transform: coerceFlip,\n });\n\n /**\n * Define the offset of the select dropdown 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: 'ngpSelectDropdownOffset',\n transform: coerceOffset,\n });\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption = input<(index: number) => void>(undefined, {\n alias: 'ngpSelectScrollToOption',\n });\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions = input<T[]>(undefined, { alias: 'ngpSelectOptions' });\n\n /** The state of the select. */\n protected readonly state = ngpSelect<T>({\n id: this.id,\n value: this.value,\n multiple: this.multiple,\n disabled: this.disabled,\n compareWith: this.compareWith,\n placement: this.placement,\n container: this.container,\n flip: this.flip,\n offset: this.offset,\n scrollToOption: this.scrollToOption,\n allOptions: this.allOptions,\n onValueChange: value => this.valueChange.emit(value),\n onOpenChange: open => this.openChange.emit(open),\n });\n\n /** @internal Access the select element. */\n readonly elementRef = this.state.elementRef;\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal = this.state.portal;\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown = this.state.dropdown;\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options = this.state.options;\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = this.state.overlay;\n\n /**\n * The open state of the select.\n * @internal\n */\n readonly open = this.state.open;\n\n /**\n * The options sorted by their index or DOM position.\n * @internal\n */\n readonly sortedOptions = this.state.sortedOptions;\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = this.state.activeDescendantManager;\n\n /**\n * Open the dropdown.\n * @internal\n */\n openDropdown(): Promise<void> {\n return this.state.openDropdown();\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n return this.state.closeDropdown();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n toggleDropdown(): Promise<void> {\n return this.state.toggleDropdown();\n }\n\n /**\n * Select an option.\n * @param id The id of the option to select.\n * @internal\n */\n selectOption(id: string): void {\n this.state.selectOption(id);\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: T): boolean {\n return this.state.isOptionSelected(option);\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 this.state.activateNextOption();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n this.state.activatePreviousOption();\n }\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void {\n this.state.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAgCO,MAAM,CACX,yBAAyB,EACzB,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACzB,GAAG,eAAe,CACjB,iBAAiB,EACjB,CAAC,EACC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EACnC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,GACrB,KAAI;AACzB,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AAClC,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC;;AAEtC,IAAA,eAAe,CAAC;AACd,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,YAAY,EAAE,IAAI;AAClB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA,CAAC;IACF,cAAc,CAAC,EAAE,EA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A,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,EAAA,SAAA,EAFT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBALrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AAClC,iBAAA;;;ACjCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-select.mjs","sources":["../../../../packages/ng-primitives/select/src/native-select/native-select-state.ts","../../../../packages/ng-primitives/select/src/native-select/native-select.ts","../../../../packages/ng-primitives/select/src/select/select-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown-state.ts","../../../../packages/ng-primitives/select/src/select-dropdown/select-dropdown.ts","../../../../packages/ng-primitives/select/src/select-option/select-option-state.ts","../../../../packages/ng-primitives/select/src/select-option/select-option.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal-state.ts","../../../../packages/ng-primitives/select/src/select-portal/select-portal.ts","../../../../packages/ng-primitives/select/src/config/select-config.ts","../../../../packages/ng-primitives/select/src/select/select.ts","../../../../packages/ng-primitives/select/src/ng-primitives-select.ts"],"sourcesContent":["import { signal, Signal } from '@angular/core';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, controlled, createPrimitive, deprecatedSetter } from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\n\nexport interface NgpNativeSelectState {\n /**\n * Whether the select is disabled.\n */\n readonly disabled: Signal<boolean>;\n\n /**\n * Set the disabled state of the select.\n * @param value The disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\nexport interface NgpNativeSelectProps {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id?: Signal<string>;\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport const [\n NgpNativeSelectStateToken,\n ngpNativeSelect,\n injectNativeSelectState,\n provideNativeSelectState,\n] = createPrimitive(\n 'NgpNativeSelect',\n ({\n disabled: _disabled = signal(false),\n id = signal(uniqueId('ngp-native-select')),\n }: NgpNativeSelectProps) => {\n const element = injectElementRef();\n const disabled = controlled(_disabled);\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: disabled,\n });\n ngpFormControl({ id: id, disabled: disabled });\n\n attrBinding(element, 'disabled', disabled);\n\n function setDisabled(value: boolean): void {\n disabled.set(value);\n }\n\n return {\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n setDisabled,\n } satisfies NgpNativeSelectState;\n },\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpNativeSelect, provideNativeSelectState } from './native-select-state';\n\n/**\n * Apply the `ngpNativeSelect` directive to a select element that you want to enhance.\n */\n@Directive({\n selector: 'select[ngpNativeSelect]',\n exportAs: 'ngpNativeSelect',\n providers: [provideNativeSelectState()],\n})\nexport class NgpNativeSelect {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-native-select'));\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpNativeSelectDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n ngpNativeSelect({\n id: this.id,\n disabled: this.disabled,\n });\n }\n}\n","import { computed, ElementRef, Signal, signal, WritableSignal } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { ngpFormControl } from 'ng-primitives/form-field';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { domSort, injectElementRef } from 'ng-primitives/internal';\nimport type { NgpFlip, NgpOffset, NgpOverlay } from 'ng-primitives/portal';\nimport {\n attrBinding,\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n listener,\n SetterOptions,\n StateInjectionOptions,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { Observable } from 'rxjs';\nimport type { NgpSelectDropdownState } from '../select-dropdown/select-dropdown-state';\nimport type { NgpSelectOptionState } from '../select-option/select-option-state';\nimport { NgpSelectPortalState } from '../select-portal/select-portal-state';\n\nexport interface NgpSelectState<T> {\n /**\n * @internal Access the select element.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The unique id of the select. */\n readonly id: Signal<string>;\n\n /** The value of the select. */\n readonly value: WritableSignal<T | undefined>;\n\n /** Whether the select is multiple selection. */\n readonly multiple: Signal<boolean>;\n\n /** Whether the select is disabled. */\n readonly disabled: WritableSignal<boolean>;\n\n /** The comparator function used to compare options. */\n readonly compareWith: Signal<(a: T | undefined, b: T | undefined) => boolean>;\n\n /** The position of the dropdown. */\n readonly placement: Signal<Placement>;\n\n /** The container for the dropdown. */\n readonly container: WritableSignal<HTMLElement | string | null>;\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip: Signal<NgpFlip>;\n\n /**\n * Define the offset of the select dropdown relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n */\n readonly offset: Signal<NgpOffset>;\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption: Signal<((index: number) => void) | undefined>;\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions: Signal<T[] | undefined>;\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal: WritableSignal<NgpSelectPortalState | undefined>;\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown: WritableSignal<NgpSelectDropdownState | undefined>;\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options: WritableSignal<NgpSelectOptionState[]>;\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<void> | null | undefined>;\n\n /**\n * The open state of the select.\n * @internal\n */\n readonly open: Signal<boolean>;\n\n /**\n * The options sorted by their index or DOM position.\n * @internal\n */\n readonly sortedOptions: Signal<NgpSelectOptionState[]>;\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager: ReturnType<typeof activeDescendantManager>;\n\n /**\n * Open the dropdown.\n * @internal\n */\n openDropdown(): Promise<void>;\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void;\n\n /**\n * Handle the overlay being closed (e.g. via outside click or Escape).\n * Emits the openChange event and resets the active descendant.\n * @internal\n */\n onOverlayClose(): void;\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n toggleDropdown(): Promise<void>;\n\n /**\n * Select an option.\n * @param index The index of the option to select.\n * @internal\n */\n selectOption(id: string): void;\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpSelectOptionState): void;\n\n /**\n * Toggle the selection of an option.\n * @param id The id of the option to toggle.\n * @internal\n */\n toggleOption(id: string): void;\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: T): boolean;\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\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void;\n\n /**\n * Register the dropdown portal with the select.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpSelectPortalState): void;\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpSelectDropdownState): void;\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpSelectOptionState): void;\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpSelectOptionState): void;\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void;\n\n /**\n * Programmatically set the value of the select. Fires `onValueChange` and\n * emits on `valueChange` by default. Pass `{ emit: false }` for cases like\n * form `writeValue` where the internal state should sync without notifying.\n */\n setValue(value: T | undefined, options?: SetterOptions): void;\n\n /**\n * Programmatically set the disabled state of the select. Used by the form\n * `setDisabledState` integration.\n */\n setDisabled(disabled: boolean): void;\n\n /**\n * Set the container in which the dropdown should be attached. Takes effect the\n * next time the dropdown is opened; it does not move a dropdown that is already\n * open.\n * @param container - The new container\n */\n setContainer(container: HTMLElement | string | null): void;\n\n /**\n * Observable that emits whenever the value changes.\n */\n readonly valueChange: Observable<T | undefined>;\n}\n\nexport interface NgpSelectProps<T> {\n /** The unique id of the select. */\n readonly id?: Signal<string>;\n\n /** The value of the select. */\n readonly value?: Signal<T | undefined>;\n\n /** Event emitted when the value changes. */\n readonly onValueChange?: (value: T) => void;\n\n /** Whether the select is multiple selection. */\n readonly multiple?: Signal<boolean>;\n\n /** Whether the select is disabled. */\n readonly disabled?: Signal<boolean>;\n\n /** Emit when the dropdown open state changes. */\n readonly onOpenChange?: (open: boolean) => void;\n\n /** The comparator function used to compare options. */\n readonly compareWith?: Signal<(a: T | undefined, b: T | undefined) => boolean>;\n\n /** The position of the dropdown. */\n readonly placement?: Signal<Placement>;\n\n /** The container for the dropdown. */\n readonly container?: Signal<HTMLElement | string | null>;\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip?: Signal<NgpFlip>;\n\n /**\n * Define the offset of the select dropdown relative to the trigger.\n * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.\n */\n readonly offset?: Signal<NgpOffset>;\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption?: Signal<((index: number) => void) | undefined>;\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions?: Signal<T[] | undefined>;\n}\n\nexport const [NgpSelectStateToken, ngpSelect, _injectSelectState, provideSelectState] =\n createPrimitive(\n 'NgpSelect',\n <T>({\n id = signal(uniqueId('ngp-select')),\n value: _value = signal<T | undefined>(undefined),\n multiple = signal(false),\n disabled: _disabled = signal(false),\n compareWith = signal<(a: T | undefined, b: T | undefined) => boolean>(Object.is),\n placement = signal<Placement>('bottom'),\n container: _container,\n flip = signal<NgpFlip>(true),\n offset = signal<NgpOffset>(0),\n scrollToOption = signal<((index: number) => void) | undefined>(undefined),\n allOptions = signal<T[] | undefined>(undefined),\n onValueChange,\n onOpenChange,\n }: NgpSelectProps<T>): NgpSelectState<T> => {\n const elementRef = injectElementRef<HTMLElement>();\n const value = controlled(_value);\n const disabled = controlled(_disabled, false);\n const container = controlled(_container, 'body');\n const valueChangeEmitter = emitter<T | undefined>();\n\n function setValue(newValue: T | undefined, options?: SetterOptions): void {\n value.set(newValue);\n if (options?.emit !== false) {\n onValueChange?.(newValue as T);\n valueChangeEmitter.emit(newValue);\n }\n }\n\n function setDisabled(isDisabled: boolean): void {\n disabled.set(isDisabled);\n }\n\n function setContainer(newContainer: HTMLElement | string | null): void {\n container.set(newContainer);\n }\n\n ngpInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled,\n });\n\n ngpFormControl({ id, disabled });\n\n const portal = signal<NgpSelectPortalState | undefined>(undefined);\n const dropdown = signal<NgpSelectDropdownState | undefined>(undefined);\n const options = signal<NgpSelectOptionState[]>([]);\n\n const overlay = computed(() => portal()?.overlay());\n const open = computed(() => overlay()?.isOpen() ?? false);\n\n const sortedOptions = computed(() =>\n domSort(\n options(),\n option => option.elementRef.nativeElement,\n option => option.index?.(),\n ),\n );\n\n const activeDescendantManagerInstance = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => disabled()),\n wrap: signal(true),\n count: computed(() => allOptions()?.length ?? options().length),\n getItemId: index => getOptionAtIndex(index)?.id(),\n isItemDisabled: index => getOptionAtIndex(index)?.disabled() ?? false,\n scrollIntoView: index => {\n const isPositioned = portal()?.overlay()?.isPositioned() ?? false;\n\n if (!isPositioned || index === -1) {\n return;\n }\n\n scrollTo(index);\n },\n });\n\n // Host bindings\n attrBinding(elementRef, 'role', 'combobox');\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-expanded', open);\n attrBinding(elementRef, 'aria-controls', () => (open() ? dropdown()?.id() : undefined));\n attrBinding(elementRef, 'aria-activedescendant', () =>\n open() ? activeDescendantManagerInstance.id() : undefined,\n );\n attrBinding(elementRef, 'tabindex', () => (disabled() ? -1 : 0));\n dataBinding(elementRef, 'data-open', () => (open() ? '' : null));\n dataBinding(elementRef, 'data-disabled', () => (disabled() ? '' : null));\n dataBinding(elementRef, 'data-multiple', () => (multiple() ? '' : null));\n\n // Event listeners\n listener(elementRef, 'click', () => void toggleDropdown());\n listener(elementRef, 'keydown', handleKeydown);\n listener(elementRef, 'blur', onBlur);\n\n /**\n * Open the dropdown.\n * @internal\n */\n async function openDropdown(): Promise<void> {\n if (disabled() || open()) {\n return;\n }\n\n onOpenChange?.(true);\n await portal()?.show();\n\n let selectedOptionIdx = -1;\n\n // if we have been provided with allOptions, we need to find the selected option(s) from that list\n if (allOptions()) {\n selectedOptionIdx = allOptions()!.findIndex(option => isOptionSelected(option));\n }\n\n // if we don't have allOptions, find the selected option(s) from the registered options\n if (selectedOptionIdx === -1) {\n // if there is a selected option(s), set the active descendant to the first selected option\n selectedOptionIdx = sortedOptions().findIndex(option => isOptionSelected(option.value()));\n }\n\n // if after checking there is a selected option, set the active descendant to the first option\n if (selectedOptionIdx !== -1) {\n // scroll to and activate the selected option\n scrollTo(selectedOptionIdx);\n activeDescendantManagerInstance.activateByIndex(selectedOptionIdx);\n return;\n }\n\n // activate the selected option or the first option\n activeDescendantManagerInstance.first();\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n function closeDropdown(): void {\n if (!open()) {\n return;\n }\n\n portal()?.hide();\n }\n\n /**\n * Handle the overlay being closed (whether via imperative closeDropdown(),\n * outside click, or Escape). Emits openChange(false) and resets the active\n * descendant. Wired in from select-portal-state.ts via the overlay onClose\n * config — this is the single source of truth for the close-side emit so\n * external close paths (outside click, Escape) also fire openChange.\n * @internal\n */\n function onOverlayClose(): void {\n onOpenChange?.(false);\n activeDescendantManagerInstance.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n async function toggleDropdown(): Promise<void> {\n if (open()) {\n closeDropdown();\n } else {\n await openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param index The index of the option to select.\n * @internal\n */\n function selectOption(id: string): void {\n if (disabled()) {\n return;\n }\n\n const option = sortedOptions().find(opt => opt.id() === id);\n\n if (!option) {\n setValue(undefined, { emit: false });\n closeDropdown();\n return;\n }\n\n const optionValue = option.value();\n\n // If the option has no associated value, treat it as non-selectable.\n if (optionValue === undefined) {\n return;\n }\n\n if (multiple()) {\n // if the option is already selected, do nothing\n if (isOptionSelected(optionValue)) {\n return;\n }\n\n const newValue = [...((value() ?? []) as T[]), optionValue as T];\n\n // add the option to the value\n setValue(newValue as T | undefined);\n } else {\n setValue(optionValue as T | undefined);\n\n // close the dropdown on single selection\n closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n function deselectOption(option: NgpSelectOptionState): void {\n const optionValue = option.value();\n\n // Options without values cannot be deselected (and should never be selected).\n if (optionValue === undefined) {\n return;\n }\n\n // if the select is disabled or the option is not selected, do nothing\n // if the select is single selection, we don't allow deselecting\n if (disabled() || !isOptionSelected(optionValue) || !multiple()) {\n return;\n }\n\n const values = (value() as T[]) ?? [];\n\n const newValue = values.filter(v => !compareWith()(v, optionValue as T));\n\n // remove the option from the value\n setValue(newValue as T | undefined);\n }\n\n /**\n * Toggle the selection of an option.\n * @param id The id of the option to toggle.\n * @internal\n */\n function toggleOption(id: string): void {\n if (disabled()) {\n return;\n }\n\n const option = sortedOptions().find(opt => opt.id() === id);\n\n if (!option) {\n return;\n }\n\n const optionValue = option.value();\n\n // Options without values cannot be toggled.\n if (optionValue === undefined) {\n return;\n }\n\n // if the state is single selection, we don't allow toggling\n if (!multiple()) {\n // always select the option in single selection mode even if it is already selected so that we update the input\n selectOption(id);\n return;\n }\n\n // otherwise toggle the option\n if (isOptionSelected(optionValue)) {\n deselectOption(option);\n } else {\n selectOption(id);\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n function isOptionSelected(option: T): boolean {\n if (disabled()) {\n return false;\n }\n\n const currentValue = value();\n\n // Only treat `undefined` as \"no selection\" (allow '', 0, false).\n if (currentValue === undefined) {\n return false;\n }\n\n if (multiple()) {\n return Array.isArray(currentValue) && currentValue.some(v => compareWith()(option, v));\n }\n\n return compareWith()(option, currentValue as T);\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 function activateNextOption(): void {\n if (disabled()) {\n return;\n }\n\n const currentOptions = sortedOptions();\n\n // if there are no options, do nothing\n if (currentOptions.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (activeDescendantManagerInstance.index() === -1) {\n const selectedOption = currentOptions.findIndex(option =>\n isOptionSelected(option.value()),\n );\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption !== -1 ? selectedOption : 0;\n\n activeDescendantManagerInstance.activateByIndex(targetOption, { origin: 'keyboard' });\n return;\n }\n\n // otherwise activate the next option\n activeDescendantManagerInstance.next({ origin: 'keyboard' });\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n function activatePreviousOption(): void {\n if (disabled()) {\n return;\n }\n const currentOptions = sortedOptions();\n // if there are no options, do nothing\n if (currentOptions.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (activeDescendantManagerInstance.index() === -1) {\n const selectedOption = currentOptions.findIndex(option =>\n isOptionSelected(option.value()),\n );\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption !== -1 ? selectedOption : currentOptions.length - 1;\n activeDescendantManagerInstance.activateByIndex(targetOption, { origin: 'keyboard' });\n return;\n }\n // otherwise activate the previous option\n activeDescendantManagerInstance.previous({ origin: 'keyboard' });\n }\n\n /**\n * Register the dropdown portal with the select.\n * @param portal The dropdown portal.\n * @internal\n */\n function registerPortal(portalInstance: NgpSelectPortalState): void {\n portal.set(portalInstance);\n }\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n function registerDropdown(dropdownInstance: NgpSelectDropdownState): void {\n dropdown.set(dropdownInstance);\n }\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n function registerOption(option: NgpSelectOptionState): void {\n options.update(current => [...current, option]);\n }\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n function unregisterOption(option: NgpSelectOptionState): void {\n options.update(current => current.filter(o => o !== option));\n }\n\n /**\n * Focus the select.\n * @internal\n */\n function focus(): void {\n elementRef.nativeElement.focus();\n }\n\n /** Handle keydown events for accessibility. */\n function handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (open()) {\n activateNextOption();\n } else {\n void openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (open()) {\n activatePreviousOption();\n } else {\n void openDropdown();\n activeDescendantManagerInstance.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (open()) {\n activeDescendantManagerInstance.first({ origin: 'keyboard' });\n }\n event.preventDefault();\n break;\n case 'End':\n if (open()) {\n activeDescendantManagerInstance.last({ origin: 'keyboard' });\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (open()) {\n const activeId = activeDescendantManagerInstance.id();\n\n if (activeId) {\n const option = sortedOptions().find(opt => opt.id() === activeId);\n option?.select();\n }\n } else {\n void openDropdown();\n }\n event.preventDefault();\n break;\n case ' ':\n void toggleDropdown();\n event.preventDefault();\n break;\n }\n }\n\n function 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 && dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n closeDropdown();\n event.preventDefault();\n }\n\n function scrollTo(index: number): void {\n const customScrollToOption = scrollToOption();\n\n if (customScrollToOption) {\n customScrollToOption(index);\n return;\n }\n const option = getOptionAtIndex(index);\n if (option) {\n option.scrollIntoView();\n }\n }\n\n function getOptionAtIndex(index: number): NgpSelectOptionState | undefined {\n // if the option has an index, use that to get the option because this is required for virtual scrolling scenarios\n const optionIndex = options().findIndex(opt => opt.index?.() === index);\n\n if (optionIndex !== -1) {\n return options()[optionIndex];\n }\n\n return sortedOptions()[index];\n }\n\n return {\n elementRef,\n id,\n value: deprecatedSetter(value, 'setValue', v => setValue(v)),\n multiple,\n disabled: deprecatedSetter(disabled, 'setDisabled', setDisabled),\n compareWith,\n placement,\n container: deprecatedSetter(container, 'setContainer', setContainer),\n flip,\n offset,\n scrollToOption,\n allOptions,\n portal,\n dropdown,\n options,\n overlay,\n open,\n sortedOptions,\n activeDescendantManager: activeDescendantManagerInstance,\n openDropdown,\n closeDropdown,\n onOverlayClose,\n toggleDropdown,\n selectOption,\n deselectOption,\n toggleOption,\n isOptionSelected,\n activateNextOption,\n activatePreviousOption,\n setValue,\n setDisabled,\n setContainer,\n valueChange: valueChangeEmitter.asObservable(),\n registerPortal,\n registerDropdown,\n registerOption,\n unregisterOption,\n focus,\n } satisfies NgpSelectState<T>;\n },\n );\n\nexport function injectSelectState<T>(options?: StateInjectionOptions): Signal<NgpSelectState<T>> {\n return _injectSelectState(options) as Signal<NgpSelectState<T>>;\n}\n","import { ElementRef, Signal, signal } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n StateInjectionOptions,\n styleBinding,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectDropdownState {\n /**\n * @internal Access the element reference.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The id of the dropdown. */\n readonly id: Signal<string>;\n}\n\nexport interface NgpSelectDropdownProps {\n /** The id of the dropdown. */\n readonly id?: Signal<string>;\n}\n\nexport const [\n NgpSelectDropdownStateToken,\n ngpSelectDropdown,\n _injectSelectDropdownState,\n provideSelectDropdownState,\n] = createPrimitive(\n 'NgpSelectDropdown',\n ({ id: _id = signal(uniqueId('ngp-select-dropdown')) }: NgpSelectDropdownProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n const selectState = injectSelectState();\n\n const selectDimensions = observeResize(() => selectState().elementRef.nativeElement);\n // Host bindings\n attrBinding(elementRef, 'role', 'listbox');\n attrBinding(elementRef, 'id', _id);\n styleBinding(elementRef, 'left.px', () => selectState().overlay()?.position()?.x ?? null);\n styleBinding(elementRef, 'top.px', () => selectState().overlay()?.position()?.y ?? null);\n styleBinding(\n elementRef,\n '--ngp-select-transform-origin',\n () => selectState().overlay()?.transformOrigin() ?? null,\n );\n styleBinding(\n elementRef,\n '--ngp-select-available-width.px',\n () => selectState().overlay()?.availableWidth() ?? null,\n );\n styleBinding(\n elementRef,\n '--ngp-select-available-height.px',\n () => selectState().overlay()?.availableHeight() ?? null,\n );\n styleBinding(elementRef, '--ngp-select-width.px', () => selectDimensions().width ?? null);\n\n const state = {\n elementRef,\n id: _id,\n } satisfies NgpSelectDropdownState;\n\n selectState().registerDropdown(state);\n\n return state;\n },\n);\n\nexport function injectSelectDropdownState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectDropdownState> {\n return _injectSelectDropdownState(options) as Signal<NgpSelectDropdownState>;\n}\n","import { Directive, input } from '@angular/core';\nimport { provideControlContainerIsolation } from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpSelectDropdown } from './select-dropdown-state';\n\n@Directive({\n selector: '[ngpSelectDropdown]',\n exportAs: 'ngpSelectDropdown',\n providers: [provideControlContainerIsolation()],\n})\nexport class NgpSelectDropdown {\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-select-dropdown'));\n\n constructor() {\n ngpSelectDropdown({\n id: this.id,\n });\n }\n}\n","import { computed, ElementRef, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef, scrollIntoViewIfNeeded } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n StateInjectionOptions,\n} from 'ng-primitives/state';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectOptionState {\n /**\n * @internal Access the element reference.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n\n /** The id of the option. */\n readonly id: Signal<string>;\n\n /** The value of the option. */\n readonly value: Signal<any>;\n\n /** The disabled state of the option. */\n readonly disabled: Signal<boolean>;\n\n /** The index of the option in the list. */\n readonly index: Signal<number | undefined>;\n\n /**\n * Whether this option is the active descendant.\n * @internal\n */\n readonly active: Signal<boolean>;\n\n /**\n * Whether this option is selected.\n * @internal\n */\n readonly selected: Signal<boolean>;\n\n /**\n * Select the option.\n * @internal\n */\n select(): void;\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void;\n\n /**\n * Activate on pointer enter.\n * @internal\n */\n activateOnPointerEnter(): void;\n\n /**\n * Deactivate on pointer leave.\n * @internal\n */\n deactivateOnPointerLeave(): void;\n\n /**\n * Emit activated event.\n * @internal\n */\n emitActivated(): void;\n}\n\nexport interface NgpSelectOptionProps {\n /** The id of the option. */\n readonly id?: Signal<string>;\n\n /** The value of the option. */\n readonly value?: Signal<any>;\n\n /** The disabled state of the option. */\n readonly disabled?: Signal<boolean>;\n\n /** The index of the option in the list. */\n readonly index?: Signal<number | undefined>;\n\n /** Callback when option is activated. */\n readonly onActivated?: () => void;\n}\n\nexport const [\n NgpSelectOptionStateToken,\n ngpSelectOption,\n _injectSelectOptionState,\n provideSelectOptionState,\n] = createPrimitive(\n 'NgpSelectOption',\n ({\n id = signal(uniqueId('ngp-select-option')),\n value = signal<any>(undefined),\n disabled = signal(false),\n index = signal<number | undefined>(undefined),\n onActivated,\n }: NgpSelectOptionProps) => {\n const elementRef = injectElementRef<HTMLElement>();\n const selectState = injectSelectState();\n\n ngpInteractions({\n hover: true,\n press: true,\n disabled: disabled,\n });\n // Computed states\n const active = computed(() => {\n const idx = index();\n\n if (idx !== undefined) {\n return selectState().activeDescendantManager.index() === idx;\n }\n\n return selectState().activeDescendantManager.id() === id();\n });\n\n const selected = computed(() => {\n const val = value();\n const stateValue = selectState().value();\n\n if (val === undefined) {\n return false;\n }\n\n if (selectState().multiple()) {\n return (\n Array.isArray(stateValue) && stateValue.some(v => selectState().compareWith()(val, v))\n );\n }\n\n if (stateValue === undefined) {\n return false;\n }\n\n return selectState().compareWith()(val, stateValue);\n });\n\n // Host bindings\n attrBinding(elementRef, 'role', 'option');\n attrBinding(elementRef, 'tabindex', -1);\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-selected', () => (selected() ? 'true' : undefined));\n dataBinding(elementRef, 'data-selected', () => (selected() ? '' : null));\n dataBinding(elementRef, 'data-active', () => (active() ? '' : null));\n dataBinding(elementRef, 'data-disabled', () => (disabled() ? '' : null));\n\n // Event listeners\n listener(elementRef, 'click', () => select());\n listener(elementRef, 'pointerenter', () => activateOnPointerEnter());\n listener(elementRef, 'pointerleave', () => deactivateOnPointerLeave());\n\n // Methods\n function select(): void {\n if (disabled()) {\n return;\n }\n\n onActivated?.();\n selectState().toggleOption(id());\n }\n\n function scrollIntoView(): void {\n scrollIntoViewIfNeeded(elementRef.nativeElement);\n }\n\n function activateOnPointerEnter(): void {\n const idx = index();\n\n if (idx !== undefined) {\n selectState().activeDescendantManager.activateByIndex(idx, {\n scroll: false,\n origin: 'pointer',\n });\n return;\n }\n\n selectState().activeDescendantManager.activateById(id(), {\n scroll: false,\n origin: 'pointer',\n });\n }\n\n function deactivateOnPointerLeave(): void {\n if (selectState().activeDescendantManager.id() === id()) {\n selectState().activeDescendantManager.reset({ origin: 'pointer' });\n }\n }\n\n const state = {\n elementRef,\n id,\n value,\n disabled,\n index,\n active,\n selected,\n select,\n scrollIntoView,\n activateOnPointerEnter,\n deactivateOnPointerLeave,\n emitActivated: () => onActivated?.(),\n } satisfies NgpSelectOptionState;\n\n selectState().registerOption(state);\n\n onDestroy(() => {\n selectState().unregisterOption(state);\n });\n\n return state;\n },\n);\n\nexport function injectSelectOptionState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectOptionState> {\n return _injectSelectOptionState(options) as Signal<NgpSelectOptionState>;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\nimport { ngpSelectOption } from './select-option-state';\n\n@Directive({\n selector: '[ngpSelectOption]',\n exportAs: 'ngpSelectOption',\n})\nexport class NgpSelectOption {\n /** Access the select state. */\n protected readonly selectState = injectSelectState();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-select-option'));\n\n /** @required The value of the option. */\n readonly value = input<any>(undefined, {\n alias: 'ngpSelectOptionValue',\n });\n\n /** The disabled state of the option. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectOptionDisabled',\n transform: booleanAttribute,\n });\n\n /** The index of the option in the list. */\n readonly index = input<number | undefined>(undefined, {\n alias: 'ngpSelectOptionIndex',\n });\n\n /**\n * Event emitted when the option is activated via click or keyboard.\n * This is useful for options without values that need custom behavior.\n */\n readonly activated = output<void>({\n alias: 'ngpSelectOptionActivated',\n });\n\n /** Access the select option state */\n protected readonly state = ngpSelectOption({\n id: this.id,\n value: this.value,\n disabled: this.disabled,\n index: this.index,\n onActivated: () => this.activated.emit(),\n });\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n this.state.select();\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.state.scrollIntoView();\n }\n}\n","import { inject, Injector, Signal, signal, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { createPrimitive, StateInjectionOptions } from 'ng-primitives/state';\nimport { injectSelectState } from '../select/select-state';\n\nexport interface NgpSelectPortalState {\n /**\n * The overlay that manages the dropdown.\n * @internal\n */\n readonly overlay: Signal<NgpOverlay<void> | null>;\n\n /**\n * Show the portal.\n * @internal\n */\n show(): Promise<void>;\n\n /**\n * Hide the portal.\n * @internal\n */\n hide(): void;\n\n /**\n * Destroy the overlay. The directive class calls this from ngOnDestroy so\n * the overlay's onClose callback fires while the parent NgpSelect's output\n * bindings are still attached — destroyRef.onDestroy callbacks fire after\n * Angular has already torn those bindings down, which would prevent\n * openChange(false) from reaching the consumer on fixture.destroy().\n * @internal\n */\n destroy(): void;\n}\n\nexport interface NgpSelectPortalProps {\n // No props needed, injected from context\n}\n\nexport const [\n NgpSelectPortalStateToken,\n ngpSelectPortal,\n _injectSelectPortalState,\n provideSelectPortalState,\n] = createPrimitive('NgpSelectPortal', ({}: NgpSelectPortalProps): NgpSelectPortalState => {\n const templateRef = inject(TemplateRef);\n const viewContainerRef = inject(ViewContainerRef);\n const injector = inject(Injector);\n const selectState = injectSelectState();\n const overlay = signal<NgpOverlay<void> | null>(null);\n\n // Methods\n async function show(): Promise<void> {\n if (!overlay()) {\n createOverlayInstance();\n }\n\n return overlay()?.show();\n }\n\n function hide(): void {\n overlay()?.hide();\n }\n\n function destroy(): void {\n overlay()?.destroy();\n }\n\n function createOverlayInstance(): void {\n const overlayConfig: NgpOverlayConfig<void> = {\n content: templateRef,\n viewContainerRef,\n triggerElement: selectState().elementRef.nativeElement,\n injector,\n placement: selectState().placement,\n offset: selectState().offset(),\n flip: selectState().flip(),\n container: selectState().container(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n onClose: () => selectState().onOverlayClose(),\n };\n\n overlay.set(createOverlay(overlayConfig));\n }\n\n const state = {\n overlay,\n show,\n hide,\n destroy,\n } satisfies NgpSelectPortalState;\n\n selectState().registerPortal(state);\n\n return state;\n});\n\nexport function injectSelectPortalState(\n options?: StateInjectionOptions,\n): Signal<NgpSelectPortalState> {\n return _injectSelectPortalState(options) as Signal<NgpSelectPortalState>;\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { ngpSelectPortal } from './select-portal-state';\n\n@Directive({\n selector: '[ngpSelectPortal]',\n exportAs: 'ngpSelectPortal',\n})\nexport class NgpSelectPortal implements OnDestroy {\n protected readonly state = ngpSelectPortal({});\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n return this.state.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n detach(): void {\n this.state.hide();\n }\n\n ngOnDestroy(): void {\n this.state.destroy();\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { NgpFlip, NgpOffset } from 'ng-primitives/portal';\n\nexport interface NgpSelectConfig {\n /**\n * The default placement for the select dropdown.\n * @default 'bottom'\n */\n placement: Placement;\n\n /**\n * The container element or selector for the select 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 /**\n * Whether the select dropdown should flip when there is not enough space.\n * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options.\n * @default true\n */\n flip: NgpFlip;\n\n /**\n * Define the offset of the select dropdown 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 offset: NgpOffset;\n}\n\nexport const defaultSelectConfig: NgpSelectConfig = {\n placement: 'bottom',\n container: 'body',\n flip: true,\n offset: 0,\n};\n\nexport const NgpSelectConfigToken = new InjectionToken<NgpSelectConfig>('NgpSelectConfigToken');\n\n/**\n * Provide the default Select configuration\n * @param config The Select configuration\n * @returns The provider\n */\nexport function provideSelectConfig(config: Partial<NgpSelectConfig>): Provider[] {\n return [\n {\n provide: NgpSelectConfigToken,\n useValue: { ...defaultSelectConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Select configuration\n * @returns The global Select configuration\n */\nexport function injectSelectConfig(): NgpSelectConfig {\n return inject(NgpSelectConfigToken, { optional: true }) ?? defaultSelectConfig;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport {\n coerceFlip,\n coerceOffset,\n NgpFlip,\n NgpFlipInput,\n NgpOffset,\n NgpOffsetInput,\n} from 'ng-primitives/portal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectConfig } from '../config/select-config';\nimport { ngpSelect, provideSelectState } from './select-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: '[ngpSelect]',\n exportAs: 'ngpSelect',\n providers: [provideSelectState()],\n})\nexport class NgpSelect {\n /** Access the select configuration. */\n protected readonly config = injectSelectConfig();\n\n /** The unique id of the select. */\n readonly id = input(uniqueId('ngp-select'));\n\n /** The value of the select. */\n readonly value = input<T>(undefined, {\n alias: 'ngpSelectValue',\n });\n\n /** Event emitted when the value changes. */\n readonly valueChange = output<T>({\n alias: 'ngpSelectValueChange',\n });\n\n /** Whether the select is multiple selection. */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectMultiple',\n transform: booleanAttribute,\n });\n\n /** Whether the select is disabled. */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectDisabled',\n transform: booleanAttribute,\n });\n\n /** Emit when the dropdown open state changes. */\n readonly openChange = output<boolean>({\n alias: 'ngpSelectOpenChange',\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: 'ngpSelectCompareWith',\n });\n\n /** The position of the dropdown. */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpSelectDropdownPlacement',\n });\n\n /** The container for the dropdown. */\n readonly container = input<HTMLElement | string | null>(this.config.container, {\n alias: 'ngpSelectDropdownContainer',\n });\n\n /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */\n readonly flip = input<NgpFlip, NgpFlipInput>(this.config.flip, {\n alias: 'ngpSelectDropdownFlip',\n transform: coerceFlip,\n });\n\n /**\n * Define the offset of the select dropdown 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: 'ngpSelectDropdownOffset',\n transform: coerceOffset,\n });\n\n /**\n * A function that will scroll the active option into view. This can be overridden\n * for cases such as virtual scrolling where we cannot scroll the option directly because\n * it may not be rendered.\n */\n readonly scrollToOption = input<(index: number) => void>(undefined, {\n alias: 'ngpSelectScrollToOption',\n });\n\n /**\n * Provide all the option values to the select. This is useful for virtual scrolling scenarios\n * where not all options are rendered in the DOM. This is not an alternative to adding the options\n * in the DOM, it is only to provide the select with the full list of options. This list should match\n * the order of the options as they would appear in the DOM.\n */\n readonly allOptions = input<T[]>(undefined, { alias: 'ngpSelectOptions' });\n\n /** The state of the select. */\n protected readonly state = ngpSelect<T>({\n id: this.id,\n value: this.value,\n multiple: this.multiple,\n disabled: this.disabled,\n compareWith: this.compareWith,\n placement: this.placement,\n container: this.container,\n flip: this.flip,\n offset: this.offset,\n scrollToOption: this.scrollToOption,\n allOptions: this.allOptions,\n onValueChange: value => this.valueChange.emit(value),\n onOpenChange: open => this.openChange.emit(open),\n });\n\n /** @internal Access the select element. */\n readonly elementRef = this.state.elementRef;\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal = this.state.portal;\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown = this.state.dropdown;\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options = this.state.options;\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = this.state.overlay;\n\n /**\n * The open state of the select.\n * @internal\n */\n readonly open = this.state.open;\n\n /**\n * The options sorted by their index or DOM position.\n * @internal\n */\n readonly sortedOptions = this.state.sortedOptions;\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = this.state.activeDescendantManager;\n\n /**\n * Open the dropdown.\n * @internal\n */\n openDropdown(): Promise<void> {\n return this.state.openDropdown();\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n return this.state.closeDropdown();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n toggleDropdown(): Promise<void> {\n return this.state.toggleDropdown();\n }\n\n /**\n * Select an option.\n * @param id The id of the option to select.\n * @internal\n */\n selectOption(id: string): void {\n this.state.selectOption(id);\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: T): boolean {\n return this.state.isOptionSelected(option);\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 this.state.activateNextOption();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n this.state.activatePreviousOption();\n }\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void {\n this.state.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAgCO,MAAM,CACX,yBAAyB,EACzB,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACzB,GAAG,eAAe,CACjB,iBAAiB,EACjB,CAAC,EACC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EACnC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,GACrB,KAAI;AACzB,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AAClC,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC;;AAEtC,IAAA,eAAe,CAAC;AACd,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,YAAY,EAAE,IAAI;AAClB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA,CAAC;IACF,cAAc,CAAC,EAAE,EAAE,E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AAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,EAAA,SAAA,EAFT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBALrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AAClC,iBAAA;;;ACjCD;;AAEG;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ApplicationRef, RendererFactory2, Injector, signal, ViewContainerRef, computed, Injectable,
|
|
2
|
+
import { InjectionToken, inject, ApplicationRef, RendererFactory2, Injector, signal, ViewContainerRef, computed, Injectable, ElementRef, afterNextRender, Directive } from '@angular/core';
|
|
3
3
|
import { InteractivityChecker } from '@angular/cdk/a11y';
|
|
4
4
|
import { injectDimensions, explicitEffect } from 'ng-primitives/internal';
|
|
5
|
+
import { listener } from 'ng-primitives/state';
|
|
5
6
|
import { createPortal } from 'ng-primitives/portal';
|
|
6
7
|
|
|
7
8
|
const defaultToastConfig = {
|
|
@@ -249,6 +250,7 @@ class NgpToast {
|
|
|
249
250
|
constructor() {
|
|
250
251
|
this.manager = inject(NgpToastManager);
|
|
251
252
|
this.injector = inject(Injector);
|
|
253
|
+
this.elementRef = inject(ElementRef);
|
|
252
254
|
this.config = injectToastConfig();
|
|
253
255
|
/** @internal */
|
|
254
256
|
this.options = injectToastOptions();
|
|
@@ -335,6 +337,16 @@ class NgpToast {
|
|
|
335
337
|
persistent: this.options.persistent,
|
|
336
338
|
});
|
|
337
339
|
this.options.register(this);
|
|
340
|
+
// Bind the pointer listeners outside the Angular zone via the `listener()`
|
|
341
|
+
// helper. Using `@HostListener` would run every `pointermove` inside the
|
|
342
|
+
// zone, triggering an application-wide change detection pass on each mouse
|
|
343
|
+
// move while merely hovering a toast (#762). Registering them out-of-zone
|
|
344
|
+
// means only the signal writes that occur during an actual swipe schedule
|
|
345
|
+
// change detection.
|
|
346
|
+
const element = this.elementRef.nativeElement;
|
|
347
|
+
listener(element, 'pointerdown', event => this.onPointerDown(event));
|
|
348
|
+
listener(element, 'pointermove', event => this.onPointerMove(event));
|
|
349
|
+
listener(element, 'pointerup', () => this.onPointerUp());
|
|
338
350
|
// Start the timer when the toast is created
|
|
339
351
|
this.timer.start();
|
|
340
352
|
// Pause the timer when the toast is expanded or when the user is interacting with it
|
|
@@ -448,7 +460,7 @@ class NgpToast {
|
|
|
448
460
|
this.swiping.set(false);
|
|
449
461
|
}
|
|
450
462
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
451
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpToast, isStandalone: true, selector: "[ngpToast]", host: {
|
|
463
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpToast, isStandalone: true, selector: "[ngpToast]", host: { properties: { "attr.data-position-x": "x", "attr.data-position-y": "y", "attr.data-visible": "visible()", "attr.data-front": "index() === 0", "attr.data-swiping": "swiping()", "attr.data-swipe-direction": "swipeOutDirection()", "attr.data-expanded": "options.expanded()", "style.--ngp-toast-gap.px": "config.gap", "style.--ngp-toast-z-index": "zIndex()", "style.--ngp-toasts-before": "index()", "style.--ngp-toast-index": "index() + 1", "style.--ngp-toast-height.px": "dimensions().height", "style.--ngp-toast-offset.px": "offset()", "style.--ngp-toast-front-height.px": "frontToastHeight()", "style.--ngp-toast-swipe-amount-x.px": "swipeAmount().x", "style.--ngp-toast-swipe-amount-y.px": "swipeAmount().y", "style.--ngp-toast-swipe-x": "swipeAmount().x", "style.--ngp-toast-swipe-y": "swipeAmount().y" } }, exportAs: ["ngpToast"], ngImport: i0 }); }
|
|
452
464
|
}
|
|
453
465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpToast, decorators: [{
|
|
454
466
|
type: Directive,
|
|
@@ -476,16 +488,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
476
488
|
'[style.--ngp-toast-swipe-y]': 'swipeAmount().y',
|
|
477
489
|
},
|
|
478
490
|
}]
|
|
479
|
-
}], ctorParameters: () => []
|
|
480
|
-
type: HostListener,
|
|
481
|
-
args: ['pointerdown', ['$event']]
|
|
482
|
-
}], onPointerMove: [{
|
|
483
|
-
type: HostListener,
|
|
484
|
-
args: ['pointermove', ['$event']]
|
|
485
|
-
}], onPointerUp: [{
|
|
486
|
-
type: HostListener,
|
|
487
|
-
args: ['pointerup']
|
|
488
|
-
}] } });
|
|
491
|
+
}], ctorParameters: () => [] });
|
|
489
492
|
|
|
490
493
|
/**
|
|
491
494
|
* Generated bundle index. Do not edit.
|