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 +8 -8
- package/CHANGELOG.md +69 -2
- package/README.md +68 -60
- package/fesm2022/ng-select2-component.mjs +435 -486
- package/fesm2022/ng-select2-component.mjs.map +1 -1
- package/lib/select2-hint.component.d.ts +1 -1
- package/lib/select2-interfaces.d.ts +10 -6
- package/lib/select2-interfaces.d.ts.map +1 -1
- package/lib/select2-label.component.d.ts +1 -1
- package/lib/select2-utils.d.ts +9 -9
- package/lib/select2-utils.d.ts.map +1 -1
- package/lib/select2.component.d.ts +111 -120
- package/lib/select2.component.d.ts.map +1 -1
- package/package.json +5 -7
- package/public_api.d.ts +2 -4
- package/public_api.d.ts.map +1 -1
- package/esm2022/lib/select2-const.mjs +0 -48
- package/esm2022/lib/select2-hint.component.mjs +0 -11
- package/esm2022/lib/select2-interfaces.mjs +0 -2
- package/esm2022/lib/select2-label.component.mjs +0 -11
- package/esm2022/lib/select2-utils.mjs +0 -293
- package/esm2022/lib/select2.component.mjs +0 -1170
- package/esm2022/lib/select2.module.mjs +0 -23
- package/esm2022/ng-select2-component.mjs +0 -5
- package/esm2022/public_api.mjs +0 -12
- package/lib/select2.module.d.ts +0 -14
- package/lib/select2.module.d.ts.map +0 -1
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
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- Célian Veyssière (aka Zéfling)
|
|
8
|
+
- Baptiste (aka BatMen)
|
|
9
9
|
|
|
10
10
|
Thanks for your contributions:
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
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 {
|
|
66
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
67
|
+
|
|
68
|
+
import { Select2, Select2Hint, Select2Label } from 'ng-select2-component';
|
|
62
69
|
|
|
63
|
-
@
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
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
|
|
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
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
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
|
-
-
|
|
298
|
-
-
|
|
305
|
+
- `{templateSelection: TemplateRef}`
|
|
306
|
+
- `{optionSelection: TemplateRef}`
|
|
299
307
|
|
|
300
308
|
#### Priority order
|
|
301
309
|
|
|
302
310
|
For group or option:
|
|
303
311
|
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
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
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
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
|
|