@ng-select/ng-select 13.7.1 → 13.8.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/README.md CHANGED
@@ -195,54 +195,55 @@ map: {
195
195
 
196
196
  ## API
197
197
  ### Inputs
198
- | Input | Type | Default | Required | Description |
199
- | ------------- | ------------- | ------------- | ------------- | ------------- |
200
- | [addTag] | `boolean \| ((term: string) => any \| Promise<any>)` | `false` | no | Allows to create custom options. |
201
- | addTagText | `string` | `Add item` | no | Set custom text when using tagging |
202
- | appearance | `string` | `underline` | no | Allows to select dropdown appearance. Set to `outline` to add border instead of underline (applies only to Material theme) |
203
- | appendTo | `string` | null | no | Append dropdown to body or any other element using css selector. For correct positioning `body` should have `position:relative` |
204
- | bufferAmount | `string` | null | no | Append dropdown to body or any other element using css selector. For correct positioning `body` should have `position:relative` |
205
- | bindValue | `string` | `-` | no | Object property to use for selected model. By default binds to whole object. |
206
- | bindLabel | `string` | `label` | no | Object property to use for label. Default `label` |
207
- | [closeOnSelect] | `boolean` | true | no | Whether to close the menu when a value is selected |
208
- | clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |
209
- | [clearable] | `boolean` | `true` | no | Allow to clear selected value. Default `true`|
210
- | [clearOnBackspace] | `boolean` | `true` | no | Clear selected values one by one when clicking backspace. Default `true`|
211
- | [compareWith] | `(a: any, b: any) => boolean` | `(a, b) => a === b` | no | A function to compare the option values with the selected values. The first argument is a value from an option. The second is a value from the selection(model). A boolean should be returned. |
212
- | dropdownPosition | `bottom` \| `top` \| `auto` | `auto` | no | Set the dropdown position on open |
213
- | [groupBy] | `string` \| `Function` | null | no | Allow to group items by key or function expression |
214
- | [groupValue] | `(groupKey: string, children: any[]) => Object` | - | no | Function expression to provide group value |
215
- | [selectableGroup] | `boolean` | false | no | Allow to select group when groupBy is used |
216
- | [selectableGroupAsModel] | `boolean` | true | no | Indicates whether to select all children or group itself |
217
- | [items] | `Array<any>` | `[]` | yes | Items array |
218
- | [loading] | `boolean` | `-` | no | You can set the loading state from the outside (e.g. async items loading) |
219
- | loadingText | `string` | `Loading...` | no | Set custom text when for loading items |
220
- | labelForId | `string` | `-` | no | Id to associate control with label. |
221
- | [markFirst] | `boolean` | `true` | no | Marks first item as focused when opening/filtering. |
222
- | [isOpen] | `boolean` | `-` | no | Allows manual control of dropdown opening and closing. `true` - won't close. `false` - won't open. |
223
- | maxSelectedItems | `number` | none | no | When multiple = true, allows to set a limit number of selection. |
224
- | [hideSelected] | `boolean` | `false` | no | Allows to hide selected items. |
225
- | [multiple] | `boolean` | `false` | no | Allows to select multiple items. |
226
- | notFoundText | `string` | `No items found` | no | Set custom text when filter returns empty result |
227
- | placeholder | `string` | `-` | no | Placeholder text. |
228
- | [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|
229
- | [readonly] | `boolean` | `false` | no | Set ng-select as readonly. Mostly used with reactive forms. |
230
- | [searchFn] | `(term: string, item: any) => boolean` | `null` | no | Allow to filter by custom search function |
231
- | [searchWhileComposing] | `boolean` | `true` | no | Whether items should be filtered while composition started |
232
- | [trackByFn] | `(item: any) => any` | `null` | no | Provide custom trackBy function |
233
- | [clearSearchOnAdd] | `boolean` | `true` | no | Clears search input when item is selected. Default `true`. Default `false` when **closeOnSelect** is `false` |
234
- | [deselectOnClick] | `boolean` | `false` | no | Deselects a selected item when it is clicked in the dropdown. Default `false`. Default `true` when **multiple** is `true` |
235
- | [editableSearchTerm] | `boolean` | `false` | no | Allow to edit search query if option selected. Default `false`. Works only if multiple is `false`. |
236
- | [selectOnTab] | `boolean` | `false` | no | Select marked dropdown item using tab. Default `false`|
237
- | [openOnEnter] | `boolean` | `true` | no | Open dropdown using enter. Default `true`|
238
- | [typeahead] | `Subject` | `-` | no | Custom autocomplete or advanced filter. |
239
- | [minTermLength] | `number` | `0` | no | Minimum term length to start a search. Should be used with `typeahead` |
240
- | typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |
241
- | [virtualScroll] | `boolean` | false | no | Enable virtual scroll for better performance when rendering a lot of data |
242
- | [inputAttrs] | `{ [key: string]: string }` | `-` | no | Pass custom attributes to underlying `input` element |
243
- | [tabIndex] | `number` | `-` | no | Set tabindex on ng-select |
244
- | [preventToggleOnRightClick] | `boolean` | `false` | no | Prevent opening of ng-select on right mouse click |
245
- | [keyDownFn] | `($event: KeyboardEvent) => bool` | `true` | no | Provide custom keyDown function. Executed before default handler. Return false to suppress execution of default key down handlers |
198
+ | Input | Type | Default | Required | Description |
199
+ |-----------------------------|------------------------------------------------------|---------------------| ------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
200
+ | [addTag] | `boolean \| ((term: string) => any \| Promise<any>)` | `false` | no | Allows to create custom options. |
201
+ | addTagText | `string` | `Add item` | no | Set custom text when using tagging |
202
+ | appearance | `string` | `underline` | no | Allows to select dropdown appearance. Set to `outline` to add border instead of underline (applies only to Material theme) |
203
+ | appendTo | `string` | null | no | Append dropdown to body or any other element using css selector. For correct positioning `body` should have `position:relative` |
204
+ | bufferAmount | `string` | null | no | Append dropdown to body or any other element using css selector. For correct positioning `body` should have `position:relative` |
205
+ | bindValue | `string` | `-` | no | Object property to use for selected model. By default binds to whole object. |
206
+ | bindLabel | `string` | `label` | no | Object property to use for label. Default `label` |
207
+ | [closeOnSelect] | `boolean` | true | no | Whether to close the menu when a value is selected |
208
+ | clearAllText | `string` | `Clear all` | no | Set custom text for clear all icon title |
209
+ | [clearable] | `boolean` | `true` | no | Allow to clear selected value. Default `true` |
210
+ | [clearOnBackspace] | `boolean` | `true` | no | Clear selected values one by one when clicking backspace. Default `true` |
211
+ | [compareWith] | `(a: any, b: any) => boolean` | `(a, b) => a === b` | no | A function to compare the option values with the selected values. The first argument is a value from an option. The second is a value from the selection(model). A boolean should be returned. |
212
+ | dropdownPosition | `bottom` \| `top` \| `auto` | `auto` | no | Set the dropdown position on open |
213
+ | [fixedPlaceholder] | `boolean` | `false` | no | Set placeholder visible even when an item is selected |
214
+ | [groupBy] | `string` \| `Function` | null | no | Allow to group items by key or function expression |
215
+ | [groupValue] | `(groupKey: string, children: any[]) => Object` | - | no | Function expression to provide group value |
216
+ | [selectableGroup] | `boolean` | false | no | Allow to select group when groupBy is used |
217
+ | [selectableGroupAsModel] | `boolean` | true | no | Indicates whether to select all children or group itself |
218
+ | [items] | `Array<any>` | `[]` | yes | Items array |
219
+ | [loading] | `boolean` | `-` | no | You can set the loading state from the outside (e.g. async items loading) |
220
+ | loadingText | `string` | `Loading...` | no | Set custom text when for loading items |
221
+ | labelForId | `string` | `-` | no | Id to associate control with label. |
222
+ | [markFirst] | `boolean` | `true` | no | Marks first item as focused when opening/filtering. |
223
+ | [isOpen] | `boolean` | `-` | no | Allows manual control of dropdown opening and closing. `true` - won't close. `false` - won't open. |
224
+ | maxSelectedItems | `number` | none | no | When multiple = true, allows to set a limit number of selection. |
225
+ | [hideSelected] | `boolean` | `false` | no | Allows to hide selected items. |
226
+ | [multiple] | `boolean` | `false` | no | Allows to select multiple items. |
227
+ | notFoundText | `string` | `No items found` | no | Set custom text when filter returns empty result |
228
+ | placeholder | `string` | `-` | no | Placeholder text. |
229
+ | [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true` |
230
+ | [readonly] | `boolean` | `false` | no | Set ng-select as readonly. Mostly used with reactive forms. |
231
+ | [searchFn] | `(term: string, item: any) => boolean` | `null` | no | Allow to filter by custom search function |
232
+ | [searchWhileComposing] | `boolean` | `true` | no | Whether items should be filtered while composition started |
233
+ | [trackByFn] | `(item: any) => any` | `null` | no | Provide custom trackBy function |
234
+ | [clearSearchOnAdd] | `boolean` | `true` | no | Clears search input when item is selected. Default `true`. Default `false` when **closeOnSelect** is `false` |
235
+ | [deselectOnClick] | `boolean` | `false` | no | Deselects a selected item when it is clicked in the dropdown. Default `false`. Default `true` when **multiple** is `true` |
236
+ | [editableSearchTerm] | `boolean` | `false` | no | Allow to edit search query if option selected. Default `false`. Works only if multiple is `false`. |
237
+ | [selectOnTab] | `boolean` | `false` | no | Select marked dropdown item using tab. Default `false` |
238
+ | [openOnEnter] | `boolean` | `true` | no | Open dropdown using enter. Default `true` |
239
+ | [typeahead] | `Subject` | `-` | no | Custom autocomplete or advanced filter. |
240
+ | [minTermLength] | `number` | `0` | no | Minimum term length to start a search. Should be used with `typeahead` |
241
+ | typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |
242
+ | [virtualScroll] | `boolean` | false | no | Enable virtual scroll for better performance when rendering a lot of data |
243
+ | [inputAttrs] | `{ [key: string]: string }` | `-` | no | Pass custom attributes to underlying `input` element |
244
+ | [tabIndex] | `number` | `-` | no | Set tabindex on ng-select |
245
+ | [preventToggleOnRightClick] | `boolean` | `false` | no | Prevent opening of ng-select on right mouse click |
246
+ | [keyDownFn] | `($event: KeyboardEvent) => bool` | `true` | no | Provide custom keyDown function. Executed before default handler. Return false to suppress execution of default key down handlers |
246
247
 
247
248
  ### Outputs
248
249
 
@@ -18,4 +18,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
18
18
  type: Injectable,
19
19
  args: [{ providedIn: 'root' }]
20
20
  }] });
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbmctc2VsZWN0L2xpYi9jb25maWcuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUczQyxNQUFNLE9BQU8sY0FBYztJQUQzQjtRQUdDLGlCQUFZLEdBQUcsZ0JBQWdCLENBQUM7UUFDaEMscUJBQWdCLEdBQUcsZ0JBQWdCLENBQUM7UUFDcEMsZUFBVSxHQUFHLFVBQVUsQ0FBQztRQUN4QixnQkFBVyxHQUFHLFlBQVksQ0FBQztRQUM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