@apexara/ng-components 1.0.6-test.6 → 1.0.6-test.7
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
|
@@ -979,6 +979,64 @@ Simple styled radio-button that can accept a formGroup and a control.
|
|
|
979
979
|
><apex-select>
|
|
980
980
|
>```
|
|
981
981
|
|
|
982
|
+
### In-dropdown search
|
|
983
|
+
>Set `searchInDropdown: true` to move the search input inside the dropdown
|
|
984
|
+
>(instead of the trigger). Intended for multi-select. The trigger then shows
|
|
985
|
+
>chips (or a counter when `counterAsValue: true`) and the arrow only, and the
|
|
986
|
+
>search input auto-focuses when the dropdown opens.
|
|
987
|
+
>```typescript
|
|
988
|
+
>public selectOptions: ApexSelectOptions = {
|
|
989
|
+
> label: 'Property Type',
|
|
990
|
+
> data: [
|
|
991
|
+
> { label: 'SFR', value: 'sfr' },
|
|
992
|
+
> { label: 'Duplex', value: 'duplex' },
|
|
993
|
+
> { label: 'Condo', value: 'condo' },
|
|
994
|
+
> ],
|
|
995
|
+
> multiple: true,
|
|
996
|
+
> searchInDropdown: true,
|
|
997
|
+
> counterAsValue: true,
|
|
998
|
+
> placeholder: 'Select property types',
|
|
999
|
+
> formGroup: this.selectForm,
|
|
1000
|
+
> formControlName: 'selectControl',
|
|
1001
|
+
>};
|
|
1002
|
+
>```
|
|
1003
|
+
|
|
1004
|
+
### Grouped options with categories
|
|
1005
|
+
>Pass a `groups` array to render category headers above each section. `groups`
|
|
1006
|
+
>supersedes `data` when both are present. Grouped mode requires
|
|
1007
|
+
>`searchInDropdown: true` and uses native scroll (not virtual scroll), so it is
|
|
1008
|
+
>intended for bounded lists that fit comfortably within
|
|
1009
|
+
>`--apex-select-dropdown-body-max-height`. Search filters inside each category
|
|
1010
|
+
>and empty categories disappear.
|
|
1011
|
+
>```typescript
|
|
1012
|
+
>public selectOptions: ApexSelectOptions = {
|
|
1013
|
+
> label: 'Property Type',
|
|
1014
|
+
> data: [], // ignored when groups is present
|
|
1015
|
+
> groups: [
|
|
1016
|
+
> {
|
|
1017
|
+
> label: 'Residential',
|
|
1018
|
+
> data: [
|
|
1019
|
+
> { label: 'SFR', value: 'sfr' },
|
|
1020
|
+
> { label: 'SFR w/ ADU', value: 'sfr-adu' },
|
|
1021
|
+
> { label: 'Duplex', value: 'duplex' },
|
|
1022
|
+
> ],
|
|
1023
|
+
> },
|
|
1024
|
+
> {
|
|
1025
|
+
> label: 'Commercial',
|
|
1026
|
+
> data: [
|
|
1027
|
+
> { label: 'Medical', value: 'medical' },
|
|
1028
|
+
> { label: 'Mixed Use', value: 'mixed-use' },
|
|
1029
|
+
> ],
|
|
1030
|
+
> },
|
|
1031
|
+
> ],
|
|
1032
|
+
> multiple: true,
|
|
1033
|
+
> searchInDropdown: true,
|
|
1034
|
+
> counterAsValue: true,
|
|
1035
|
+
> formGroup: this.selectForm,
|
|
1036
|
+
> formControlName: 'selectControl',
|
|
1037
|
+
>};
|
|
1038
|
+
>```
|
|
1039
|
+
|
|
982
1040
|
### CSS Variables
|
|
983
1041
|
>Here are all the available CSS variables (and their default values) you can set when using the apex-select:
|
|
984
1042
|
>```css
|
|
@@ -1041,6 +1099,16 @@ Simple styled radio-button that can accept a formGroup and a control.
|
|
|
1041
1099
|
> --apex-select-dropdown-border-color: #E9E9E9;
|
|
1042
1100
|
> --apex-select-dropdown-background-color: #FFFFFF;
|
|
1043
1101
|
>
|
|
1102
|
+
> /* In-dropdown search row (searchInDropdown: true) */
|
|
1103
|
+
> --apex-select-dropdown-search-border-color: #E9E9E9;
|
|
1104
|
+
> --apex-select-dropdown-search-icon-color: #5D6068;
|
|
1105
|
+
>
|
|
1106
|
+
> /* Dropdown body scroll area (grouped mode) */
|
|
1107
|
+
> --apex-select-dropdown-body-max-height: 320px;
|
|
1108
|
+
>
|
|
1109
|
+
> /* Group header (grouped mode) */
|
|
1110
|
+
> --apex-select-group-header-color: #9A9A9A;
|
|
1111
|
+
>
|
|
1044
1112
|
> /* Option icons (per-item icons in dropdown): */
|
|
1045
1113
|
> --apex-select-option-icon-size: 20px;
|
|
1046
1114
|
> --apex-select-option-icon-spacing: 10px;
|
|
@@ -23,6 +23,8 @@ class ApexSelectComponent {
|
|
|
23
23
|
this.label = null;
|
|
24
24
|
this.dropdown = null;
|
|
25
25
|
this.inputWrapper = null;
|
|
26
|
+
this.dropdownSearch = null;
|
|
27
|
+
this.dropdownContainer = null;
|
|
26
28
|
this.selectChange = new EventEmitter();
|
|
27
29
|
this.helperTextChange = new EventEmitter();
|
|
28
30
|
this.firstDropdown = signal(0, ...(ngDevMode ? [{ debugName: "firstDropdown" }] : []));
|
|
@@ -36,6 +38,7 @@ class ApexSelectComponent {
|
|
|
36
38
|
this.documentKeyUpSubscription = null;
|
|
37
39
|
this.controlSubscription = null;
|
|
38
40
|
this.filteredData = signal([], ...(ngDevMode ? [{ debugName: "filteredData" }] : []));
|
|
41
|
+
this.filteredGroups = signal([], ...(ngDevMode ? [{ debugName: "filteredGroups" }] : []));
|
|
39
42
|
this.lastSearch = '';
|
|
40
43
|
this.keyListener = (event) => this.blockArrowScroll(event);
|
|
41
44
|
this.wheelListener = (event) => this.blockScroll(event);
|
|
@@ -48,6 +51,7 @@ class ApexSelectComponent {
|
|
|
48
51
|
this.controlValue = signal(null, ...(ngDevMode ? [{ debugName: "controlValue" }] : []));
|
|
49
52
|
this.controlDisabled = signal(false, ...(ngDevMode ? [{ debugName: "controlDisabled" }] : []));
|
|
50
53
|
this.dataDiffer = this.iterableDiffers.find([]).create();
|
|
54
|
+
this.groupsDiffer = this.iterableDiffers.find([]).create();
|
|
51
55
|
this.handleEvents();
|
|
52
56
|
}
|
|
53
57
|
ngOnInit() {
|
|
@@ -80,11 +84,14 @@ class ApexSelectComponent {
|
|
|
80
84
|
}
|
|
81
85
|
ngDoCheck() {
|
|
82
86
|
const data = this.options?.data || [];
|
|
83
|
-
const
|
|
84
|
-
|
|
87
|
+
const groups = this.options?.groups || [];
|
|
88
|
+
const dataDiff = this.dataDiffer.diff(data);
|
|
89
|
+
const groupsDiff = this.groupsDiffer.diff(groups);
|
|
90
|
+
if (!dataDiff && !groupsDiff) {
|
|
85
91
|
return;
|
|
86
92
|
}
|
|
87
93
|
this.filteredData.set([...data]);
|
|
94
|
+
this.filteredGroups.set(this.cloneGroups(groups));
|
|
88
95
|
// Sync controlValue signal and visible input when data changes.
|
|
89
96
|
// The parent may have reset the control with { emitEvent: false },
|
|
90
97
|
// which bypasses valueChanges — the only thing that updates controlValue.
|
|
@@ -98,7 +105,8 @@ class ApexSelectComponent {
|
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
ngAfterViewInit() {
|
|
101
|
-
this.filteredData.set([...this.options.data]);
|
|
108
|
+
this.filteredData.set([...(this.options.data || [])]);
|
|
109
|
+
this.filteredGroups.set(this.cloneGroups(this.options.groups || []));
|
|
102
110
|
setTimeout(() => {
|
|
103
111
|
if (this.options.formGroup && this.options.formControlName) {
|
|
104
112
|
this.setVisibleValue(this.options.formGroup.controls[this.options.formControlName].value);
|
|
@@ -110,6 +118,30 @@ class ApexSelectComponent {
|
|
|
110
118
|
}));
|
|
111
119
|
}
|
|
112
120
|
}
|
|
121
|
+
cloneGroups(groups) {
|
|
122
|
+
return groups.map(group => ({
|
|
123
|
+
label: group.label,
|
|
124
|
+
data: [...group.data],
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
hasGroups() {
|
|
128
|
+
return !!this.options?.groups && this.options.groups.length > 0;
|
|
129
|
+
}
|
|
130
|
+
isSearchInDropdown() {
|
|
131
|
+
return !!this.options?.searchInDropdown;
|
|
132
|
+
}
|
|
133
|
+
getAllOptions() {
|
|
134
|
+
if (this.hasGroups()) {
|
|
135
|
+
return (this.options.groups || []).flatMap(group => group.data);
|
|
136
|
+
}
|
|
137
|
+
return this.options.data || [];
|
|
138
|
+
}
|
|
139
|
+
getDropdownEl() {
|
|
140
|
+
if (this.dropdownContainer) {
|
|
141
|
+
return this.dropdownContainer.nativeElement;
|
|
142
|
+
}
|
|
143
|
+
return this.dropdown?.elementRef.nativeElement ?? null;
|
|
144
|
+
}
|
|
113
145
|
ngOnChanges(changes) {
|
|
114
146
|
if (!changes['options'] || changes['options'].firstChange) {
|
|
115
147
|
return;
|
|
@@ -171,15 +203,30 @@ class ApexSelectComponent {
|
|
|
171
203
|
}
|
|
172
204
|
this.lastSearch = '';
|
|
173
205
|
this.input.nativeElement.value = '';
|
|
174
|
-
this.filteredData.set([...this.options.data]);
|
|
206
|
+
this.filteredData.set([...(this.options.data || [])]);
|
|
207
|
+
if (this.hasGroups()) {
|
|
208
|
+
this.filteredGroups.set(this.cloneGroups(this.options.groups || []));
|
|
209
|
+
}
|
|
210
|
+
if (this.dropdownSearch) {
|
|
211
|
+
this.dropdownSearch.nativeElement.value = '';
|
|
212
|
+
}
|
|
175
213
|
this.control.setValue(newValue);
|
|
176
214
|
this.selectChange.emit(newValue);
|
|
215
|
+
if (this.isSearchInDropdown() && this.dropdownSearch) {
|
|
216
|
+
setTimeout(() => this.dropdownSearch?.nativeElement.focus());
|
|
217
|
+
}
|
|
177
218
|
}
|
|
178
219
|
setVisibleValue(newValue) {
|
|
179
220
|
if (newValue === null) {
|
|
180
221
|
this.input.nativeElement.value = '';
|
|
181
222
|
return;
|
|
182
223
|
}
|
|
224
|
+
if (this.isSearchInDropdown()) {
|
|
225
|
+
// Chips / counter span next to the input own the selection display.
|
|
226
|
+
// Keep the input empty so the placeholder can show when nothing is selected.
|
|
227
|
+
this.input.nativeElement.value = '';
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
183
230
|
if (this.options.counterAsValue) {
|
|
184
231
|
if (this.options.searchable) {
|
|
185
232
|
return;
|
|
@@ -189,7 +236,10 @@ class ApexSelectComponent {
|
|
|
189
236
|
return;
|
|
190
237
|
}
|
|
191
238
|
let visibleValue = '';
|
|
192
|
-
|
|
239
|
+
const sourceList = this.hasGroups()
|
|
240
|
+
? this.filteredGroups().flatMap(group => group.data)
|
|
241
|
+
: this.filteredData();
|
|
242
|
+
for (let data of sourceList) {
|
|
193
243
|
// when newValue is object and not array
|
|
194
244
|
if (data.value === newValue.value) {
|
|
195
245
|
visibleValue = data.label;
|
|
@@ -215,7 +265,7 @@ class ApexSelectComponent {
|
|
|
215
265
|
this.input.nativeElement.value = visibleValue;
|
|
216
266
|
}
|
|
217
267
|
updateDropdownHeight() {
|
|
218
|
-
if (!this.isDropdown()) {
|
|
268
|
+
if (!this.isDropdown() || this.hasGroups()) {
|
|
219
269
|
return;
|
|
220
270
|
}
|
|
221
271
|
setTimeout(() => {
|
|
@@ -282,23 +332,29 @@ class ApexSelectComponent {
|
|
|
282
332
|
return;
|
|
283
333
|
}
|
|
284
334
|
this.isDropdown.set(true);
|
|
285
|
-
this.
|
|
335
|
+
if (!this.isSearchInDropdown()) {
|
|
336
|
+
this.input.nativeElement.focus();
|
|
337
|
+
}
|
|
286
338
|
if (this.firstDropdown() === 0) {
|
|
287
339
|
this.firstDropdown.update(v => v + 1);
|
|
288
340
|
setTimeout(() => this.generateDropdownPosition(true));
|
|
289
341
|
}
|
|
290
342
|
this.attachGlobalScrollBlockers();
|
|
291
343
|
this.onSearch(this.lastSearch, false);
|
|
344
|
+
if (this.isSearchInDropdown()) {
|
|
345
|
+
setTimeout(() => this.dropdownSearch?.nativeElement.focus());
|
|
346
|
+
}
|
|
292
347
|
}
|
|
293
348
|
deactivateControl(event) {
|
|
294
349
|
if (event instanceof KeyboardEvent) {
|
|
295
350
|
this.removeDropdown();
|
|
296
351
|
return;
|
|
297
352
|
}
|
|
298
|
-
|
|
353
|
+
const dropdownEl = this.getDropdownEl();
|
|
354
|
+
if (!dropdownEl || !this.inputWrapper) {
|
|
299
355
|
return;
|
|
300
356
|
}
|
|
301
|
-
const dropdownRect =
|
|
357
|
+
const dropdownRect = dropdownEl.getBoundingClientRect();
|
|
302
358
|
const inputWrapperRect = this.inputWrapper.nativeElement.getBoundingClientRect();
|
|
303
359
|
const isClickInsideDropdown = this.isWithinBounds(event, dropdownRect);
|
|
304
360
|
const isClickInsideInputWrapper = this.isWithinBounds(event, inputWrapperRect);
|
|
@@ -333,12 +389,12 @@ class ApexSelectComponent {
|
|
|
333
389
|
}
|
|
334
390
|
}
|
|
335
391
|
generateDropdownPosition(checkRevserse = false) {
|
|
336
|
-
|
|
392
|
+
const dropdownEl = this.getDropdownEl();
|
|
393
|
+
if (!dropdownEl) {
|
|
337
394
|
// method will keep executing until dropdown is rendered
|
|
338
395
|
setTimeout(() => this.generateDropdownPosition(true));
|
|
339
396
|
return;
|
|
340
397
|
}
|
|
341
|
-
const dropdownEl = this.dropdown.elementRef.nativeElement;
|
|
342
398
|
const elementRefRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
343
399
|
if (this.osService.mobileOS === MobileOS.iOS) {
|
|
344
400
|
elementRefRect.y += window.visualViewport.offsetTop;
|
|
@@ -382,6 +438,11 @@ class ApexSelectComponent {
|
|
|
382
438
|
}
|
|
383
439
|
onSearch(value, shouldResetHover) {
|
|
384
440
|
this.lastSearch = value;
|
|
441
|
+
if (this.hasGroups()) {
|
|
442
|
+
this.filterGroups(value, shouldResetHover);
|
|
443
|
+
this.updateDropdownHeight();
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
385
446
|
if (!value) {
|
|
386
447
|
// Reset to original data if input is empty
|
|
387
448
|
this.filteredData.set([...this.options.data]);
|
|
@@ -399,6 +460,36 @@ class ApexSelectComponent {
|
|
|
399
460
|
this.filteredData.set(filtered);
|
|
400
461
|
this.updateDropdownHeight();
|
|
401
462
|
}
|
|
463
|
+
filterGroups(value, shouldResetHover) {
|
|
464
|
+
const sourceGroups = this.options.groups || [];
|
|
465
|
+
if (!value) {
|
|
466
|
+
this.filteredGroups.set(this.cloneGroups(sourceGroups));
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const searchTerm = value.toLowerCase();
|
|
470
|
+
const result = [];
|
|
471
|
+
for (const group of sourceGroups) {
|
|
472
|
+
const matches = group.data.filter(item => item.label.toLowerCase().includes(searchTerm));
|
|
473
|
+
if (matches.length) {
|
|
474
|
+
result.push({ label: group.label, data: matches });
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (shouldResetHover) {
|
|
478
|
+
let firstHoverSet = false;
|
|
479
|
+
for (const group of result) {
|
|
480
|
+
for (const item of group.data) {
|
|
481
|
+
if (!firstHoverSet) {
|
|
482
|
+
item.isHover = true;
|
|
483
|
+
firstHoverSet = true;
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
item.isHover = false;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
this.filteredGroups.set(result);
|
|
492
|
+
}
|
|
402
493
|
getPlaceholder() {
|
|
403
494
|
const options = this.options;
|
|
404
495
|
const formGroup = options.formGroup;
|
|
@@ -445,29 +536,20 @@ class ApexSelectComponent {
|
|
|
445
536
|
window.addEventListener('keydown', this.keyListener);
|
|
446
537
|
}
|
|
447
538
|
keyup(event) {
|
|
448
|
-
|
|
539
|
+
const activeEl = document.activeElement;
|
|
540
|
+
const triggerInputEl = this.input?.nativeElement ?? null;
|
|
541
|
+
const searchInputEl = this.dropdownSearch?.nativeElement ?? null;
|
|
542
|
+
const isTriggerFocused = activeEl === triggerInputEl;
|
|
543
|
+
const isDropdownSearchFocused = this.isSearchInDropdown() && activeEl === searchInputEl;
|
|
544
|
+
if (!isTriggerFocused && !isDropdownSearchFocused) {
|
|
449
545
|
this.deactivateControl(event);
|
|
450
546
|
return;
|
|
451
547
|
}
|
|
452
|
-
if (
|
|
453
|
-
if (document.activeElement !== this.input?.nativeElement) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
548
|
+
if (isDropdownSearchFocused) {
|
|
456
549
|
switch (event.code) {
|
|
457
550
|
case 'Enter':
|
|
458
551
|
this.documentEnterKeyup(event);
|
|
459
552
|
return;
|
|
460
|
-
case 'Space':
|
|
461
|
-
if (!this.options.searchable) {
|
|
462
|
-
this.documentEnterKeyup(event);
|
|
463
|
-
}
|
|
464
|
-
return;
|
|
465
|
-
case 'Backspace':
|
|
466
|
-
if (!this.options.multiple && this.options.searchable && this.control.value.value != null) {
|
|
467
|
-
this.onSearch('', false);
|
|
468
|
-
this.setValue('');
|
|
469
|
-
}
|
|
470
|
-
return;
|
|
471
553
|
case 'Escape':
|
|
472
554
|
this.deactivateControl(event);
|
|
473
555
|
return;
|
|
@@ -478,11 +560,38 @@ class ApexSelectComponent {
|
|
|
478
560
|
this.documentArrowsKeyup(false);
|
|
479
561
|
return;
|
|
480
562
|
}
|
|
481
|
-
|
|
563
|
+
// Typing is handled by the input's (input) event, not here.
|
|
564
|
+
return;
|
|
482
565
|
}
|
|
566
|
+
switch (event.code) {
|
|
567
|
+
case 'Enter':
|
|
568
|
+
this.documentEnterKeyup(event);
|
|
569
|
+
return;
|
|
570
|
+
case 'Space':
|
|
571
|
+
if (!this.options.searchable) {
|
|
572
|
+
this.documentEnterKeyup(event);
|
|
573
|
+
}
|
|
574
|
+
return;
|
|
575
|
+
case 'Backspace':
|
|
576
|
+
if (!this.options.multiple && this.options.searchable && this.control.value.value != null) {
|
|
577
|
+
this.onSearch('', false);
|
|
578
|
+
this.setValue('');
|
|
579
|
+
}
|
|
580
|
+
return;
|
|
581
|
+
case 'Escape':
|
|
582
|
+
this.deactivateControl(event);
|
|
583
|
+
return;
|
|
584
|
+
case 'ArrowDown':
|
|
585
|
+
this.documentArrowsKeyup(true);
|
|
586
|
+
return;
|
|
587
|
+
case 'ArrowUp':
|
|
588
|
+
this.documentArrowsKeyup(false);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
this.documentKeyup(event);
|
|
483
592
|
}
|
|
484
593
|
documentEnterKeyup(event) {
|
|
485
|
-
const data = this.
|
|
594
|
+
const data = this.getNavigableOptions();
|
|
486
595
|
for (let i = 0; i < data.length; i++) {
|
|
487
596
|
if (data[i].isHover) {
|
|
488
597
|
switch (this.options.multiple) {
|
|
@@ -498,11 +607,11 @@ class ApexSelectComponent {
|
|
|
498
607
|
}
|
|
499
608
|
}
|
|
500
609
|
documentArrowsKeyup(isDownArrow) {
|
|
501
|
-
|
|
610
|
+
const data = this.getNavigableOptions();
|
|
611
|
+
const dataLength = data.length;
|
|
612
|
+
if (!dataLength) {
|
|
502
613
|
return;
|
|
503
614
|
}
|
|
504
|
-
const data = this.filteredData();
|
|
505
|
-
const dataLength = data.length;
|
|
506
615
|
const controlValue = this.control.getRawValue();
|
|
507
616
|
const isControlValue = controlValue && controlValue !== '';
|
|
508
617
|
let hoverIndex = null;
|
|
@@ -521,14 +630,34 @@ class ApexSelectComponent {
|
|
|
521
630
|
newIndex = newIndex < 0 ? 0 : newIndex;
|
|
522
631
|
newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;
|
|
523
632
|
data[newIndex].isHover = true;
|
|
524
|
-
this.
|
|
525
|
-
|
|
633
|
+
if (this.hasGroups()) {
|
|
634
|
+
this.filteredGroups.set([...this.filteredGroups()]);
|
|
635
|
+
this.scrollGroupedOptionIntoView(newIndex);
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
this.filteredData.set([...this.filteredData()]);
|
|
639
|
+
this.dropdown?.scrollToIndex(newIndex, 'auto');
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
getNavigableOptions() {
|
|
643
|
+
if (this.hasGroups()) {
|
|
644
|
+
return this.filteredGroups().flatMap(group => group.data);
|
|
645
|
+
}
|
|
646
|
+
return this.filteredData();
|
|
647
|
+
}
|
|
648
|
+
scrollGroupedOptionIntoView(index) {
|
|
649
|
+
if (!this.dropdownContainer) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
const optionEls = this.dropdownContainer.nativeElement.querySelectorAll('.option');
|
|
653
|
+
const target = optionEls[index];
|
|
654
|
+
target?.scrollIntoView({ block: 'nearest' });
|
|
526
655
|
}
|
|
527
656
|
documentKeyup(event) {
|
|
528
657
|
if (!this.isDropdown() || this.options.searchable) {
|
|
529
658
|
return;
|
|
530
659
|
}
|
|
531
|
-
const data = this.
|
|
660
|
+
const data = this.getNavigableOptions();
|
|
532
661
|
for (let i = 0; i < data.length; i++) {
|
|
533
662
|
data[i].isHover = false;
|
|
534
663
|
}
|
|
@@ -544,9 +673,17 @@ class ApexSelectComponent {
|
|
|
544
673
|
}
|
|
545
674
|
if (newIndex !== null) {
|
|
546
675
|
data[newIndex].isHover = true;
|
|
547
|
-
this.
|
|
676
|
+
if (this.hasGroups()) {
|
|
677
|
+
this.filteredGroups.set([...this.filteredGroups()]);
|
|
678
|
+
this.scrollGroupedOptionIntoView(newIndex);
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
this.dropdown?.scrollToIndex(newIndex, 'auto');
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
if (!this.hasGroups()) {
|
|
685
|
+
this.filteredData.set([...this.filteredData()]);
|
|
548
686
|
}
|
|
549
|
-
this.filteredData.set([...data]);
|
|
550
687
|
}
|
|
551
688
|
removeProperty(obj, propertyName) {
|
|
552
689
|
let { [propertyName]: removedProperty, ...data } = obj;
|
|
@@ -561,10 +698,10 @@ class ApexSelectComponent {
|
|
|
561
698
|
}
|
|
562
699
|
}
|
|
563
700
|
blockScroll(event) {
|
|
564
|
-
|
|
701
|
+
const dropdownEl = this.getDropdownEl();
|
|
702
|
+
if (!dropdownEl) {
|
|
565
703
|
return;
|
|
566
704
|
}
|
|
567
|
-
const dropdownEl = this.dropdown.elementRef.nativeElement;
|
|
568
705
|
const isInsideDropdown = this.isDescendant(dropdownEl, event.target);
|
|
569
706
|
if (isInsideDropdown) {
|
|
570
707
|
const canScroll = dropdownEl.scrollHeight > dropdownEl.clientHeight;
|
|
@@ -601,7 +738,7 @@ class ApexSelectComponent {
|
|
|
601
738
|
this.scrollBlockersAttached = false;
|
|
602
739
|
}
|
|
603
740
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexSelectComponent, deps: [{ token: i1.OSService }, { token: i0.ElementRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
604
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexSelectComponent, isStandalone: true, selector: "apex-select", inputs: { options: "options" }, outputs: { selectChange: "selectChange", helperTextChange: "helperTextChange" }, host: { listeners: { "document:click": "deactivateControl($event)" } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "inputWrapper", first: true, predicate: ["inputWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n \n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n \n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of options.data; track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n \n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host-context(.table) .input-field-wrapper{width:80px;justify-content:center}:host-context(.table) .input-field-wrapper input{width:40px;color:var(--apex-select-input-table-color, #5D6068);font-weight:600;margin:0}.header{display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-select-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}.header label{font-size:14px;font-weight:600}.header-helper{font-size:12px;text-align:right;color:var(--apex-select-helper-text-color, #5D6068);cursor:pointer}.header-helper:after{width:0;height:1px;display:block;content:\"\";background:var(--apex-select-helper-text-color, #5D6068);transition:width .3s}.header-helper:hover:after{width:100%}.header .label-wrapper{display:flex;justify-content:center;align-items:center;text-wrap:wrap}.tooltip-icon{overflow:visible}.tooltip-icon path{fill:var(--apex-select-tooltip-icon-fill, transparent);stroke:var(--apex-input-tooltip-icon-stroke, #C6C6C6)}.input-field-wrapper{width:100%;height:44px;display:flex;justify-content:space-around;align-items:center;cursor:pointer;box-sizing:border-box;overflow:scroll;background-color:var(--apex-select-input-background-color, #ffffff00);border:solid var(--apex-select-input-border-color, #E9E9E9);border-width:var(--apex-select-input-border-width, 1px);transition:border 1s;border-radius:4px;padding:0 16px}.input-field-wrapper .multiple-count{font-size:14px;padding:0 8px;font-weight:600}.input-field-wrapper::-webkit-scrollbar{display:none}.input-field-wrapper:not(.input-field-wrapper.disabled):hover{border-color:var(--apex-select-input-border-hover-color, #4B5368)}.input-field-wrapper.disabled{opacity:.8;cursor:not-allowed;border:1px dashed var(--apex-select-input-border-disabled-color, #F2F2F2)}.input-field-wrapper .input-field{height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}apex-img{width:16px;height:16px}apex-img.prefix path{fill:var(--apex-select-icon-prefix-fill, #C6C6C6);stroke:var(--apex-select-icon-prefix-stroke, transparent)}.input-field-wrapper.disabled label{cursor:not-allowed}.chips{--apex-chip-font-size: var(--apex-select-chip-font-size, 10px);--apex-chip-color: var(--apex-select-chip-color, #FFFFFF);--apex-chip-background-color: var(--apex-select-chip-background-color, #0B1222);--apex-chip-icon-color: var(--apex-select-chip-icon-color, #FFFFFF);display:flex;padding-left:8px}.input-field-wrapper input{width:inherit;flex:1;text-overflow:ellipsis;border:none;outline:none;cursor:pointer;background:transparent;color:var(--apex-select-input-text-color, #0B1222);font-size:16px;transform:scale(.875);transform-origin:left center;padding:0;margin:0 12px}.input-field-wrapper input.hidden{display:none}input::placeholder{color:var(--apex-select-input-placeholder-color, #0B1222)}.input-field-wrapper input.no-icon{left:0}.input-field-wrapper.disabled input{cursor:not-allowed}.arrow-wrapper{width:8px;height:8px}.arrow{width:8px;height:8px;position:relative;bottom:3px;border-top:2px solid var(--apex-select-arrow-color, #5D6068);border-left:2px solid var(--apex-select-arrow-color, #5D6068);border-top-left-radius:3px;border-top-right-radius:1px;border-bottom-left-radius:1px;transition:all .25s ease-in-out;transform-origin:center;transform:rotate(-135deg)}.arrow.checked{bottom:-2px;transform:rotate(45deg);border-top:2px solid var(--apex-select-arrow-checked-color, #F96138);border-left:2px solid var(--apex-select-arrow-checked-color, #F96138)}.arrow svg{width:16px;height:16px;transform:rotate(0);transition:transform .25s ease-in-out}.arrow.checked svg{transform:rotate(180deg)}.input-field-wrapper.invalid{border:solid var(--apex-select-invalid-color, #F96138);border-width:var(--apex-select-invalid-border-width, 1px)}.input-field-wrapper.invalid label{color:var(--apex-select-invalid-color, #F96138)}.input-field-wrapper apex-chip{margin-right:4px}.dropdown{width:264px;position:fixed;overscroll-behavior:contain;border-radius:8px;border:1px solid var(--apex-select-dropdown-border-color, #E9E9E9);background-color:var(--apex-select-dropdown-background-color, #FFFFFF);box-shadow:var(--apex-select-dropdown-box-shadow);z-index:900;margin-top:15px;opacity:0;animation:fadeIn .3s forwards}.dropdown:focus{outline:none}.dropdown::-webkit-scrollbar{width:16px;padding:8px}.dropdown::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values::-webkit-scrollbar{width:8px;padding:4px}.values::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.values::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.values::-webkit-scrollbar-button{display:none}.dropdown .option{min-height:48px;display:flex;align-items:center;cursor:pointer;font-weight:600;color:#0009;padding:0 16px}.dropdown .option.disabled{pointer-events:none}.dropdown .option:hover,.dropdown .option.preselected{background:#00000005}.dropdown .option.checkbox.selected{--apex-checkbox-text-color: var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.dropdown .option.selected{color:var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.option-icon{width:var(--apex-select-option-icon-size, 16px);height:var(--apex-select-option-icon-size, 16px);min-width:var(--apex-select-option-icon-size, 16px);display:flex;justify-content:center;align-items:center;margin-right:var(--apex-select-option-icon-spacing, 10px)}.option-icon apex-img{max-width:var(--apex-select-option-icon-size, 20px);max-height:var(--apex-select-option-icon-size, 20px);display:flex;justify-content:center;align-items:center}.option-icon apex-img path{fill:var(--apex-select-option-icon-fill, #5D6068);stroke:var(--apex-select-option-icon-stroke, #ffffff00)}.dropdown .option.selected .option-icon apex-img path{fill:var(--apex-select-option-icon-selected-fill, #F96138);stroke:var(--apex-select-option-icon-selected-stroke, #ffffff00)}.values{width:fit-content;display:flex;flex-wrap:wrap;align-items:center;padding:6px;overflow-x:auto}.values apex-chip{margin:6px 0 0}.single-value{padding:6px}.options-divider{width:calc(100% - 36px);height:var(--apex-select-options-divider-height, 1px);background-color:var(--apex-select-options-divider-color, #E9E9E9);margin:0 auto}.multiple-checkbox-container{display:flex;flex-direction:column;row-gap:3px;padding:12px 0 12px 6px}.multiple-checkbox-container span{word-break:normal;overflow-wrap:break-word;white-space:normal}.multiple-checkbox-container span:nth-of-type(2){font-size:13px;font-weight:500;line-height:1.3;color:#5d6068}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: ApexChipComponent, selector: "apex-chip", inputs: ["closeIcon", "options"], outputs: ["closeChange"] }, { kind: "component", type: ApexImageComponent, selector: "apex-img", inputs: ["src", "alt"] }, { kind: "directive", type: ApexTooltipDirective, selector: "[apexTooltip]", inputs: ["apexTooltip", "tooltipPosition"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ApexCheckboxComponent, selector: "apex-checkbox", inputs: ["checked", "disabled", "tooltip", "options"], outputs: ["clickChange"] }] }); }
|
|
741
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexSelectComponent, isStandalone: true, selector: "apex-select", inputs: { options: "options" }, outputs: { selectChange: "selectChange", helperTextChange: "helperTextChange" }, host: { listeners: { "document:click": "deactivateControl($event)" } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "inputWrapper", first: true, predicate: ["inputWrapper"], descendants: true }, { propertyName: "dropdownSearch", first: true, predicate: ["dropdownSearch"], descendants: true }, { propertyName: "dropdownContainer", first: true, predicate: ["dropdownContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (isSearchInDropdown() && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (!isSearchInDropdown() && options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (isSearchInDropdown()) {\n <!-- Hidden input owns the form binding; the visible one is a placeholder slot. -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"/>\n } @else if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n\n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n @if (isSearchInDropdown()) {\n <div #dropdownContainer class=\"dropdown dropdown-wrapper\">\n <div class=\"dropdown-search\">\n <svg class=\"dropdown-search-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n <path d=\"M11 11L14 14\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n <input #dropdownSearch\n type=\"text\"\n placeholder=\"Search\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n (input)=\"onSearch(dropdownSearch.value, true)\"\n (keydown)=\"handleKeydown($event)\"/>\n </div>\n\n @if (options.groups && options.groups.length > 0) {\n <div class=\"dropdown-body\">\n @for (group of filteredGroups(); track group.label) {\n <div class=\"group-header\">{{ group.label }}</div>\n @for (data of group.data; track data.value) {\n <div class=\"option\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n }\n }\n\n @if (filteredGroups().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown-body dropdown-body-virtual\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n }\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host-context(.table) .input-field-wrapper{width:80px;justify-content:center}:host-context(.table) .input-field-wrapper input{width:40px;color:var(--apex-select-input-table-color, #5D6068);font-weight:600;margin:0}.header{display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-select-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}.header label{font-size:14px;font-weight:600}.header-helper{font-size:12px;text-align:right;color:var(--apex-select-helper-text-color, #5D6068);cursor:pointer}.header-helper:after{width:0;height:1px;display:block;content:\"\";background:var(--apex-select-helper-text-color, #5D6068);transition:width .3s}.header-helper:hover:after{width:100%}.header .label-wrapper{display:flex;justify-content:center;align-items:center;text-wrap:wrap}.tooltip-icon{overflow:visible}.tooltip-icon path{fill:var(--apex-select-tooltip-icon-fill, transparent);stroke:var(--apex-input-tooltip-icon-stroke, #C6C6C6)}.input-field-wrapper{width:100%;height:44px;display:flex;justify-content:space-around;align-items:center;cursor:pointer;box-sizing:border-box;overflow:scroll;background-color:var(--apex-select-input-background-color, #ffffff00);border:solid var(--apex-select-input-border-color, #E9E9E9);border-width:var(--apex-select-input-border-width, 1px);transition:border 1s;border-radius:4px;padding:0 16px}.input-field-wrapper .multiple-count{font-size:14px;padding:0 8px;font-weight:600}.input-field-wrapper::-webkit-scrollbar{display:none}.input-field-wrapper:not(.input-field-wrapper.disabled):hover{border-color:var(--apex-select-input-border-hover-color, #4B5368)}.input-field-wrapper.disabled{opacity:.8;cursor:not-allowed;border:1px dashed var(--apex-select-input-border-disabled-color, #F2F2F2)}.input-field-wrapper .input-field{height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}apex-img{width:16px;height:16px}apex-img.prefix path{fill:var(--apex-select-icon-prefix-fill, #C6C6C6);stroke:var(--apex-select-icon-prefix-stroke, transparent)}.input-field-wrapper.disabled label{cursor:not-allowed}.chips{--apex-chip-font-size: var(--apex-select-chip-font-size, 10px);--apex-chip-color: var(--apex-select-chip-color, #FFFFFF);--apex-chip-background-color: var(--apex-select-chip-background-color, #0B1222);--apex-chip-icon-color: var(--apex-select-chip-icon-color, #FFFFFF);display:flex;padding-left:8px}.input-field-wrapper input{width:inherit;flex:1;text-overflow:ellipsis;border:none;outline:none;cursor:pointer;background:transparent;color:var(--apex-select-input-text-color, #0B1222);font-size:16px;transform:scale(.875);transform-origin:left center;padding:0;margin:0 12px}.input-field-wrapper input.hidden{display:none}input::placeholder{color:var(--apex-select-input-placeholder-color, #0B1222)}.input-field-wrapper input.no-icon{left:0}.input-field-wrapper.disabled input{cursor:not-allowed}.arrow-wrapper{width:8px;height:8px}.arrow{width:8px;height:8px;position:relative;bottom:3px;border-top:2px solid var(--apex-select-arrow-color, #5D6068);border-left:2px solid var(--apex-select-arrow-color, #5D6068);border-top-left-radius:3px;border-top-right-radius:1px;border-bottom-left-radius:1px;transition:all .25s ease-in-out;transform-origin:center;transform:rotate(-135deg)}.arrow.checked{bottom:-2px;transform:rotate(45deg);border-top:2px solid var(--apex-select-arrow-checked-color, #F96138);border-left:2px solid var(--apex-select-arrow-checked-color, #F96138)}.arrow svg{width:16px;height:16px;transform:rotate(0);transition:transform .25s ease-in-out}.arrow.checked svg{transform:rotate(180deg)}.input-field-wrapper.invalid{border:solid var(--apex-select-invalid-color, #F96138);border-width:var(--apex-select-invalid-border-width, 1px)}.input-field-wrapper.invalid label{color:var(--apex-select-invalid-color, #F96138)}.input-field-wrapper apex-chip{margin-right:4px}.dropdown{width:264px;position:fixed;z-index:900;overscroll-behavior:contain;border-radius:8px;border:1px solid var(--apex-select-dropdown-border-color, #E9E9E9);background-color:var(--apex-select-dropdown-background-color, #FFFFFF);box-shadow:var(--apex-select-dropdown-box-shadow);animation:fadeIn .3s forwards;opacity:0;margin-top:15px}.dropdown:focus{outline:none}.dropdown::-webkit-scrollbar{width:16px;padding:8px}.dropdown::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values::-webkit-scrollbar{width:8px;padding:4px}.values::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.values::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.values::-webkit-scrollbar-button{display:none}.dropdown .option{min-height:48px;display:flex;align-items:center;cursor:pointer;font-weight:600;color:#0009;padding:0 16px}.dropdown .option.disabled{pointer-events:none}.dropdown .option:hover,.dropdown .option.preselected{background:#00000005}.dropdown .option.checkbox.selected{--apex-checkbox-text-color: var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.dropdown .option.selected{color:var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.option-icon{width:var(--apex-select-option-icon-size, 16px);height:var(--apex-select-option-icon-size, 16px);min-width:var(--apex-select-option-icon-size, 16px);display:flex;justify-content:center;align-items:center;margin-right:var(--apex-select-option-icon-spacing, 10px)}.option-icon apex-img{max-width:var(--apex-select-option-icon-size, 20px);max-height:var(--apex-select-option-icon-size, 20px);display:flex;justify-content:center;align-items:center}.option-icon apex-img path{fill:var(--apex-select-option-icon-fill, #5D6068);stroke:var(--apex-select-option-icon-stroke, #ffffff00)}.dropdown .option.selected .option-icon apex-img path{fill:var(--apex-select-option-icon-selected-fill, #F96138);stroke:var(--apex-select-option-icon-selected-stroke, #ffffff00)}.values{width:fit-content;display:flex;flex-wrap:wrap;align-items:center;padding:6px;overflow-x:auto}.values apex-chip{margin:6px 0 0}.single-value{padding:6px}.options-divider{width:calc(100% - 36px);height:var(--apex-select-options-divider-height, 1px);background-color:var(--apex-select-options-divider-color, #E9E9E9);margin:0 auto}.multiple-checkbox-container{display:flex;flex-direction:column;row-gap:3px;padding:12px 0 12px 6px}.multiple-checkbox-container span{word-break:normal;overflow-wrap:break-word;white-space:normal}.multiple-checkbox-container span:nth-of-type(2){font-size:13px;font-weight:500;line-height:1.3;color:#5d6068}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown.dropdown-wrapper{display:flex;flex-direction:column;overflow:hidden;padding:0}.dropdown-search{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--apex-select-dropdown-search-border-color, #E9E9E9);color:var(--apex-select-dropdown-search-icon-color, #5D6068);padding:10px 16px}.dropdown-search-icon{flex:0 0 auto}.dropdown-search input{flex:1;border:none;outline:none;background:transparent;font-size:14px;color:var(--apex-select-input-text-color, #0B1222);padding:0}.dropdown-search input::placeholder{color:var(--apex-select-input-placeholder-color, #9A9A9A)}.dropdown-body{flex:1 1 auto;min-height:0;overflow-y:auto;max-height:var(--apex-select-dropdown-body-max-height, 320px)}.dropdown-body.dropdown-body-virtual{overflow:hidden;max-height:none}.dropdown-body::-webkit-scrollbar{width:8px}.dropdown-body::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown-body::-webkit-scrollbar-track{background-color:#f8f8f8}.group-header{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:none;color:var(--apex-select-group-header-color, #9A9A9A);pointer-events:none;-webkit-user-select:none;user-select:none;padding:10px 16px 4px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: ApexChipComponent, selector: "apex-chip", inputs: ["closeIcon", "options"], outputs: ["closeChange"] }, { kind: "component", type: ApexImageComponent, selector: "apex-img", inputs: ["src", "alt"] }, { kind: "directive", type: ApexTooltipDirective, selector: "[apexTooltip]", inputs: ["apexTooltip", "tooltipPosition"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ApexCheckboxComponent, selector: "apex-checkbox", inputs: ["checked", "disabled", "tooltip", "options"], outputs: ["clickChange"] }] }); }
|
|
605
742
|
}
|
|
606
743
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexSelectComponent, decorators: [{
|
|
607
744
|
type: Component,
|
|
@@ -615,7 +752,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
615
752
|
ApexTooltipDirective,
|
|
616
753
|
ReactiveFormsModule,
|
|
617
754
|
ApexCheckboxComponent,
|
|
618
|
-
], template: "@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n \n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n \n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of options.data; track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n \n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host-context(.table) .input-field-wrapper{width:80px;justify-content:center}:host-context(.table) .input-field-wrapper input{width:40px;color:var(--apex-select-input-table-color, #5D6068);font-weight:600;margin:0}.header{display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-select-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}.header label{font-size:14px;font-weight:600}.header-helper{font-size:12px;text-align:right;color:var(--apex-select-helper-text-color, #5D6068);cursor:pointer}.header-helper:after{width:0;height:1px;display:block;content:\"\";background:var(--apex-select-helper-text-color, #5D6068);transition:width .3s}.header-helper:hover:after{width:100%}.header .label-wrapper{display:flex;justify-content:center;align-items:center;text-wrap:wrap}.tooltip-icon{overflow:visible}.tooltip-icon path{fill:var(--apex-select-tooltip-icon-fill, transparent);stroke:var(--apex-input-tooltip-icon-stroke, #C6C6C6)}.input-field-wrapper{width:100%;height:44px;display:flex;justify-content:space-around;align-items:center;cursor:pointer;box-sizing:border-box;overflow:scroll;background-color:var(--apex-select-input-background-color, #ffffff00);border:solid var(--apex-select-input-border-color, #E9E9E9);border-width:var(--apex-select-input-border-width, 1px);transition:border 1s;border-radius:4px;padding:0 16px}.input-field-wrapper .multiple-count{font-size:14px;padding:0 8px;font-weight:600}.input-field-wrapper::-webkit-scrollbar{display:none}.input-field-wrapper:not(.input-field-wrapper.disabled):hover{border-color:var(--apex-select-input-border-hover-color, #4B5368)}.input-field-wrapper.disabled{opacity:.8;cursor:not-allowed;border:1px dashed var(--apex-select-input-border-disabled-color, #F2F2F2)}.input-field-wrapper .input-field{height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}apex-img{width:16px;height:16px}apex-img.prefix path{fill:var(--apex-select-icon-prefix-fill, #C6C6C6);stroke:var(--apex-select-icon-prefix-stroke, transparent)}.input-field-wrapper.disabled label{cursor:not-allowed}.chips{--apex-chip-font-size: var(--apex-select-chip-font-size, 10px);--apex-chip-color: var(--apex-select-chip-color, #FFFFFF);--apex-chip-background-color: var(--apex-select-chip-background-color, #0B1222);--apex-chip-icon-color: var(--apex-select-chip-icon-color, #FFFFFF);display:flex;padding-left:8px}.input-field-wrapper input{width:inherit;flex:1;text-overflow:ellipsis;border:none;outline:none;cursor:pointer;background:transparent;color:var(--apex-select-input-text-color, #0B1222);font-size:16px;transform:scale(.875);transform-origin:left center;padding:0;margin:0 12px}.input-field-wrapper input.hidden{display:none}input::placeholder{color:var(--apex-select-input-placeholder-color, #0B1222)}.input-field-wrapper input.no-icon{left:0}.input-field-wrapper.disabled input{cursor:not-allowed}.arrow-wrapper{width:8px;height:8px}.arrow{width:8px;height:8px;position:relative;bottom:3px;border-top:2px solid var(--apex-select-arrow-color, #5D6068);border-left:2px solid var(--apex-select-arrow-color, #5D6068);border-top-left-radius:3px;border-top-right-radius:1px;border-bottom-left-radius:1px;transition:all .25s ease-in-out;transform-origin:center;transform:rotate(-135deg)}.arrow.checked{bottom:-2px;transform:rotate(45deg);border-top:2px solid var(--apex-select-arrow-checked-color, #F96138);border-left:2px solid var(--apex-select-arrow-checked-color, #F96138)}.arrow svg{width:16px;height:16px;transform:rotate(0);transition:transform .25s ease-in-out}.arrow.checked svg{transform:rotate(180deg)}.input-field-wrapper.invalid{border:solid var(--apex-select-invalid-color, #F96138);border-width:var(--apex-select-invalid-border-width, 1px)}.input-field-wrapper.invalid label{color:var(--apex-select-invalid-color, #F96138)}.input-field-wrapper apex-chip{margin-right:4px}.dropdown{width:264px;position:fixed;overscroll-behavior:contain;border-radius:8px;border:1px solid var(--apex-select-dropdown-border-color, #E9E9E9);background-color:var(--apex-select-dropdown-background-color, #FFFFFF);box-shadow:var(--apex-select-dropdown-box-shadow);z-index:900;margin-top:15px;opacity:0;animation:fadeIn .3s forwards}.dropdown:focus{outline:none}.dropdown::-webkit-scrollbar{width:16px;padding:8px}.dropdown::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values::-webkit-scrollbar{width:8px;padding:4px}.values::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.values::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.values::-webkit-scrollbar-button{display:none}.dropdown .option{min-height:48px;display:flex;align-items:center;cursor:pointer;font-weight:600;color:#0009;padding:0 16px}.dropdown .option.disabled{pointer-events:none}.dropdown .option:hover,.dropdown .option.preselected{background:#00000005}.dropdown .option.checkbox.selected{--apex-checkbox-text-color: var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.dropdown .option.selected{color:var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.option-icon{width:var(--apex-select-option-icon-size, 16px);height:var(--apex-select-option-icon-size, 16px);min-width:var(--apex-select-option-icon-size, 16px);display:flex;justify-content:center;align-items:center;margin-right:var(--apex-select-option-icon-spacing, 10px)}.option-icon apex-img{max-width:var(--apex-select-option-icon-size, 20px);max-height:var(--apex-select-option-icon-size, 20px);display:flex;justify-content:center;align-items:center}.option-icon apex-img path{fill:var(--apex-select-option-icon-fill, #5D6068);stroke:var(--apex-select-option-icon-stroke, #ffffff00)}.dropdown .option.selected .option-icon apex-img path{fill:var(--apex-select-option-icon-selected-fill, #F96138);stroke:var(--apex-select-option-icon-selected-stroke, #ffffff00)}.values{width:fit-content;display:flex;flex-wrap:wrap;align-items:center;padding:6px;overflow-x:auto}.values apex-chip{margin:6px 0 0}.single-value{padding:6px}.options-divider{width:calc(100% - 36px);height:var(--apex-select-options-divider-height, 1px);background-color:var(--apex-select-options-divider-color, #E9E9E9);margin:0 auto}.multiple-checkbox-container{display:flex;flex-direction:column;row-gap:3px;padding:12px 0 12px 6px}.multiple-checkbox-container span{word-break:normal;overflow-wrap:break-word;white-space:normal}.multiple-checkbox-container span:nth-of-type(2){font-size:13px;font-weight:500;line-height:1.3;color:#5d6068}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
755
|
+
], template: "@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (isSearchInDropdown() && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (!isSearchInDropdown() && options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (isSearchInDropdown()) {\n <!-- Hidden input owns the form binding; the visible one is a placeholder slot. -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"/>\n } @else if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n\n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n @if (isSearchInDropdown()) {\n <div #dropdownContainer class=\"dropdown dropdown-wrapper\">\n <div class=\"dropdown-search\">\n <svg class=\"dropdown-search-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n <path d=\"M11 11L14 14\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n <input #dropdownSearch\n type=\"text\"\n placeholder=\"Search\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n (input)=\"onSearch(dropdownSearch.value, true)\"\n (keydown)=\"handleKeydown($event)\"/>\n </div>\n\n @if (options.groups && options.groups.length > 0) {\n <div class=\"dropdown-body\">\n @for (group of filteredGroups(); track group.label) {\n <div class=\"group-header\">{{ group.label }}</div>\n @for (data of group.data; track data.value) {\n <div class=\"option\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n }\n }\n\n @if (filteredGroups().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown-body dropdown-body-virtual\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n }\n </div>\n }\n}\n", styles: [":host{display:block;touch-action:manipulation}:host-context(.table) .input-field-wrapper{width:80px;justify-content:center}:host-context(.table) .input-field-wrapper input{width:40px;color:var(--apex-select-input-table-color, #5D6068);font-weight:600;margin:0}.header{display:flex;align-items:center;justify-content:space-between;column-gap:4px;color:var(--apex-select-header-color, #0B1222);text-wrap:nowrap;margin-bottom:2px}.header label{font-size:14px;font-weight:600}.header-helper{font-size:12px;text-align:right;color:var(--apex-select-helper-text-color, #5D6068);cursor:pointer}.header-helper:after{width:0;height:1px;display:block;content:\"\";background:var(--apex-select-helper-text-color, #5D6068);transition:width .3s}.header-helper:hover:after{width:100%}.header .label-wrapper{display:flex;justify-content:center;align-items:center;text-wrap:wrap}.tooltip-icon{overflow:visible}.tooltip-icon path{fill:var(--apex-select-tooltip-icon-fill, transparent);stroke:var(--apex-input-tooltip-icon-stroke, #C6C6C6)}.input-field-wrapper{width:100%;height:44px;display:flex;justify-content:space-around;align-items:center;cursor:pointer;box-sizing:border-box;overflow:scroll;background-color:var(--apex-select-input-background-color, #ffffff00);border:solid var(--apex-select-input-border-color, #E9E9E9);border-width:var(--apex-select-input-border-width, 1px);transition:border 1s;border-radius:4px;padding:0 16px}.input-field-wrapper .multiple-count{font-size:14px;padding:0 8px;font-weight:600}.input-field-wrapper::-webkit-scrollbar{display:none}.input-field-wrapper:not(.input-field-wrapper.disabled):hover{border-color:var(--apex-select-input-border-hover-color, #4B5368)}.input-field-wrapper.disabled{opacity:.8;cursor:not-allowed;border:1px dashed var(--apex-select-input-border-disabled-color, #F2F2F2)}.input-field-wrapper .input-field{height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 16px}apex-img{width:16px;height:16px}apex-img.prefix path{fill:var(--apex-select-icon-prefix-fill, #C6C6C6);stroke:var(--apex-select-icon-prefix-stroke, transparent)}.input-field-wrapper.disabled label{cursor:not-allowed}.chips{--apex-chip-font-size: var(--apex-select-chip-font-size, 10px);--apex-chip-color: var(--apex-select-chip-color, #FFFFFF);--apex-chip-background-color: var(--apex-select-chip-background-color, #0B1222);--apex-chip-icon-color: var(--apex-select-chip-icon-color, #FFFFFF);display:flex;padding-left:8px}.input-field-wrapper input{width:inherit;flex:1;text-overflow:ellipsis;border:none;outline:none;cursor:pointer;background:transparent;color:var(--apex-select-input-text-color, #0B1222);font-size:16px;transform:scale(.875);transform-origin:left center;padding:0;margin:0 12px}.input-field-wrapper input.hidden{display:none}input::placeholder{color:var(--apex-select-input-placeholder-color, #0B1222)}.input-field-wrapper input.no-icon{left:0}.input-field-wrapper.disabled input{cursor:not-allowed}.arrow-wrapper{width:8px;height:8px}.arrow{width:8px;height:8px;position:relative;bottom:3px;border-top:2px solid var(--apex-select-arrow-color, #5D6068);border-left:2px solid var(--apex-select-arrow-color, #5D6068);border-top-left-radius:3px;border-top-right-radius:1px;border-bottom-left-radius:1px;transition:all .25s ease-in-out;transform-origin:center;transform:rotate(-135deg)}.arrow.checked{bottom:-2px;transform:rotate(45deg);border-top:2px solid var(--apex-select-arrow-checked-color, #F96138);border-left:2px solid var(--apex-select-arrow-checked-color, #F96138)}.arrow svg{width:16px;height:16px;transform:rotate(0);transition:transform .25s ease-in-out}.arrow.checked svg{transform:rotate(180deg)}.input-field-wrapper.invalid{border:solid var(--apex-select-invalid-color, #F96138);border-width:var(--apex-select-invalid-border-width, 1px)}.input-field-wrapper.invalid label{color:var(--apex-select-invalid-color, #F96138)}.input-field-wrapper apex-chip{margin-right:4px}.dropdown{width:264px;position:fixed;z-index:900;overscroll-behavior:contain;border-radius:8px;border:1px solid var(--apex-select-dropdown-border-color, #E9E9E9);background-color:var(--apex-select-dropdown-background-color, #FFFFFF);box-shadow:var(--apex-select-dropdown-box-shadow);animation:fadeIn .3s forwards;opacity:0;margin-top:15px}.dropdown:focus{outline:none}.dropdown::-webkit-scrollbar{width:16px;padding:8px}.dropdown::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values::-webkit-scrollbar{width:8px;padding:4px}.values::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.values::-webkit-scrollbar-track{background-color:#f8f8f8;border-top-right-radius:8px;border-bottom-right-radius:8px}.values::-webkit-scrollbar-button{display:none}.dropdown .option{min-height:48px;display:flex;align-items:center;cursor:pointer;font-weight:600;color:#0009;padding:0 16px}.dropdown .option.disabled{pointer-events:none}.dropdown .option:hover,.dropdown .option.preselected{background:#00000005}.dropdown .option.checkbox.selected{--apex-checkbox-text-color: var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.dropdown .option.selected{color:var(--apex-select-input-text-selected-color, #F96138);background:#0000000a}.option-icon{width:var(--apex-select-option-icon-size, 16px);height:var(--apex-select-option-icon-size, 16px);min-width:var(--apex-select-option-icon-size, 16px);display:flex;justify-content:center;align-items:center;margin-right:var(--apex-select-option-icon-spacing, 10px)}.option-icon apex-img{max-width:var(--apex-select-option-icon-size, 20px);max-height:var(--apex-select-option-icon-size, 20px);display:flex;justify-content:center;align-items:center}.option-icon apex-img path{fill:var(--apex-select-option-icon-fill, #5D6068);stroke:var(--apex-select-option-icon-stroke, #ffffff00)}.dropdown .option.selected .option-icon apex-img path{fill:var(--apex-select-option-icon-selected-fill, #F96138);stroke:var(--apex-select-option-icon-selected-stroke, #ffffff00)}.values{width:fit-content;display:flex;flex-wrap:wrap;align-items:center;padding:6px;overflow-x:auto}.values apex-chip{margin:6px 0 0}.single-value{padding:6px}.options-divider{width:calc(100% - 36px);height:var(--apex-select-options-divider-height, 1px);background-color:var(--apex-select-options-divider-color, #E9E9E9);margin:0 auto}.multiple-checkbox-container{display:flex;flex-direction:column;row-gap:3px;padding:12px 0 12px 6px}.multiple-checkbox-container span{word-break:normal;overflow-wrap:break-word;white-space:normal}.multiple-checkbox-container span:nth-of-type(2){font-size:13px;font-weight:500;line-height:1.3;color:#5d6068}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.dropdown.dropdown-wrapper{display:flex;flex-direction:column;overflow:hidden;padding:0}.dropdown-search{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--apex-select-dropdown-search-border-color, #E9E9E9);color:var(--apex-select-dropdown-search-icon-color, #5D6068);padding:10px 16px}.dropdown-search-icon{flex:0 0 auto}.dropdown-search input{flex:1;border:none;outline:none;background:transparent;font-size:14px;color:var(--apex-select-input-text-color, #0B1222);padding:0}.dropdown-search input::placeholder{color:var(--apex-select-input-placeholder-color, #9A9A9A)}.dropdown-body{flex:1 1 auto;min-height:0;overflow-y:auto;max-height:var(--apex-select-dropdown-body-max-height, 320px)}.dropdown-body.dropdown-body-virtual{overflow:hidden;max-height:none}.dropdown-body::-webkit-scrollbar{width:8px}.dropdown-body::-webkit-scrollbar-thumb{background-color:#e0dfde;border-radius:25px}.dropdown-body::-webkit-scrollbar-track{background-color:#f8f8f8}.group-header{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:none;color:var(--apex-select-group-header-color, #9A9A9A);pointer-events:none;-webkit-user-select:none;user-select:none;padding:10px 16px 4px}\n"] }]
|
|
619
756
|
}], ctorParameters: () => [{ type: i1.OSService }, { type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { input: [{
|
|
620
757
|
type: ViewChild,
|
|
621
758
|
args: ['input']
|
|
@@ -628,6 +765,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
628
765
|
}], inputWrapper: [{
|
|
629
766
|
type: ViewChild,
|
|
630
767
|
args: ['inputWrapper']
|
|
768
|
+
}], dropdownSearch: [{
|
|
769
|
+
type: ViewChild,
|
|
770
|
+
args: ['dropdownSearch']
|
|
771
|
+
}], dropdownContainer: [{
|
|
772
|
+
type: ViewChild,
|
|
773
|
+
args: ['dropdownContainer']
|
|
631
774
|
}], options: [{
|
|
632
775
|
type: Input
|
|
633
776
|
}], selectChange: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apexara-ng-components-select.mjs","sources":["../../../../projects/apexara/ng-components/select/src/select.component.ts","../../../../projects/apexara/ng-components/select/src/select.component.html","../../../../projects/apexara/ng-components/select/apexara-ng-components-select.ts"],"sourcesContent":["import {\n Component, OnInit, ViewChild, Input,\n Output, inject, PLATFORM_ID, ElementRef,\n HostListener, EventEmitter, IterableDiffers,\n OnDestroy, AfterViewInit, SimpleChanges, IterableDiffer, signal} from '@angular/core';\nimport { NgClass, isPlatformServer } from '@angular/common';\nimport { FormGroup, FormsModule, ReactiveFormsModule, AbstractControl, TouchedChangeEvent } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\n\nimport { Subscription, debounceTime, filter, fromEvent, tap } from 'rxjs';\n\nimport { ApexChipComponent } from '@apexara/ng-components/chip';\nimport { ApexImageComponent } from '@apexara/ng-components/image';\nimport { ApexCheckboxComponent } from '@apexara/ng-components/checkbox';\n\nimport { OSService, MobileOS } from '@apexara/ng-components/services';\n\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexSelectOptions {\n label: string;\n tooltip?: string;\n data: ApexSelectData[];\n multiple?: boolean;\n counterAsValue?: boolean;\n placeholder?: string;\n helperText?: string;\n helperRoute?: string;\n prefixImg?: string;\n suffixImg?: string;\n formGroup?: FormGroup;\n searchable?: boolean;\n formControlName?: string;\n errors?: ControlErrors;\n maxDropdownHeightPx?: number; // optional hard max height in px\n}\n\nexport interface ApexSelectData {\n label: string;\n value: any;\n description?: string;\n isHover?: boolean;\n icon?: string;\n}\n\nexport interface ControlErrors {\n [x: string]: string;\n}\n\n@Component({\n selector: 'apex-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.css'],\n imports: [\n NgClass,\n RouterLink,\n FormsModule,\n ScrollingModule,\n ApexChipComponent,\n ApexImageComponent,\n ApexTooltipDirective,\n ReactiveFormsModule,\n ApexCheckboxComponent,\n ]\n})\n\nexport class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {\n\n @ViewChild('input') input: ElementRef<HTMLInputElement> | null = null;\n\n @ViewChild('label') label: ElementRef<HTMLLabelElement> | null = null;\n @ViewChild('dropdown') dropdown: CdkVirtualScrollViewport | null = null;\n @ViewChild('inputWrapper') inputWrapper: ElementRef<HTMLInputElement> | null = null;\n\n @Input() options!: ApexSelectOptions;\n\n\n @Output() selectChange = new EventEmitter<ApexSelectData>();\n @Output() helperTextChange = new EventEmitter<void>();\n\n constructor(\n private osService: OSService,\n private elementRef: ElementRef,\n private iterableDiffers: IterableDiffers) {\n\n this.dataDiffer = this.iterableDiffers.find([]).create<ApexSelectData>();\n\n this.handleEvents();\n }\n\n public firstDropdown = signal(0);\n public isDropdown = signal(false);\n public control!: AbstractControl;\n\n public tooltipPosition = TooltipPosition;\n\n private platformId = inject(PLATFORM_ID);\n\n private isDropdownReversed = false;\n\n private shouldPreventEvents = false;\n\n private documentKeyupValue = '';\n private documentKeyupValueResetTime = 1000;\n private documentKeyUpSubscription: Subscription | null = null;\n\n private dataDiffer!: IterableDiffer<ApexSelectData>;\n\n private controlSubscription: Subscription | null = null;\n\n public filteredData = signal<ApexSelectData[]>([]);\n\n private lastSearch = '';\n\n private keyListener = (event: KeyboardEvent) => this.blockArrowScroll(event);\n private wheelListener = (event: WheelEvent | TouchEvent) => this.blockScroll(event);\n\n private scrollBlockersAttached = false;\n\n // Virtual scroll config for options list\n public optionItemSizePx = 48; // must match .dropdown .option height in CSS\n public maxVisibleOptions = 8;\n public dropdownHeightPx = signal(this.optionItemSizePx);\n\n public controlInvalid = signal(false);\n public controlValue = signal<any>(null);\n public controlDisabled = signal(false);\n\n public ngOnInit(): void {\n this.control = this.getControl()!;\n\n if (this.control) {\n this.controlValue.set(this.control.value);\n this.controlDisabled.set(this.control.disabled);\n\n const touchedSub = this.control.events\n .pipe(filter(event => event instanceof TouchedChangeEvent))\n .subscribe(() => {\n this.controlInvalid.set(this.control.touched && this.control.invalid);\n });\n\n const statusSub = this.control.statusChanges.subscribe(() => {\n this.controlInvalid.set(this.control.touched && this.control.invalid);\n this.controlDisabled.set(this.control.disabled);\n });\n\n const valueSub = this.control.valueChanges.subscribe((value) => {\n this.controlValue.set(value);\n });\n\n this.controlSubscription = touchedSub;\n this.controlSubscription.add(statusSub);\n this.controlSubscription.add(valueSub);\n }\n\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n this.documentKeyUpSubscription = fromEvent<KeyboardEvent>(this.elementRef.nativeElement, 'keydown')\n .pipe(\n tap(event => { this.keyup(event) }),\n debounceTime(this.documentKeyupValueResetTime),\n )\n .subscribe(() => { this.documentKeyupValue = '' });\n }\n\n public ngDoCheck(): void {\n const data = this.options?.data || [];\n const diff = this.dataDiffer.diff(data);\n\n if (!diff) {\n return;\n }\n\n this.filteredData.set([...data]);\n\n // Sync controlValue signal and visible input when data changes.\n // The parent may have reset the control with { emitEvent: false },\n // which bypasses valueChanges — the only thing that updates controlValue.\n // Clone the value to force a new reference so the signal always fires.\n if (this.control) {\n const value = this.control.value;\n this.controlValue.set(Array.isArray(value) ? [...value] : value != null ? { ...value } : null);\n\n if (this.input) {\n this.setVisibleValue(value);\n }\n }\n }\n\n public ngAfterViewInit(): void {\n this.filteredData.set([...this.options.data]);\n\n setTimeout(() => {\n if (this.options.formGroup && this.options.formControlName) {\n this.setVisibleValue(this.options.formGroup.controls[this.options.formControlName].value);\n }\n })\n\n if (this.options.searchable) {\n this.controlSubscription!.add(this.control.valueChanges.subscribe((value) => {\n this.setVisibleValue(value);\n }));\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (!changes['options'] || changes['options'].firstChange) {\n return;\n }\n\n this.updateDropdownHeight();\n }\n\n public ngOnDestroy(): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n this.detachGlobalScrollBlockers();\n window.removeEventListener('keydown', this.keyListener);\n\n if (this.documentKeyUpSubscription) {\n this.documentKeyUpSubscription.unsubscribe();\n }\n\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onHelperText(): void {\n this.helperTextChange.emit();\n }\n\n public setValue(value: any): void {\n if (!this.options.multiple) {\n value = this.removeProperty(value, 'isHover');\n }\n\n this.control.setValue(value);\n this.input!.nativeElement.value = value.label ? value.label : '';\n\n this.selectChange.emit(value);\n\n if (value.value == null) {\n return;\n }\n\n setTimeout(() => {\n this.removeDropdown();\n\n if (!this.options.multiple) {\n this.lastSearch = '';\n }\n })\n }\n\n public setMultipleValue(data: any, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n const newValue = this.control.value;\n let indexOfValue = -1;\n\n for (let i = 0; i < newValue.length; i++) {\n if (newValue[i].value === data.value) {\n indexOfValue = i;\n }\n\n if (JSON.stringify(newValue[i].value) === JSON.stringify(data.value)) {\n indexOfValue = i;\n }\n }\n\n if (indexOfValue === -1) {\n newValue.push({ label: data.label, value: data.value });\n } else {\n newValue.splice(indexOfValue, 1);\n }\n\n this.lastSearch = '';\n this.input!.nativeElement.value = '';\n this.filteredData.set([...this.options.data]);\n\n this.control.setValue(newValue);\n this.selectChange.emit(newValue);\n }\n\n public setVisibleValue(newValue: any | any[]): void {\n if (newValue === null) {\n this.input!.nativeElement.value = '';\n\n return;\n }\n\n if (this.options.counterAsValue) {\n if (this.options.searchable) {\n return;\n }\n\n const count = Array.isArray(newValue) ? newValue.length : 0;\n this.input!.nativeElement.value = count > 0 ? count + ' selected' : '';\n\n return;\n }\n\n let visibleValue = '';\n\n for (let data of this.filteredData()) {\n // when newValue is object and not array\n if (data.value === newValue.value) {\n visibleValue = data.label;\n\n break;\n }\n\n if (this.options.multiple && !this.options.searchable) {\n // when newValue is array\n for (let item of newValue) {\n if (data.value === item.value) {\n visibleValue += item.label + ', ';\n\n break;\n }\n }\n }\n\n if (newValue.value) {\n // Edge case for when we use { label, value } pattern as value\n if (newValue.value.value && this.getControl()?.value.value.value === newValue.value.value) {\n visibleValue = data.label;\n\n break;\n }\n }\n }\n\n this.input!.nativeElement.value = visibleValue;\n }\n\n private updateDropdownHeight(): void {\n if (!this.isDropdown()) {\n return;\n }\n\n setTimeout(() => {\n const count = this.filteredData().length;\n const maxRows = this.maxVisibleOptions;\n\n let next = this.optionItemSizePx;\n\n if (count > 0 && count <= maxRows && this.dropdown) {\n const options = this.dropdown.elementRef.nativeElement.querySelectorAll('.option');\n\n let total = 0;\n\n options.forEach((option: any) => {\n const height = option.getBoundingClientRect().height;\n total += isFinite(height) ? height : 0;\n });\n\n next = total;\n } else {\n const rows = Math.min(count, maxRows);\n\n next = Math.max(rows * this.optionItemSizePx, this.optionItemSizePx);\n }\n\n const maxHeight = this.options.maxDropdownHeightPx;\n\n if (maxHeight) {\n next = Math.min(next, Math.max(this.optionItemSizePx, maxHeight));\n }\n\n this.dropdownHeightPx.set(next);\n\n setTimeout(() => {\n this.dropdown?.checkViewportSize();\n }, 100)\n\n });\n }\n\n public showMultipleCount(): number {\n const value = this.controlValue();\n if (!value || !value.length) {\n return 0;\n }\n\n return value.length;\n }\n\n public isValueSelected(value: ApexSelectData): boolean {\n const controlVal = this.controlValue();\n if (value.value == null || controlVal == null) {\n return false;\n }\n\n return value.value === controlVal.value;\n }\n\n public isMultipleSelected(value: ApexSelectData): boolean {\n const controlVal = this.controlValue();\n if (!controlVal || !controlVal.length) {\n return false;\n }\n\n for (let i = 0; i < controlVal.length; i++) {\n if (value.value === controlVal[i]) {\n return true;\n }\n\n if (controlVal[i].value === value.value) {\n return true;\n }\n\n if (JSON.stringify(controlVal[i].value) === JSON.stringify(value.value)) {\n return true;\n }\n }\n\n return false;\n }\n\n public activateDropdown(): void {\n if (this.checkIfControlDisabled()) {\n return;\n }\n\n this.isDropdown.set(true);\n this.input!.nativeElement.focus();\n\n if (this.firstDropdown() === 0) {\n this.firstDropdown.update(v => v + 1);\n\n setTimeout(() => this.generateDropdownPosition(true));\n }\n\n this.attachGlobalScrollBlockers();\n this.onSearch(this.lastSearch, false);\n }\n\n @HostListener('document:click', ['$event'])\n public deactivateControl(event: MouseEvent | KeyboardEvent): void {\n if (event instanceof KeyboardEvent) {\n this.removeDropdown();\n\n return;\n }\n\n if (!this.dropdown || !this.inputWrapper) {\n return;\n }\n\n const dropdownRect = this.dropdown.elementRef.nativeElement.getBoundingClientRect();\n const inputWrapperRect = this.inputWrapper.nativeElement.getBoundingClientRect();\n\n const isClickInsideDropdown = this.isWithinBounds(event, dropdownRect);\n const isClickInsideInputWrapper = this.isWithinBounds(event, inputWrapperRect);\n\n if (isClickInsideDropdown || isClickInsideInputWrapper) {\n return;\n }\n\n this.removeDropdown();\n }\n\n public onFocusIn(): void {\n this.shouldPreventEvents = true;\n\n this.activateDropdown();\n\n setTimeout(() => {\n this.shouldPreventEvents = false;\n }, 200);\n }\n\n public onFocusOut(): void {\n this.shouldPreventEvents = true;\n\n setTimeout(() => {\n this.shouldPreventEvents = false;\n }, 200);\n\n this.removeDropdown();\n }\n\n public toggleDropdown(): void {\n if (this.shouldPreventEvents) {\n return;\n }\n\n if (this.isDropdown()) {\n this.removeDropdown();\n } else {\n this.activateDropdown();\n }\n }\n\n private generateDropdownPosition(checkRevserse: boolean = false): void {\n if (!this.dropdown) {\n // method will keep executing until dropdown is rendered\n setTimeout(() => this.generateDropdownPosition(true));\n\n return;\n }\n\n const dropdownEl = this.dropdown.elementRef.nativeElement;\n const elementRefRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n if (this.osService.mobileOS === MobileOS.iOS) {\n elementRefRect.y += window.visualViewport!.offsetTop;\n elementRefRect.x += window.visualViewport!.offsetLeft;\n }\n\n dropdownEl.style.left = elementRefRect.x + 'px';\n dropdownEl.style.width = elementRefRect.width + 'px';\n dropdownEl.style.top = elementRefRect.y + elementRefRect.height + 'px';\n\n if (checkRevserse) {\n if (window.innerHeight < dropdownEl.getBoundingClientRect().bottom) {\n dropdownEl.style.top = 'unset';\n dropdownEl.style.bottom = window.innerHeight - elementRefRect.y + 10 + 'px';\n\n this.isDropdownReversed = true;\n }\n }\n\n if (this.isDropdownReversed) {\n dropdownEl.style.top = 'unset';\n dropdownEl.style.bottom = window.innerHeight - elementRefRect.y + 10 + 'px';\n }\n\n setTimeout(() => {\n this.updateDropdownHeight();\n }, 100);\n }\n\n public removeDropdown(): void {\n this.isDropdown.set(false);\n this.isDropdownReversed = false;\n this.firstDropdown.set(0);\n\n this.input!.nativeElement.blur();\n\n this.detachGlobalScrollBlockers();\n }\n\n public handleKeydown(event: any): void {\n if (event.code === 'Backspace') {\n this.onSearch('', true);\n }\n }\n\n public preventFocusChange(event: MouseEvent): void {\n if (this.input?.nativeElement === document.activeElement) {\n event.preventDefault();\n\n return;\n }\n }\n\n public onSearch(value: string, shouldResetHover?: boolean): void {\n this.lastSearch = value;\n\n if (!value) {\n // Reset to original data if input is empty\n this.filteredData.set([...this.options.data]);\n\n this.updateDropdownHeight();\n\n return;\n }\n\n const searchTerm = value.toLowerCase();\n\n const filtered = this.options.data.filter(item =>\n item.label.toLowerCase().includes(searchTerm)\n );\n\n if (filtered.length && shouldResetHover) {\n for (let i = 0; i < filtered.length; i++) {\n filtered[i].isHover = false;\n }\n\n filtered[0].isHover = true;\n }\n\n this.filteredData.set(filtered);\n\n this.updateDropdownHeight();\n }\n\n public getPlaceholder(): string {\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n const controlVal = this.controlValue();\n\n let placeholder = '';\n\n if (options.placeholder) {\n placeholder = options.placeholder;\n }\n\n if (formGroup && formControlName && options.errors && this.checkIfControlInvalid()) {\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n placeholder = options.errors[error];\n }\n }\n }\n\n if ((controlVal instanceof Array && controlVal.length) || (controlVal && !(controlVal instanceof Array))) {\n return '';\n }\n\n return placeholder;\n }\n\n public checkIfControlInvalid(): boolean {\n return this.controlInvalid();\n }\n\n public checkIfControlDisabled(): boolean {\n return this.controlDisabled();\n }\n\n private getControl(): AbstractControl | null {\n if (this.options && this.options.formGroup && this.options.formControlName) {\n return this.options.formGroup.controls[this.options.formControlName];\n }\n\n return null;\n }\n\n private isWithinBounds(event: MouseEvent, rect: DOMRect): boolean {\n return (\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom\n );\n }\n\n private handleEvents(): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n window.addEventListener('keydown', this.keyListener);\n }\n\n private keyup(event: KeyboardEvent): void {\n if (document.activeElement !== this.input?.nativeElement) {\n this.deactivateControl(event);\n\n return;\n }\n\n if (document.activeElement === this.input?.nativeElement) {\n if (document.activeElement !== this.input?.nativeElement) {\n return;\n }\n\n switch (event.code) {\n case 'Enter':\n this.documentEnterKeyup(event);\n\n return;\n case 'Space':\n if (!this.options.searchable) {\n this.documentEnterKeyup(event);\n }\n\n return;\n case 'Backspace':\n if (!this.options.multiple && this.options.searchable && this.control.value.value != null) {\n this.onSearch('', false);\n\n this.setValue('');\n }\n\n return;\n case 'Escape':\n this.deactivateControl(event);\n\n return;\n case 'ArrowDown':\n this.documentArrowsKeyup(true);\n\n return;\n case 'ArrowUp':\n this.documentArrowsKeyup(false);\n\n return;\n }\n\n this.documentKeyup(event);\n }\n }\n\n private documentEnterKeyup(event: KeyboardEvent): void {\n const data = this.filteredData();\n for (let i = 0; i < data.length; i++) {\n if (data[i].isHover) {\n switch(this.options.multiple) {\n case true:\n this.setMultipleValue(data[i], event);\n\n this.updateDropdownHeight();\n\n return;\n default:\n this.setValue(data[i]);\n\n this.removeDropdown();\n }\n }\n }\n }\n\n private documentArrowsKeyup(isDownArrow: boolean): void {\n if (!this.dropdown || !this.filteredData().length) {\n return;\n }\n\n const data = this.filteredData();\n const dataLength = data.length;\n const controlValue = this.control.getRawValue();\n const isControlValue = controlValue && controlValue !== '';\n\n let hoverIndex: number | null = null;\n let valueIndex: number | null = null;\n\n for (let i = 0; i < dataLength; i++) {\n if (data[i].isHover) {\n hoverIndex = i;\n }\n\n if (isControlValue && data[i].value === controlValue) {\n valueIndex = i;\n }\n\n data[i].isHover = false;\n }\n\n const currentIndex = hoverIndex ? hoverIndex : valueIndex ? valueIndex : 0;\n let newIndex = isDownArrow ? currentIndex + 1 : currentIndex - 1;\n\n newIndex = newIndex < 0 ? 0 : newIndex;\n newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;\n\n data[newIndex].isHover = true;\n\n this.filteredData.set([...data]);\n\n this.dropdown?.scrollToIndex(newIndex, 'auto');\n }\n\n private documentKeyup(event: KeyboardEvent): void {\n if (!this.isDropdown() || this.options.searchable) {\n return;\n }\n\n const data = this.filteredData();\n\n for (let i = 0; i < data.length; i++) {\n data[i].isHover = false;\n }\n\n this.documentKeyupValue = this.documentKeyupValue + event.key.toLowerCase();\n\n let newIndex: number | null = null;\n\n for (let i = 0; i < data.length; i++) {\n const subLabel = data[i].label.substring(0, this.documentKeyupValue.length).toLowerCase();\n\n if (subLabel === this.documentKeyupValue) {\n newIndex = i;\n\n break;\n }\n\n data[i].isHover = false;\n }\n\n if (newIndex !== null) {\n data[newIndex].isHover = true;\n\n this.dropdown?.scrollToIndex(newIndex, 'auto');\n }\n\n this.filteredData.set([...data]);\n }\n\n private removeProperty(obj: ApexSelectData, propertyName: keyof ApexSelectData): Partial<ApexSelectData> {\n let { [propertyName]: removedProperty, ...data } = obj;\n return data;\n }\n\n private blockArrowScroll(event: any) {\n if (!this.dropdown) {\n return;\n }\n\n if (event.key ==='ArrowDown' || event.key ==='ArrowUp') {\n event.preventDefault();\n }\n }\n\n private blockScroll(event: WheelEvent | TouchEvent): void {\n if (!this.dropdown) {\n return;\n }\n\n const dropdownEl = this.dropdown.elementRef.nativeElement;\n const isInsideDropdown = this.isDescendant(dropdownEl, event.target as HTMLElement);\n\n if (isInsideDropdown) {\n const canScroll = dropdownEl.scrollHeight > dropdownEl.clientHeight;\n\n if (!canScroll) {\n event.preventDefault();\n }\n\n return;\n }\n\n event.preventDefault();\n }\n\n private isDescendant(parent: HTMLElement, child: HTMLElement | null): boolean {\n while (child !== null) {\n if (child === parent) {\n return true;\n }\n child = child.parentElement;\n }\n\n return false;\n }\n\n private attachGlobalScrollBlockers(): void {\n if (this.scrollBlockersAttached) {\n return;\n }\n\n window.addEventListener('wheel', this.wheelListener, { passive: false });\n window.addEventListener('touchmove', this.wheelListener, { passive: false });\n\n this.scrollBlockersAttached = true;\n }\n\n private detachGlobalScrollBlockers(): void {\n if (!this.scrollBlockersAttached) {\n return;\n }\n\n window.removeEventListener('wheel', this.wheelListener as EventListener);\n window.removeEventListener('touchmove', this.wheelListener as EventListener);\n\n this.scrollBlockersAttached = false;\n }\n\n}\n","@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n \n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n \n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of options.data; track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n \n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAmEa,mBAAmB,CAAA;AAc9B,IAAA,WAAA,CACU,SAAoB,EACpB,UAAsB,EACtB,eAAgC,EAAA;QAFhC,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,eAAe,GAAf,eAAe;QAfL,IAAA,CAAA,KAAK,GAAwC,IAAI;QAEjD,IAAA,CAAA,KAAK,GAAwC,IAAI;QAC9C,IAAA,CAAA,QAAQ,GAAoC,IAAI;QAC5C,IAAA,CAAA,YAAY,GAAwC,IAAI;AAKzE,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAkB;AACjD,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAQ;AAY9C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,CAAC,yDAAC;AACzB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC;QAG1B,IAAA,CAAA,eAAe,GAAG,eAAe;AAEhC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAEhC,IAAA,CAAA,kBAAkB,GAAG,KAAK;QAE1B,IAAA,C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AAA,UAAA,EAAA,IAAA,EACpB,mBAAmB,gVACnB,qBAAqB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIZ,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAjB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EAGd;wBACP,OAAO;wBACP,UAAU;wBACV,WAAW;wBACX,eAAe;wBACf,iBAAiB;wBACjB,kBAAkB;wBAClB,oBAAoB;wBACpB,mBAAmB;wBACnB,qBAAqB;AACtB,qBAAA,EAAA,QAAA,EAAA,uzMAAA,EAAA,MAAA,EAAA,CAAA,ouNAAA,CAAA,EAAA;;sBAKA,SAAS;uBAAC,OAAO;;sBAEjB,SAAS;uBAAC,OAAO;;sBACjB,SAAS;uBAAC,UAAU;;sBACpB,SAAS;uBAAC,cAAc;;sBAExB;;sBAGA;;sBACA;;sBA+WA,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;;AE9b5C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"apexara-ng-components-select.mjs","sources":["../../../../projects/apexara/ng-components/select/src/select.component.ts","../../../../projects/apexara/ng-components/select/src/select.component.html","../../../../projects/apexara/ng-components/select/apexara-ng-components-select.ts"],"sourcesContent":["import {\n Component, OnInit, ViewChild, Input,\n Output, inject, PLATFORM_ID, ElementRef,\n HostListener, EventEmitter, IterableDiffers,\n OnDestroy, AfterViewInit, SimpleChanges, IterableDiffer, signal} from '@angular/core';\nimport { NgClass, isPlatformServer } from '@angular/common';\nimport { FormGroup, FormsModule, ReactiveFormsModule, AbstractControl, TouchedChangeEvent } from '@angular/forms';\nimport { RouterLink } from '@angular/router';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\n\nimport { Subscription, debounceTime, filter, fromEvent, tap } from 'rxjs';\n\nimport { ApexChipComponent } from '@apexara/ng-components/chip';\nimport { ApexImageComponent } from '@apexara/ng-components/image';\nimport { ApexCheckboxComponent } from '@apexara/ng-components/checkbox';\n\nimport { OSService, MobileOS } from '@apexara/ng-components/services';\n\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexSelectOptions {\n label: string;\n tooltip?: string;\n data: ApexSelectData[];\n multiple?: boolean;\n counterAsValue?: boolean;\n placeholder?: string;\n helperText?: string;\n helperRoute?: string;\n prefixImg?: string;\n suffixImg?: string;\n formGroup?: FormGroup;\n searchable?: boolean;\n formControlName?: string;\n errors?: ControlErrors;\n maxDropdownHeightPx?: number; // optional hard max height in px\n // When true, the search input is rendered inside the dropdown\n // (instead of the trigger row). Intended for multi-select.\n searchInDropdown?: boolean;\n // Grouped options. When provided, supersedes `data` and renders\n // category headers. Grouped mode does not use virtual scroll.\n groups?: ApexSelectGroup[];\n}\n\nexport interface ApexSelectData {\n label: string;\n value: any;\n description?: string;\n isHover?: boolean;\n icon?: string;\n}\n\nexport interface ApexSelectGroup {\n label: string;\n data: ApexSelectData[];\n}\n\nexport interface ControlErrors {\n [x: string]: string;\n}\n\n@Component({\n selector: 'apex-select',\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.css'],\n imports: [\n NgClass,\n RouterLink,\n FormsModule,\n ScrollingModule,\n ApexChipComponent,\n ApexImageComponent,\n ApexTooltipDirective,\n ReactiveFormsModule,\n ApexCheckboxComponent,\n ]\n})\n\nexport class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {\n\n @ViewChild('input') input: ElementRef<HTMLInputElement> | null = null;\n\n @ViewChild('label') label: ElementRef<HTMLLabelElement> | null = null;\n @ViewChild('dropdown') dropdown: CdkVirtualScrollViewport | null = null;\n @ViewChild('inputWrapper') inputWrapper: ElementRef<HTMLInputElement> | null = null;\n @ViewChild('dropdownSearch') dropdownSearch: ElementRef<HTMLInputElement> | null = null;\n @ViewChild('dropdownContainer') dropdownContainer: ElementRef<HTMLElement> | null = null;\n\n @Input() options!: ApexSelectOptions;\n\n\n @Output() selectChange = new EventEmitter<ApexSelectData>();\n @Output() helperTextChange = new EventEmitter<void>();\n\n constructor(\n private osService: OSService,\n private elementRef: ElementRef,\n private iterableDiffers: IterableDiffers) {\n\n this.dataDiffer = this.iterableDiffers.find([]).create<ApexSelectData>();\n this.groupsDiffer = this.iterableDiffers.find([]).create<ApexSelectGroup>();\n\n this.handleEvents();\n }\n\n public firstDropdown = signal(0);\n public isDropdown = signal(false);\n public control!: AbstractControl;\n\n public tooltipPosition = TooltipPosition;\n\n private platformId = inject(PLATFORM_ID);\n\n private isDropdownReversed = false;\n\n private shouldPreventEvents = false;\n\n private documentKeyupValue = '';\n private documentKeyupValueResetTime = 1000;\n private documentKeyUpSubscription: Subscription | null = null;\n\n private dataDiffer!: IterableDiffer<ApexSelectData>;\n private groupsDiffer!: IterableDiffer<ApexSelectGroup>;\n\n private controlSubscription: Subscription | null = null;\n\n public filteredData = signal<ApexSelectData[]>([]);\n public filteredGroups = signal<ApexSelectGroup[]>([]);\n\n private lastSearch = '';\n\n private keyListener = (event: KeyboardEvent) => this.blockArrowScroll(event);\n private wheelListener = (event: WheelEvent | TouchEvent) => this.blockScroll(event);\n\n private scrollBlockersAttached = false;\n\n // Virtual scroll config for options list\n public optionItemSizePx = 48; // must match .dropdown .option height in CSS\n public maxVisibleOptions = 8;\n public dropdownHeightPx = signal(this.optionItemSizePx);\n\n public controlInvalid = signal(false);\n public controlValue = signal<any>(null);\n public controlDisabled = signal(false);\n\n public ngOnInit(): void {\n this.control = this.getControl()!;\n\n if (this.control) {\n this.controlValue.set(this.control.value);\n this.controlDisabled.set(this.control.disabled);\n\n const touchedSub = this.control.events\n .pipe(filter(event => event instanceof TouchedChangeEvent))\n .subscribe(() => {\n this.controlInvalid.set(this.control.touched && this.control.invalid);\n });\n\n const statusSub = this.control.statusChanges.subscribe(() => {\n this.controlInvalid.set(this.control.touched && this.control.invalid);\n this.controlDisabled.set(this.control.disabled);\n });\n\n const valueSub = this.control.valueChanges.subscribe((value) => {\n this.controlValue.set(value);\n });\n\n this.controlSubscription = touchedSub;\n this.controlSubscription.add(statusSub);\n this.controlSubscription.add(valueSub);\n }\n\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n this.documentKeyUpSubscription = fromEvent<KeyboardEvent>(this.elementRef.nativeElement, 'keydown')\n .pipe(\n tap(event => { this.keyup(event) }),\n debounceTime(this.documentKeyupValueResetTime),\n )\n .subscribe(() => { this.documentKeyupValue = '' });\n }\n\n public ngDoCheck(): void {\n const data = this.options?.data || [];\n const groups = this.options?.groups || [];\n\n const dataDiff = this.dataDiffer.diff(data);\n const groupsDiff = this.groupsDiffer.diff(groups);\n\n if (!dataDiff && !groupsDiff) {\n return;\n }\n\n this.filteredData.set([...data]);\n this.filteredGroups.set(this.cloneGroups(groups));\n\n // Sync controlValue signal and visible input when data changes.\n // The parent may have reset the control with { emitEvent: false },\n // which bypasses valueChanges — the only thing that updates controlValue.\n // Clone the value to force a new reference so the signal always fires.\n if (this.control) {\n const value = this.control.value;\n this.controlValue.set(Array.isArray(value) ? [...value] : value != null ? { ...value } : null);\n\n if (this.input) {\n this.setVisibleValue(value);\n }\n }\n }\n\n public ngAfterViewInit(): void {\n this.filteredData.set([...(this.options.data || [])]);\n this.filteredGroups.set(this.cloneGroups(this.options.groups || []));\n\n setTimeout(() => {\n if (this.options.formGroup && this.options.formControlName) {\n this.setVisibleValue(this.options.formGroup.controls[this.options.formControlName].value);\n }\n })\n\n if (this.options.searchable) {\n this.controlSubscription!.add(this.control.valueChanges.subscribe((value) => {\n this.setVisibleValue(value);\n }));\n }\n }\n\n private cloneGroups(groups: ApexSelectGroup[]): ApexSelectGroup[] {\n return groups.map(group => ({\n label: group.label,\n data: [...group.data],\n }));\n }\n\n private hasGroups(): boolean {\n return !!this.options?.groups && this.options.groups.length > 0;\n }\n\n public isSearchInDropdown(): boolean {\n return !!this.options?.searchInDropdown;\n }\n\n public getAllOptions(): ApexSelectData[] {\n if (this.hasGroups()) {\n return (this.options.groups || []).flatMap(group => group.data);\n }\n\n return this.options.data || [];\n }\n\n private getDropdownEl(): HTMLElement | null {\n if (this.dropdownContainer) {\n return this.dropdownContainer.nativeElement;\n }\n\n return this.dropdown?.elementRef.nativeElement ?? null;\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (!changes['options'] || changes['options'].firstChange) {\n return;\n }\n\n this.updateDropdownHeight();\n }\n\n public ngOnDestroy(): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n this.detachGlobalScrollBlockers();\n window.removeEventListener('keydown', this.keyListener);\n\n if (this.documentKeyUpSubscription) {\n this.documentKeyUpSubscription.unsubscribe();\n }\n\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onHelperText(): void {\n this.helperTextChange.emit();\n }\n\n public setValue(value: any): void {\n if (!this.options.multiple) {\n value = this.removeProperty(value, 'isHover');\n }\n\n this.control.setValue(value);\n this.input!.nativeElement.value = value.label ? value.label : '';\n\n this.selectChange.emit(value);\n\n if (value.value == null) {\n return;\n }\n\n setTimeout(() => {\n this.removeDropdown();\n\n if (!this.options.multiple) {\n this.lastSearch = '';\n }\n })\n }\n\n public setMultipleValue(data: any, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n const newValue = this.control.value;\n let indexOfValue = -1;\n\n for (let i = 0; i < newValue.length; i++) {\n if (newValue[i].value === data.value) {\n indexOfValue = i;\n }\n\n if (JSON.stringify(newValue[i].value) === JSON.stringify(data.value)) {\n indexOfValue = i;\n }\n }\n\n if (indexOfValue === -1) {\n newValue.push({ label: data.label, value: data.value });\n } else {\n newValue.splice(indexOfValue, 1);\n }\n\n this.lastSearch = '';\n this.input!.nativeElement.value = '';\n this.filteredData.set([...(this.options.data || [])]);\n\n if (this.hasGroups()) {\n this.filteredGroups.set(this.cloneGroups(this.options.groups || []));\n }\n\n if (this.dropdownSearch) {\n this.dropdownSearch.nativeElement.value = '';\n }\n\n this.control.setValue(newValue);\n this.selectChange.emit(newValue);\n\n if (this.isSearchInDropdown() && this.dropdownSearch) {\n setTimeout(() => this.dropdownSearch?.nativeElement.focus());\n }\n }\n\n public setVisibleValue(newValue: any | any[]): void {\n if (newValue === null) {\n this.input!.nativeElement.value = '';\n\n return;\n }\n\n if (this.isSearchInDropdown()) {\n // Chips / counter span next to the input own the selection display.\n // Keep the input empty so the placeholder can show when nothing is selected.\n this.input!.nativeElement.value = '';\n\n return;\n }\n\n if (this.options.counterAsValue) {\n if (this.options.searchable) {\n return;\n }\n\n const count = Array.isArray(newValue) ? newValue.length : 0;\n this.input!.nativeElement.value = count > 0 ? count + ' selected' : '';\n\n return;\n }\n\n let visibleValue = '';\n\n const sourceList = this.hasGroups()\n ? this.filteredGroups().flatMap(group => group.data)\n : this.filteredData();\n\n for (let data of sourceList) {\n // when newValue is object and not array\n if (data.value === newValue.value) {\n visibleValue = data.label;\n\n break;\n }\n\n if (this.options.multiple && !this.options.searchable) {\n // when newValue is array\n for (let item of newValue) {\n if (data.value === item.value) {\n visibleValue += item.label + ', ';\n\n break;\n }\n }\n }\n\n if (newValue.value) {\n // Edge case for when we use { label, value } pattern as value\n if (newValue.value.value && this.getControl()?.value.value.value === newValue.value.value) {\n visibleValue = data.label;\n\n break;\n }\n }\n }\n\n this.input!.nativeElement.value = visibleValue;\n }\n\n private updateDropdownHeight(): void {\n if (!this.isDropdown() || this.hasGroups()) {\n return;\n }\n\n setTimeout(() => {\n const count = this.filteredData().length;\n const maxRows = this.maxVisibleOptions;\n\n let next = this.optionItemSizePx;\n\n if (count > 0 && count <= maxRows && this.dropdown) {\n const options = this.dropdown.elementRef.nativeElement.querySelectorAll('.option');\n\n let total = 0;\n\n options.forEach((option: any) => {\n const height = option.getBoundingClientRect().height;\n total += isFinite(height) ? height : 0;\n });\n\n next = total;\n } else {\n const rows = Math.min(count, maxRows);\n\n next = Math.max(rows * this.optionItemSizePx, this.optionItemSizePx);\n }\n\n const maxHeight = this.options.maxDropdownHeightPx;\n\n if (maxHeight) {\n next = Math.min(next, Math.max(this.optionItemSizePx, maxHeight));\n }\n\n this.dropdownHeightPx.set(next);\n\n setTimeout(() => {\n this.dropdown?.checkViewportSize();\n }, 100)\n\n });\n }\n\n public showMultipleCount(): number {\n const value = this.controlValue();\n if (!value || !value.length) {\n return 0;\n }\n\n return value.length;\n }\n\n public isValueSelected(value: ApexSelectData): boolean {\n const controlVal = this.controlValue();\n if (value.value == null || controlVal == null) {\n return false;\n }\n\n return value.value === controlVal.value;\n }\n\n public isMultipleSelected(value: ApexSelectData): boolean {\n const controlVal = this.controlValue();\n if (!controlVal || !controlVal.length) {\n return false;\n }\n\n for (let i = 0; i < controlVal.length; i++) {\n if (value.value === controlVal[i]) {\n return true;\n }\n\n if (controlVal[i].value === value.value) {\n return true;\n }\n\n if (JSON.stringify(controlVal[i].value) === JSON.stringify(value.value)) {\n return true;\n }\n }\n\n return false;\n }\n\n public activateDropdown(): void {\n if (this.checkIfControlDisabled()) {\n return;\n }\n\n this.isDropdown.set(true);\n\n if (!this.isSearchInDropdown()) {\n this.input!.nativeElement.focus();\n }\n\n if (this.firstDropdown() === 0) {\n this.firstDropdown.update(v => v + 1);\n\n setTimeout(() => this.generateDropdownPosition(true));\n }\n\n this.attachGlobalScrollBlockers();\n this.onSearch(this.lastSearch, false);\n\n if (this.isSearchInDropdown()) {\n setTimeout(() => this.dropdownSearch?.nativeElement.focus());\n }\n }\n\n @HostListener('document:click', ['$event'])\n public deactivateControl(event: MouseEvent | KeyboardEvent): void {\n if (event instanceof KeyboardEvent) {\n this.removeDropdown();\n\n return;\n }\n\n const dropdownEl = this.getDropdownEl();\n\n if (!dropdownEl || !this.inputWrapper) {\n return;\n }\n\n const dropdownRect = dropdownEl.getBoundingClientRect();\n const inputWrapperRect = this.inputWrapper.nativeElement.getBoundingClientRect();\n\n const isClickInsideDropdown = this.isWithinBounds(event, dropdownRect);\n const isClickInsideInputWrapper = this.isWithinBounds(event, inputWrapperRect);\n\n if (isClickInsideDropdown || isClickInsideInputWrapper) {\n return;\n }\n\n this.removeDropdown();\n }\n\n public onFocusIn(): void {\n this.shouldPreventEvents = true;\n\n this.activateDropdown();\n\n setTimeout(() => {\n this.shouldPreventEvents = false;\n }, 200);\n }\n\n public onFocusOut(): void {\n this.shouldPreventEvents = true;\n\n setTimeout(() => {\n this.shouldPreventEvents = false;\n }, 200);\n\n this.removeDropdown();\n }\n\n public toggleDropdown(): void {\n if (this.shouldPreventEvents) {\n return;\n }\n\n if (this.isDropdown()) {\n this.removeDropdown();\n } else {\n this.activateDropdown();\n }\n }\n\n private generateDropdownPosition(checkRevserse: boolean = false): void {\n const dropdownEl = this.getDropdownEl();\n\n if (!dropdownEl) {\n // method will keep executing until dropdown is rendered\n setTimeout(() => this.generateDropdownPosition(true));\n\n return;\n }\n\n const elementRefRect = this.elementRef.nativeElement.getBoundingClientRect();\n\n if (this.osService.mobileOS === MobileOS.iOS) {\n elementRefRect.y += window.visualViewport!.offsetTop;\n elementRefRect.x += window.visualViewport!.offsetLeft;\n }\n\n dropdownEl.style.left = elementRefRect.x + 'px';\n dropdownEl.style.width = elementRefRect.width + 'px';\n dropdownEl.style.top = elementRefRect.y + elementRefRect.height + 'px';\n\n if (checkRevserse) {\n if (window.innerHeight < dropdownEl.getBoundingClientRect().bottom) {\n dropdownEl.style.top = 'unset';\n dropdownEl.style.bottom = window.innerHeight - elementRefRect.y + 10 + 'px';\n\n this.isDropdownReversed = true;\n }\n }\n\n if (this.isDropdownReversed) {\n dropdownEl.style.top = 'unset';\n dropdownEl.style.bottom = window.innerHeight - elementRefRect.y + 10 + 'px';\n }\n\n setTimeout(() => {\n this.updateDropdownHeight();\n }, 100);\n }\n\n public removeDropdown(): void {\n this.isDropdown.set(false);\n this.isDropdownReversed = false;\n this.firstDropdown.set(0);\n\n this.input!.nativeElement.blur();\n\n this.detachGlobalScrollBlockers();\n }\n\n public handleKeydown(event: any): void {\n if (event.code === 'Backspace') {\n this.onSearch('', true);\n }\n }\n\n public preventFocusChange(event: MouseEvent): void {\n if (this.input?.nativeElement === document.activeElement) {\n event.preventDefault();\n\n return;\n }\n }\n\n public onSearch(value: string, shouldResetHover?: boolean): void {\n this.lastSearch = value;\n\n if (this.hasGroups()) {\n this.filterGroups(value, shouldResetHover);\n this.updateDropdownHeight();\n\n return;\n }\n\n if (!value) {\n // Reset to original data if input is empty\n this.filteredData.set([...this.options.data]);\n\n this.updateDropdownHeight();\n\n return;\n }\n\n const searchTerm = value.toLowerCase();\n\n const filtered = this.options.data.filter(item =>\n item.label.toLowerCase().includes(searchTerm)\n );\n\n if (filtered.length && shouldResetHover) {\n for (let i = 0; i < filtered.length; i++) {\n filtered[i].isHover = false;\n }\n\n filtered[0].isHover = true;\n }\n\n this.filteredData.set(filtered);\n\n this.updateDropdownHeight();\n }\n\n private filterGroups(value: string, shouldResetHover?: boolean): void {\n const sourceGroups = this.options.groups || [];\n\n if (!value) {\n this.filteredGroups.set(this.cloneGroups(sourceGroups));\n\n return;\n }\n\n const searchTerm = value.toLowerCase();\n\n const result: ApexSelectGroup[] = [];\n\n for (const group of sourceGroups) {\n const matches = group.data.filter(item =>\n item.label.toLowerCase().includes(searchTerm)\n );\n\n if (matches.length) {\n result.push({ label: group.label, data: matches });\n }\n }\n\n if (shouldResetHover) {\n let firstHoverSet = false;\n\n for (const group of result) {\n for (const item of group.data) {\n if (!firstHoverSet) {\n item.isHover = true;\n firstHoverSet = true;\n } else {\n item.isHover = false;\n }\n }\n }\n }\n\n this.filteredGroups.set(result);\n }\n\n public getPlaceholder(): string {\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n const controlVal = this.controlValue();\n\n let placeholder = '';\n\n if (options.placeholder) {\n placeholder = options.placeholder;\n }\n\n if (formGroup && formControlName && options.errors && this.checkIfControlInvalid()) {\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n placeholder = options.errors[error];\n }\n }\n }\n\n if ((controlVal instanceof Array && controlVal.length) || (controlVal && !(controlVal instanceof Array))) {\n return '';\n }\n\n return placeholder;\n }\n\n public checkIfControlInvalid(): boolean {\n return this.controlInvalid();\n }\n\n public checkIfControlDisabled(): boolean {\n return this.controlDisabled();\n }\n\n private getControl(): AbstractControl | null {\n if (this.options && this.options.formGroup && this.options.formControlName) {\n return this.options.formGroup.controls[this.options.formControlName];\n }\n\n return null;\n }\n\n private isWithinBounds(event: MouseEvent, rect: DOMRect): boolean {\n return (\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom\n );\n }\n\n private handleEvents(): void {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n window.addEventListener('keydown', this.keyListener);\n }\n\n private keyup(event: KeyboardEvent): void {\n const activeEl = document.activeElement;\n const triggerInputEl = this.input?.nativeElement ?? null;\n const searchInputEl = this.dropdownSearch?.nativeElement ?? null;\n const isTriggerFocused = activeEl === triggerInputEl;\n const isDropdownSearchFocused = this.isSearchInDropdown() && activeEl === searchInputEl;\n\n if (!isTriggerFocused && !isDropdownSearchFocused) {\n this.deactivateControl(event);\n\n return;\n }\n\n if (isDropdownSearchFocused) {\n switch (event.code) {\n case 'Enter':\n this.documentEnterKeyup(event);\n\n return;\n case 'Escape':\n this.deactivateControl(event);\n\n return;\n case 'ArrowDown':\n this.documentArrowsKeyup(true);\n\n return;\n case 'ArrowUp':\n this.documentArrowsKeyup(false);\n\n return;\n }\n\n // Typing is handled by the input's (input) event, not here.\n return;\n }\n\n switch (event.code) {\n case 'Enter':\n this.documentEnterKeyup(event);\n\n return;\n case 'Space':\n if (!this.options.searchable) {\n this.documentEnterKeyup(event);\n }\n\n return;\n case 'Backspace':\n if (!this.options.multiple && this.options.searchable && this.control.value.value != null) {\n this.onSearch('', false);\n\n this.setValue('');\n }\n\n return;\n case 'Escape':\n this.deactivateControl(event);\n\n return;\n case 'ArrowDown':\n this.documentArrowsKeyup(true);\n\n return;\n case 'ArrowUp':\n this.documentArrowsKeyup(false);\n\n return;\n }\n\n this.documentKeyup(event);\n }\n\n private documentEnterKeyup(event: KeyboardEvent): void {\n const data = this.getNavigableOptions();\n for (let i = 0; i < data.length; i++) {\n if (data[i].isHover) {\n switch(this.options.multiple) {\n case true:\n this.setMultipleValue(data[i], event);\n\n this.updateDropdownHeight();\n\n return;\n default:\n this.setValue(data[i]);\n\n this.removeDropdown();\n }\n }\n }\n }\n\n private documentArrowsKeyup(isDownArrow: boolean): void {\n const data = this.getNavigableOptions();\n const dataLength = data.length;\n\n if (!dataLength) {\n return;\n }\n\n const controlValue = this.control.getRawValue();\n const isControlValue = controlValue && controlValue !== '';\n\n let hoverIndex: number | null = null;\n let valueIndex: number | null = null;\n\n for (let i = 0; i < dataLength; i++) {\n if (data[i].isHover) {\n hoverIndex = i;\n }\n\n if (isControlValue && data[i].value === controlValue) {\n valueIndex = i;\n }\n\n data[i].isHover = false;\n }\n\n const currentIndex = hoverIndex ? hoverIndex : valueIndex ? valueIndex : 0;\n let newIndex = isDownArrow ? currentIndex + 1 : currentIndex - 1;\n\n newIndex = newIndex < 0 ? 0 : newIndex;\n newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;\n\n data[newIndex].isHover = true;\n\n if (this.hasGroups()) {\n this.filteredGroups.set([...this.filteredGroups()]);\n this.scrollGroupedOptionIntoView(newIndex);\n } else {\n this.filteredData.set([...this.filteredData()]);\n this.dropdown?.scrollToIndex(newIndex, 'auto');\n }\n }\n\n public getNavigableOptions(): ApexSelectData[] {\n if (this.hasGroups()) {\n return this.filteredGroups().flatMap(group => group.data);\n }\n\n return this.filteredData();\n }\n\n private scrollGroupedOptionIntoView(index: number): void {\n if (!this.dropdownContainer) {\n return;\n }\n\n const optionEls = this.dropdownContainer.nativeElement.querySelectorAll('.option');\n const target = optionEls[index] as HTMLElement | undefined;\n\n target?.scrollIntoView({ block: 'nearest' });\n }\n\n private documentKeyup(event: KeyboardEvent): void {\n if (!this.isDropdown() || this.options.searchable) {\n return;\n }\n\n const data = this.getNavigableOptions();\n\n for (let i = 0; i < data.length; i++) {\n data[i].isHover = false;\n }\n\n this.documentKeyupValue = this.documentKeyupValue + event.key.toLowerCase();\n\n let newIndex: number | null = null;\n\n for (let i = 0; i < data.length; i++) {\n const subLabel = data[i].label.substring(0, this.documentKeyupValue.length).toLowerCase();\n\n if (subLabel === this.documentKeyupValue) {\n newIndex = i;\n\n break;\n }\n\n data[i].isHover = false;\n }\n\n if (newIndex !== null) {\n data[newIndex].isHover = true;\n\n if (this.hasGroups()) {\n this.filteredGroups.set([...this.filteredGroups()]);\n this.scrollGroupedOptionIntoView(newIndex);\n } else {\n this.dropdown?.scrollToIndex(newIndex, 'auto');\n }\n }\n\n if (!this.hasGroups()) {\n this.filteredData.set([...this.filteredData()]);\n }\n }\n\n private removeProperty(obj: ApexSelectData, propertyName: keyof ApexSelectData): Partial<ApexSelectData> {\n let { [propertyName]: removedProperty, ...data } = obj;\n return data;\n }\n\n private blockArrowScroll(event: any) {\n if (!this.dropdown) {\n return;\n }\n\n if (event.key ==='ArrowDown' || event.key ==='ArrowUp') {\n event.preventDefault();\n }\n }\n\n private blockScroll(event: WheelEvent | TouchEvent): void {\n const dropdownEl = this.getDropdownEl();\n\n if (!dropdownEl) {\n return;\n }\n\n const isInsideDropdown = this.isDescendant(dropdownEl, event.target as HTMLElement);\n\n if (isInsideDropdown) {\n const canScroll = dropdownEl.scrollHeight > dropdownEl.clientHeight;\n\n if (!canScroll) {\n event.preventDefault();\n }\n\n return;\n }\n\n event.preventDefault();\n }\n\n private isDescendant(parent: HTMLElement, child: HTMLElement | null): boolean {\n while (child !== null) {\n if (child === parent) {\n return true;\n }\n child = child.parentElement;\n }\n\n return false;\n }\n\n private attachGlobalScrollBlockers(): void {\n if (this.scrollBlockersAttached) {\n return;\n }\n\n window.addEventListener('wheel', this.wheelListener, { passive: false });\n window.addEventListener('touchmove', this.wheelListener, { passive: false });\n\n this.scrollBlockersAttached = true;\n }\n\n private detachGlobalScrollBlockers(): void {\n if (!this.scrollBlockersAttached) {\n return;\n }\n\n window.removeEventListener('wheel', this.wheelListener as EventListener);\n window.removeEventListener('touchmove', this.wheelListener as EventListener);\n\n this.scrollBlockersAttached = false;\n }\n\n}\n","@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n <div #inputWrapper class=\"input-field-wrapper\" (click)=\"toggleDropdown()\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'invalid': checkIfControlInvalid(), 'disabled': checkIfControlDisabled() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"'Select prefix icon'\"></apex-img>\n }\n\n @if (isSearchInDropdown() && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (!isSearchInDropdown() && options.searchable && options.multiple && this.showMultipleCount() > 0) {\n @if (options.counterAsValue) {\n <span class=\"multiple-count\">\n {{ this.showMultipleCount() }} selected\n </span>\n } @else {\n <div class=\"chips\">\n @for (data of getAllOptions(); track $index) {\n @if (isMultipleSelected(data)) {\n <apex-chip [closeIcon]=\"true\" (closeChange)=\"setMultipleValue(data)\">{{ data.label }}</apex-chip>\n }\n }\n </div>\n }\n }\n\n @if (isSearchInDropdown()) {\n <!-- Hidden input owns the form binding; the visible one is a placeholder slot. -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"/>\n } @else if (options.searchable) {\n <!-- used for formControl data binding and reactivness -->\n <input #hiddenInput\n class=\"hidden\"\n [formControlName]=\"options.formControlName\">\n\n <!-- used for searching and data displaying -->\n <input #input\n [placeholder]=\"getPlaceholder()\"\n [readOnly]=\"!options.searchable\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n [disabled]=\"checkIfControlDisabled()\"\n (keydown)=\"handleKeydown($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (input)=\"onSearch(input.value, true)\"\n autocorrect=\"off\"\n spellcheck=\"false\">\n } @else {\n <input #input\n readonly\n [disabled]=\"checkIfControlDisabled()\"\n [placeholder]=\"getPlaceholder()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n [formControlName]=\"options.formControlName\"\n [ngClass]=\"{ 'no-icon': !options.prefixImg }\"\n (ngModelChange)=\"setVisibleValue($event)\"/>\n }\n\n <div class=\"arrow-wrapper\">\n <div class=\"arrow\" [class]=\"{ checked: this.isDropdown() }\"></div>\n </div>\n </div>\n\n @if (isDropdown()) {\n @if (isSearchInDropdown()) {\n <div #dropdownContainer class=\"dropdown dropdown-wrapper\">\n <div class=\"dropdown-search\">\n <svg class=\"dropdown-search-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"7\" cy=\"7\" r=\"5\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n <path d=\"M11 11L14 14\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n <input #dropdownSearch\n type=\"text\"\n placeholder=\"Search\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n (input)=\"onSearch(dropdownSearch.value, true)\"\n (keydown)=\"handleKeydown($event)\"/>\n </div>\n\n @if (options.groups && options.groups.length > 0) {\n <div class=\"dropdown-body\">\n @for (group of filteredGroups(); track group.label) {\n <div class=\"group-header\">{{ group.label }}</div>\n @for (data of group.data; track data.value) {\n <div class=\"option\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n }\n }\n\n @if (filteredGroups().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown-body dropdown-body-virtual\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData();\"\n [ngClass]=\"{ selected: !options.multiple ? isValueSelected(data) : false, preselected: data.isHover, checkbox: options.multiple }\"\n (click)=\"options.multiple ? setMultipleValue(data, $event) : setValue(data)\">\n @if (options.multiple) {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n <apex-checkbox [checked]=\"isMultipleSelected(data)\">\n <div class=\"multiple-checkbox-container\">\n <span>{{ data.label }}</span>\n @if (data.description) { <span>{{ data.description }}</span> }\n </div>\n </apex-checkbox>\n } @else {\n @if (data.icon) {\n <div class=\"option-icon\">\n <apex-img [src]=\"'assets/img/' + data.icon\" [alt]=\"'Option icon.'\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n @if (filteredData().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n </cdk-virtual-scroll-viewport>\n }\n }\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MA8Ea,mBAAmB,CAAA;AAgB9B,IAAA,WAAA,CACU,SAAoB,EACpB,UAAsB,EACtB,eAAgC,EAAA;QAFhC,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,eAAe,GAAf,eAAe;QAjBL,IAAA,CAAA,KAAK,GAAwC,IAAI;QAEjD,IAAA,CAAA,KAAK,GAAwC,IAAI;QAC9C,IAAA,CAAA,QAAQ,GAAoC,IAAI;QAC5C,IAAA,CAAA,YAAY,GAAwC,IAAI;QACtD,IAAA,CAAA,cAAc,GAAwC,IAAI;QACvD,IAAA,CAAA,iBAAiB,GAAmC,IAAI;AAK9E,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAkB;AACjD,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAQ;AAa9C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,CAAC,yDAAC;AACzB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC;QAG1B,IAAA,CAAA,eAAe,GAAG,eAAe;AAEhC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAEhC,IAAA,CAAA,kBAAkB,GAAG,KAAK;QAE1B,IAAA,CAAA,mBAAmB,GAAG,KAAK;QAE3B,IAAA,CAAA,kBAAkB,GAAG,EAAE;QACvB,IAAA,CAAA,2BAA2B,GAAG,IAAI;QAClC,IAAA,CAAA,yBAAyB,GAAwB,IAAI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AAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAClB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACpB,mBAAmB,gVACnB,qBAAqB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIZ,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAjB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EAGd;wBACP,OAAO;wBACP,UAAU;wBACV,WAAW;wBACX,eAAe;wBACf,iBAAiB;wBACjB,kBAAkB;wBAClB,oBAAoB;wBACpB,mBAAmB;wBACnB,qBAAqB;AACtB,qBAAA,EAAA,QAAA,EAAA,y/bAAA,EAAA,MAAA,EAAA,CAAA,84PAAA,CAAA,EAAA;;sBAKA,SAAS;uBAAC,OAAO;;sBAEjB,SAAS;uBAAC,OAAO;;sBACjB,SAAS;uBAAC,UAAU;;sBACpB,SAAS;uBAAC,cAAc;;sBACxB,SAAS;uBAAC,gBAAgB;;sBAC1B,SAAS;uBAAC,mBAAmB;;sBAE7B;;sBAGA;;sBACA;;sBAqbA,YAAY;uBAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC;;;AEjhB5C;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -21,6 +21,8 @@ interface ApexSelectOptions {
|
|
|
21
21
|
formControlName?: string;
|
|
22
22
|
errors?: ControlErrors;
|
|
23
23
|
maxDropdownHeightPx?: number;
|
|
24
|
+
searchInDropdown?: boolean;
|
|
25
|
+
groups?: ApexSelectGroup[];
|
|
24
26
|
}
|
|
25
27
|
interface ApexSelectData {
|
|
26
28
|
label: string;
|
|
@@ -29,6 +31,10 @@ interface ApexSelectData {
|
|
|
29
31
|
isHover?: boolean;
|
|
30
32
|
icon?: string;
|
|
31
33
|
}
|
|
34
|
+
interface ApexSelectGroup {
|
|
35
|
+
label: string;
|
|
36
|
+
data: ApexSelectData[];
|
|
37
|
+
}
|
|
32
38
|
interface ControlErrors {
|
|
33
39
|
[x: string]: string;
|
|
34
40
|
}
|
|
@@ -40,6 +46,8 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
40
46
|
label: ElementRef<HTMLLabelElement> | null;
|
|
41
47
|
dropdown: CdkVirtualScrollViewport | null;
|
|
42
48
|
inputWrapper: ElementRef<HTMLInputElement> | null;
|
|
49
|
+
dropdownSearch: ElementRef<HTMLInputElement> | null;
|
|
50
|
+
dropdownContainer: ElementRef<HTMLElement> | null;
|
|
43
51
|
options: ApexSelectOptions;
|
|
44
52
|
selectChange: EventEmitter<ApexSelectData>;
|
|
45
53
|
helperTextChange: EventEmitter<void>;
|
|
@@ -55,8 +63,10 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
55
63
|
private documentKeyupValueResetTime;
|
|
56
64
|
private documentKeyUpSubscription;
|
|
57
65
|
private dataDiffer;
|
|
66
|
+
private groupsDiffer;
|
|
58
67
|
private controlSubscription;
|
|
59
68
|
filteredData: _angular_core.WritableSignal<ApexSelectData[]>;
|
|
69
|
+
filteredGroups: _angular_core.WritableSignal<ApexSelectGroup[]>;
|
|
60
70
|
private lastSearch;
|
|
61
71
|
private keyListener;
|
|
62
72
|
private wheelListener;
|
|
@@ -70,6 +80,11 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
70
80
|
ngOnInit(): void;
|
|
71
81
|
ngDoCheck(): void;
|
|
72
82
|
ngAfterViewInit(): void;
|
|
83
|
+
private cloneGroups;
|
|
84
|
+
private hasGroups;
|
|
85
|
+
isSearchInDropdown(): boolean;
|
|
86
|
+
getAllOptions(): ApexSelectData[];
|
|
87
|
+
private getDropdownEl;
|
|
73
88
|
ngOnChanges(changes: SimpleChanges): void;
|
|
74
89
|
ngOnDestroy(): void;
|
|
75
90
|
onHelperText(): void;
|
|
@@ -90,6 +105,7 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
90
105
|
handleKeydown(event: any): void;
|
|
91
106
|
preventFocusChange(event: MouseEvent): void;
|
|
92
107
|
onSearch(value: string, shouldResetHover?: boolean): void;
|
|
108
|
+
private filterGroups;
|
|
93
109
|
getPlaceholder(): string;
|
|
94
110
|
checkIfControlInvalid(): boolean;
|
|
95
111
|
checkIfControlDisabled(): boolean;
|
|
@@ -99,6 +115,8 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
99
115
|
private keyup;
|
|
100
116
|
private documentEnterKeyup;
|
|
101
117
|
private documentArrowsKeyup;
|
|
118
|
+
getNavigableOptions(): ApexSelectData[];
|
|
119
|
+
private scrollGroupedOptionIntoView;
|
|
102
120
|
private documentKeyup;
|
|
103
121
|
private removeProperty;
|
|
104
122
|
private blockArrowScroll;
|
|
@@ -111,4 +129,4 @@ declare class ApexSelectComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
111
129
|
}
|
|
112
130
|
|
|
113
131
|
export { ApexSelectComponent };
|
|
114
|
-
export type { ApexSelectData, ApexSelectOptions, ControlErrors };
|
|
132
|
+
export type { ApexSelectData, ApexSelectGroup, ApexSelectOptions, ControlErrors };
|