forked from bithost-gmbh/ngx-mat-select-search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-options.ts
42 lines (38 loc) · 1.33 KB
/
default-options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { InjectionToken } from '@angular/core';
import { MatSelectSearchComponent } from './mat-select-search.component';
/** List of inputs of NgxMatSelectSearchComponent that can be configured with a global default. */
export const configurableDefaultOptions = [
'ariaLabel',
'clearSearchInput',
'closeIcon',
'closeSvgIcon',
'disableInitialFocus',
'disableScrollToActiveOnOptionsChanged',
'enableClearOnEscapePressed',
'hideClearSearchButton',
'noEntriesFoundLabel',
'placeholderLabel',
'preventHomeEndKeyPropagation',
'searching',
] as const;
export type ConfigurableDefaultOptions = typeof configurableDefaultOptions[number];
/**
* InjectionToken that can be used to specify global options. e.g.
*
* ```typescript
* providers: [
* {
* provide: MAT_SELECTSEARCH_DEFAULT_OPTIONS,
* useValue: <MatSelectSearchOptions>{
* closeIcon: 'delete',
* noEntriesFoundLabel: 'No options found'
* }
* }
* ]
* ```
*
* See the corresponding inputs of `MatSelectSearchComponent` for documentation.
*/
export const MAT_SELECTSEARCH_DEFAULT_OPTIONS = new InjectionToken<MatSelectSearchOptions>('mat-selectsearch-default-options');
/** Global configurable options for MatSelectSearch. */
export type MatSelectSearchOptions = Readonly<Partial<Pick<MatSelectSearchComponent, ConfigurableDefaultOptions>>>;