ng-primitives 0.73.0 → 0.73.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-select.mjs","sources":["../../../../packages/ng-primitives/select/src/select/select-state.ts","../../../../packages/ng-primitives/select/src/select/select.ts","../../../../packages/ng-primitives/select/src/ng-primitives-select.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSelect } from './select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpSelectStateToken = createStateToken<NgpSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideSelectState = createStateProvider(NgpSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectSelectState = createStateInjector<NgpSelect>(NgpSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectState = createState(NgpSelectStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideSelectState, selectState } from './select-state';\n\n/**\n * Apply the `ngpSelect` directive to a select element that you want to enhance.\n */\n@Directive({\n selector: 'select[ngpSelect]',\n exportAs: 'ngpSelect',\n providers: [provideSelectState()],\n host: {\n '[id]': 'id()',\n '[attr.disabled]': 'disabled() || null',\n },\n})\nexport class NgpSelect {\n /**\n * The id of the select. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-select'));\n\n /**\n * Whether the select is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSelectDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The select state.\n */\n private readonly state = selectState<NgpSelect>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,mBAAmB,GAAG,gBAAgB,CAAY,QAAQ,CAAC;AAExE;;AAEG;MACU,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB;AAEzE;;AAEG;MACU,iBAAiB,GAAG,mBAAmB,CAAY,mBAAmB;AAEnF;;AAEG;AACI,MAAM,WAAW,GAAG,WAAW,CAAC,mBAAmB,CAAC;;ACnB3D;;AAEG;MAUU,SAAS,CAAA;AAmBpB,IAAA,WAAA,GAAA;AAlBA;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEnD;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,mBAAmB;AAC1B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;AACc,QAAA,IAAA,CAAA,KAAK,GAAG,WAAW,CAAY,IAAI,CAAC;AAGnD,QAAA,iBAAiB,CAAC;AAChB,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;AAC9B,SAAA,CAAC;AACF,QAAA,gBAAgB,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACxE;+GA5BW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,SAAA,EANT,CAAC,kBAAkB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAMtB,SAAS,EAAA,UAAA,EAAA,CAAA;kBATrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;AACjC,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,iBAAiB,EAAE,oBAAoB;AACxC,qBAAA;AACF,iBAAA;;;AClBD;;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.ts","../../../../packages/ng-primitives/select/src/select-option/select-option.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 {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpNativeSelect } from './native-select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpNativeSelectStateToken = createStateToken<NgpNativeSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideNativeSelectState = createStateProvider(NgpNativeSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectNativeSelectState =\n createStateInjector<NgpNativeSelect>(NgpNativeSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectNativeSelectState = createState(NgpNativeSelectStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { setupInteractions } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { provideNativeSelectState, selectNativeSelectState } 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 host: {\n '[attr.disabled]': 'state.disabled() || null',\n },\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 /**\n * The select state.\n */\n private readonly state = selectNativeSelectState<NgpNativeSelect>(this);\n\n constructor() {\n setupInteractions({\n hover: true,\n press: true,\n focus: true,\n focusVisible: true,\n disabled: this.state.disabled,\n });\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSelect } from './select';\n\n/**\n * The state token for the Select primitive.\n */\nexport const NgpSelectStateToken = createStateToken<NgpSelect>('Select');\n\n/**\n * Provides the Select state.\n */\nexport const provideSelectState = createStateProvider(NgpSelectStateToken);\n\n/**\n * Injects the Select state.\n */\nexport const injectSelectState = createStateInjector<NgpSelect>(NgpSelectStateToken);\n\n/**\n * The Select state registration function.\n */\nexport const selectState = createState(NgpSelectStateToken);\n","import { Directive, input } from '@angular/core';\nimport { injectElementRef, observeResize } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectDropdown]',\n exportAs: 'ngpSelectDropdown',\n host: {\n role: 'listbox',\n '[id]': 'id()',\n '[style.left.px]': 'state().overlay()?.position()?.x',\n '[style.top.px]': 'state().overlay()?.position()?.y',\n '[style.--ngp-select-transform-origin]': 'state().overlay()?.transformOrigin()',\n '[style.--ngp-select-width.px]': 'selectDimensions().width',\n },\n})\nexport class NgpSelectDropdown {\n /** Access the select state. */\n protected readonly state = injectSelectState();\n\n /** The dimensions of the select. */\n protected readonly selectDimensions = observeResize(() => this.state().elementRef.nativeElement);\n\n /**\n * Access the element reference.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the dropdown. */\n readonly id = input<string>(uniqueId('ngp-select-dropdown'));\n\n constructor() {\n this.state().registerDropdown(this);\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n input,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { NgpActivatable } from 'ng-primitives/a11y';\nimport { injectElementRef, setupInteractions } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectOption]',\n exportAs: 'ngpSelectOption',\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.tabindex]': '-1',\n '[attr.aria-selected]': 'selected() ? \"true\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-active]': 'active() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '(click)': 'select()',\n },\n})\nexport class NgpSelectOption implements OnInit, OnDestroy, NgpActivatable {\n /** Access the select state. */\n protected readonly state = injectSelectState();\n\n /**\n * The element reference of the option.\n * @internal\n */\n readonly elementRef = injectElementRef();\n\n /** The id of the option. */\n readonly id = input<string>(uniqueId('ngp-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 /**\n * Whether this option is the active descendant.\n * @internal\n */\n protected readonly active = computed(\n () => this.state().activeDescendantManager.activeDescendant() === this.id(),\n );\n\n /** Whether this option is selected. */\n protected readonly selected = computed(() => {\n const value = this.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state().multiple()) {\n return (\n Array.isArray(value) && value.some(v => this.state().compareWith()(v, this.state().value()))\n );\n }\n\n return this.state().compareWith()(value, this.state().value());\n });\n\n constructor() {\n this.state().registerOption(this);\n\n setupInteractions({\n hover: true,\n press: true,\n disabled: this.disabled,\n });\n }\n\n ngOnInit(): void {\n if (this.value() === undefined) {\n throw new Error(\n 'ngpSelectOption: The value input is required. Please provide a value for the option.',\n );\n }\n }\n\n ngOnDestroy(): void {\n this.state().unregisterOption(this);\n }\n\n /**\n * Select the option.\n * @internal\n */\n select(): void {\n if (this.disabled()) {\n return;\n }\n\n this.state().toggleOption(this);\n }\n\n /**\n * Scroll the option into view.\n * @internal\n */\n scrollIntoView(): void {\n this.elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n }\n\n /**\n * Whenever the pointer enters the option, activate it.\n * @internal\n */\n @HostListener('pointerenter')\n protected onPointerEnter(): void {\n this.state().activeDescendantManager.activate(this);\n }\n\n /**\n * Whenever the pointer leaves the option, deactivate it.\n * @internal\n */\n @HostListener('pointerleave')\n protected onPointerLeave(): void {\n this.state().activeDescendantManager.activate(undefined);\n }\n}\n","import {\n Directive,\n inject,\n Injector,\n OnDestroy,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { createOverlay, NgpOverlay, NgpOverlayConfig } from 'ng-primitives/portal';\nimport { injectSelectState } from '../select/select-state';\n\n@Directive({\n selector: '[ngpSelectPortal]',\n exportAs: 'ngpSelectPortal',\n})\nexport class NgpSelectPortal implements OnDestroy {\n /** Access the select state. */\n private readonly state = injectSelectState();\n /** Access the view container reference. */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the template reference. */\n private readonly templateRef = inject(TemplateRef);\n\n /** Access the injector. */\n private readonly injector = inject(Injector);\n\n /**\n * The overlay that manages the popover\n * @internal\n */\n readonly overlay = signal<NgpOverlay<void> | null>(null);\n\n constructor() {\n this.state().registerPortal(this);\n }\n\n /** Cleanup the portal. */\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n /**\n * Attach the portal.\n * @internal\n */\n show(): Promise<void> {\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n return this.overlay()!.show();\n }\n\n /**\n * Detach the portal.\n * @internal\n */\n async detach(): Promise<void> {\n this.overlay()?.hide();\n }\n\n /**\n * Create the overlay that will contain the dropdown\n */\n private createOverlay(): void {\n // Create config for the overlay\n const config: NgpOverlayConfig<void> = {\n content: this.templateRef,\n viewContainerRef: this.viewContainerRef,\n triggerElement: this.state().elementRef.nativeElement,\n injector: this.injector,\n placement: this.state().placement(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: false,\n scrollBehaviour: 'reposition',\n container: this.state().container(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { InjectionToken, Provider, inject } from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\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 for the select dropdown.\n * This can be used to control where the dropdown is rendered in the DOM.\n * @default document.body\n */\n container: HTMLElement | null;\n}\n\nexport const defaultSelectConfig: NgpSelectConfig = {\n placement: 'bottom',\n container: null,\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 {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport type { Placement } from '@floating-ui/dom';\nimport { activeDescendantManager } from 'ng-primitives/a11y';\nimport { setupFormControl } from 'ng-primitives/form-field';\nimport { injectElementRef, setupInteractions } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectSelectConfig } from '../config/select-config';\nimport type { NgpSelectDropdown } from '../select-dropdown/select-dropdown';\nimport { NgpSelectOption } from '../select-option/select-option';\nimport type { NgpSelectPortal } from '../select-portal/select-portal';\nimport { provideSelectState, selectState } 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 host: {\n role: 'combobox',\n '[id]': 'state.id()',\n '[attr.aria-expanded]': 'state.open()',\n '[attr.aria-controls]': 'state.open() ? state.dropdown()?.id() : undefined',\n '[attr.aria-activedescendant]':\n 'state.open() ? activeDescendantManager.activeDescendant() : undefined',\n '[attr.tabindex]': 'state.disabled() ? -1 : 0',\n '[attr.data-open]': 'state.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'state.disabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'state.multiple() ? \"\" : undefined',\n },\n})\nexport class NgpSelect {\n /** Access the select configuration. */\n protected readonly config = injectSelectConfig();\n\n /** @internal Access the select element. */\n readonly elementRef = injectElementRef();\n\n /** Access the injector. */\n protected readonly injector = inject(Injector);\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 | null>(this.config.container, {\n alias: 'ngpSelectDropdownContainer',\n });\n\n /**\n * Store the select portal.\n * @internal\n */\n readonly portal = signal<NgpSelectPortal | undefined>(undefined);\n\n /**\n * Store the select dropdown.\n * @internal\n */\n readonly dropdown = signal<NgpSelectDropdown | undefined>(undefined);\n\n /**\n * Store the select options.\n * @internal\n */\n readonly options = signal<NgpSelectOption[]>([]);\n\n /**\n * Access the overlay\n * @internal\n */\n readonly overlay = computed(() => this.portal()?.overlay());\n\n /**\n * The open state of the select.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The active key descendant manager.\n * @internal\n */\n readonly activeDescendantManager = activeDescendantManager({\n // we must wrap the signal in a computed to ensure it is not used before it is defined\n disabled: computed(() => this.state.disabled()),\n items: this.options,\n });\n\n /** The state of the select. */\n protected readonly state = selectState<NgpSelect>(this);\n\n constructor() {\n setupInteractions({\n focus: true,\n focusWithin: true,\n hover: true,\n press: true,\n disabled: this.state.disabled,\n });\n\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n\n // any time the active descendant changes, ensure we scroll it into view\n // perform after next render to ensure the DOM is updated\n // e.g. the dropdown is open before the option is scrolled into view\n afterRenderEffect({\n write: () => {\n const isPositioned = this.portal()?.overlay()?.isPositioned() ?? false;\n const activeItem = this.activeDescendantManager.activeItem();\n\n if (!isPositioned || !activeItem) {\n return;\n }\n\n this.activeDescendantManager.activeItem()?.scrollIntoView?.();\n },\n });\n }\n\n /**\n * Open the dropdown.\n * @internal\n */\n async openDropdown(): Promise<void> {\n if (this.state.disabled() || this.open()) {\n return;\n }\n\n this.openChange.emit(true);\n await this.portal()?.show();\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const selectedOption = this.options().find(option => this.isOptionSelected(option));\n\n // if there is no selected option, set the active descendant to the first option\n const targetOption = selectedOption ?? this.options()[0];\n\n // if there is no target option, do nothing\n if (!targetOption) {\n return;\n }\n\n // activate the selected option or the first option\n this.activeDescendantManager.activate(targetOption);\n }\n\n /**\n * Close the dropdown.\n * @internal\n */\n closeDropdown(): void {\n if (!this.open()) {\n return;\n }\n\n this.openChange.emit(false);\n this.portal()?.detach();\n\n // clear the active descendant\n this.activeDescendantManager.reset();\n }\n\n /**\n * Toggle the dropdown.\n * @internal\n */\n @HostListener('click')\n async toggleDropdown(): Promise<void> {\n if (this.open()) {\n this.closeDropdown();\n } else {\n await this.openDropdown();\n }\n }\n\n /**\n * Select an option.\n * @param option The option to select.\n * @internal\n */\n selectOption(option: NgpSelectOption | undefined): void {\n if (this.state.disabled()) {\n return;\n }\n\n if (!option) {\n this.state.value.set(undefined);\n this.closeDropdown();\n return;\n }\n\n if (this.state.multiple()) {\n // if the option is already selected, do nothing\n if (this.isOptionSelected(option)) {\n return;\n }\n\n const value = [...((this.state.value() ?? []) as T[]), option.value() as T];\n\n // add the option to the value\n this.state.value.set(value as T);\n this.valueChange.emit(value as T);\n } else {\n this.state.value.set(option.value() as T);\n this.valueChange.emit(option.value() as T);\n\n // close the dropdown on single selection\n this.closeDropdown();\n }\n }\n\n /**\n * Deselect an option.\n * @param option The option to deselect.\n * @internal\n */\n deselectOption(option: NgpSelectOption): void {\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 (this.state.disabled() || !this.isOptionSelected(option) || !this.state.multiple()) {\n return;\n }\n\n const values = (this.state.value() as T[]) ?? [];\n\n const newValue = values.filter(v => !this.state.compareWith()(v, option.value() as T));\n\n // remove the option from the value\n this.state.value.set(newValue as T);\n this.valueChange.emit(newValue as T);\n }\n\n /**\n * Toggle the selection of an option.\n * @param option The option to toggle.\n * @internal\n */\n toggleOption(option: NgpSelectOption): void {\n if (this.state.disabled()) {\n return;\n }\n\n // if the state is single selection, we don't allow toggling\n if (!this.state.multiple()) {\n // always select the option in single selection mode even if it is already selected so that we update the input\n this.selectOption(option);\n return;\n }\n\n // otherwise toggle the option\n if (this.isOptionSelected(option)) {\n this.deselectOption(option);\n } else {\n this.selectOption(option);\n }\n }\n\n /**\n * Determine if an option is selected.\n * @param option The option to check.\n * @internal\n */\n isOptionSelected(option: NgpSelectOption): boolean {\n if (this.state.disabled()) {\n return false;\n }\n\n const value = this.state.value();\n\n if (!value) {\n return false;\n }\n\n if (this.state.multiple()) {\n return value && (value as T[]).some(v => this.state.compareWith()(option.value(), v));\n }\n\n return this.state.compareWith()(option.value(), value);\n }\n\n /**\n * Activate the next option in the list if there is one.\n * If there is no option currently active, activate the selected option or the first option.\n * @internal\n */\n activateNextOption(): void {\n if (this.state.disabled()) {\n return;\n }\n\n const options = this.options();\n\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n\n // if there is no active option, activate the first option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[0];\n\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n\n // otherwise activate the next option\n this.activeDescendantManager.next();\n }\n\n /**\n * Activate the previous option in the list if there is one.\n * @internal\n */\n activatePreviousOption(): void {\n if (this.state.disabled()) {\n return;\n }\n const options = this.options();\n // if there are no options, do nothing\n if (options.length === 0) {\n return;\n }\n // if there is no active option, activate the last option\n if (!this.activeDescendantManager.activeItem()) {\n const selectedOption = options.find(option => this.isOptionSelected(option));\n // if there is a selected option(s), set the active descendant to the first selected option\n const targetOption = selectedOption ?? options[options.length - 1];\n this.activeDescendantManager.activate(targetOption);\n return;\n }\n // otherwise activate the previous option\n this.activeDescendantManager.previous();\n }\n\n /**\n * Register the dropdown portal with the select.\n * @param portal The dropdown portal.\n * @internal\n */\n registerPortal(portal: NgpSelectPortal): void {\n this.portal.set(portal);\n }\n\n /**\n * Register the dropdown with the select.\n * @param dropdown The dropdown to register.\n * @internal\n */\n registerDropdown(dropdown: NgpSelectDropdown): void {\n this.dropdown.set(dropdown);\n }\n\n /**\n * Register an option with the select.\n * @param option The option to register.\n * @internal\n */\n registerOption(option: NgpSelectOption): void {\n this.options.update(options => [...options, option]);\n }\n\n /**\n * Unregister an option from the select.\n * @param option The option to unregister.\n * @internal\n */\n unregisterOption(option: NgpSelectOption): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n\n /**\n * Focus the select.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n /** Handle keydown events for accessibility. */\n @HostListener('keydown', ['$event'])\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n if (this.open()) {\n this.activateNextOption();\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (this.open()) {\n this.activatePreviousOption();\n } else {\n this.openDropdown();\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Home':\n if (this.open()) {\n this.activeDescendantManager.first();\n }\n event.preventDefault();\n break;\n case 'End':\n if (this.open()) {\n this.activeDescendantManager.last();\n }\n event.preventDefault();\n break;\n case 'Enter':\n if (this.open()) {\n this.selectOption(this.activeDescendantManager.activeItem());\n } else {\n this.openDropdown();\n }\n event.preventDefault();\n break;\n case ' ':\n this.toggleDropdown();\n event.preventDefault();\n break;\n }\n }\n\n @HostListener('blur', ['$event'])\n protected onBlur(event: FocusEvent): void {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // if the blur was caused by focus moving to the dropdown, don't close\n if (relatedTarget && this.dropdown()?.elementRef.nativeElement.contains(relatedTarget)) {\n return;\n }\n\n this.closeDropdown();\n event.preventDefault();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA;;AAEG;AACI,MAAM,yBAAyB,GAAG,gBAAgB,CAAkB,QAAQ,CAAC;AAEpF;;AAEG;MACU,wBAAwB,GAAG,mBAAmB,CAAC,yBAAyB;AAErF;;AAEG;MACU,uBAAuB,GAClC,mBAAmB,CAAkB,yBAA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CAAC,QAAQ,CAAC;;;AC3elC;;AAEG;;;;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.73.0",
5
+ "version": "0.73.1",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -71,14 +71,14 @@
71
71
  "types": "./accordion/index.d.ts",
72
72
  "default": "./fesm2022/ng-primitives-accordion.mjs"
73
73
  },
74
- "./autofill": {
75
- "types": "./autofill/index.d.ts",
76
- "default": "./fesm2022/ng-primitives-autofill.mjs"
77
- },
78
74
  "./avatar": {
79
75
  "types": "./avatar/index.d.ts",
80
76
  "default": "./fesm2022/ng-primitives-avatar.mjs"
81
77
  },
78
+ "./autofill": {
79
+ "types": "./autofill/index.d.ts",
80
+ "default": "./fesm2022/ng-primitives-autofill.mjs"
81
+ },
82
82
  "./button": {
83
83
  "types": "./button/index.d.ts",
84
84
  "default": "./fesm2022/ng-primitives-button.mjs"
@@ -103,14 +103,14 @@
103
103
  "types": "./date-time/index.d.ts",
104
104
  "default": "./fesm2022/ng-primitives-date-time.mjs"
105
105
  },
106
- "./date-time-luxon": {
107
- "types": "./date-time-luxon/index.d.ts",
108
- "default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
109
- },
110
106
  "./dialog": {
111
107
  "types": "./dialog/index.d.ts",
112
108
  "default": "./fesm2022/ng-primitives-dialog.mjs"
113
109
  },
110
+ "./date-time-luxon": {
111
+ "types": "./date-time-luxon/index.d.ts",
112
+ "default": "./fesm2022/ng-primitives-date-time-luxon.mjs"
113
+ },
114
114
  "./file-upload": {
115
115
  "types": "./file-upload/index.d.ts",
116
116
  "default": "./fesm2022/ng-primitives-file-upload.mjs"
@@ -183,6 +183,10 @@
183
183
  "types": "./select/index.d.ts",
184
184
  "default": "./fesm2022/ng-primitives-select.mjs"
185
185
  },
186
+ "./separator": {
187
+ "types": "./separator/index.d.ts",
188
+ "default": "./fesm2022/ng-primitives-separator.mjs"
189
+ },
186
190
  "./slider": {
187
191
  "types": "./slider/index.d.ts",
188
192
  "default": "./fesm2022/ng-primitives-slider.mjs"
@@ -191,21 +195,17 @@
191
195
  "types": "./state/index.d.ts",
192
196
  "default": "./fesm2022/ng-primitives-state.mjs"
193
197
  },
194
- "./separator": {
195
- "types": "./separator/index.d.ts",
196
- "default": "./fesm2022/ng-primitives-separator.mjs"
197
- },
198
- "./textarea": {
199
- "types": "./textarea/index.d.ts",
200
- "default": "./fesm2022/ng-primitives-textarea.mjs"
198
+ "./switch": {
199
+ "types": "./switch/index.d.ts",
200
+ "default": "./fesm2022/ng-primitives-switch.mjs"
201
201
  },
202
202
  "./tabs": {
203
203
  "types": "./tabs/index.d.ts",
204
204
  "default": "./fesm2022/ng-primitives-tabs.mjs"
205
205
  },
206
- "./switch": {
207
- "types": "./switch/index.d.ts",
208
- "default": "./fesm2022/ng-primitives-switch.mjs"
206
+ "./textarea": {
207
+ "types": "./textarea/index.d.ts",
208
+ "default": "./fesm2022/ng-primitives-textarea.mjs"
209
209
  },
210
210
  "./toast": {
211
211
  "types": "./toast/index.d.ts",
@@ -219,14 +219,14 @@
219
219
  "types": "./toggle-group/index.d.ts",
220
220
  "default": "./fesm2022/ng-primitives-toggle-group.mjs"
221
221
  },
222
- "./tooltip": {
223
- "types": "./tooltip/index.d.ts",
224
- "default": "./fesm2022/ng-primitives-tooltip.mjs"
225
- },
226
222
  "./toolbar": {
227
223
  "types": "./toolbar/index.d.ts",
228
224
  "default": "./fesm2022/ng-primitives-toolbar.mjs"
229
225
  },
226
+ "./tooltip": {
227
+ "types": "./tooltip/index.d.ts",
228
+ "default": "./fesm2022/ng-primitives-tooltip.mjs"
229
+ },
230
230
  "./utils": {
231
231
  "types": "./utils/index.d.ts",
232
232
  "default": "./fesm2022/ng-primitives-utils.mjs"
@@ -29,7 +29,8 @@ export interface AngularPrimitivesComponentSchema {
29
29
  | 'menu'
30
30
  | 'popover'
31
31
  | 'combobox'
32
- | 'select';
32
+ | 'select'
33
+ | 'native-select';
33
34
 
34
35
  /**
35
36
  * The path where the component files should be created, relative to the current workspace.
@@ -29,6 +29,7 @@
29
29
  "radio",
30
30
  "search",
31
31
  "select",
32
+ "native-select",
32
33
  "separator",
33
34
  "slider",
34
35
  "switch",
@@ -1,17 +1,10 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
2
  import { booleanAttribute, Component, input, model } from '@angular/core';
3
3
  import { ControlValueAccessor } from '@angular/forms';
4
- import { NgIcon, provideIcons } from '@ng-icons/core';
4
+ import { provideIcons } from '@ng-icons/core';
5
5
  import { heroChevronDownSolid } from '@ng-icons/heroicons/solid';
6
- import { NgpButton } from 'ng-primitives/button';
7
6
  import { NgpSelectionMode } from 'ng-primitives/common';
8
- import {
9
- injectListboxState,
10
- NgpListbox,
11
- NgpListboxTrigger,
12
- provideListboxState,
13
- } from 'ng-primitives/listbox';
14
- import { NgpPopover, NgpPopoverTrigger } from 'ng-primitives/popover';
7
+ import { injectListboxState, NgpListbox, provideListboxState } from 'ng-primitives/listbox';
15
8
  import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
16
9
 
17
10
  @Component({
@@ -21,66 +14,36 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
21
14
  provideListboxState(),
22
15
  provideValueAccessor(Listbox<%= componentSuffix %>),
23
16
  ],
24
- imports: [NgpPopoverTrigger, NgpListbox, NgpListboxTrigger, NgIcon, NgpButton, NgpPopover],
17
+ imports: [NgpListbox],
25
18
  template: `
26
- <button [ngpPopoverTrigger]="dropdown" ngpButton ngpListboxTrigger>
27
- {{ value().length ? value().join(', ') : placeholder() }}
28
- <ng-icon name="heroChevronDownSolid" />
29
- </button>
30
-
31
- <ng-template #dropdown>
32
- <div
33
- [(ngpListboxValue)]="value"
34
- [ngpListboxMode]="mode()"
35
- [ngpListboxDisabled]="disabled()"
36
- [ngpListboxCompareWith]="compareWith()"
37
- (ngpListboxValueChange)="onListboxValueChange($event)"
38
- ngpPopover
39
- ngpListbox
40
- >
41
- <ng-content />
42
- </div>
43
- </ng-template>
19
+ <div
20
+ [(ngpListboxValue)]="value"
21
+ [ngpListboxMode]="mode()"
22
+ [ngpListboxDisabled]="disabled()"
23
+ [ngpListboxCompareWith]="compareWith()"
24
+ [attr.aria-label]="ariaLabel()"
25
+ (ngpListboxValueChange)="onListboxValueChange($event)"
26
+ ngpListbox
27
+ >
28
+ <ng-content />
29
+ </div>
44
30
  `,
45
31
  styles: `
46
32
  /* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
47
33
 
48
- [ngpButton] {
49
- display: flex;
50
- justify-content: space-between;
51
- align-items: center;
52
- height: 36px;
53
- width: 300px;
54
- border-radius: 8px;
55
- padding: 0 16px;
56
- border: none;
57
- background-color: var(--ngp-background);
58
- text-align: left;
59
- box-shadow: var(--ngp-input-shadow);
60
- outline: none;
61
- font-family: inherit;
62
- font-size: 14px;
63
- box-sizing: border-box;
64
- }
65
-
66
- [ngpButton][data-focus-visible] {
67
- outline: 2px solid var(--ngp-focus-ring);
68
- outline-offset: 2px;
69
- }
70
-
71
34
  [ngpListbox] {
72
35
  background-color: var(--ngp-background);
73
36
  border: 1px solid var(--ngp-border);
74
37
  padding: 0.25rem;
75
38
  border-radius: 0.75rem;
76
39
  outline: none;
77
- position: absolute;
78
- animation: popover-show 0.1s ease-out;
79
40
  width: var(--ngp-popover-trigger-width);
80
- box-shadow: var(--ngp-shadow-lg);
81
41
  box-sizing: border-box;
82
42
  }
83
43
  `,
44
+ host: {
45
+ '[attr.aria-label]': 'null',
46
+ },
84
47
  })
85
48
  export class Listbox<%= componentSuffix %> implements ControlValueAccessor {
86
49
  /**
@@ -115,6 +78,13 @@ export class Listbox<%= componentSuffix %> implements ControlValueAccessor {
115
78
  */
116
79
  readonly placeholder = input<string>('Select an option');
117
80
 
81
+ /**
82
+ * The aria-label attribute for the listbox.
83
+ */
84
+ readonly ariaLabel = input<string>('Listbox', {
85
+ alias: 'aria-label',
86
+ });
87
+
118
88
  /**
119
89
  * The onChange callback.
120
90
  */
@@ -0,0 +1,47 @@
1
+ import { Component } from '@angular/core';
2
+ import { NgpNativeSelect } from 'ng-primitives/select';
3
+
4
+ @Component({
5
+ selector: 'select[<%= prefix %>-select]',
6
+ hostDirectives: [{ directive: NgpNativeSelect, inputs: ['ngpNativeSelectDisabled:disabled'] }],
7
+ template: `
8
+ <ng-content />
9
+ `,
10
+ styles: `
11
+ /* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
12
+
13
+ :host {
14
+ all: unset;
15
+ appearance: none;
16
+ display: flex;
17
+ width: 90%;
18
+ align-items: center;
19
+ height: 2.5rem;
20
+ padding: 0 1rem;
21
+ border-radius: 0.5rem;
22
+ background-color: var(--ngp-background);
23
+ text-align: start;
24
+ box-shadow: var(--ngp-button-shadow);
25
+ outline: none;
26
+ background-position-x: calc(100% - 10px);
27
+ background-position-y: 50%;
28
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzczNzM3MyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4yMiA4LjIyYS43NS43NSAwIDAgMSAxLjA2IDBMMTAgMTEuOTRsMy43Mi0zLjcyYS43NS43NSAwIDEgMSAxLjA2IDEuMDZsLTQuMjUgNC4yNWEuNzUuNzUgMCAwIDEtMS4wNiAwTDUuMjIgOS4yOGEuNzUuNzUgMCAwIDEgMC0xLjA2WiIgY2xpcC1ydWxlPSJldmVub2RkIj48L3BhdGg+PC9zdmc+');
29
+ background-size: 1.25rem;
30
+ background-repeat: no-repeat;
31
+ }
32
+
33
+ :host[data-hover] {
34
+ background-color: var(--ngp-background-hover);
35
+ }
36
+
37
+ :host[data-focus-visible] {
38
+ outline: 2px solid var(--ngp-focus-ring);
39
+ outline-offset: 0;
40
+ }
41
+
42
+ :host[data-press] {
43
+ background-color: var(--ngp-background-active);
44
+ }
45
+ `,
46
+ })
47
+ export class NativeSelect<%= componentSuffix %> {}
@@ -1,47 +1,220 @@
1
- import { Component } from '@angular/core';
2
- import { NgpSelect } from 'ng-primitives/select';
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { booleanAttribute, Component, input, model, signal } from '@angular/core';
3
+ import { ControlValueAccessor } from '@angular/forms';
4
+ import { NgIcon, provideIcons } from '@ng-icons/core';
5
+ import { heroChevronDown } from '@ng-icons/heroicons/outline';
6
+ import {
7
+ NgpSelect,
8
+ NgpSelectDropdown,
9
+ NgpSelectOption,
10
+ NgpSelectPortal,
11
+ } from 'ng-primitives/select';
12
+ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
3
13
 
4
14
  @Component({
5
- selector: 'select[<%= prefix %>-select]',
6
- hostDirectives: [{ directive: NgpSelect, inputs: ['ngpSelectDisabled:disabled'] }],
15
+ selector: '<%= prefix %>-select',
16
+ imports: [NgpSelect, NgpSelectDropdown, NgpSelectOption, NgpSelectPortal, NgIcon],
17
+ providers: [provideIcons({ heroChevronDown }), provideValueAccessor(Select<%= componentSuffix %>)],
7
18
  template: `
8
- <ng-content />
19
+ <div
20
+ [(ngpSelectValue)]="value"
21
+ [ngpSelectDisabled]="disabled() || formDisabled()"
22
+ (ngpSelectValueChange)="onValueChange($event)"
23
+ ngpSelect
24
+ >
25
+ @if (value(); as value) {
26
+ <span class="select-value">{{ value }}</span>
27
+ } @else {
28
+ <span class="select-placeholder">{{ placeholder() }}</span>
29
+ }
30
+
31
+ <ng-icon name="heroChevronDown" />
32
+
33
+ <div *ngpSelectPortal ngpSelectDropdown>
34
+ @for (option of options(); track option) {
35
+ <div [ngpSelectOptionValue]="option" ngpSelectOption>
36
+ {{ option }}
37
+ </div>
38
+ } @empty {
39
+ <div class="empty-message">No options found</div>
40
+ }
41
+ </div>
42
+ </div>
9
43
  `,
10
44
  styles: `
11
45
  /* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
12
46
 
13
- :host {
14
- all: unset;
15
- appearance: none;
47
+ [ngpSelect] {
16
48
  display: flex;
17
- width: 90%;
49
+ justify-content: space-between;
18
50
  align-items: center;
19
- height: 2.5rem;
20
- padding: 0 1rem;
21
- border-radius: 0.5rem;
51
+ height: 36px;
52
+ width: 300px;
53
+ border-radius: 8px;
54
+ border: none;
55
+ background-color: var(--ngp-background);
56
+ box-shadow: var(--ngp-input-shadow);
57
+ box-sizing: border-box;
58
+ }
59
+
60
+ [ngpSelect][data-focus] {
61
+ outline: 2px solid var(--ngp-focus-ring);
62
+ outline-offset: 2px;
63
+ }
64
+
65
+ .select-value,
66
+ .select-placeholder {
67
+ display: flex;
68
+ align-items: center;
69
+ flex: 1;
70
+ padding: 0 16px;
71
+ background-color: transparent;
72
+ color: var(--ngp-text-primary);
73
+ font-family: inherit;
74
+ font-size: 14px;
75
+ padding: 0 16px;
76
+ height: 100%;
77
+ }
78
+
79
+ .select-placeholder {
80
+ color: var(--ngp-text-secondary);
81
+ }
82
+
83
+ ng-icon {
84
+ display: inline-flex;
85
+ justify-content: center;
86
+ align-items: center;
87
+ height: 100%;
88
+ margin-inline: 8px;
89
+ font-size: 14px;
90
+ }
91
+
92
+ [ngpSelectDropdown] {
22
93
  background-color: var(--ngp-background);
23
- text-align: start;
24
- box-shadow: var(--ngp-button-shadow);
94
+ border: 1px solid var(--ngp-border);
95
+ padding: 0.25rem;
96
+ border-radius: 0.75rem;
25
97
  outline: none;
26
- background-position-x: calc(100% - 10px);
27
- background-position-y: 50%;
28
- background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzczNzM3MyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4yMiA4LjIyYS43NS43NSAwIDAgMSAxLjA2IDBMMTAgMTEuOTRsMy43Mi0zLjcyYS43NS43NSAwIDEgMSAxLjA2IDEuMDZsLTQuMjUgNC4yNWEuNzUuNzUgMCAwIDEtMS4wNiAwTDUuMjIgOS4yOGEuNzUuNzUgMCAwIDEgMC0xLjA2WiIgY2xpcC1ydWxlPSJldmVub2RkIj48L3BhdGg+PC9zdmc+');
29
- background-size: 1.25rem;
30
- background-repeat: no-repeat;
98
+ position: absolute;
99
+ animation: popover-show 0.1s ease-out;
100
+ width: var(--ngp-select-width);
101
+ box-shadow: var(--ngp-shadow-lg);
102
+ box-sizing: border-box;
103
+ margin-top: 4px;
104
+ max-height: 240px;
105
+ overflow-y: auto;
106
+ transform-origin: var(--ngp-select-transform-origin);
107
+ }
108
+
109
+ [ngpSelectDropdown][data-enter] {
110
+ animation: select-show 0.1s ease-out;
111
+ }
112
+
113
+ [ngpSelectDropdown][data-exit] {
114
+ animation: select-hide 0.1s ease-out;
115
+ }
116
+
117
+ [ngpSelectOption] {
118
+ display: flex;
119
+ align-items: center;
120
+ gap: 0.5rem;
121
+ padding: 0.375rem 0.75rem;
122
+ cursor: pointer;
123
+ border-radius: 0.5rem;
124
+ width: 100%;
125
+ height: 36px;
126
+ font-size: 14px;
127
+ color: var(--ngp-text-primary);
128
+ box-sizing: border-box;
31
129
  }
32
130
 
33
- :host[data-hover] {
131
+ [ngpSelectOption][data-hover] {
34
132
  background-color: var(--ngp-background-hover);
35
133
  }
36
134
 
37
- :host[data-focus-visible] {
38
- outline: 2px solid var(--ngp-focus-ring);
39
- outline-offset: 0;
135
+ [ngpSelectOption][data-press] {
136
+ background-color: var(--ngp-background-active);
40
137
  }
41
138
 
42
- :host[data-press] {
139
+ [ngpSelectOption][data-active] {
43
140
  background-color: var(--ngp-background-active);
44
141
  }
142
+
143
+ .empty-message {
144
+ display: flex;
145
+ justify-content: center;
146
+ align-items: center;
147
+ padding: 0.5rem;
148
+ color: var(--ngp-text-secondary);
149
+ font-size: 14px;
150
+ font-weight: 500;
151
+ text-align: center;
152
+ }
153
+
154
+ @keyframes select-show {
155
+ 0% {
156
+ opacity: 0;
157
+ transform: translateY(-10px) scale(0.9);
158
+ }
159
+ 100% {
160
+ opacity: 1;
161
+ transform: translateY(0) scale(1);
162
+ }
163
+ }
164
+
165
+ @keyframes select-hide {
166
+ 0% {
167
+ opacity: 1;
168
+ transform: translateY(0) scale(1);
169
+ }
170
+ 100% {
171
+ opacity: 0;
172
+ transform: translateY(-10px) scale(0.9);
173
+ }
174
+ }
45
175
  `,
46
176
  })
47
- export class Select<%= componentSuffix %> {}
177
+ export class Select<%= componentSuffix %> implements ControlValueAccessor {
178
+ /** The options for the select. */
179
+ readonly options = input<string[]>([]);
180
+
181
+ /** The selected value. */
182
+ readonly value = model<string | undefined>();
183
+
184
+ /** The placeholder for the input. */
185
+ readonly placeholder = input<string>('');
186
+
187
+ /** The disabled state of the select. */
188
+ readonly disabled = input<boolean, BooleanInput>(false, {
189
+ transform: booleanAttribute,
190
+ });
191
+
192
+ /** Store the form disabled state */
193
+ protected readonly formDisabled = signal(false);
194
+
195
+ /** The on change callback */
196
+ private onChange?: ChangeFn<string>;
197
+
198
+ /** The on touch callback */
199
+ protected onTouched?: TouchedFn;
200
+
201
+ writeValue(value: string | undefined): void {
202
+ this.value.set(value);
203
+ }
204
+
205
+ registerOnChange(fn: ChangeFn<string | undefined>): void {
206
+ this.onChange = fn;
207
+ }
208
+
209
+ registerOnTouched(fn: TouchedFn): void {
210
+ this.onTouched = fn;
211
+ }
212
+
213
+ setDisabledState(isDisabled: boolean): void {
214
+ this.formDisabled.set(isDisabled);
215
+ }
216
+
217
+ protected onValueChange(value: string): void {
218
+ this.onChange?.(value);
219
+ }
220
+ }