ng-select2-component 15.4.0 → 17.0.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/AUTHORS.md CHANGED
@@ -4,14 +4,14 @@ ng-select2 is written by York Yao with contributions from:
4
4
 
5
5
  Main contributors:
6
6
 
7
- - Célian Veyssière (aka Zéfling)
8
- - Baptiste (aka BatMen)
7
+ - Célian Veyssière (aka Zéfling)
8
+ - Baptiste (aka BatMen)
9
9
 
10
10
  Thanks for your contributions:
11
11
 
12
- - ADesbois
13
- - mbelin-hvs
14
- - Varun Nambiar
15
- - Khanh Ngo
16
- - Johan Compagner
17
- - majora2007
12
+ - ADesbois
13
+ - mbelin-hvs
14
+ - Varun Nambiar
15
+ - Khanh Ngo
16
+ - Johan Compagner
17
+ - majora2007
package/CHANGELOG.md CHANGED
@@ -1,6 +1,56 @@
1
1
  # Changelog of ng-select2
2
2
 
3
- ## V15.4.0 (2024-12-18)
3
+ ## V17.0.0 (2024-12-23)
4
+
5
+ ### Changes
6
+
7
+ - Rewrite the component to use all the advances of Angular:
8
+ - Switch to stand-alone component mode
9
+ - Use of signals for inputs & queries
10
+ - Removed a lot of setTimeout
11
+ - Improved the overlay with the CDK
12
+ - Fix autocreate with single option
13
+ - Add resettable with multiple mode
14
+ - Fix inconsistencies in the code
15
+ - Much stricter code rewriting
16
+ - Accessibility (from 15.4.0)
17
+ - Added/modified accessibility attributes
18
+ - New inputs for accessibility
19
+ - `title`
20
+ - `ariaLabelledBy`
21
+ - `ariaDescribedBy`
22
+ - `ariaInvalid`
23
+ - `ariaResetButtonDescription`
24
+ - Improved focus/blur
25
+ - Fixed readonly
26
+ - Added reset button to tab navigation
27
+ - Keyboard interactions
28
+ - Update
29
+ - `Escape`: Improved focus after closing popup.
30
+ - `Tab`: Navigates correctly when no searchbox.
31
+ - New
32
+ - `Home`: Opens popup. Goes to first option.
33
+ - `End`: Opens popup. Goes to last option.
34
+ - `PageUp`: Opens popup. Goes up 10 options.
35
+ - `PageDown`: Opens popup. Goes down 10 options.
36
+ - `Space`: Opens popup. Selects option when there is no search input.
37
+ - `Alt`+`Down`, `Alt`+`Up`: Opens/closes popup.
38
+
39
+ ### Demo
40
+
41
+ - New demo
42
+
43
+ ---
44
+
45
+ ## V16.0.0 (2024-11-27)
46
+
47
+ ### Breaking Changes
48
+
49
+ - minimum required support has been upgraded to Angular `19.0`.
50
+
51
+ ---
52
+
53
+ ## V15.4.0 (on a branch) (2024-12-18)
4
54
 
5
55
  ### Changes
6
56
 
@@ -80,6 +130,8 @@
80
130
 
81
131
  - manage blur event (overlay, click on option)
82
132
 
133
+ ---
134
+
83
135
  ## V14.0.1 (2024-03-04)
84
136
 
85
137
  - add `borderless` style
@@ -90,7 +142,18 @@
90
142
 
91
143
  - minimum required support has been upgraded to Angular `17.0`.
92
144
 
93
- ## V13.0.10 (2024-03-04)
145
+ ---
146
+
147
+ ## V13.0.12 (on a branch) (2024-07-24)
148
+
149
+ - Fix reset with multiple #69
150
+ - Rewrite update event #69
151
+
152
+ ## V13.0.11 (on a branch) (2024-06-14)
153
+
154
+ - manage blur event (overlay, click on option)
155
+
156
+ ## V13.0.10 (on a branch) (2024-03-04)
94
157
 
95
158
  - add `borderless` style
96
159
 
@@ -154,6 +217,8 @@
154
217
  - fix template with `multiple`
155
218
  - refacto with `numberAttribute` & `booleanAttribute` (Angular `16.1`)
156
219
 
220
+ ---
221
+
157
222
  ## V12.1.0 (2023-07-05)
158
223
 
159
224
  ### Changes
@@ -195,6 +260,8 @@
195
260
  - fix class `select2-container--focus`
196
261
  - add item keyboard remove (multiple)
197
262
 
263
+ ---
264
+
198
265
  ## V10.0.0 (2022-07-27)
199
266
 
200
267
  ### Breaking Changes
package/README.md CHANGED
@@ -12,25 +12,30 @@ npm i ng-select2-component --save
12
12
 
13
13
  ## Requirements
14
14
 
15
- - peerDependencies:
16
-
17
- - `angular` 18.0.0 and more
18
- - `angular/cdk` 18.0.0 and more
19
-
20
- - dependencies (include):
21
- - `ngx-infinite-scroll` 18.0.0 and more
22
-
23
- > **Note:**<br>
24
- >
25
- > - For `angular` 7, 8 and 9 (View Engine): use version `7.3.1`.
26
- > - For `angular` 10, 11 and 12 (View Engine): use version `8.1.0`.
27
- > - For `angular` 13 (Ivy): use version `9.0.0`.
28
- > - For `angular` 14 (Ivy): use version `10.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`.
15
+ - peerDependencies:
16
+
17
+ - `angular` 19.0.0 and more
18
+ - `angular/cdk` 19.0.0 and more
19
+
20
+ - dependencies (include):
21
+
22
+ - `ngx-infinite-scroll` 19.0.0 and more
23
+
24
+ ### Notes
25
+
26
+ | Version  | For **Angular** | Notes |
27
+ | --------- | --------------- | ----------------- |
28
+ | `7.3.1` | 7, 8 and 9 | View Engine |
29
+ | `8.1.0` | 10, 11 and 12 | View Engine |
30
+ | `9.0.0` | 13 | Ivy |
31
+ | `10.0.0` | 14 | Ivy |
32
+ | `11.1.0` | 15 | Ivy |
33
+ | `12.1.0` | 16 | Ivy |
34
+ | `13.0.12` | 16.1 | Ivy |
35
+ | `14.0.1` | 17 | Ivy |
36
+ | `15.3.0` | 18 | Ivy |
37
+ | `16.0.0` | 19 | Ivy / Module |
38
+ | `17.0.0` | 19 and more | Ivy / Stand-alone |
34
39
 
35
40
  ## Demo
36
41
 
@@ -38,34 +43,37 @@ npm i ng-select2-component --save
38
43
 
39
44
  ## Features
40
45
 
41
- - select one
42
- - options or groups (list or grid)
43
- - scroll
44
- - local search
45
- - select by keyboard
46
- - disabled option
47
- - disabled component
48
- - hide search box
49
- - placeholder
50
- - multiple selection
51
- - add items not found in multiple
52
- - material style
53
- - form binding
54
- - templating
46
+ - select one
47
+ - options or groups (list or grid)
48
+ - scroll
49
+ - local search
50
+ - select by keyboard
51
+ - disabled option
52
+ - disabled component
53
+ - hide search box
54
+ - placeholder
55
+ - multiple selection
56
+ - add items not found in multiple
57
+ - material style
58
+ - form binding
59
+ - templating
55
60
 
56
61
  ## Usage
57
62
 
58
63
  ### example
59
64
 
60
65
  ```ts
61
- import { Select2Module } from 'ng-select2-component';
66
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
67
+
68
+ import { Select2, Select2Hint, Select2Label } from 'ng-select2-component';
62
69
 
63
- @NgModule({
64
- imports: [BrowserModule, FormsModule, Select2Module],
65
- declarations: [MainComponent],
66
- bootstrap: [MainComponent],
70
+ @Component({
71
+ selector: 'my-component',
72
+ templateUrl: './my-component.component.html',
73
+ styleUrls: ['./my-component.component.scss'],
74
+ imports: [FormsModule, ReactiveFormsModule, Select2, Select2Hint, Select2Label],
67
75
  })
68
- class MainModule {}
76
+ class MyComponent {}
69
77
  ```
70
78
 
71
79
  ```html
@@ -107,7 +115,7 @@ class MainModule {}
107
115
  | `selectionNoWrap` | `boolean` | | `false` | Force selection on one line | |
108
116
  | `showSelectAll` | `boolean` | | `false` | Add an option to select all options | with `multiple` |
109
117
  | `selectAllText` | `string` | | `'Select all'` | Text when all options as not selected | with `multiple` |
110
- | `removeAllText` | `string` | | `'Remove all'` | Text when all options as selected | with `multiple` |
118
+ | `removeAllText` | `string` | | `'Remove all'` | Text when all options as selected | with `multiple` |
111
119
  | `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
112
120
  | `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
113
121
  | `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
@@ -287,37 +295,37 @@ const data: Select2Data = [
287
295
 
288
296
  #### Possible object
289
297
 
290
- - `TemplateRef`
291
- - `{template: TemplateRef}`
292
- - `{option?: TemplateRef, group?: TemplateRef}`
293
- - `{templateId1: TemplateRef, ...}`
298
+ - `TemplateRef`
299
+ - `{template: TemplateRef}`
300
+ - `{option?: TemplateRef, group?: TemplateRef}`
301
+ - `{templateId1: TemplateRef, ...}`
294
302
 
295
303
  In addition to the rendering templates of options and groups, in addition to going through the `templateSelection` attribute, it is possible to define that of the selection :
296
304
 
297
- - `{templateSelection: TemplateRef}`
298
- - `{optionSelection: TemplateRef}`
305
+ - `{templateSelection: TemplateRef}`
306
+ - `{optionSelection: TemplateRef}`
299
307
 
300
308
  #### Priority order
301
309
 
302
310
  For group or option:
303
311
 
304
- - `'id'` (from item data `templateId`)
305
- - `'group'` or `'option'`
306
- - `'template'`
307
- - `TemplateRef` (from html attribute `templates`)
308
- - Default render
312
+ - `'id'` (from item data `templateId`)
313
+ - `'group'` or `'option'`
314
+ - `'template'`
315
+ - `TemplateRef` (from html attribute `templates`)
316
+ - Default render
309
317
 
310
318
  For the selection:
311
319
 
312
- - `'id'` (from item data `templateSelectionId`)
313
- - `'optionSelection'`
314
- - `'templateSelection'`
315
- - `TemplateRef` (from html attribute `templateSelection`)
316
- - `'id'` (from item data `templateId`)
317
- - `'option'`
318
- - `'template'`
319
- - `TemplateRef` (from html attribute `templates`)
320
- - Default render
320
+ - `'id'` (from item data `templateSelectionId`)
321
+ - `'optionSelection'`
322
+ - `'templateSelection'`
323
+ - `TemplateRef` (from html attribute `templateSelection`)
324
+ - `'id'` (from item data `templateId`)
325
+ - `'option'`
326
+ - `'template'`
327
+ - `TemplateRef` (from html attribute `templates`)
328
+ - Default render
321
329
 
322
330
  ### Overlay
323
331