# select

```ts
import { SelectModule } from '@anguless/angulux/select';
```

## SelectItem

`agl-selectItem` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string \| undefined` | _not documented_ |  |
| `option` | `any` | _not documented_ |  |
| `selected` | `boolean \| undefined` | _not documented_ |  |
| `focused` | `boolean \| undefined` | _not documented_ |  |
| `label` | `string \| undefined` | _not documented_ |  |
| `disabled` | `boolean \| undefined` | _not documented_ |  |
| `visible` | `boolean \| undefined` | _not documented_ |  |
| `itemSize` | `number \| undefined` | _not documented_ |  |
| `ariaPosInset` | `string \| undefined` | _not documented_ |  |
| `ariaSetSize` | `string \| undefined` | _not documented_ |  |
| `template` | `TemplateRef<any> \| undefined` | _not documented_ |  |
| `checkmark` | `boolean` | _not documented_ |  |
| `index` | `number \| undefined` | _not documented_ |  |
| `scrollerOptions` | `any` | _not documented_ |  |

| Output | Type | Description |
| --- | --- | --- |
| `onClick` | `EventEmitter<any>` |  |
| `onMouseEnter` | `EventEmitter<any>` |  |

## Select

`agl-select` — component

Inherits every input, output and slot of `BaseInput` — see [baseinput.md](baseinput.md).

Select is used to choose an item from a collection of options.

Accessibility, a known limit: when there are more options than fit in the panel, axe reports the
scrolling list as a region the keyboard cannot reach (scrollable-region-focusable). The keyboard
does reach it. Focus stays on the combobox, or in the filter, and the arrow keys move through the
options with aria-activedescendant and scroll the list as they go. A tab stop on the list would
only add a stop that does nothing, so the list has none.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string \| undefined` | _not documented_ | Unique identifier of the component |
| `scrollHeight` | `string` | _not documented_ | Height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. |
| `filter` | `boolean \| undefined` | _not documented_ | When specified, displays an input field to filter the items on keyup. |
| `panelStyle` | `{ [klass: string]: any } \| null \| undefined` | _not documented_ | Inline style of the overlay panel element. |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the element. **Deprecated:** since v20.0.0, use `class` instead. |
| `panelStyleClass` | `string \| undefined` | _not documented_ | Style class of the overlay panel element. |
| `readonly` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component cannot be edited. |
| `editable` | `boolean \| undefined` | _not documented_ | When present, custom value instead of predefined options can be entered using the editable input field. |
| `tabindex` | `number \| undefined` | _not documented_ | Index of the element in tabbing order. |
| `placeholder` | `` | _not documented_ | Default text to display when no option is selected. |
| `loadingIcon` | `string \| undefined` | _not documented_ | Icon to display in loading state. |
| `filterPlaceholder` | `string \| undefined` | _not documented_ | Placeholder text to show when filter input is empty. |
| `filterLocale` | `string \| undefined` | _not documented_ | Locale to use in filtering. The default locale is the host environment's current locale. |
| `inputId` | `string \| undefined` | _not documented_ | Identifier of the accessible input element. |
| `dataKey` | `string \| undefined` | _not documented_ | A property to uniquely identify a value in options. Ignored when optionValue is set: the value is then the field optionValue names, and is compared as it is. |
| `filterBy` | `string \| undefined` | _not documented_ | When filtering is enabled, filterBy decides which field or fields (comma separated) to search against. |
| `filterFields` | `any[] \| undefined` | _not documented_ | Fields used when filtering the options, defaults to optionLabel. |
| `autofocus` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component should automatically get focus on load. |
| `resetFilterOnHide` | `boolean` | _not documented_ | Clears the filter value when hiding the select. |
| `checkmark` | `boolean` | _not documented_ | Whether the selected option will be shown with a check mark. |
| `dropdownIcon` | `string \| undefined` | _not documented_ | Icon class of the select icon. |
| `loading` | `boolean \| undefined` | _not documented_ | Whether the select is in loading state. |
| `optionLabel` | `string \| undefined` | _not documented_ | Name of the label field of an option. |
| `optionValue` | `string \| undefined` | _not documented_ | Name of the value field of an option. |
| `optionDisabled` | `string \| undefined` | _not documented_ | Name of the disabled field of an option. |
| `optionGroupLabel` | `string \| undefined` | _not documented_ | Name of the label field of an option group. |
| `optionGroupChildren` | `string` | _not documented_ | Name of the options field of an option group. |
| `group` | `boolean \| undefined` | _not documented_ | Whether to display options as grouped when nested options are provided. |
| `showClear` | `boolean \| undefined` | _not documented_ | When enabled, a clear icon is displayed to clear the value. |
| `emptyFilterMessage` | `string` | _not documented_ | Text to display when filtering does not return any results. Defaults to global value in i18n translation configuration. |
| `emptyMessage` | `string` | _not documented_ | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
| `lazy` | `boolean` | _not documented_ | Defines if data is loaded and interacted with in lazy manner. Takes effect with virtualScroll, which is what emits onLazyLoad; without it, lazy does nothing. |
| `virtualScroll` | `boolean \| undefined` | _not documented_ | Whether the data should be loaded on demand during scroll. |
| `virtualScrollItemSize` | `number \| undefined` | _not documented_ | Height of an item in the list for VirtualScrolling. |
| `virtualScrollOptions` | `ScrollerOptions \| undefined` | _not documented_ | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
| `overlayOptions` | `OverlayOptions \| undefined` | _not documented_ | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
| `ariaFilterLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the filter input. |
| `ariaLabel` | `string \| undefined` | _not documented_ | Used to define a aria label attribute the current element. |
| `ariaLabelledBy` | `string \| undefined` | _not documented_ | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| `filterMatchMode` | `'contains' \| 'startsWith' \| 'endsWith' \| 'equals' \| 'notEquals' \| 'in' \| 'lt' \| 'lte' \| 'gt' \| 'gte'` | _not documented_ | Defines how the items are filtered. |
| `tooltip` | `string` | _not documented_ | Advisory information to display in a tooltip on hover. |
| `tooltipPosition` | `'top' \| 'left' \| 'right' \| 'bottom'` | _not documented_ | Position of the tooltip. |
| `tooltipPositionStyle` | `string` | _not documented_ | Type of CSS position. |
| `tooltipStyleClass` | `string \| undefined` | _not documented_ | Style class of the tooltip. |
| `focusOnHover` | `boolean` | _not documented_ | Fields used when filtering the options, defaults to optionLabel. |
| `selectOnFocus` | `boolean` | _not documented_ | Determines if the option will be selected on focus. |
| `autoOptionFocus` | `boolean` | _not documented_ | Whether to focus on the first visible or selected element when the overlay panel is shown. |
| `autofocusFilter` | `boolean` | _not documented_ | Applies focus to the filter element when the overlay is shown. |
| `filterValue` | `string \| undefined \| null` | _not documented_ | When specified, filter displays with this value. |
| `options` | `any[] \| null \| undefined` | _not documented_ | An array of objects to display as the available options. |
| `appendTo` | `HTMLElement \| ElementRef \| TemplateRef<any> \| 'self' \| 'body' \| null \| undefined \| any` | `'self'` | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| `motionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options. |

| Output | Type | Description |
| --- | --- | --- |
| `onChange` | `EventEmitter<SelectChangeEvent>` | Callback to invoke when value of select changes. |
| `onFilter` | `EventEmitter<SelectFilterEvent>` | Callback to invoke when data is filtered. |
| `onFocus` | `EventEmitter<Event>` | Callback to invoke when select gets focus. |
| `onBlur` | `EventEmitter<Event>` | Callback to invoke when select loses focus. |
| `onClick` | `EventEmitter<MouseEvent>` | Callback to invoke when component is clicked. |
| `onShow` | `EventEmitter<AnimationEvent>` | Callback to invoke when select overlay gets visible. |
| `onHide` | `EventEmitter<AnimationEvent>` | Callback to invoke when select overlay gets hidden. |
| `onClear` | `EventEmitter<Event>` | Callback to invoke when select clears the value. |
| `onLazyLoad` | `EventEmitter<SelectLazyLoadEvent>` | Callback to invoke in lazy mode to load new data. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #item>` | `itemTemplate` | Custom item template. |
| `<ng-template #group>` | `groupTemplate` | Custom group template. |
| `<ng-template #loader>` | `loaderTemplate` | Custom loader template. |
| `<ng-template #selectedItem>` | `selectedItemTemplate` | Custom selected item template. |
| `<ng-template #header>` | `headerTemplate` | Custom header template. |
| `<ng-template #filter>` | `filterTemplate` | Custom filter template. |
| `<ng-template #footer>` | `footerTemplate` | Custom footer template. |
| `<ng-template #emptyfilter>` | `emptyFilterTemplate` | Custom empty filter template. |
| `<ng-template #empty>` | `emptyTemplate` | Custom empty template. |
| `<ng-template #dropdownicon>` | `dropdownIconTemplate` | Custom dropdown icon template. |
| `<ng-template #loadingicon>` | `loadingIconTemplate` | Custom loading icon template. |
| `<ng-template #clearicon>` | `clearIconTemplate` | Custom clear icon template. |
| `<ng-template #filtericon>` | `filterIconTemplate` | Custom filter icon template. |
