(selector: string | HTMLSelectElement, options: Partial<Choices['config']> = {})
| 26 | * Create a new Choices instance with sensible defaults |
| 27 | */ |
| 28 | export function createChoices(selector: string | HTMLSelectElement, options: Partial<Choices['config']> = {}): Choices { |
| 29 | return new Choices(selector, { |
| 30 | removeItemButton: true, |
| 31 | searchPlaceholderValue: 'Search...', |
| 32 | noResultsText: 'No results found', |
| 33 | noChoicesText: 'No options available', |
| 34 | itemSelectText: '', |
| 35 | shouldSort: false, |
| 36 | searchResultLimit: 100, |
| 37 | resetScrollPosition: false, |
| 38 | ...options, |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | export { Choices }; |
no outgoing calls
no test coverage detected