ng-select2-component 16.0.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 +242 -150
- package/README.md +68 -61
- package/fesm2022/ng-select2-component.mjs +594 -581
- package/fesm2022/ng-select2-component.mjs.map +1 -1
- package/lib/select2-hint.component.d.ts +1 -1
- package/lib/select2-hint.component.d.ts.map +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-label.component.d.ts.map +1 -1
- package/lib/select2-utils.d.ts +12 -8
- package/lib/select2-utils.d.ts.map +1 -1
- package/lib/select2.component.d.ts +122 -121
- package/lib/select2.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -4
- package/public_api.d.ts.map +1 -1
- package/lib/select2.module.d.ts +0 -14
- package/lib/select2.module.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -12,26 +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
|
-
|
|
34
|
-
|
|
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 |
|
|
35
39
|
|
|
36
40
|
## Demo
|
|
37
41
|
|
|
@@ -39,34 +43,37 @@ npm i ng-select2-component --save
|
|
|
39
43
|
|
|
40
44
|
## Features
|
|
41
45
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
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
|
|
56
60
|
|
|
57
61
|
## Usage
|
|
58
62
|
|
|
59
63
|
### example
|
|
60
64
|
|
|
61
65
|
```ts
|
|
62
|
-
import {
|
|
66
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
67
|
+
|
|
68
|
+
import { Select2, Select2Hint, Select2Label } from 'ng-select2-component';
|
|
63
69
|
|
|
64
|
-
@
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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],
|
|
68
75
|
})
|
|
69
|
-
class
|
|
76
|
+
class MyComponent {}
|
|
70
77
|
```
|
|
71
78
|
|
|
72
79
|
```html
|
|
@@ -108,7 +115,7 @@ class MainModule {}
|
|
|
108
115
|
| `selectionNoWrap` | `boolean` | | `false` | Force selection on one line | |
|
|
109
116
|
| `showSelectAll` | `boolean` | | `false` | Add an option to select all options | with `multiple` |
|
|
110
117
|
| `selectAllText` | `string` | | `'Select all'` | Text when all options as not selected | with `multiple` |
|
|
111
|
-
| `removeAllText` | `string` | | `'Remove all'` | Text when all options as selected
|
|
118
|
+
| `removeAllText` | `string` | | `'Remove all'` | Text when all options as selected | with `multiple` |
|
|
112
119
|
| `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search | |
|
|
113
120
|
| `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control | |
|
|
114
121
|
| `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option | |
|
|
@@ -288,37 +295,37 @@ const data: Select2Data = [
|
|
|
288
295
|
|
|
289
296
|
#### Possible object
|
|
290
297
|
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
298
|
+
- `TemplateRef`
|
|
299
|
+
- `{template: TemplateRef}`
|
|
300
|
+
- `{option?: TemplateRef, group?: TemplateRef}`
|
|
301
|
+
- `{templateId1: TemplateRef, ...}`
|
|
295
302
|
|
|
296
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 :
|
|
297
304
|
|
|
298
|
-
-
|
|
299
|
-
-
|
|
305
|
+
- `{templateSelection: TemplateRef}`
|
|
306
|
+
- `{optionSelection: TemplateRef}`
|
|
300
307
|
|
|
301
308
|
#### Priority order
|
|
302
309
|
|
|
303
310
|
For group or option:
|
|
304
311
|
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
312
|
+
- `'id'` (from item data `templateId`)
|
|
313
|
+
- `'group'` or `'option'`
|
|
314
|
+
- `'template'`
|
|
315
|
+
- `TemplateRef` (from html attribute `templates`)
|
|
316
|
+
- Default render
|
|
310
317
|
|
|
311
318
|
For the selection:
|
|
312
319
|
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
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
|
|
322
329
|
|
|
323
330
|
### Overlay
|
|
324
331
|
|