ng-select2-component 15.0.0 → 15.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog of ng-select2
2
2
 
3
+ ## V15.1.0 (2024-08-02)
4
+
5
+ ### Changes
6
+
7
+ - Add grid layout mode in dropdown #72
8
+ - Fix init value in multiple mode #73
9
+ - Fix reset value
10
+
11
+ ## V15.0.1 (2024-07-24)
12
+
13
+ ### Changes
14
+
15
+ - Fix reset with multiple #69
16
+ - Rewrite update event #69
17
+
3
18
  ## V15.0.0 (2024-05-31)
4
19
 
5
20
  ### Breaking Changes
package/README.md CHANGED
@@ -26,20 +26,20 @@ npm i ng-select2-component --save
26
26
  > - For `angular` 10, 11 and 12 (View Engine): use version `8.1.0`.
27
27
  > - For `angular` 13 (Ivy): use version `9.0.0`.
28
28
  > - For `angular` 14 (Ivy): use version `10.0.0`.
29
- > - For `angular` 15 (Ivy): use version `11.0.0`.
30
- > - For `angular` 16 (Ivy): use version `12.0.0`.
31
- > - For `angular` 16.1 (Ivy): use version `13.0.0`.
32
- > - For `angular` 17 (Ivy): use version `14.0.0`.
33
- > - For `angular` 18 and more (Ivy): use version `15.0.0`.
29
+ > - For `angular` 15 (Ivy): use version `11.1.0`.
30
+ > - For `angular` 16 (Ivy): use version `12.1.0`.
31
+ > - For `angular` 16.1 (Ivy): use version `13.0.10`.
32
+ > - For `angular` 17 (Ivy): use version `14.0.1`.
33
+ > - For `angular` 18 and more (Ivy): use version `15.0.1`.
34
34
 
35
35
  ## Demo
36
36
 
37
- [See a demo](https://harvest-dev.github.io/ng-select2/dist/ng-select2/).
37
+ [See a demo](https://harvest-dev.github.io/ng-select2/dist/ng-select2/browser).
38
38
 
39
39
  ## Features
40
40
 
41
41
  - select one
42
- - options or groups
42
+ - options or groups (list or grid)
43
43
  - scroll
44
44
  - local search
45
45
  - select by keyboard
@@ -74,44 +74,45 @@ class MainModule {}
74
74
 
75
75
  ### properties and events of the component
76
76
 
77
- | name | type | status | default | description | required |
78
- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------------------------------------------------------------------------- | ------------------------------------ |
79
- | `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2 | |
80
- | `value` | [`Select2Value`](#select2-data-structure) | | | initial value | |
81
- | `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited) | |
82
- | `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch` | |
83
- | `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`) | |
84
- | `placeholder` | `string` | | | the placeholder string if nothing selected | |
85
- | `noResultMessage` | `string` | | | the message string if no results when using the search field | |
86
- | `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter | |
87
- | `multiple` | `boolean` | | `false` | select multiple options | |
88
- | `resettable` | `boolean` | | `false` | add a button to reset value | not `multiple` |
89
- | `resetSelectedValue` | `any` | | `undefined` | selected option when × is clicked | not `multiple` and with `resettable` |
90
- | `autoCreate` | `boolean` | | `false` | gives the possibility to add elements not present in the list. | |
91
- | `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited) | |
92
- | `hideSelectedItems` | `boolean` | | `false` | remove selected values | with `multiple` |
93
- | `resultMaxHeight` | `string` | | `'200px'` | change the height size of results | |
94
- | `maxResults` | `number` | | `0` | maximum results limit (`0` = unlimited) | |
95
- | `maxResultsMessage` | `string` | | `'Too much result…'` | message when maximum result | |
96
- | `listPosition` | `'below'`<br>`'above'`<br>`'auto'` ¹ | | `'below'` | the position for the dropdown list | ¹ `'auto'`: only with `overlay` |
97
- | `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list | with `ngx-infinite-scroll` |
98
- | `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance | with `ngx-infinite-scroll` |
99
- | `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle | |
100
- | `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay)) | |
101
- | `styleMode` | `'default'`<br>`'material'`<br>`'noStyle'`<br>`'borderless'` | | `'default'` | change style for material style or remove border and background color | |
102
- | `templates` | `TemplateRef`<br>`{option?: TemplateRef, group?: TemplateRef}`<br>`{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating)) | |
103
- | `noLabelTemplate` | `boolean` | | `false` | do not use the template in the selection, stay in text mode | |
104
- | `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
105
- | `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
106
- | `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
107
- | `(open)` | `(event: Select2) => void` | event | | triggered when user open the options | |
108
- | `(close)` | `(event: Select2) => void` | event | | triggered when user close the options | |
109
- | `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component | |
110
- | `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component | |
111
- | `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed | with `customSearchEnabled` |
112
- | `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position | with `ngx-infinite-scroll` |
113
- | `(removeOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | triggered when an option is removed from the list of selected options options list | with `multiple` |
114
- | `(autoCreateItem)` | `(event: `[`Select2AutoCreateEvent`](#select2-data-structure)`) => void` | event | | triggered when a new item has been added | with `autoCreate` |
77
+ | name | type | status | default | description | required |
78
+ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
79
+ | `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2 | |
80
+ | `value` | [`Select2Value`](#select2-data-structure) | | | initial value | |
81
+ | `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited) | |
82
+ | `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch` | |
83
+ | `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`) | |
84
+ | `placeholder` | `string` | | | the placeholder string if nothing selected | |
85
+ | `noResultMessage` | `string` | | | the message string if no results when using the search field | |
86
+ | `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter | |
87
+ | `multiple` | `boolean` | | `false` | select multiple options | |
88
+ | `resettable` | `boolean` | | `false` | add a button to reset value | not `multiple` |
89
+ | `resetSelectedValue` | `any` | | `undefined` | selected option when × is clicked | not `multiple` and with `resettable` |
90
+ | `autoCreate` | `boolean` | | `false` | gives the possibility to add elements not present in the list. | |
91
+ | `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited) | |
92
+ | `hideSelectedItems` | `boolean` | | `false` | remove selected values | with `multiple` |
93
+ | `resultMaxHeight` | `string` | | `'200px'` | change the height size of results | |
94
+ | `maxResults` | `number` | | `0` | maximum results limit (`0` = unlimited) | |
95
+ | `maxResultsMessage` | `string` | | `'Too much result…'` | message when maximum result | |
96
+ | `grid` | `number` or `string` | | | option by line in grid layout (empty or `0` = no grid layout)<br>number: item by line<br>string: minimal item width | |
97
+ | `listPosition` | `'below'`<br>`'above'`<br>`'auto'` ¹ | | `'below'` | the position for the dropdown list | ¹ `'auto'`: only with `overlay` |
98
+ | `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list | with `ngx-infinite-scroll` |
99
+ | `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance | with `ngx-infinite-scroll` |
100
+ | `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle | |
101
+ | `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay)) | |
102
+ | `styleMode` | `'default'`<br>`'material'`<br>`'noStyle'`<br>`'borderless'` | | `'default'` | change style for material style or remove border and background color | |
103
+ | `templates` | `TemplateRef`<br>`{option?: TemplateRef, group?: TemplateRef}`<br>`{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating)) | |
104
+ | `noLabelTemplate` | `boolean` | | `false` | do not use the template in the selection, stay in text mode | |
105
+ | `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
106
+ | `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
107
+ | `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
108
+ | `(open)` | `(event: Select2) => void` | event | | triggered when user open the options | |
109
+ | `(close)` | `(event: Select2) => void` | event | | triggered when user close the options | |
110
+ | `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component | |
111
+ | `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component | |
112
+ | `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed | with `customSearchEnabled` |
113
+ | `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position | with `ngx-infinite-scroll` |
114
+ | `(removeOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | triggered when an option is removed from the list of selected options options list | with `multiple` |
115
+ | `(autoCreateItem)` | `(event: `[`Select2AutoCreateEvent`](#select2-data-structure)`) => void` | event | | triggered when a new item has been added | with `autoCreate` |
115
116
 
116
117
  ### select2 data structure
117
118
 
@@ -359,7 +360,7 @@ It's possible to change different colors (and more) with CSS variables without h
359
360
  --select2-option-group-text-color: gray;
360
361
  --select2-option-group-background: transparent;
361
362
  --select2-option-padding: 6px;
362
-
363
+
363
364
  /* hint */
364
365
  --select2-hint-text-color: #888;
365
366
 
@@ -1,10 +1,10 @@
1
1
  import { Directive } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export class Select2Hint {
4
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: Select2Hint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: Select2Hint, selector: "select2-hint", ngImport: i0 }); }
4
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: Select2Hint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", type: Select2Hint, selector: "select2-hint", ngImport: i0 }); }
6
6
  }
7
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: Select2Hint, decorators: [{
7
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: Select2Hint, decorators: [{
8
8
  type: Directive,
9
9
  args: [{ selector: 'select2-hint' }]
10
10
  }] });
@@ -1,10 +1,10 @@
1
1
  import { Directive } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export class Select2Label {
4
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: Select2Label, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: Select2Label, selector: "select2-label", ngImport: i0 }); }
4
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: Select2Label, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", type: Select2Label, selector: "select2-label", ngImport: i0 }); }
6
6
  }
7
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: Select2Label, decorators: [{
7
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: Select2Label, decorators: [{
8
8
  type: Directive,
9
9
  args: [{ selector: 'select2-label' }]
10
10
  }] });