Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-select2-component

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-select2-component - npm Package Compare versions

Comparing version 13.0.0 to 13.0.1

7

CHANGELOG.md
# Changelog of ng-select2
## V13.0.1 (2023-07-31)
### Changes
- add `resetSelectedValue` parameter #42
- fix `autoCreate` with no search input #49
## V13.0.0 (2023-07-20)

@@ -4,0 +11,0 @@

4

lib/select2.component.d.ts

@@ -76,2 +76,4 @@ import { ConnectedPosition } from '@angular/cdk/overlay';

resettable: boolean;
/** selected value when × is clicked */
resetSelectedValue: any;
update: EventEmitter<Select2UpdateEvent<Select2UpdateValue>>;

@@ -217,3 +219,3 @@ open: EventEmitter<Select2>;

static ɵfac: i0.ɵɵFactoryDeclaration<Select2, [null, null, { optional: true; }, { optional: true; }, { optional: true; self: true; }, { attribute: "tabindex"; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<Select2, "select2", never, { "data": { "alias": "data"; "required": true; }; "minCharForSearch": { "alias": "minCharForSearch"; "required": false; }; "displaySearchStatus": { "alias": "displaySearchStatus"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "limitSelection": { "alias": "limitSelection"; "required": false; }; "listPosition": { "alias": "listPosition"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "overlay": { "alias": "overlay"; "required": false; }; "styleMode": { "alias": "styleMode"; "required": false; }; "noResultMessage": { "alias": "noResultMessage"; "required": false; }; "maxResults": { "alias": "maxResults"; "required": false; }; "maxResultsMessage": { "alias": "maxResultsMessage"; "required": false; }; "infiniteScrollDistance": { "alias": "infiniteScrollDistance"; "required": false; }; "infiniteScrollThrottle": { "alias": "infiniteScrollThrottle"; "required": false; }; "infiniteScroll": { "alias": "infiniteScroll"; "required": false; }; "autoCreate": { "alias": "autoCreate"; "required": false; }; "noLabelTemplate": { "alias": "noLabelTemplate"; "required": false; }; "editPattern": { "alias": "editPattern"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; "resultMaxHeight": { "alias": "resultMaxHeight"; "required": false; }; "customSearchEnabled": { "alias": "customSearchEnabled"; "required": false; }; "minCountForSearch": { "alias": "minCountForSearch"; "required": false; }; "id": { "alias": "id"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideSelectedItems": { "alias": "hideSelectedItems"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "resettable": { "alias": "resettable"; "required": false; }; }, { "update": "update"; "open": "open"; "close": "close"; "focus": "focus"; "blur": "blur"; "search": "search"; "scroll": "scroll"; "removeOption": "removeOption"; }, never, ["select2-label", "select2-hint"], false, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<Select2, "select2", never, { "data": { "alias": "data"; "required": true; }; "minCharForSearch": { "alias": "minCharForSearch"; "required": false; }; "displaySearchStatus": { "alias": "displaySearchStatus"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "limitSelection": { "alias": "limitSelection"; "required": false; }; "listPosition": { "alias": "listPosition"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "overlay": { "alias": "overlay"; "required": false; }; "styleMode": { "alias": "styleMode"; "required": false; }; "noResultMessage": { "alias": "noResultMessage"; "required": false; }; "maxResults": { "alias": "maxResults"; "required": false; }; "maxResultsMessage": { "alias": "maxResultsMessage"; "required": false; }; "infiniteScrollDistance": { "alias": "infiniteScrollDistance"; "required": false; }; "infiniteScrollThrottle": { "alias": "infiniteScrollThrottle"; "required": false; }; "infiniteScroll": { "alias": "infiniteScroll"; "required": false; }; "autoCreate": { "alias": "autoCreate"; "required": false; }; "noLabelTemplate": { "alias": "noLabelTemplate"; "required": false; }; "editPattern": { "alias": "editPattern"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; "resultMaxHeight": { "alias": "resultMaxHeight"; "required": false; }; "customSearchEnabled": { "alias": "customSearchEnabled"; "required": false; }; "minCountForSearch": { "alias": "minCountForSearch"; "required": false; }; "id": { "alias": "id"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hideSelectedItems": { "alias": "hideSelectedItems"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "resettable": { "alias": "resettable"; "required": false; }; "resetSelectedValue": { "alias": "resetSelectedValue"; "required": false; }; }, { "update": "update"; "open": "open"; "close": "close"; "focus": "focus"; "blur": "blur"; "search": "search"; "scroll": "scroll"; "removeOption": "removeOption"; }, never, ["select2-label", "select2-hint"], false, never>;
static ngAcceptInputType_minCharForSearch: unknown;

@@ -220,0 +222,0 @@ static ngAcceptInputType_limitSelection: unknown;

{
"name": "ng-select2-component",
"version": "13.0.0",
"version": "13.0.1",
"description": "An Angular select2 component.",

@@ -5,0 +5,0 @@ "author": "York Yao, Célian Veyssière",

@@ -17,4 +17,4 @@ [![npm version](https://badge.fury.io/js/ng-select2-component.svg)](https://badge.fury.io/js/ng-select2-component) [![Downloads](https://img.shields.io/npm/dm/ng-select2-component.svg)](https://www.npmjs.com/package/ng-select2-component) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Harvest-Dev/ng-select2/master/LICENSE.md)

- `angular` 16.0.0 and more
- `angular/cdk` 16.0.0 and more
- `angular` 16.1.0 and more
- `angular/cdk` 16.1.0 and more

@@ -32,2 +32,3 @@ - dependencies (include):

> - For `angular` 16 and more (Ivy): use version `12.0.0`.
> - For `angular` 16.1 and more (Ivy): use version `13.0.0`.

@@ -76,38 +77,39 @@ ## Demo

| name | type | status | default | description | required |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------------------------------------------------------------------------- | ----------------------------- |
| `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2 | |
| `value` | [`Select2Value`](#select2-data-structure) | | | initial value | |
| `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited) | |
| `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch` | |
| `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`) | |
| `placeholder` | `string` | | | the placeholder string if nothing selected | |
| `noResultMessage` | `string` | | | the message string if no results when using the search field | |
| `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter | |
| `multiple` | `boolean` | | `false` | select multiple options | |
| `resettable` | `boolean` | | `false` | add a button to reset value | not `multiple` |
| `autoCreate` | `boolean` | | `false` | gives the possibility to add elements not present in the list. | with `multiple` |
| `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited) | |
| `hideSelectedItems` | `boolean` | | `false` | remove selected values | with `multiple` |
| `resultMaxHeight` | `string` | | `'200px'` | change the height size of results | |
| `maxResults` | `number` | | `0` | maximum results limit (`0` = unlimited) | |
| `maxResultsMessage` | `string` | | `'Too much result…'` | message when maximum result | |
| `listPosition` | `'below'`<br>`'above'`<br>`'auto'` \* | | `'below'` | the position for the dropdown list | `'auto'`: only with `overlay` |
| `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list | with `ngx-infinite-scroll` |
| `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance | with `ngx-infinite-scroll` |
| `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle | |
| `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay)) | |
| `styleMode` | `'default'`<br>`'material'`<br>`'noStyle'` | | `'default'` | change style for material style or remove border and background color | |
| `templates` | `TemplateRef`<br>`{option?: TemplateRef, group?: TemplateRef}`<br>`{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating)) | |
| `noLabelTemplate` | `boolean` | | `false` | do not use the template in the selection, stay in text mode | |
| `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
| `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
| `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
| `(open)` | `(event: Select2) => void` | event | | triggered when user open the options | |
| `(close)` | `(event: Select2) => void` | event | | triggered when user close the options | |
| `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component | |
| `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component | |
| `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed | with `customSearchEnabled` |
| `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position | with `ngx-infinite-scroll` |
| `(removedOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | triggered when an option is removed from the list of selected options options list | with `multiple` |
| name | type | status | default | description | required |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------------------------------------------------------------------------- | ------------------------------------ |
| `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2 | |
| `value` | [`Select2Value`](#select2-data-structure) | | | initial value | |
| `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited) | |
| `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch` | |
| `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`) | |
| `placeholder` | `string` | | | the placeholder string if nothing selected | |
| `noResultMessage` | `string` | | | the message string if no results when using the search field | |
| `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter | |
| `multiple` | `boolean` | | `false` | select multiple options | |
| `resettable` | `boolean` | | `false` | add a button to reset value | not `multiple` |
| `resetSelectedValue` | `any` | | `undefined` | selected option when × is clicked | not `multiple` and with `resettable` |
| `autoCreate` | `boolean` | | `false` | gives the possibility to add elements not present in the list. | with `multiple` |
| `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited) | |
| `hideSelectedItems` | `boolean` | | `false` | remove selected values | with `multiple` |
| `resultMaxHeight` | `string` | | `'200px'` | change the height size of results | |
| `maxResults` | `number` | | `0` | maximum results limit (`0` = unlimited) | |
| `maxResultsMessage` | `string` | | `'Too much result…'` | message when maximum result | |
| `listPosition` | `'below'`<br>`'above'`<br>`'auto'` ¹ | | `'below'` | the position for the dropdown list | ¹ `'auto'`: only with `overlay` |
| `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list | with `ngx-infinite-scroll` |
| `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance | with `ngx-infinite-scroll` |
| `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle | |
| `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay)) | |
| `styleMode` | `'default'`<br>`'material'`<br>`'noStyle'` | | `'default'` | change style for material style or remove border and background color | |
| `templates` | `TemplateRef`<br>`{option?: TemplateRef, group?: TemplateRef}`<br>`{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating)) | |
| `noLabelTemplate` | `boolean` | | `false` | do not use the template in the selection, stay in text mode | |
| `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
| `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
| `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
| `(open)` | `(event: Select2) => void` | event | | triggered when user open the options | |
| `(close)` | `(event: Select2) => void` | event | | triggered when user close the options | |
| `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component | |
| `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component | |
| `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed | with `customSearchEnabled` |
| `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position | with `ngx-infinite-scroll` |
| `(removedOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | triggered when an option is removed from the list of selected options options list | with `multiple` |

@@ -117,3 +119,2 @@ ### select2 data structure

```ts
export interface Select2Group {

@@ -120,0 +121,0 @@ /** label of group */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc