@stackline/angular-multiselect-dropdown 21.1.15 → 21.2.1
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/README.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
# @stackline/angular-multiselect-dropdown
|
|
2
2
|
|
|
3
|
-
> A maintained Angular multiselect dropdown for classic Angular forms workflows, with search, grouping, custom item and badge templates, lazy loading, custom CSS/SCSS theming,
|
|
3
|
+
> A maintained Angular multiselect dropdown for classic Angular forms workflows, with search, grouping, custom item and badge templates, lazy loading, custom CSS/SCSS theming, accessibility-focused and keyboard/ARIA tested support, and support for both template-driven and reactive forms.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@stackline/angular-multiselect-dropdown)
|
|
6
|
-
[](https://www.npmjs.com/package/@stackline/angular-multiselect-dropdown)
|
|
7
6
|
[](https://www.npmjs.com/package/@stackline/angular-multiselect-dropdown)
|
|
8
7
|
[](https://github.com/alexandroit/angular-multiselect-dropdown/blob/master/LICENSE)
|
|
9
8
|
[](https://alexandro.net/docs/angular/multiselect/angular-21/)
|
|
10
9
|
[](https://www.typescriptlang.org)
|
|
11
|
-
[](https://www.reddit.com/r/Stackline/)
|
|
12
11
|
|
|
13
|
-
**[Documentation & Live Demos](https://alexandro.net/docs/angular/multiselect/)** | **[Angular 21 Demo](https://alexandro.net/docs/angular/multiselect/angular-21/)** | **[StackBlitz Playground](https://stackblitz.com/github/alexandroit/stackline-angular-multiselect-angular-21?startScript=start&initialpath=%2Fbasic)** | **[npm](https://www.npmjs.com/package/@stackline/angular-multiselect-dropdown)** | **[Issues](https://github.com/alexandroit/angular-multiselect-dropdown/issues)** | **[Repository](https://github.com/alexandroit/angular-multiselect-dropdown)**
|
|
12
|
+
**[Documentation & Live Demos](https://alexandro.net/docs/angular/multiselect/)** | **[Angular 21 Demo](https://alexandro.net/docs/angular/multiselect/angular-21/)** | **[StackBlitz Playground](https://stackblitz.com/github/alexandroit/stackline-angular-multiselect-angular-21?startScript=start&initialpath=%2Fbasic)** | **[npm](https://www.npmjs.com/package/@stackline/angular-multiselect-dropdown)** | **[Issues](https://github.com/alexandroit/angular-multiselect-dropdown/issues)** | **[Repository](https://github.com/alexandroit/angular-multiselect-dropdown)** | **[Community Discussions](https://www.reddit.com/r/Stackline/)**
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="https://alexandro.net/images/public/2026/06/dropdownlist.gif" alt="@stackline/angular-multiselect-dropdown live dropdown preview" width="420">
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
**Latest tested package release:** `21.2.1` for Angular `21.x`
|
|
16
19
|
|
|
17
20
|
---
|
|
18
21
|
|
|
@@ -24,9 +27,9 @@
|
|
|
24
27
|
|
|
25
28
|
The original `angular2-multiselect-dropdown` package became difficult to keep current across multiple Angular generations. This maintained package keeps the classic API and template structure intact, introduces the new primary selector `<angular-multiselect>`, preserves the legacy alias `<angular2-multiselect>`, and publishes the project line by line so older applications can keep a predictable upgrade path.
|
|
26
29
|
|
|
27
|
-
The repository contains the full documentation matrix from Angular 2 through Angular 21. The current tested package release is `21.1
|
|
30
|
+
The repository contains the full documentation matrix from Angular 2 through Angular 21. The current tested package release is `21.2.1` for Angular 21.x applications.
|
|
28
31
|
|
|
29
|
-
The Angular 21 package is compatible with Angular 21.x and was tested in a real Angular 21.2.14 application before npm publication. The 21.
|
|
32
|
+
The Angular 21 package is compatible with Angular 21.x and was tested in a real Angular 21.2.14 application before npm publication. The 21.2.x line includes accessibility-focused keyboard navigation, focus handling, and ARIA support for the dropdown trigger, clear-all action, selected chips, listbox, and lazy-loaded results. It ports the React 19.1.x combobox contract into Angular patterns: configurable keyboard behavior, matching `aria-selected` plus `aria-checked`, selected-object preservation across async data refreshes, richer template contexts, and renderless state helpers for custom Angular HTML.
|
|
30
33
|
|
|
31
34
|
## Features
|
|
32
35
|
|
|
@@ -36,13 +39,15 @@ The Angular 21 package is compatible with Angular 21.x and was tested in a real
|
|
|
36
39
|
| Multi-select and single-select modes | ✅ |
|
|
37
40
|
| Search and filter | ✅ |
|
|
38
41
|
| Group by field | ✅ |
|
|
39
|
-
| Custom item templates (`<c-item>`) | ✅ |
|
|
42
|
+
| Custom item templates (`<c-item>`) with selected/ARIA context | ✅ |
|
|
40
43
|
| Custom badge templates (`<c-badge>`) | ✅ |
|
|
44
|
+
| Renderless Angular state helper for custom HTML | ✅ |
|
|
41
45
|
| Template-driven forms (`ngModel`) | ✅ |
|
|
42
46
|
| Reactive forms (`formControlName`) | ✅ |
|
|
43
47
|
| Lazy loading and remote-data hooks | ✅ |
|
|
44
48
|
| Theming via bundled CSS/SCSS | ✅ |
|
|
45
|
-
|
|
|
49
|
+
| Accessibility-focused keyboard navigation, focus states, and ARIA labels | ✅ |
|
|
50
|
+
| Matching `aria-selected` and `aria-checked` option state | ✅ |
|
|
46
51
|
| Primary selector `<angular-multiselect>` | ✅ |
|
|
47
52
|
| Legacy compatibility alias `<angular2-multiselect>` | ✅ |
|
|
48
53
|
| Versioned docs builds per Angular line | ✅ |
|
|
@@ -57,13 +62,15 @@ The Angular 21 package is compatible with Angular 21.x and was tested in a real
|
|
|
57
62
|
6. [Custom CSS and SCSS Themes](#custom-css-and-scss-themes)
|
|
58
63
|
7. [Basic Usage](#basic-usage)
|
|
59
64
|
8. [Official Angular 21 Test Matrix](#official-angular-21-test-matrix)
|
|
60
|
-
9. [
|
|
61
|
-
10. [
|
|
62
|
-
11. [
|
|
63
|
-
12. [
|
|
64
|
-
13. [
|
|
65
|
-
14. [
|
|
66
|
-
15. [
|
|
65
|
+
9. [Keyboard and ARIA Contract](#keyboard-and-aria-contract)
|
|
66
|
+
10. [Custom Templates](#custom-templates)
|
|
67
|
+
11. [Renderless State Helper](#renderless-state-helper)
|
|
68
|
+
12. [Forms Integration](#forms-integration)
|
|
69
|
+
13. [Lazy Loading and Remote Data](#lazy-loading-and-remote-data)
|
|
70
|
+
14. [Dialogs and Overflow Containers](#dialogs-and-overflow-containers)
|
|
71
|
+
15. [Events](#events)
|
|
72
|
+
16. [Run Locally](#run-locally)
|
|
73
|
+
17. [License](#license)
|
|
67
74
|
|
|
68
75
|
## Rename Note
|
|
69
76
|
|
|
@@ -80,7 +87,7 @@ Peer ranges are intentionally bounded to the tested Angular major. The Angular 2
|
|
|
80
87
|
|
|
81
88
|
| Package family | Framework family | Peer range | Tested release window | Demo link |
|
|
82
89
|
| :---: | :---: | :---: | :---: | :--- |
|
|
83
|
-
| **21.x** | **Angular 21 only** | **`>=21.0.0 <22.0.0`** | **21.1
|
|
90
|
+
| **21.x** | **Angular 21 only** | **`>=21.0.0 <22.0.0`** | **21.2.1 -> 21.2.14** | [Angular 21 family docs](https://alexandro.net/docs/angular/multiselect/angular-21/) |
|
|
84
91
|
| **20.x** | **Angular 20 only** | **`>=20.0.0 <21.0.0`** | **20.0.1 -> 20.3.21** | [Angular 20 family docs](https://alexandro.net/docs/angular/multiselect/angular-20/) |
|
|
85
92
|
| **19.x** | **Angular 19 only** | **`>=19.0.0 <20.0.0`** | **19.0.1 -> 19.2.22** | [Angular 19 family docs](https://alexandro.net/docs/angular/multiselect/angular-19/) |
|
|
86
93
|
| **18.x** | **Angular 18 only** | **`>=18.0.0 <19.0.0`** | **18.0.1 -> 18.2.14** | [Angular 18 family docs](https://alexandro.net/docs/angular/multiselect/angular-18/) |
|
|
@@ -134,10 +141,10 @@ The editable StackBlitz entry is one Angular 21 playground with isolated lazy ro
|
|
|
134
141
|
## Installation
|
|
135
142
|
|
|
136
143
|
```bash
|
|
137
|
-
npm install @stackline/angular-multiselect-dropdown@21.1
|
|
144
|
+
npm install @stackline/angular-multiselect-dropdown@21.2.1 --save-exact
|
|
138
145
|
```
|
|
139
146
|
|
|
140
|
-
Install `21.1
|
|
147
|
+
Install `21.2.1` for Angular 21.x applications. This line keeps the tested Angular 21 behavior, makes `<angular-multiselect>` the documented standard selector, keeps `<angular2-multiselect>` only as a legacy compatibility alias, adds the accessibility-focused and keyboard/ARIA tested interaction contract, fixes responsive dropdown width handling, preserves selected objects during async refreshes, and keeps dropdown surfaces opaque in clipped containers.
|
|
141
148
|
|
|
142
149
|
## Setup
|
|
143
150
|
|
|
@@ -233,7 +240,7 @@ dropdownSettings = {
|
|
|
233
240
|
|
|
234
241
|
## Official Angular 21 Test Matrix
|
|
235
242
|
|
|
236
|
-
The published Angular 21 release was tested in a real Angular `21.2.14` application with `@stackline/angular-multiselect-dropdown@21.1
|
|
243
|
+
The published Angular 21 release was tested in a real Angular `21.2.14` application with `@stackline/angular-multiselect-dropdown@21.2.1`. The docs now use the same examples from that test app, including the accessibility-focused keyboard, focus, and ARIA behavior, responsive dropdown width handling, opaque menu surfaces, and dialog-safe positioning added in this release line.
|
|
237
244
|
|
|
238
245
|
Switch between skins through the settings object:
|
|
239
246
|
|
|
@@ -268,6 +275,38 @@ The same twelve scenarios are validated for both `classic` and `material`:
|
|
|
268
275
|
| 11 | Local lazy loading | `{ lazyLoading: true, maxHeight: 120, badgeShowLimit: 3 }` |
|
|
269
276
|
| 12 | Item + chip template | `<c-badge>` and `<c-item>` custom templates |
|
|
270
277
|
|
|
278
|
+
## Keyboard and ARIA Contract
|
|
279
|
+
|
|
280
|
+
The Angular line follows the same combobox contract validated in the React 19.1.x work, but exposed through Angular settings:
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
dropdownSettings = {
|
|
284
|
+
text: 'Keyboard-tested countries',
|
|
285
|
+
enableSearchFilter: true,
|
|
286
|
+
searchAutofocus: false,
|
|
287
|
+
keyboard: {
|
|
288
|
+
space: true,
|
|
289
|
+
spaceOptionAction: 'toggle',
|
|
290
|
+
tab: true,
|
|
291
|
+
arrows: true,
|
|
292
|
+
escape: true,
|
|
293
|
+
backspaceRemovesLastWhenSearchEmpty: false,
|
|
294
|
+
deleteRemovesFocusedBadge: true
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Default behavior:
|
|
300
|
+
|
|
301
|
+
- Space on the trigger opens or closes the dropdown.
|
|
302
|
+
- Space on an option toggles that option and keeps focus on it.
|
|
303
|
+
- Search inputs type a normal space.
|
|
304
|
+
- Tab moves focus and never selects an option.
|
|
305
|
+
- Escape closes the list without clearing selected values.
|
|
306
|
+
- Empty-search Backspace does not remove selected values by default.
|
|
307
|
+
- Focused badge/remove buttons can remove intentionally with Backspace/Delete.
|
|
308
|
+
- Options expose matching `aria-selected` and `aria-checked` values.
|
|
309
|
+
|
|
271
310
|
## Custom Templates
|
|
272
311
|
|
|
273
312
|
```html
|
|
@@ -276,9 +315,15 @@ The same twelve scenarios are validated for both `classic` and `material`:
|
|
|
276
315
|
[(ngModel)]="selectedItems"
|
|
277
316
|
[settings]="dropdownSettings">
|
|
278
317
|
<c-item>
|
|
279
|
-
<ng-template
|
|
280
|
-
|
|
281
|
-
|
|
318
|
+
<ng-template
|
|
319
|
+
let-item="item"
|
|
320
|
+
let-label="label"
|
|
321
|
+
let-selected="selected"
|
|
322
|
+
let-ariaChecked="ariaChecked">
|
|
323
|
+
<span [attr.data-aria-checked]="ariaChecked">
|
|
324
|
+
{{ label }}
|
|
325
|
+
<strong *ngIf="selected">Selected</strong>
|
|
326
|
+
</span>
|
|
282
327
|
</ng-template>
|
|
283
328
|
</c-item>
|
|
284
329
|
</angular-multiselect>
|
|
@@ -286,6 +331,39 @@ The same twelve scenarios are validated for both `classic` and `material`:
|
|
|
286
331
|
|
|
287
332
|
`<angular2-multiselect>` remains available only as a legacy compatibility alias for applications migrating from the old outdated plugin. New code and all current examples should use `<angular-multiselect>`.
|
|
288
333
|
|
|
334
|
+
## Renderless State Helper
|
|
335
|
+
|
|
336
|
+
Use `AngularMultiselectState` when you want Stackline selection, filtering, item identity, object preservation, and ARIA state while owning all HTML yourself.
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
import {
|
|
340
|
+
AngularMultiselectState,
|
|
341
|
+
defineAngularMultiselectSettings
|
|
342
|
+
} from '@stackline/angular-multiselect-dropdown';
|
|
343
|
+
|
|
344
|
+
interface CountryOption {
|
|
345
|
+
id: number;
|
|
346
|
+
itemName: string;
|
|
347
|
+
region: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
state = new AngularMultiselectState<CountryOption>({
|
|
351
|
+
data: countries,
|
|
352
|
+
selectedItems: [countries[0]],
|
|
353
|
+
settings: defineAngularMultiselectSettings<CountryOption>({
|
|
354
|
+
primaryKey: 'id',
|
|
355
|
+
labelKey: 'itemName',
|
|
356
|
+
searchBy: ['itemName', 'region'],
|
|
357
|
+
ariaLabel: 'Headless country picker'
|
|
358
|
+
}),
|
|
359
|
+
onChange: (items) => {
|
|
360
|
+
selectedItems = items;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The docs include a `Headless + ARIA` route that binds the returned trigger, listbox, and option state into fully custom Angular HTML.
|
|
366
|
+
|
|
289
367
|
## Forms Integration
|
|
290
368
|
|
|
291
369
|
### Template-driven forms
|
|
@@ -345,7 +423,7 @@ settings = {
|
|
|
345
423
|
};
|
|
346
424
|
```
|
|
347
425
|
|
|
348
|
-
In `21.
|
|
426
|
+
In the `21.2.x` line, `tagToBody: true` renders the open panel outside clipping containers, keeps it aligned to the original trigger, keeps the menu surface opaque, recalculates position on scroll and resize, and cleans it up on close or destroy. `appendToBody: true` is also accepted as an alias for teams that prefer that name.
|
|
349
427
|
|
|
350
428
|
## Events
|
|
351
429
|
|