@keenmate/web-multiselect 1.0.0-rc02
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/LICENSE +21 -0
- package/README.md +562 -0
- package/dist/index.d.ts +26 -0
- package/dist/multiselect.d.ts +117 -0
- package/dist/multiselect.js +2231 -0
- package/dist/multiselect.umd.js +46 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +187 -0
- package/dist/web-component.d.ts +103 -0
- package/package.json +75 -0
- package/src/scss/_base.scss +41 -0
- package/src/scss/_debug.scss +60 -0
- package/src/scss/_input-dropdown.scss +177 -0
- package/src/scss/_modifiers.scss +95 -0
- package/src/scss/_options.scss +175 -0
- package/src/scss/_pills-display.scss +218 -0
- package/src/scss/_tooltips-popover.scss +114 -0
- package/src/scss/_variables.scss +453 -0
- package/src/scss/main.scss +24 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure Admin - MultiSelect with Typeahead
|
|
3
|
+
* Comprehensive multiselect component with rich content support and floating hints
|
|
4
|
+
*/
|
|
5
|
+
import type { MultiSelectConfig } from './types';
|
|
6
|
+
export declare class PureMultiSelect<T = any> {
|
|
7
|
+
private element;
|
|
8
|
+
private instanceId;
|
|
9
|
+
private options;
|
|
10
|
+
private isOpen;
|
|
11
|
+
private selectedValues;
|
|
12
|
+
private selectedOptions;
|
|
13
|
+
private allOptions;
|
|
14
|
+
private filteredOptions;
|
|
15
|
+
private hiddenInputs;
|
|
16
|
+
private focusedIndex;
|
|
17
|
+
private searchTerm;
|
|
18
|
+
private isLoading;
|
|
19
|
+
private showSelectedPopover;
|
|
20
|
+
private selectedPopoverPlacement;
|
|
21
|
+
private dropdownPlacement;
|
|
22
|
+
private dropdownCleanup;
|
|
23
|
+
private hintCleanup;
|
|
24
|
+
private selectedPopoverCleanup;
|
|
25
|
+
private pillTooltips;
|
|
26
|
+
private pillTooltipCleanups;
|
|
27
|
+
private input;
|
|
28
|
+
private dropdown;
|
|
29
|
+
private pillsContainer;
|
|
30
|
+
private countBadge;
|
|
31
|
+
private hint?;
|
|
32
|
+
private selectedPopover;
|
|
33
|
+
/**
|
|
34
|
+
* Extract value/ID from item
|
|
35
|
+
* Precedence: tuple[0] -> valueMember -> getValueCallback -> '[N/A]'
|
|
36
|
+
*/
|
|
37
|
+
private getItemValue;
|
|
38
|
+
/**
|
|
39
|
+
* Extract display value from item
|
|
40
|
+
* Precedence: tuple[1] -> displayValueMember -> getDisplayValueCallback -> '[N/A]'
|
|
41
|
+
*/
|
|
42
|
+
private getItemDisplayValue;
|
|
43
|
+
/**
|
|
44
|
+
* Extract search value from item
|
|
45
|
+
* Precedence: searchValueMember -> getSearchValueCallback -> displayValue
|
|
46
|
+
*/
|
|
47
|
+
private getItemSearchValue;
|
|
48
|
+
/**
|
|
49
|
+
* Extract icon from item
|
|
50
|
+
*/
|
|
51
|
+
private getItemIcon;
|
|
52
|
+
/**
|
|
53
|
+
* Extract subtitle from item
|
|
54
|
+
*/
|
|
55
|
+
private getItemSubtitle;
|
|
56
|
+
/**
|
|
57
|
+
* Extract group from item
|
|
58
|
+
*/
|
|
59
|
+
private getItemGroup;
|
|
60
|
+
/**
|
|
61
|
+
* Extract disabled state from item
|
|
62
|
+
*/
|
|
63
|
+
private getItemDisabled;
|
|
64
|
+
constructor(element: HTMLElement, options?: Partial<MultiSelectConfig<T>>);
|
|
65
|
+
private init;
|
|
66
|
+
private parseOptions;
|
|
67
|
+
private buildHTML;
|
|
68
|
+
private renderDropdown;
|
|
69
|
+
private renderOption;
|
|
70
|
+
private highlightMatch;
|
|
71
|
+
private groupOptions;
|
|
72
|
+
private renderPills;
|
|
73
|
+
private attachEvents;
|
|
74
|
+
private handleSearch;
|
|
75
|
+
private handleKeydown;
|
|
76
|
+
private handleDropdownClick;
|
|
77
|
+
private handlePillClick;
|
|
78
|
+
private handleClickOutside;
|
|
79
|
+
private focusNext;
|
|
80
|
+
private focusPrevious;
|
|
81
|
+
private focusFirst;
|
|
82
|
+
private focusLast;
|
|
83
|
+
private focusPageUp;
|
|
84
|
+
private focusPageDown;
|
|
85
|
+
private scrollToFocused;
|
|
86
|
+
private toggleOption;
|
|
87
|
+
private handleAddNew;
|
|
88
|
+
private selectOption;
|
|
89
|
+
private deselectOption;
|
|
90
|
+
private selectAll;
|
|
91
|
+
private clearAll;
|
|
92
|
+
private open;
|
|
93
|
+
private close;
|
|
94
|
+
private positionDropdown;
|
|
95
|
+
private positionHint;
|
|
96
|
+
private parseInitialSelection;
|
|
97
|
+
private toggleSelectedPopover;
|
|
98
|
+
private showPopover;
|
|
99
|
+
private hideSelectedPopover;
|
|
100
|
+
private renderSelectedPopover;
|
|
101
|
+
private handleSelectedPopoverClick;
|
|
102
|
+
private positionSelectedPopover;
|
|
103
|
+
private updateHiddenInput;
|
|
104
|
+
private getFormValue;
|
|
105
|
+
getSelected(): T[];
|
|
106
|
+
setSelected(values: (string | number)[]): void;
|
|
107
|
+
get selectedItem(): T | null;
|
|
108
|
+
get selectedValue(): string | number | (string | number)[] | null;
|
|
109
|
+
getValue(): string | number | (string | number)[] | null;
|
|
110
|
+
private attachPillTooltips;
|
|
111
|
+
private createTooltipForElement;
|
|
112
|
+
private createRemoveButtonTooltip;
|
|
113
|
+
private positionPillTooltip;
|
|
114
|
+
private cleanupPillTooltip;
|
|
115
|
+
private destroyAllPillTooltips;
|
|
116
|
+
destroy(): void;
|
|
117
|
+
}
|