@apexara/ng-components 1.0.6-test.6 → 1.0.6
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 +103 -0
- package/fesm2022/apexara-ng-components-button.mjs +15 -3
- package/fesm2022/apexara-ng-components-button.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-chip.mjs +1 -1
- package/fesm2022/apexara-ng-components-chip.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-datepicker.mjs +1 -1
- package/fesm2022/apexara-ng-components-datepicker.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-dialog.mjs +26 -3
- package/fesm2022/apexara-ng-components-dialog.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-drawer.mjs +26 -7
- package/fesm2022/apexara-ng-components-drawer.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-expander.mjs +5 -2
- package/fesm2022/apexara-ng-components-expander.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-filter-pill.mjs +58 -0
- package/fesm2022/apexara-ng-components-filter-pill.mjs.map +1 -0
- package/fesm2022/apexara-ng-components-image.mjs +15 -5
- package/fesm2022/apexara-ng-components-image.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-input.mjs +30 -7
- package/fesm2022/apexara-ng-components-input.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-more-options.mjs +1 -1
- package/fesm2022/apexara-ng-components-more-options.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-select.mjs +440 -48
- package/fesm2022/apexara-ng-components-select.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-services.mjs +6 -0
- package/fesm2022/apexara-ng-components-services.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-snackbar.mjs +2 -2
- package/fesm2022/apexara-ng-components-snackbar.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-table.mjs +154 -2
- package/fesm2022/apexara-ng-components-table.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-textarea.mjs +10 -2
- package/fesm2022/apexara-ng-components-textarea.mjs.map +1 -1
- package/package.json +5 -1
- package/types/apexara-ng-components-button.d.ts +3 -2
- package/types/apexara-ng-components-dialog.d.ts +6 -1
- package/types/apexara-ng-components-drawer.d.ts +10 -2
- package/types/apexara-ng-components-expander.d.ts +2 -0
- package/types/apexara-ng-components-filter-pill.d.ts +30 -0
- package/types/apexara-ng-components-image.d.ts +2 -1
- package/types/apexara-ng-components-input.d.ts +14 -2
- package/types/apexara-ng-components-select.d.ts +50 -2
- package/types/apexara-ng-components-services.d.ts +1 -0
- package/types/apexara-ng-components-table.d.ts +36 -3
- package/types/apexara-ng-components-textarea.d.ts +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, signal, inject, PLATFORM_ID, HostListener, Output, Input, ViewChild, Component } from '@angular/core';
|
|
3
|
-
import { isPlatformServer, NgClass } from '@angular/common';
|
|
2
|
+
import { EventEmitter, signal, inject, PLATFORM_ID, computed, HostListener, Output, Input, ViewChild, Component } from '@angular/core';
|
|
3
|
+
import { isPlatformServer, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import * as i2 from '@angular/forms';
|
|
5
5
|
import { TouchedChangeEvent, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import { RouterLink } from '@angular/router';
|
|
@@ -14,7 +14,38 @@ import * as i1 from '@apexara/ng-components/services';
|
|
|
14
14
|
import { MobileOS } from '@apexara/ng-components/services';
|
|
15
15
|
import { TooltipPosition, ApexTooltipDirective } from '@apexara/ng-components/tooltip';
|
|
16
16
|
|
|
17
|
+
// Trigger appearance. Default is the standard single-line trigger; Inset moves the
|
|
18
|
+
// field label inside the trigger, stacks it above the value, and swaps the caret for
|
|
19
|
+
// an inline clear (×). Add a new appearance by extending this enum, then giving it its
|
|
20
|
+
// own predicate + overlay block + CSS namespace — existing variants stay closed.
|
|
21
|
+
var ApexSelectVariant;
|
|
22
|
+
(function (ApexSelectVariant) {
|
|
23
|
+
ApexSelectVariant["Default"] = "default";
|
|
24
|
+
ApexSelectVariant["Inset"] = "inset";
|
|
25
|
+
})(ApexSelectVariant || (ApexSelectVariant = {}));
|
|
17
26
|
class ApexSelectComponent {
|
|
27
|
+
static { this.nextA11yId = 0; }
|
|
28
|
+
// Accessible-name fallback chain: explicit ariaLabel → visible label → placeholder.
|
|
29
|
+
get ariaLabelValue() {
|
|
30
|
+
return this.options?.ariaLabel ?? (this.options?.label || this.options?.placeholder || null);
|
|
31
|
+
}
|
|
32
|
+
optionId(index) {
|
|
33
|
+
return `${this.listboxId}-opt-${index}`;
|
|
34
|
+
}
|
|
35
|
+
// Flat index of an option across groups, so grouped options share the same
|
|
36
|
+
// id scheme as the virtual-scrolled flat list.
|
|
37
|
+
flatIndexOf(data) {
|
|
38
|
+
return this.getNavigableOptions().indexOf(data);
|
|
39
|
+
}
|
|
40
|
+
// The keyboard-highlighted option's id, exposed on the trigger as
|
|
41
|
+
// aria-activedescendant so AT tracks arrow-key navigation.
|
|
42
|
+
activeOptionId() {
|
|
43
|
+
if (!this.isDropdown()) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const index = this.getNavigableOptions().findIndex(option => option.isHover);
|
|
47
|
+
return index >= 0 ? this.optionId(index) : null;
|
|
48
|
+
}
|
|
18
49
|
constructor(osService, elementRef, iterableDiffers) {
|
|
19
50
|
this.osService = osService;
|
|
20
51
|
this.elementRef = elementRef;
|
|
@@ -23,6 +54,14 @@ class ApexSelectComponent {
|
|
|
23
54
|
this.label = null;
|
|
24
55
|
this.dropdown = null;
|
|
25
56
|
this.inputWrapper = null;
|
|
57
|
+
this.dropdownSearch = null;
|
|
58
|
+
this.dropdownContainer = null;
|
|
59
|
+
// Exposes the variant enum to the template (mirrors TableColumnType on apex-table).
|
|
60
|
+
this.Variant = ApexSelectVariant;
|
|
61
|
+
// Ids wiring the APG combobox pattern: trigger (combobox) ↔ dropdown
|
|
62
|
+
// (listbox) ↔ options, all referenced via aria-controls/activedescendant.
|
|
63
|
+
this.selectA11yId = `apex-select-${ApexSelectComponent.nextA11yId++}`;
|
|
64
|
+
this.listboxId = `${this.selectA11yId}-listbox`;
|
|
26
65
|
this.selectChange = new EventEmitter();
|
|
27
66
|
this.helperTextChange = new EventEmitter();
|
|
28
67
|
this.firstDropdown = signal(0, ...(ngDevMode ? [{ debugName: "firstDropdown" }] : []));
|
|
@@ -36,6 +75,26 @@ class ApexSelectComponent {
|
|
|
36
75
|
this.documentKeyUpSubscription = null;
|
|
37
76
|
this.controlSubscription = null;
|
|
38
77
|
this.filteredData = signal([], ...(ngDevMode ? [{ debugName: "filteredData" }] : []));
|
|
78
|
+
this.filteredGroups = signal([], ...(ngDevMode ? [{ debugName: "filteredGroups" }] : []));
|
|
79
|
+
// The groups split into `dropdownColumns` side-by-side lists (one list when the option is unset or
|
|
80
|
+
// 1). Each group stays whole in one column; groups are handed to the currently-shortest column so
|
|
81
|
+
// the columns end up roughly equal height. The template lays these out as flex columns that scroll
|
|
82
|
+
// together, so a capped, columned menu never clips.
|
|
83
|
+
this.groupColumns = computed(() => {
|
|
84
|
+
const columnCount = this.options?.dropdownColumns ?? 1;
|
|
85
|
+
const groups = this.filteredGroups();
|
|
86
|
+
if (columnCount <= 1) {
|
|
87
|
+
return [groups];
|
|
88
|
+
}
|
|
89
|
+
const columns = Array.from({ length: columnCount }, () => []);
|
|
90
|
+
const heights = new Array(columnCount).fill(0);
|
|
91
|
+
for (const group of groups) {
|
|
92
|
+
const shortest = heights.indexOf(Math.min(...heights));
|
|
93
|
+
columns[shortest].push(group);
|
|
94
|
+
heights[shortest] += group.data.length + 1; // + 1 for the group header row
|
|
95
|
+
}
|
|
96
|
+
return columns;
|
|
97
|
+
}, ...(ngDevMode ? [{ debugName: "groupColumns" }] : []));
|
|
39
98
|
this.lastSearch = '';
|
|
40
99
|
this.keyListener = (event) => this.blockArrowScroll(event);
|
|
41
100
|
this.wheelListener = (event) => this.blockScroll(event);
|
|
@@ -48,6 +107,7 @@ class ApexSelectComponent {
|
|
|
48
107
|
this.controlValue = signal(null, ...(ngDevMode ? [{ debugName: "controlValue" }] : []));
|
|
49
108
|
this.controlDisabled = signal(false, ...(ngDevMode ? [{ debugName: "controlDisabled" }] : []));
|
|
50
109
|
this.dataDiffer = this.iterableDiffers.find([]).create();
|
|
110
|
+
this.groupsDiffer = this.iterableDiffers.find([]).create();
|
|
51
111
|
this.handleEvents();
|
|
52
112
|
}
|
|
53
113
|
ngOnInit() {
|
|
@@ -80,11 +140,14 @@ class ApexSelectComponent {
|
|
|
80
140
|
}
|
|
81
141
|
ngDoCheck() {
|
|
82
142
|
const data = this.options?.data || [];
|
|
83
|
-
const
|
|
84
|
-
|
|
143
|
+
const groups = this.options?.groups || [];
|
|
144
|
+
const dataDiff = this.dataDiffer.diff(data);
|
|
145
|
+
const groupsDiff = this.groupsDiffer.diff(groups);
|
|
146
|
+
if (!dataDiff && !groupsDiff) {
|
|
85
147
|
return;
|
|
86
148
|
}
|
|
87
149
|
this.filteredData.set([...data]);
|
|
150
|
+
this.filteredGroups.set(this.cloneGroups(groups));
|
|
88
151
|
// Sync controlValue signal and visible input when data changes.
|
|
89
152
|
// The parent may have reset the control with { emitEvent: false },
|
|
90
153
|
// which bypasses valueChanges — the only thing that updates controlValue.
|
|
@@ -98,7 +161,8 @@ class ApexSelectComponent {
|
|
|
98
161
|
}
|
|
99
162
|
}
|
|
100
163
|
ngAfterViewInit() {
|
|
101
|
-
this.filteredData.set([...this.options.data]);
|
|
164
|
+
this.filteredData.set([...(this.options.data || [])]);
|
|
165
|
+
this.filteredGroups.set(this.cloneGroups(this.options.groups || []));
|
|
102
166
|
setTimeout(() => {
|
|
103
167
|
if (this.options.formGroup && this.options.formControlName) {
|
|
104
168
|
this.setVisibleValue(this.options.formGroup.controls[this.options.formControlName].value);
|
|
@@ -110,6 +174,92 @@ class ApexSelectComponent {
|
|
|
110
174
|
}));
|
|
111
175
|
}
|
|
112
176
|
}
|
|
177
|
+
cloneGroups(groups) {
|
|
178
|
+
return groups.map(group => ({
|
|
179
|
+
label: group.label,
|
|
180
|
+
data: [...group.data],
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
hasGroups() {
|
|
184
|
+
return !!this.options?.groups && this.options.groups.length > 0;
|
|
185
|
+
}
|
|
186
|
+
isSearchInDropdown() {
|
|
187
|
+
return !!this.options?.searchInDropdown;
|
|
188
|
+
}
|
|
189
|
+
// The active trigger appearance; defaults to Default when unset. Single source
|
|
190
|
+
// for every variant check + the wrapper's variant class.
|
|
191
|
+
variant() {
|
|
192
|
+
return this.options?.variant ?? ApexSelectVariant.Default;
|
|
193
|
+
}
|
|
194
|
+
isInsetLabel() {
|
|
195
|
+
return this.variant() === ApexSelectVariant.Inset;
|
|
196
|
+
}
|
|
197
|
+
// The selected option's label for the inset-variant overlay. Reads the reactive
|
|
198
|
+
// controlValue (an { label, value } object, or a raw value) and resolves it to a
|
|
199
|
+
// label via the option list. Empty when nothing is selected.
|
|
200
|
+
insetValueLabel() {
|
|
201
|
+
const controlVal = this.controlValue();
|
|
202
|
+
if (controlVal == null || controlVal === '') {
|
|
203
|
+
return '';
|
|
204
|
+
}
|
|
205
|
+
// Multiple selects show a count, matching the counterAsValue trigger.
|
|
206
|
+
if (this.options.multiple) {
|
|
207
|
+
const count = Array.isArray(controlVal) ? controlVal.length : 0;
|
|
208
|
+
return count ? `${count} selected` : '';
|
|
209
|
+
}
|
|
210
|
+
if (typeof controlVal === 'object' && controlVal.label) {
|
|
211
|
+
return controlVal.label;
|
|
212
|
+
}
|
|
213
|
+
return this.getAllOptions().find(option => option.value === controlVal)?.label ?? '';
|
|
214
|
+
}
|
|
215
|
+
// The inset variant only shows its stacked caption + value + clear once a value
|
|
216
|
+
// is set; empty, it renders the normal placeholder + caret.
|
|
217
|
+
hasInsetValue() {
|
|
218
|
+
return this.isInsetLabel() && !!this.insetValueLabel();
|
|
219
|
+
}
|
|
220
|
+
// Inline clear (×) on the inset trigger. Stops the click from toggling the
|
|
221
|
+
// dropdown, then resets the bound control to null so the placeholder returns.
|
|
222
|
+
clearInsetValue(event) {
|
|
223
|
+
event.stopPropagation();
|
|
224
|
+
// A multiple control holds an array — clearing it to null would break the next toggle, which
|
|
225
|
+
// reads `.length`. Reset to an empty array there, and to null for a single select.
|
|
226
|
+
const cleared = this.options.multiple ? [] : null;
|
|
227
|
+
this.control.setValue(cleared);
|
|
228
|
+
this.controlValue.set(cleared);
|
|
229
|
+
if (this.input) {
|
|
230
|
+
this.input.nativeElement.value = '';
|
|
231
|
+
}
|
|
232
|
+
this.selectChange.emit(cleared);
|
|
233
|
+
}
|
|
234
|
+
getAllOptions() {
|
|
235
|
+
if (this.hasGroups()) {
|
|
236
|
+
return (this.options.groups || []).flatMap(group => group.data);
|
|
237
|
+
}
|
|
238
|
+
return this.options.data || [];
|
|
239
|
+
}
|
|
240
|
+
// Whether every option is currently selected — drives the Select All master's ticked state.
|
|
241
|
+
isAllSelected() {
|
|
242
|
+
const all = this.getAllOptions();
|
|
243
|
+
return all.length > 0 && all.every(option => this.isMultipleSelected(option));
|
|
244
|
+
}
|
|
245
|
+
// Select All toggles the whole set: clear it when everything is already picked, otherwise
|
|
246
|
+
// select every option. Mirrors setMultipleValue's stored shape ({ label, value } only).
|
|
247
|
+
toggleSelectAll(event) {
|
|
248
|
+
if (event) {
|
|
249
|
+
event.preventDefault();
|
|
250
|
+
}
|
|
251
|
+
const next = this.isAllSelected()
|
|
252
|
+
? []
|
|
253
|
+
: this.getAllOptions().map(option => ({ label: option.label, value: option.value }));
|
|
254
|
+
this.control.setValue(next);
|
|
255
|
+
this.selectChange.emit(next);
|
|
256
|
+
}
|
|
257
|
+
getDropdownEl() {
|
|
258
|
+
if (this.dropdownContainer) {
|
|
259
|
+
return this.dropdownContainer.nativeElement;
|
|
260
|
+
}
|
|
261
|
+
return this.dropdown?.elementRef.nativeElement ?? null;
|
|
262
|
+
}
|
|
113
263
|
ngOnChanges(changes) {
|
|
114
264
|
if (!changes['options'] || changes['options'].firstChange) {
|
|
115
265
|
return;
|
|
@@ -171,15 +321,30 @@ class ApexSelectComponent {
|
|
|
171
321
|
}
|
|
172
322
|
this.lastSearch = '';
|
|
173
323
|
this.input.nativeElement.value = '';
|
|
174
|
-
this.filteredData.set([...this.options.data]);
|
|
324
|
+
this.filteredData.set([...(this.options.data || [])]);
|
|
325
|
+
if (this.hasGroups()) {
|
|
326
|
+
this.filteredGroups.set(this.cloneGroups(this.options.groups || []));
|
|
327
|
+
}
|
|
328
|
+
if (this.dropdownSearch) {
|
|
329
|
+
this.dropdownSearch.nativeElement.value = '';
|
|
330
|
+
}
|
|
175
331
|
this.control.setValue(newValue);
|
|
176
332
|
this.selectChange.emit(newValue);
|
|
333
|
+
if (this.isSearchInDropdown() && this.dropdownSearch) {
|
|
334
|
+
setTimeout(() => this.dropdownSearch?.nativeElement.focus());
|
|
335
|
+
}
|
|
177
336
|
}
|
|
178
337
|
setVisibleValue(newValue) {
|
|
179
338
|
if (newValue === null) {
|
|
180
339
|
this.input.nativeElement.value = '';
|
|
181
340
|
return;
|
|
182
341
|
}
|
|
342
|
+
if (this.isSearchInDropdown()) {
|
|
343
|
+
// Chips / counter span next to the input own the selection display.
|
|
344
|
+
// Keep the input empty so the placeholder can show when nothing is selected.
|
|
345
|
+
this.input.nativeElement.value = '';
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
183
348
|
if (this.options.counterAsValue) {
|
|
184
349
|
if (this.options.searchable) {
|
|
185
350
|
return;
|
|
@@ -189,7 +354,10 @@ class ApexSelectComponent {
|
|
|
189
354
|
return;
|
|
190
355
|
}
|
|
191
356
|
let visibleValue = '';
|
|
192
|
-
|
|
357
|
+
const sourceList = this.hasGroups()
|
|
358
|
+
? this.filteredGroups().flatMap(group => group.data)
|
|
359
|
+
: this.filteredData();
|
|
360
|
+
for (let data of sourceList) {
|
|
193
361
|
// when newValue is object and not array
|
|
194
362
|
if (data.value === newValue.value) {
|
|
195
363
|
visibleValue = data.label;
|
|
@@ -215,7 +383,7 @@ class ApexSelectComponent {
|
|
|
215
383
|
this.input.nativeElement.value = visibleValue;
|
|
216
384
|
}
|
|
217
385
|
updateDropdownHeight() {
|
|
218
|
-
if (!this.isDropdown()) {
|
|
386
|
+
if (!this.isDropdown() || this.hasGroups()) {
|
|
219
387
|
return;
|
|
220
388
|
}
|
|
221
389
|
setTimeout(() => {
|
|
@@ -282,23 +450,29 @@ class ApexSelectComponent {
|
|
|
282
450
|
return;
|
|
283
451
|
}
|
|
284
452
|
this.isDropdown.set(true);
|
|
285
|
-
this.
|
|
453
|
+
if (!this.isSearchInDropdown()) {
|
|
454
|
+
this.input.nativeElement.focus();
|
|
455
|
+
}
|
|
286
456
|
if (this.firstDropdown() === 0) {
|
|
287
457
|
this.firstDropdown.update(v => v + 1);
|
|
288
458
|
setTimeout(() => this.generateDropdownPosition(true));
|
|
289
459
|
}
|
|
290
460
|
this.attachGlobalScrollBlockers();
|
|
291
461
|
this.onSearch(this.lastSearch, false);
|
|
462
|
+
if (this.isSearchInDropdown()) {
|
|
463
|
+
setTimeout(() => this.dropdownSearch?.nativeElement.focus());
|
|
464
|
+
}
|
|
292
465
|
}
|
|
293
466
|
deactivateControl(event) {
|
|
294
467
|
if (event instanceof KeyboardEvent) {
|
|
295
468
|
this.removeDropdown();
|
|
296
469
|
return;
|
|
297
470
|
}
|
|
298
|
-
|
|
471
|
+
const dropdownEl = this.getDropdownEl();
|
|
472
|
+
if (!dropdownEl || !this.inputWrapper) {
|
|
299
473
|
return;
|
|
300
474
|
}
|
|
301
|
-
const dropdownRect =
|
|
475
|
+
const dropdownRect = dropdownEl.getBoundingClientRect();
|
|
302
476
|
const inputWrapperRect = this.inputWrapper.nativeElement.getBoundingClientRect();
|
|
303
477
|
const isClickInsideDropdown = this.isWithinBounds(event, dropdownRect);
|
|
304
478
|
const isClickInsideInputWrapper = this.isWithinBounds(event, inputWrapperRect);
|
|
@@ -333,25 +507,53 @@ class ApexSelectComponent {
|
|
|
333
507
|
}
|
|
334
508
|
}
|
|
335
509
|
generateDropdownPosition(checkRevserse = false) {
|
|
336
|
-
|
|
510
|
+
const dropdownEl = this.getDropdownEl();
|
|
511
|
+
if (!dropdownEl) {
|
|
337
512
|
// method will keep executing until dropdown is rendered
|
|
338
513
|
setTimeout(() => this.generateDropdownPosition(true));
|
|
339
514
|
return;
|
|
340
515
|
}
|
|
341
|
-
const dropdownEl = this.dropdown.elementRef.nativeElement;
|
|
342
516
|
const elementRefRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
343
517
|
if (this.osService.mobileOS === MobileOS.iOS) {
|
|
344
518
|
elementRefRect.y += window.visualViewport.offsetTop;
|
|
345
519
|
elementRefRect.x += window.visualViewport.offsetLeft;
|
|
346
520
|
}
|
|
347
|
-
|
|
348
|
-
|
|
521
|
+
// ── Width ──
|
|
522
|
+
// 'trigger' (default) → match the trigger; otherwise use the explicit px
|
|
523
|
+
// value, clamped so the dropdown can never exceed viewport minus 2× the
|
|
524
|
+
// safe-area padding on very narrow screens.
|
|
525
|
+
const VIEWPORT_PADDING = 8;
|
|
526
|
+
const widthOption = this.options.dropdownWidth ?? 'trigger';
|
|
527
|
+
const maxWidth = Math.max(elementRefRect.width, window.innerWidth - VIEWPORT_PADDING * 2);
|
|
528
|
+
const desiredWidth = typeof widthOption === 'number'
|
|
529
|
+
? Math.min(widthOption, maxWidth)
|
|
530
|
+
: elementRefRect.width;
|
|
531
|
+
dropdownEl.style.width = desiredWidth + 'px';
|
|
532
|
+
// ── Horizontal alignment ──
|
|
533
|
+
// Default is 'start' for trigger-width dropdowns (preserves the
|
|
534
|
+
// pre-existing behavior) and 'auto' for explicit-width dropdowns so a
|
|
535
|
+
// wider menu near the right edge of the viewport flips to end-align
|
|
536
|
+
// instead of clipping.
|
|
537
|
+
const defaultAlign = typeof widthOption === 'number' ? 'auto' : 'start';
|
|
538
|
+
const alignOption = this.options.dropdownAlign ?? defaultAlign;
|
|
539
|
+
let resolvedLeft = this.resolveDropdownLeft(alignOption, elementRefRect, desiredWidth, VIEWPORT_PADDING);
|
|
540
|
+
// Final clamp keeps the dropdown inside the viewport at any width.
|
|
541
|
+
const minLeft = VIEWPORT_PADDING;
|
|
542
|
+
const maxLeft = Math.max(VIEWPORT_PADDING, window.innerWidth - desiredWidth - VIEWPORT_PADDING);
|
|
543
|
+
resolvedLeft = Math.max(minLeft, Math.min(resolvedLeft, maxLeft));
|
|
544
|
+
dropdownEl.style.left = resolvedLeft + 'px';
|
|
349
545
|
dropdownEl.style.top = elementRefRect.y + elementRefRect.height + 'px';
|
|
546
|
+
// Size the grouped-dropdown body to the space available below the trigger
|
|
547
|
+
// (with `maxDropdownHeightPx` as an optional cap). Non-grouped selects
|
|
548
|
+
// are handled by `updateDropdownHeight()` via virtual scroll height.
|
|
549
|
+
this.adjustGroupedDropdownMaxHeight(false, elementRefRect);
|
|
350
550
|
if (checkRevserse) {
|
|
351
551
|
if (window.innerHeight < dropdownEl.getBoundingClientRect().bottom) {
|
|
352
552
|
dropdownEl.style.top = 'unset';
|
|
353
553
|
dropdownEl.style.bottom = window.innerHeight - elementRefRect.y + 10 + 'px';
|
|
354
554
|
this.isDropdownReversed = true;
|
|
555
|
+
// Reflow grouped body for the above-trigger space after flipping up.
|
|
556
|
+
this.adjustGroupedDropdownMaxHeight(true, elementRefRect);
|
|
355
557
|
}
|
|
356
558
|
}
|
|
357
559
|
if (this.isDropdownReversed) {
|
|
@@ -362,6 +564,65 @@ class ApexSelectComponent {
|
|
|
362
564
|
this.updateDropdownHeight();
|
|
363
565
|
}, 100);
|
|
364
566
|
}
|
|
567
|
+
// Resolves the dropdown's left coordinate against the trigger and viewport.
|
|
568
|
+
// 'start' → trigger left edge
|
|
569
|
+
// 'end' → trigger right edge minus dropdown width
|
|
570
|
+
// 'auto' → start if it fits, else end if it fits, else pinned padding
|
|
571
|
+
// The 'auto' branch is the only place where viewport-overflow detection
|
|
572
|
+
// matters; keeping it isolated avoids the nested-else chain in the caller.
|
|
573
|
+
resolveDropdownLeft(align, triggerRect, desiredWidth, padding) {
|
|
574
|
+
const startLeft = triggerRect.x;
|
|
575
|
+
const endLeft = triggerRect.right - desiredWidth;
|
|
576
|
+
if (align === 'start') {
|
|
577
|
+
return startLeft;
|
|
578
|
+
}
|
|
579
|
+
if (align === 'end') {
|
|
580
|
+
return endLeft;
|
|
581
|
+
}
|
|
582
|
+
const fitsAtStart = startLeft + desiredWidth <= window.innerWidth - padding;
|
|
583
|
+
if (fitsAtStart) {
|
|
584
|
+
return startLeft;
|
|
585
|
+
}
|
|
586
|
+
const fitsAtEnd = endLeft >= padding;
|
|
587
|
+
if (fitsAtEnd) {
|
|
588
|
+
return endLeft;
|
|
589
|
+
}
|
|
590
|
+
// Both edges would still overflow — pin to viewport with padding.
|
|
591
|
+
return padding;
|
|
592
|
+
}
|
|
593
|
+
// Sets `--apex-select-dropdown-body-max-height` on the dropdown root so the
|
|
594
|
+
// grouped + searchInDropdown body grows to fill the viewport instead of the
|
|
595
|
+
// hardcoded 320 px CSS fallback. Called twice: once for the default
|
|
596
|
+
// below-trigger anchor, again after the reverse-flip handler so the value
|
|
597
|
+
// matches the chosen side. `maxDropdownHeightPx` (when provided) caps the
|
|
598
|
+
// dynamic value — useful when callers want a smaller-than-viewport dropdown.
|
|
599
|
+
adjustGroupedDropdownMaxHeight(reversed, triggerRect) {
|
|
600
|
+
if (!this.hasGroups()) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
const dropdownEl = this.getDropdownEl();
|
|
604
|
+
if (!dropdownEl) {
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const VIEWPORT_PADDING = 16;
|
|
608
|
+
const SEARCH_HEADER_PX = this.isSearchInDropdown() ? 52 : 0;
|
|
609
|
+
// The `.dropdown` root sits `margin-top` below its anchor and carries a 1px border top and
|
|
610
|
+
// bottom — chrome that lives OUTSIDE the body the max-height caps. Left unaccounted, the body
|
|
611
|
+
// fills the whole gap and the assembled dropdown lands a hair past the viewport edge, tripping
|
|
612
|
+
// the flip-up check even when there is room below. Reserving it keeps a below-anchored grouped
|
|
613
|
+
// dropdown open downward. A search dropdown never noticed because its header offset absorbed it.
|
|
614
|
+
const DROPDOWN_CHROME_PX = 17;
|
|
615
|
+
const MIN_BODY_PX = 160;
|
|
616
|
+
const availableSpace = reversed
|
|
617
|
+
? triggerRect.y - VIEWPORT_PADDING - DROPDOWN_CHROME_PX
|
|
618
|
+
: window.innerHeight - (triggerRect.y + triggerRect.height) - VIEWPORT_PADDING - DROPDOWN_CHROME_PX;
|
|
619
|
+
let bodyMax = Math.max(MIN_BODY_PX, availableSpace - SEARCH_HEADER_PX);
|
|
620
|
+
const cap = this.options.maxDropdownHeightPx;
|
|
621
|
+
if (cap !== undefined && cap > 0) {
|
|
622
|
+
bodyMax = Math.min(bodyMax, cap);
|
|
623
|
+
}
|
|
624
|
+
dropdownEl.style.setProperty('--apex-select-dropdown-body-max-height', bodyMax + 'px');
|
|
625
|
+
}
|
|
365
626
|
removeDropdown() {
|
|
366
627
|
this.isDropdown.set(false);
|
|
367
628
|
this.isDropdownReversed = false;
|
|
@@ -382,6 +643,11 @@ class ApexSelectComponent {
|
|
|
382
643
|
}
|
|
383
644
|
onSearch(value, shouldResetHover) {
|
|
384
645
|
this.lastSearch = value;
|
|
646
|
+
if (this.hasGroups()) {
|
|
647
|
+
this.filterGroups(value, shouldResetHover);
|
|
648
|
+
this.updateDropdownHeight();
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
385
651
|
if (!value) {
|
|
386
652
|
// Reset to original data if input is empty
|
|
387
653
|
this.filteredData.set([...this.options.data]);
|
|
@@ -399,6 +665,36 @@ class ApexSelectComponent {
|
|
|
399
665
|
this.filteredData.set(filtered);
|
|
400
666
|
this.updateDropdownHeight();
|
|
401
667
|
}
|
|
668
|
+
filterGroups(value, shouldResetHover) {
|
|
669
|
+
const sourceGroups = this.options.groups || [];
|
|
670
|
+
if (!value) {
|
|
671
|
+
this.filteredGroups.set(this.cloneGroups(sourceGroups));
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const searchTerm = value.toLowerCase();
|
|
675
|
+
const result = [];
|
|
676
|
+
for (const group of sourceGroups) {
|
|
677
|
+
const matches = group.data.filter(item => item.label.toLowerCase().includes(searchTerm));
|
|
678
|
+
if (matches.length) {
|
|
679
|
+
result.push({ label: group.label, data: matches });
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
if (shouldResetHover) {
|
|
683
|
+
let firstHoverSet = false;
|
|
684
|
+
for (const group of result) {
|
|
685
|
+
for (const item of group.data) {
|
|
686
|
+
if (!firstHoverSet) {
|
|
687
|
+
item.isHover = true;
|
|
688
|
+
firstHoverSet = true;
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
item.isHover = false;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
this.filteredGroups.set(result);
|
|
697
|
+
}
|
|
402
698
|
getPlaceholder() {
|
|
403
699
|
const options = this.options;
|
|
404
700
|
const formGroup = options.formGroup;
|
|
@@ -445,29 +741,20 @@ class ApexSelectComponent {
|
|
|
445
741
|
window.addEventListener('keydown', this.keyListener);
|
|
446
742
|
}
|
|
447
743
|
keyup(event) {
|
|
448
|
-
|
|
744
|
+
const activeEl = document.activeElement;
|
|
745
|
+
const triggerInputEl = this.input?.nativeElement ?? null;
|
|
746
|
+
const searchInputEl = this.dropdownSearch?.nativeElement ?? null;
|
|
747
|
+
const isTriggerFocused = activeEl === triggerInputEl;
|
|
748
|
+
const isDropdownSearchFocused = this.isSearchInDropdown() && activeEl === searchInputEl;
|
|
749
|
+
if (!isTriggerFocused && !isDropdownSearchFocused) {
|
|
449
750
|
this.deactivateControl(event);
|
|
450
751
|
return;
|
|
451
752
|
}
|
|
452
|
-
if (
|
|
453
|
-
if (document.activeElement !== this.input?.nativeElement) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
753
|
+
if (isDropdownSearchFocused) {
|
|
456
754
|
switch (event.code) {
|
|
457
755
|
case 'Enter':
|
|
458
756
|
this.documentEnterKeyup(event);
|
|
459
757
|
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
758
|
case 'Escape':
|
|
472
759
|
this.deactivateControl(event);
|
|
473
760
|
return;
|
|
@@ -478,11 +765,64 @@ class ApexSelectComponent {
|
|
|
478
765
|
this.documentArrowsKeyup(false);
|
|
479
766
|
return;
|
|
480
767
|
}
|
|
481
|
-
|
|
768
|
+
// Typing is handled by the input's (input) event, not here.
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
switch (event.code) {
|
|
772
|
+
case 'Enter':
|
|
773
|
+
this.documentEnterKeyup(event);
|
|
774
|
+
return;
|
|
775
|
+
case 'Space':
|
|
776
|
+
if (!this.options.searchable) {
|
|
777
|
+
this.documentEnterKeyup(event);
|
|
778
|
+
}
|
|
779
|
+
return;
|
|
780
|
+
case 'Backspace':
|
|
781
|
+
if (!this.options.multiple && this.options.searchable && this.control.value.value != null) {
|
|
782
|
+
this.onSearch('', false);
|
|
783
|
+
this.setValue('');
|
|
784
|
+
}
|
|
785
|
+
return;
|
|
786
|
+
case 'Escape':
|
|
787
|
+
this.deactivateControl(event);
|
|
788
|
+
return;
|
|
789
|
+
case 'ArrowDown':
|
|
790
|
+
this.documentArrowsKeyup(true);
|
|
791
|
+
return;
|
|
792
|
+
case 'ArrowUp':
|
|
793
|
+
this.documentArrowsKeyup(false);
|
|
794
|
+
return;
|
|
795
|
+
case 'Home':
|
|
796
|
+
this.documentHomeEndKeyup(true);
|
|
797
|
+
return;
|
|
798
|
+
case 'End':
|
|
799
|
+
this.documentHomeEndKeyup(false);
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
this.documentKeyup(event);
|
|
803
|
+
}
|
|
804
|
+
// Home/End jump the keyboard highlight to the first/last option (APG combobox).
|
|
805
|
+
documentHomeEndKeyup(toFirst) {
|
|
806
|
+
const data = this.getNavigableOptions();
|
|
807
|
+
if (!data.length || !this.isDropdown()) {
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
for (let i = 0; i < data.length; i++) {
|
|
811
|
+
data[i].isHover = false;
|
|
812
|
+
}
|
|
813
|
+
const newIndex = toFirst ? 0 : data.length - 1;
|
|
814
|
+
data[newIndex].isHover = true;
|
|
815
|
+
if (this.hasGroups()) {
|
|
816
|
+
this.filteredGroups.set([...this.filteredGroups()]);
|
|
817
|
+
this.scrollGroupedOptionIntoView(newIndex);
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
this.filteredData.set([...this.filteredData()]);
|
|
821
|
+
this.dropdown?.scrollToIndex(newIndex, 'auto');
|
|
482
822
|
}
|
|
483
823
|
}
|
|
484
824
|
documentEnterKeyup(event) {
|
|
485
|
-
const data = this.
|
|
825
|
+
const data = this.getNavigableOptions();
|
|
486
826
|
for (let i = 0; i < data.length; i++) {
|
|
487
827
|
if (data[i].isHover) {
|
|
488
828
|
switch (this.options.multiple) {
|
|
@@ -498,11 +838,11 @@ class ApexSelectComponent {
|
|
|
498
838
|
}
|
|
499
839
|
}
|
|
500
840
|
documentArrowsKeyup(isDownArrow) {
|
|
501
|
-
|
|
841
|
+
const data = this.getNavigableOptions();
|
|
842
|
+
const dataLength = data.length;
|
|
843
|
+
if (!dataLength) {
|
|
502
844
|
return;
|
|
503
845
|
}
|
|
504
|
-
const data = this.filteredData();
|
|
505
|
-
const dataLength = data.length;
|
|
506
846
|
const controlValue = this.control.getRawValue();
|
|
507
847
|
const isControlValue = controlValue && controlValue !== '';
|
|
508
848
|
let hoverIndex = null;
|
|
@@ -521,14 +861,34 @@ class ApexSelectComponent {
|
|
|
521
861
|
newIndex = newIndex < 0 ? 0 : newIndex;
|
|
522
862
|
newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;
|
|
523
863
|
data[newIndex].isHover = true;
|
|
524
|
-
this.
|
|
525
|
-
|
|
864
|
+
if (this.hasGroups()) {
|
|
865
|
+
this.filteredGroups.set([...this.filteredGroups()]);
|
|
866
|
+
this.scrollGroupedOptionIntoView(newIndex);
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
this.filteredData.set([...this.filteredData()]);
|
|
870
|
+
this.dropdown?.scrollToIndex(newIndex, 'auto');
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
getNavigableOptions() {
|
|
874
|
+
if (this.hasGroups()) {
|
|
875
|
+
return this.filteredGroups().flatMap(group => group.data);
|
|
876
|
+
}
|
|
877
|
+
return this.filteredData();
|
|
878
|
+
}
|
|
879
|
+
scrollGroupedOptionIntoView(index) {
|
|
880
|
+
if (!this.dropdownContainer) {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
const optionEls = this.dropdownContainer.nativeElement.querySelectorAll('.option');
|
|
884
|
+
const target = optionEls[index];
|
|
885
|
+
target?.scrollIntoView({ block: 'nearest' });
|
|
526
886
|
}
|
|
527
887
|
documentKeyup(event) {
|
|
528
888
|
if (!this.isDropdown() || this.options.searchable) {
|
|
529
889
|
return;
|
|
530
890
|
}
|
|
531
|
-
const data = this.
|
|
891
|
+
const data = this.getNavigableOptions();
|
|
532
892
|
for (let i = 0; i < data.length; i++) {
|
|
533
893
|
data[i].isHover = false;
|
|
534
894
|
}
|
|
@@ -544,9 +904,17 @@ class ApexSelectComponent {
|
|
|
544
904
|
}
|
|
545
905
|
if (newIndex !== null) {
|
|
546
906
|
data[newIndex].isHover = true;
|
|
547
|
-
this.
|
|
907
|
+
if (this.hasGroups()) {
|
|
908
|
+
this.filteredGroups.set([...this.filteredGroups()]);
|
|
909
|
+
this.scrollGroupedOptionIntoView(newIndex);
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
this.dropdown?.scrollToIndex(newIndex, 'auto');
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (!this.hasGroups()) {
|
|
916
|
+
this.filteredData.set([...this.filteredData()]);
|
|
548
917
|
}
|
|
549
|
-
this.filteredData.set([...data]);
|
|
550
918
|
}
|
|
551
919
|
removeProperty(obj, propertyName) {
|
|
552
920
|
let { [propertyName]: removedProperty, ...data } = obj;
|
|
@@ -561,13 +929,14 @@ class ApexSelectComponent {
|
|
|
561
929
|
}
|
|
562
930
|
}
|
|
563
931
|
blockScroll(event) {
|
|
564
|
-
|
|
932
|
+
const dropdownEl = this.getDropdownEl();
|
|
933
|
+
if (!dropdownEl) {
|
|
565
934
|
return;
|
|
566
935
|
}
|
|
567
|
-
const
|
|
568
|
-
const isInsideDropdown = this.isDescendant(dropdownEl,
|
|
936
|
+
const target = event.target;
|
|
937
|
+
const isInsideDropdown = !!target && this.isDescendant(dropdownEl, target);
|
|
569
938
|
if (isInsideDropdown) {
|
|
570
|
-
const canScroll =
|
|
939
|
+
const canScroll = this.canScrollAt(target, dropdownEl);
|
|
571
940
|
if (!canScroll) {
|
|
572
941
|
event.preventDefault();
|
|
573
942
|
}
|
|
@@ -575,6 +944,22 @@ class ApexSelectComponent {
|
|
|
575
944
|
}
|
|
576
945
|
event.preventDefault();
|
|
577
946
|
}
|
|
947
|
+
canScrollAt(start, boundary) {
|
|
948
|
+
let el = start;
|
|
949
|
+
while (el !== null) {
|
|
950
|
+
if (el.scrollHeight > el.clientHeight) {
|
|
951
|
+
const overflowY = getComputedStyle(el).overflowY;
|
|
952
|
+
if (overflowY === 'auto' || overflowY === 'scroll') {
|
|
953
|
+
return true;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
if (el === boundary || el === document.body) {
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
el = el.parentElement;
|
|
960
|
+
}
|
|
961
|
+
return false;
|
|
962
|
+
}
|
|
578
963
|
isDescendant(parent, child) {
|
|
579
964
|
while (child !== null) {
|
|
580
965
|
if (child === parent) {
|
|
@@ -601,12 +986,13 @@ class ApexSelectComponent {
|
|
|
601
986
|
this.scrollBlockersAttached = false;
|
|
602
987
|
}
|
|
603
988
|
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"] }] }); }
|
|
989
|
+
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 !== '' && variant() === Variant.Default) {\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(), 'inset': isInsetLabel(), 'inset-has-value': hasInsetValue() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"''\"></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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 @if (isInsetLabel() && hasInsetValue()) {\n <div class=\"inset-stack\" aria-hidden=\"true\">\n <span class=\"inset-label\">{{ options.label }}</span>\n <span class=\"inset-value\">{{ insetValueLabel() }}</span>\n </div>\n\n <button type=\"button\" class=\"inset-clear\" [attr.aria-label]=\"'Clear ' + (options.label || options.placeholder || 'filter')\" (click)=\"clearInsetValue($event)\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M3 3 9 9M9 3 3 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n </button>\n }\n\n <div class=\"arrow-wrapper\" aria-hidden=\"true\">\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 aria-label=\"Search options\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\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\" role=\"listbox\" [class.dropdown-body-columns]=\"(options.dropdownColumns ?? 1) > 1\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\">\n <ng-container [ngTemplateOutlet]=\"groupBody\"></ng-container>\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown-body dropdown-body-virtual\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData(); let i = index\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></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 if (options.groups && options.groups.length > 0) {\n <div #dropdownContainer class=\"dropdown dropdown-wrapper\">\n <div class=\"dropdown-body\" role=\"listbox\" [class.dropdown-body-columns]=\"(options.dropdownColumns ?? 1) > 1\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\">\n <ng-container [ngTemplateOutlet]=\"groupBody\"></ng-container>\n </div>\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData(); let i = index\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></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<!-- The grouped option list, shared by the search and no-search dropdowns so the group + option\n markup lives in one place. The Select All master (multiple mode + selectAll) sits above the\n groups and toggles every option. -->\n<ng-template #groupBody>\n @if (options.selectAll && options.multiple) {\n <div class=\"option checkbox select-all-option\"\n role=\"option\"\n [attr.aria-selected]=\"isAllSelected()\"\n (click)=\"toggleSelectAll($event)\">\n <apex-checkbox [checked]=\"isAllSelected()\">\n <div class=\"multiple-checkbox-container\"><span>Select all</span></div>\n </apex-checkbox>\n </div>\n }\n\n @if ((options.dropdownColumns ?? 1) > 1) {\n <div class=\"group-columns\">\n @for (column of groupColumns(); track $index) {\n <div class=\"select-col\">\n @for (group of column; track group.label) {\n <ng-container [ngTemplateOutlet]=\"groupBlock\" [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n }\n </div>\n }\n </div>\n } @else {\n @for (group of filteredGroups(); track group.label) {\n <ng-container [ngTemplateOutlet]=\"groupBlock\" [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n }\n }\n\n @if (filteredGroups().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n</ng-template>\n\n<!-- One group: its header followed by its options. Shared by the single-column list and by each\n flex column, so the option markup lives in exactly one place. -->\n<ng-template #groupBlock let-group>\n <div class=\"group-header\" role=\"presentation\">{{ group.label }}</div>\n @for (data of group.data; track data.value) {\n <div class=\"option\"\n role=\"option\"\n [id]=\"optionId(flatIndexOf(data))\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n }\n</ng-template>\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-x:auto;overflow-y:hidden;scrollbar-width:none;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.inset{position:relative;border-color:var(--apex-select-inset-border-color, #D3D3D3)}.input-field-wrapper.inset.disabled{opacity:1;cursor:not-allowed;background-color:var(--apex-select-inset-disabled-background-color, #F3F3F3);border:1px solid var(--apex-select-inset-disabled-border-color, #E4E4E4)}.input-field-wrapper.inset-has-value input{color:transparent}.input-field-wrapper.inset-has-value .arrow-wrapper{display:none}.inset-stack{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:0 38px 0 16px;pointer-events:none}.inset-label{font-size:var(--apex-select-inset-label-font-size, 10px);font-weight:600;letter-spacing:.04em;text-transform:uppercase;line-height:1;color:var(--apex-select-inset-label-color, #7C8182)}.inset-value{font-size:var(--apex-select-inset-value-font-size, 13px);font-weight:600;line-height:1;color:var(--apex-select-inset-value-color, #141414);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inset-clear{position:absolute;top:50%;right:12px;transform:translateY(-50%);display:inline-grid;place-items:center;width:18px;height:18px;padding:0;border:none;border-radius:999px;background:var(--apex-select-inset-clear-background, transparent);color:var(--apex-select-inset-clear-color, #7C8182);cursor:pointer}.inset-clear:hover{background:var(--apex-select-inset-clear-hover-background, #141414);color:var(--apex-select-inset-clear-hover-color, #FFFFFF)}.inset-clear svg{width:11px;height:11px;display:block}.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{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.dropdown::-webkit-scrollbar{width:4px}.dropdown::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.dropdown::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.values::-webkit-scrollbar{width:4px}.values::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.values::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.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{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.dropdown-body::-webkit-scrollbar{width:4px}.dropdown-body::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.dropdown-body::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.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}.dropdown .option.select-all-option{border-bottom:1px solid var(--apex-select-dropdown-border-color, #E9E9E9)}.dropdown-body.dropdown-body-columns{padding:4px 14px 10px}.dropdown-body-columns .group-columns{display:flex;align-items:flex-start;gap:24px}.dropdown-body-columns .select-col{flex:1;min-width:0}.dropdown-body-columns .option,.dropdown-body-columns .group-header{padding-left:8px;padding-right:8px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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", "loading"] }, { 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
990
|
}
|
|
606
991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexSelectComponent, decorators: [{
|
|
607
992
|
type: Component,
|
|
608
993
|
args: [{ selector: 'apex-select', imports: [
|
|
609
994
|
NgClass,
|
|
995
|
+
NgTemplateOutlet,
|
|
610
996
|
RouterLink,
|
|
611
997
|
FormsModule,
|
|
612
998
|
ScrollingModule,
|
|
@@ -615,7 +1001,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
615
1001
|
ApexTooltipDirective,
|
|
616
1002
|
ReactiveFormsModule,
|
|
617
1003
|
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"] }]
|
|
1004
|
+
], template: "@if (options) {\n @if (options.formGroup && options.formControlName) {\n <div class=\"container\" (mousedown)=\"preventFocusChange($event)\">\n @if (options.label !== '' && variant() === Variant.Default) {\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(), 'inset': isInsetLabel(), 'inset-has-value': hasInsetValue() }\">\n @if (options.prefixImg) {\n <apex-img class=\"prefix\" [src]=\"'assets/img/' + this.options.prefixImg\" [alt]=\"''\"></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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isDropdown()\"\n [attr.aria-controls]=\"isDropdown() ? listboxId : null\"\n [attr.aria-label]=\"ariaLabelValue\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-invalid]=\"checkIfControlInvalid() ? 'true' : null\"\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 @if (isInsetLabel() && hasInsetValue()) {\n <div class=\"inset-stack\" aria-hidden=\"true\">\n <span class=\"inset-label\">{{ options.label }}</span>\n <span class=\"inset-value\">{{ insetValueLabel() }}</span>\n </div>\n\n <button type=\"button\" class=\"inset-clear\" [attr.aria-label]=\"'Clear ' + (options.label || options.placeholder || 'filter')\" (click)=\"clearInsetValue($event)\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M3 3 9 9M9 3 3 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n </button>\n }\n\n <div class=\"arrow-wrapper\" aria-hidden=\"true\">\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 aria-label=\"Search options\"\n [attr.aria-controls]=\"listboxId\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\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\" role=\"listbox\" [class.dropdown-body-columns]=\"(options.dropdownColumns ?? 1) > 1\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\">\n <ng-container [ngTemplateOutlet]=\"groupBody\"></ng-container>\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown-body dropdown-body-virtual\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData(); let i = index\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></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 if (options.groups && options.groups.length > 0) {\n <div #dropdownContainer class=\"dropdown dropdown-wrapper\">\n <div class=\"dropdown-body\" role=\"listbox\" [class.dropdown-body-columns]=\"(options.dropdownColumns ?? 1) > 1\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\">\n <ng-container [ngTemplateOutlet]=\"groupBody\"></ng-container>\n </div>\n </div>\n } @else {\n <cdk-virtual-scroll-viewport [itemSize]=\"optionItemSizePx\" [style.height.px]=\"dropdownHeightPx()\" class=\"dropdown\" role=\"listbox\" [id]=\"listboxId\" [attr.aria-multiselectable]=\"options.multiple ? 'true' : null\" [attr.aria-label]=\"ariaLabelValue\" #dropdown>\n <div class=\"option\"\n *cdkVirtualFor=\"let data of filteredData(); let i = index\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></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<!-- The grouped option list, shared by the search and no-search dropdowns so the group + option\n markup lives in one place. The Select All master (multiple mode + selectAll) sits above the\n groups and toggles every option. -->\n<ng-template #groupBody>\n @if (options.selectAll && options.multiple) {\n <div class=\"option checkbox select-all-option\"\n role=\"option\"\n [attr.aria-selected]=\"isAllSelected()\"\n (click)=\"toggleSelectAll($event)\">\n <apex-checkbox [checked]=\"isAllSelected()\">\n <div class=\"multiple-checkbox-container\"><span>Select all</span></div>\n </apex-checkbox>\n </div>\n }\n\n @if ((options.dropdownColumns ?? 1) > 1) {\n <div class=\"group-columns\">\n @for (column of groupColumns(); track $index) {\n <div class=\"select-col\">\n @for (group of column; track group.label) {\n <ng-container [ngTemplateOutlet]=\"groupBlock\" [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n }\n </div>\n }\n </div>\n } @else {\n @for (group of filteredGroups(); track group.label) {\n <ng-container [ngTemplateOutlet]=\"groupBlock\" [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n }\n }\n\n @if (filteredGroups().length === 0) {\n <div class=\"option disabled\">No options to select from.</div>\n }\n</ng-template>\n\n<!-- One group: its header followed by its options. Shared by the single-column list and by each\n flex column, so the option markup lives in exactly one place. -->\n<ng-template #groupBlock let-group>\n <div class=\"group-header\" role=\"presentation\">{{ group.label }}</div>\n @for (data of group.data; track data.value) {\n <div class=\"option\"\n role=\"option\"\n [id]=\"optionId(flatIndexOf(data))\"\n [attr.aria-selected]=\"options.multiple ? isMultipleSelected(data) : isValueSelected(data)\"\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]=\"''\"></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]=\"''\"></apex-img>\n </div>\n }\n {{ data.label }}\n }\n </div>\n }\n</ng-template>\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-x:auto;overflow-y:hidden;scrollbar-width:none;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.inset{position:relative;border-color:var(--apex-select-inset-border-color, #D3D3D3)}.input-field-wrapper.inset.disabled{opacity:1;cursor:not-allowed;background-color:var(--apex-select-inset-disabled-background-color, #F3F3F3);border:1px solid var(--apex-select-inset-disabled-border-color, #E4E4E4)}.input-field-wrapper.inset-has-value input{color:transparent}.input-field-wrapper.inset-has-value .arrow-wrapper{display:none}.inset-stack{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:0 38px 0 16px;pointer-events:none}.inset-label{font-size:var(--apex-select-inset-label-font-size, 10px);font-weight:600;letter-spacing:.04em;text-transform:uppercase;line-height:1;color:var(--apex-select-inset-label-color, #7C8182)}.inset-value{font-size:var(--apex-select-inset-value-font-size, 13px);font-weight:600;line-height:1;color:var(--apex-select-inset-value-color, #141414);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inset-clear{position:absolute;top:50%;right:12px;transform:translateY(-50%);display:inline-grid;place-items:center;width:18px;height:18px;padding:0;border:none;border-radius:999px;background:var(--apex-select-inset-clear-background, transparent);color:var(--apex-select-inset-clear-color, #7C8182);cursor:pointer}.inset-clear:hover{background:var(--apex-select-inset-clear-hover-background, #141414);color:var(--apex-select-inset-clear-hover-color, #FFFFFF)}.inset-clear svg{width:11px;height:11px;display:block}.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{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.dropdown::-webkit-scrollbar{width:4px}.dropdown::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.dropdown::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.dropdown::-webkit-scrollbar-button{display:none}.dropdown.no-scroll{overflow:hidden}.values{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.values::-webkit-scrollbar{width:4px}.values::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.values::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.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{scrollbar-width:thin;scrollbar-color:#F2F2F2 #FAFAFA}.dropdown-body::-webkit-scrollbar{width:4px}.dropdown-body::-webkit-scrollbar-thumb{background-color:#f2f2f2;border-radius:99px}.dropdown-body::-webkit-scrollbar-track{background-color:#fafafa;border-radius:99px}.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}.dropdown .option.select-all-option{border-bottom:1px solid var(--apex-select-dropdown-border-color, #E9E9E9)}.dropdown-body.dropdown-body-columns{padding:4px 14px 10px}.dropdown-body-columns .group-columns{display:flex;align-items:flex-start;gap:24px}.dropdown-body-columns .select-col{flex:1;min-width:0}.dropdown-body-columns .option,.dropdown-body-columns .group-header{padding-left:8px;padding-right:8px}\n"] }]
|
|
619
1005
|
}], ctorParameters: () => [{ type: i1.OSService }, { type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { input: [{
|
|
620
1006
|
type: ViewChild,
|
|
621
1007
|
args: ['input']
|
|
@@ -628,6 +1014,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
628
1014
|
}], inputWrapper: [{
|
|
629
1015
|
type: ViewChild,
|
|
630
1016
|
args: ['inputWrapper']
|
|
1017
|
+
}], dropdownSearch: [{
|
|
1018
|
+
type: ViewChild,
|
|
1019
|
+
args: ['dropdownSearch']
|
|
1020
|
+
}], dropdownContainer: [{
|
|
1021
|
+
type: ViewChild,
|
|
1022
|
+
args: ['dropdownContainer']
|
|
631
1023
|
}], options: [{
|
|
632
1024
|
type: Input
|
|
633
1025
|
}], selectChange: [{
|
|
@@ -643,5 +1035,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
643
1035
|
* Generated bundle index. Do not edit.
|
|
644
1036
|
*/
|
|
645
1037
|
|
|
646
|
-
export { ApexSelectComponent };
|
|
1038
|
+
export { ApexSelectComponent, ApexSelectVariant };
|
|
647
1039
|
//# sourceMappingURL=apexara-ng-components-select.mjs.map
|