@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/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "../../../node_modules/ng-packagr/package.schema.json",
|
|
3
3
|
"name": "@stackline/angular-multiselect-dropdown",
|
|
4
|
-
"version": "21.1
|
|
4
|
+
"version": "21.2.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Pradeep Terli (Original), Alexandro Paixao Marques (Maintainer)",
|
|
7
|
-
"description": "Angular multiselect dropdown for Angular 21 with maintained release lines,
|
|
7
|
+
"description": "Angular multiselect dropdown for Angular 21 with maintained release lines, accessibility-focused and keyboard/ARIA tested interactions, dialog-safe body overlays, Stackline skins, search, grouping, templates, headless helpers, and forms support.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"angular",
|
|
10
10
|
"angular-library",
|
|
@@ -36,9 +36,21 @@
|
|
|
36
36
|
"formcontrolname",
|
|
37
37
|
"forms",
|
|
38
38
|
"accessibility",
|
|
39
|
+
"accessibility-focused",
|
|
39
40
|
"a11y",
|
|
40
41
|
"aria",
|
|
42
|
+
"aria-tested",
|
|
41
43
|
"keyboard-navigation",
|
|
44
|
+
"keyboard-tested",
|
|
45
|
+
"keyboard-aria-tested",
|
|
46
|
+
"combobox",
|
|
47
|
+
"combobox-contract",
|
|
48
|
+
"listbox",
|
|
49
|
+
"headless",
|
|
50
|
+
"renderless",
|
|
51
|
+
"template-slots",
|
|
52
|
+
"object-data",
|
|
53
|
+
"admin-ui",
|
|
42
54
|
"ada-compliant",
|
|
43
55
|
"ui-component",
|
|
44
56
|
"material-inspired",
|
|
@@ -5,6 +5,18 @@ import { ControlValueAccessor, Validator, UntypedFormControl } from '@angular/fo
|
|
|
5
5
|
import { Observable, Subject, Subscription } from 'rxjs';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
7
7
|
|
|
8
|
+
type DropdownKeyboardSpaceOptionAction = 'toggle' | 'toggle-and-next';
|
|
9
|
+
interface DropdownKeyboardSettings {
|
|
10
|
+
space?: boolean;
|
|
11
|
+
spaceOptionAction?: DropdownKeyboardSpaceOptionAction;
|
|
12
|
+
tab?: boolean;
|
|
13
|
+
arrows?: boolean;
|
|
14
|
+
escape?: boolean;
|
|
15
|
+
backspaceRemovesLastWhenSearchEmpty?: boolean;
|
|
16
|
+
deleteRemovesFocusedBadge?: boolean;
|
|
17
|
+
/** @deprecated Use backspaceRemovesLastWhenSearchEmpty instead. */
|
|
18
|
+
backspace?: boolean;
|
|
19
|
+
}
|
|
8
20
|
interface DropdownSettings {
|
|
9
21
|
singleSelection?: boolean;
|
|
10
22
|
text?: string;
|
|
@@ -52,6 +64,7 @@ interface DropdownSettings {
|
|
|
52
64
|
openDropdownAriaLabel?: string;
|
|
53
65
|
closeDropdownAriaLabel?: string;
|
|
54
66
|
loadingText?: string;
|
|
67
|
+
keyboard?: DropdownKeyboardSettings;
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
declare class DataService {
|
|
@@ -96,12 +109,13 @@ declare class TemplateRenderer implements OnInit, OnDestroy {
|
|
|
96
109
|
viewContainer: ViewContainerRef;
|
|
97
110
|
data: any;
|
|
98
111
|
item: any;
|
|
112
|
+
context: any;
|
|
99
113
|
view: EmbeddedViewRef<any>;
|
|
100
114
|
constructor(viewContainer: ViewContainerRef);
|
|
101
115
|
ngOnInit(): void;
|
|
102
116
|
ngOnDestroy(): void;
|
|
103
117
|
static ɵfac: i0.ɵɵFactoryDeclaration<TemplateRenderer, never>;
|
|
104
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TemplateRenderer, "c-templateRenderer", never, { "data": { "alias": "data"; "required": false; }; "item": { "alias": "item"; "required": false; }; }, {}, never, never, false, never>;
|
|
118
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TemplateRenderer, "c-templateRenderer", never, { "data": { "alias": "data"; "required": false; }; "item": { "alias": "item"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, {}, never, never, false, never>;
|
|
105
119
|
}
|
|
106
120
|
declare class CIcon {
|
|
107
121
|
name: any;
|
|
@@ -411,6 +425,12 @@ declare class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChan
|
|
|
411
425
|
getSkinName(): string;
|
|
412
426
|
getDropdownClasses(): string;
|
|
413
427
|
private normalizeSettings;
|
|
428
|
+
private isKeyboardEnabled;
|
|
429
|
+
private getSpaceOptionAction;
|
|
430
|
+
private getPrimaryKey;
|
|
431
|
+
private getLabelKey;
|
|
432
|
+
private getItemKey;
|
|
433
|
+
private mergeSelectedIntoData;
|
|
414
434
|
isDropdownOpenTowardsTop(): boolean;
|
|
415
435
|
getDropdownPanelClasses(): string;
|
|
416
436
|
isBodyOverlayEnabled(): boolean;
|
|
@@ -418,6 +438,10 @@ declare class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChan
|
|
|
418
438
|
private getAnchorElement;
|
|
419
439
|
private getDropdownMaxHeight;
|
|
420
440
|
private getDropdownPanelHeightForPositioning;
|
|
441
|
+
hasSelectableItems(): boolean;
|
|
442
|
+
private getSelectableItems;
|
|
443
|
+
private areAllSelectableItemsSelected;
|
|
444
|
+
private syncSelectAllState;
|
|
421
445
|
private isEventInsideHostOrPanel;
|
|
422
446
|
private syncDropdownPanelThemeVariables;
|
|
423
447
|
private clearDropdownPanelThemeVariables;
|
|
@@ -440,6 +464,23 @@ declare class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChan
|
|
|
440
464
|
getCloseDropdownAriaLabel(): string;
|
|
441
465
|
getItemLabel(item: any): string;
|
|
442
466
|
getRemoveItemAriaLabel(item: any): string;
|
|
467
|
+
getTemplateContext(item: any, index: number, prefix?: string, group?: any): {
|
|
468
|
+
item: any;
|
|
469
|
+
label: string;
|
|
470
|
+
selected: boolean;
|
|
471
|
+
disabled: boolean;
|
|
472
|
+
index: number;
|
|
473
|
+
group: any;
|
|
474
|
+
optionId: string;
|
|
475
|
+
ariaSelected: boolean;
|
|
476
|
+
ariaChecked: boolean;
|
|
477
|
+
ariaDisabled: boolean;
|
|
478
|
+
isOpen: boolean;
|
|
479
|
+
settings: DropdownSettings;
|
|
480
|
+
select: () => void;
|
|
481
|
+
remove: () => void;
|
|
482
|
+
clear: () => void;
|
|
483
|
+
};
|
|
443
484
|
getOptionId(item: any, index: number, prefix?: string): string;
|
|
444
485
|
isOptionDisabled(item: any): boolean;
|
|
445
486
|
setActiveDescendant(item: any, index: number, prefix?: string): void;
|
|
@@ -455,9 +496,15 @@ declare class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChan
|
|
|
455
496
|
onArrowButtonKeydown(evt: KeyboardEvent): void;
|
|
456
497
|
onSearchKeydown(evt: KeyboardEvent): void;
|
|
457
498
|
onSelectAllKeydown(evt: KeyboardEvent, action: 'filter' | 'infinite-filter'): void;
|
|
499
|
+
onRemoveButtonKeydown(item: any, index: number, evt: KeyboardEvent): void;
|
|
500
|
+
onClearAllKeydown(evt: KeyboardEvent): void;
|
|
501
|
+
private shouldBackspaceRemoveLast;
|
|
502
|
+
private removeLastSelectedItem;
|
|
503
|
+
private toggleOptionFromKeyboard;
|
|
458
504
|
focusTrigger(): void;
|
|
459
505
|
private getOptionElements;
|
|
460
506
|
private focusOptionByIndex;
|
|
507
|
+
private focusOptionById;
|
|
461
508
|
focusFirstOption(): void;
|
|
462
509
|
focusLastOption(): void;
|
|
463
510
|
focusNextOption(): void;
|
|
@@ -472,6 +519,7 @@ declare class AngularMultiSelect implements OnInit, ControlValueAccessor, OnChan
|
|
|
472
519
|
ngAfterViewInit(): void;
|
|
473
520
|
ngAfterViewChecked(): void;
|
|
474
521
|
onItemClick(item: any, index: number, evt: Event): void;
|
|
522
|
+
private focusClickedOption;
|
|
475
523
|
validate(c: UntypedFormControl): any;
|
|
476
524
|
private onTouchedCallback;
|
|
477
525
|
private onChangeCallback;
|
|
@@ -514,5 +562,84 @@ declare class AngularMultiSelectModule {
|
|
|
514
562
|
static ɵinj: i0.ɵɵInjectorDeclaration<AngularMultiSelectModule>;
|
|
515
563
|
}
|
|
516
564
|
|
|
517
|
-
|
|
518
|
-
|
|
565
|
+
type AngularMultiselectItemKey<T> = Extract<keyof T, string>;
|
|
566
|
+
interface AngularMultiselectStateConfig<T> {
|
|
567
|
+
data: T[];
|
|
568
|
+
selectedItems?: T[];
|
|
569
|
+
settings?: DropdownSettings;
|
|
570
|
+
id?: string;
|
|
571
|
+
onChange?: (items: T[]) => void;
|
|
572
|
+
}
|
|
573
|
+
interface AngularMultiselectOptionState<T> {
|
|
574
|
+
item: T;
|
|
575
|
+
key: string;
|
|
576
|
+
label: string;
|
|
577
|
+
selected: boolean;
|
|
578
|
+
disabled: boolean;
|
|
579
|
+
id: string;
|
|
580
|
+
role: 'option';
|
|
581
|
+
ariaSelected: 'true' | 'false';
|
|
582
|
+
ariaChecked: 'true' | 'false';
|
|
583
|
+
ariaDisabled: 'true' | 'false';
|
|
584
|
+
}
|
|
585
|
+
interface AngularMultiselectListboxState {
|
|
586
|
+
id: string;
|
|
587
|
+
role: 'listbox';
|
|
588
|
+
ariaMultiselectable: 'true' | 'false';
|
|
589
|
+
ariaLabel: string;
|
|
590
|
+
}
|
|
591
|
+
interface AngularMultiselectTriggerState {
|
|
592
|
+
role: 'combobox';
|
|
593
|
+
ariaHaspopup: 'listbox';
|
|
594
|
+
ariaControls: string;
|
|
595
|
+
ariaExpanded: 'true' | 'false';
|
|
596
|
+
ariaActivedescendant: string | null;
|
|
597
|
+
ariaLabel: string;
|
|
598
|
+
}
|
|
599
|
+
declare class AngularMultiselectState<T extends Record<string, any>> {
|
|
600
|
+
data: T[];
|
|
601
|
+
selectedItems: T[];
|
|
602
|
+
settings: DropdownSettings;
|
|
603
|
+
filter: string;
|
|
604
|
+
isOpen: boolean;
|
|
605
|
+
activeKey: string | null;
|
|
606
|
+
private id;
|
|
607
|
+
private onChange?;
|
|
608
|
+
constructor(config: AngularMultiselectStateConfig<T>);
|
|
609
|
+
setData(data: T[]): void;
|
|
610
|
+
setSelectedItems(items: T[]): void;
|
|
611
|
+
setFilter(value: string): void;
|
|
612
|
+
open(): void;
|
|
613
|
+
close(): void;
|
|
614
|
+
toggleOpen(): void;
|
|
615
|
+
getKey(item: T): string;
|
|
616
|
+
getLabel(item: T): string;
|
|
617
|
+
isSelected(item: T): boolean;
|
|
618
|
+
isDisabled(item: T): boolean;
|
|
619
|
+
getVisibleOptions(): T[];
|
|
620
|
+
getOptionState(item: T, index: number): AngularMultiselectOptionState<T>;
|
|
621
|
+
getOptionStates(): AngularMultiselectOptionState<T>[];
|
|
622
|
+
getListboxState(): AngularMultiselectListboxState;
|
|
623
|
+
getTriggerState(): AngularMultiselectTriggerState;
|
|
624
|
+
toggleItem(item: T): void;
|
|
625
|
+
removeItem(item: T): void;
|
|
626
|
+
clearSelection(): void;
|
|
627
|
+
selectAll(): void;
|
|
628
|
+
deSelectAll(): void;
|
|
629
|
+
private emitChange;
|
|
630
|
+
}
|
|
631
|
+
declare function createAngularMultiselectState<T extends Record<string, any>>(config: AngularMultiselectStateConfig<T>): AngularMultiselectState<T>;
|
|
632
|
+
declare function defineAngularMultiselectSettings<T extends Record<string, any>>(settings: DropdownSettings & {
|
|
633
|
+
primaryKey?: AngularMultiselectItemKey<T>;
|
|
634
|
+
labelKey?: AngularMultiselectItemKey<T>;
|
|
635
|
+
searchBy?: AngularMultiselectItemKey<T>[];
|
|
636
|
+
groupBy?: AngularMultiselectItemKey<T>;
|
|
637
|
+
}): DropdownSettings & {
|
|
638
|
+
primaryKey?: AngularMultiselectItemKey<T>;
|
|
639
|
+
labelKey?: AngularMultiselectItemKey<T>;
|
|
640
|
+
searchBy?: AngularMultiselectItemKey<T>[];
|
|
641
|
+
groupBy?: AngularMultiselectItemKey<T>;
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
export { AngularMultiSelect, AngularMultiSelectModule, AngularMultiselectState, Badge, CIcon, ClickOutsideDirective, Item, ListFilterPipe, ScrollDirective, Search, TemplateRenderer, createAngularMultiselectState, defineAngularMultiselectSettings, setPosition, styleDirective };
|
|
645
|
+
export type { AngularMultiselectItemKey, AngularMultiselectListboxState, AngularMultiselectOptionState, AngularMultiselectStateConfig, AngularMultiselectTriggerState, DropdownKeyboardSettings, DropdownKeyboardSpaceOptionAction, DropdownSettings };
|