@fundamental-ngx/core 0.43.10 → 0.43.12
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/date-picker/date-picker.component.d.ts +2 -0
- package/datetime-picker/datetime-picker.component.d.ts +2 -0
- package/dialog/base/dialog-base.service.d.ts +4 -3
- package/dialog/dialog-container/dialog-container.component.d.ts +12 -11
- package/dialog/index.d.ts +11 -10
- package/dialog/utils/dialog-container.model.d.ts +4 -0
- package/esm2020/busy-indicator/busy-indicator.component.mjs +4 -4
- package/esm2020/date-picker/date-picker.component.mjs +8 -8
- package/esm2020/datetime-picker/datetime-picker.component.mjs +8 -7
- package/esm2020/dialog/base/dialog-base.service.mjs +8 -3
- package/esm2020/dialog/dialog-container/dialog-container.component.mjs +23 -23
- package/esm2020/dialog/index.mjs +12 -11
- package/esm2020/dialog/utils/dialog-container.model.mjs +2 -0
- package/esm2020/form/form-message/popover-form-message.service.mjs +2 -12
- package/esm2020/message-box/message-box-container/message-box-container.component.mjs +23 -24
- package/esm2020/multi-input/multi-input.component.mjs +68 -56
- package/esm2020/multi-input/pair-selection.model.mjs +38 -0
- package/esm2020/popover/popover-body/popover-body.component.mjs +3 -3
- package/esm2020/popover/popover-service/popover.service.mjs +9 -2
- package/esm2020/time-picker/time-picker.component.mjs +19 -20
- package/esm2020/token/token.component.mjs +2 -1
- package/esm2020/token/tokenizer.component.mjs +3 -3
- package/fesm2015/fundamental-ngx-core-busy-indicator.mjs +3 -3
- package/fesm2015/fundamental-ngx-core-busy-indicator.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-date-picker.mjs +6 -6
- package/fesm2015/fundamental-ngx-core-date-picker.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-datetime-picker.mjs +6 -6
- package/fesm2015/fundamental-ngx-core-datetime-picker.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-dialog.mjs +189 -184
- package/fesm2015/fundamental-ngx-core-dialog.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-form.mjs +1 -10
- package/fesm2015/fundamental-ngx-core-form.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-message-box.mjs +20 -20
- package/fesm2015/fundamental-ngx-core-message-box.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-multi-input.mjs +104 -57
- package/fesm2015/fundamental-ngx-core-multi-input.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-popover.mjs +10 -3
- package/fesm2015/fundamental-ngx-core-popover.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-time-picker.mjs +14 -16
- package/fesm2015/fundamental-ngx-core-time-picker.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-core-token.mjs +3 -2
- package/fesm2015/fundamental-ngx-core-token.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-busy-indicator.mjs +3 -3
- package/fesm2020/fundamental-ngx-core-busy-indicator.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-date-picker.mjs +6 -6
- package/fesm2020/fundamental-ngx-core-date-picker.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-datetime-picker.mjs +6 -5
- package/fesm2020/fundamental-ngx-core-datetime-picker.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-dialog.mjs +188 -183
- package/fesm2020/fundamental-ngx-core-dialog.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-form.mjs +1 -10
- package/fesm2020/fundamental-ngx-core-form.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-message-box.mjs +20 -20
- package/fesm2020/fundamental-ngx-core-message-box.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-multi-input.mjs +104 -55
- package/fesm2020/fundamental-ngx-core-multi-input.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-popover.mjs +10 -3
- package/fesm2020/fundamental-ngx-core-popover.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-time-picker.mjs +15 -16
- package/fesm2020/fundamental-ngx-core-time-picker.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-core-token.mjs +3 -2
- package/fesm2020/fundamental-ngx-core-token.mjs.map +1 -1
- package/form/form-message/popover-form-message.service.d.ts +3 -7
- package/fundamental-ngx-core-v0.43.12.tgz +0 -0
- package/message-box/message-box-container/message-box-container.component.d.ts +12 -13
- package/multi-input/multi-input.component.d.ts +26 -21
- package/multi-input/pair-selection.model.d.ts +19 -0
- package/package.json +3 -3
- package/popover/popover-service/popover.service.d.ts +1 -1
- package/schematics/add-dependencies/index.js +4 -4
- package/time-picker/time-picker.component.d.ts +17 -15
- package/fundamental-ngx-core-v0.43.10.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i3$1 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { forwardRef, Directive, InjectionToken, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Optional, ViewChild, NgModule, EventEmitter, Injector, TemplateRef, ElementRef, Input, Output, HostListener } from '@angular/core';
|
|
4
|
+
import { forwardRef, Directive, InjectionToken, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Optional, ViewChild, NgModule, EventEmitter, Injector, isDevMode, TemplateRef, ElementRef, Input, Output, HostListener } from '@angular/core';
|
|
5
5
|
import * as i5$1 from '@angular/forms';
|
|
6
6
|
import { FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import * as i2$1 from '@fundamental-ngx/cdk/utils';
|
|
@@ -23,14 +23,13 @@ import { PopoverComponent, PopoverModule } from '@fundamental-ngx/core/popover';
|
|
|
23
23
|
import * as i4 from '@fundamental-ngx/core/token';
|
|
24
24
|
import { TokenizerComponent, TokenModule } from '@fundamental-ngx/core/token';
|
|
25
25
|
import * as i12 from '@fundamental-ngx/i18n';
|
|
26
|
-
import {
|
|
26
|
+
import { I18nModule } from '@fundamental-ngx/i18n';
|
|
27
27
|
import { __decorate, __metadata } from 'tslib';
|
|
28
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
29
28
|
import { SPACE, ENTER, DOWN_ARROW, UP_ARROW, ESCAPE, TAB } from '@angular/cdk/keycodes';
|
|
30
|
-
import
|
|
31
|
-
import { BehaviorSubject, Subscription, combineLatest, firstValueFrom } from 'rxjs';
|
|
29
|
+
import { BehaviorSubject, Subscription, combineLatest } from 'rxjs';
|
|
32
30
|
import { takeUntil, distinctUntilChanged, map, first, startWith } from 'rxjs/operators';
|
|
33
31
|
import { MenuKeyboardService } from '@fundamental-ngx/core/menu';
|
|
32
|
+
import get from 'lodash-es/get';
|
|
34
33
|
import * as i1 from '@fundamental-ngx/core/dialog';
|
|
35
34
|
import { DialogModule } from '@fundamental-ngx/core/dialog';
|
|
36
35
|
import { MobileModeBase, MobileModeControl, MOBILE_MODE_CONFIG } from '@fundamental-ngx/core/mobile-mode';
|
|
@@ -163,8 +162,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
163
162
|
}]
|
|
164
163
|
}] });
|
|
165
164
|
|
|
165
|
+
class PairSelectionModel {
|
|
166
|
+
constructor() {
|
|
167
|
+
/** @hidden */
|
|
168
|
+
this._selected = new Map();
|
|
169
|
+
/** Event emitted when the selection has changed. */
|
|
170
|
+
this.selectionChanged = new EventEmitter();
|
|
171
|
+
}
|
|
172
|
+
/** Array of selected items */
|
|
173
|
+
get selected() {
|
|
174
|
+
return [...this._selected.values()];
|
|
175
|
+
}
|
|
176
|
+
/** Whether the given key exists in the record */
|
|
177
|
+
isSelected(key) {
|
|
178
|
+
return this._selected.has(key);
|
|
179
|
+
}
|
|
180
|
+
/** Selects the given key-value pair */
|
|
181
|
+
select(keyOrValues, value) {
|
|
182
|
+
if (value) {
|
|
183
|
+
this._selected.set(keyOrValues, value);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
keyOrValues.forEach(([key, v]) => this._selected.set(key, v));
|
|
187
|
+
}
|
|
188
|
+
this.selectionChanged.emit([...this._selected]);
|
|
189
|
+
}
|
|
190
|
+
/** Deselects the given key */
|
|
191
|
+
deselect(key) {
|
|
192
|
+
this._selected.delete(key);
|
|
193
|
+
this.selectionChanged.emit([...this._selected]);
|
|
194
|
+
}
|
|
195
|
+
/** Clears the selection information */
|
|
196
|
+
clear() {
|
|
197
|
+
this._selected.clear();
|
|
198
|
+
this.selectionChanged.emit([...this._selected]);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
166
202
|
function isOptionItem(candidate) {
|
|
167
|
-
return isOptionItemBase(candidate) && 'item' in candidate;
|
|
203
|
+
return isOptionItemBase(candidate) && 'item' in candidate && 'id' in candidate;
|
|
168
204
|
}
|
|
169
205
|
function isOptionItemBase(candidate) {
|
|
170
206
|
return typeof candidate === 'object' && candidate !== null && 'value' in candidate && 'label' in candidate;
|
|
@@ -187,10 +223,21 @@ class MultiInputComponent {
|
|
|
187
223
|
/** Selected dropdown items. */
|
|
188
224
|
set selected(values) {
|
|
189
225
|
this._selectionModel.clear();
|
|
190
|
-
values
|
|
226
|
+
if (values) {
|
|
227
|
+
const potentialItems = [...values];
|
|
228
|
+
const options = [];
|
|
229
|
+
potentialItems.forEach((value) => {
|
|
230
|
+
let optionItem = this._optionItems.find((i) => i.value === value);
|
|
231
|
+
if (!optionItem) {
|
|
232
|
+
optionItem = this._getOptionItem(value);
|
|
233
|
+
}
|
|
234
|
+
options.push(optionItem);
|
|
235
|
+
});
|
|
236
|
+
this._selectionModel.select(options.map((item) => [item.id, item]));
|
|
237
|
+
}
|
|
191
238
|
}
|
|
192
239
|
get selected() {
|
|
193
|
-
return this._selectionModel.selected;
|
|
240
|
+
return this._selectionModel.selected.map((c) => c.value);
|
|
194
241
|
}
|
|
195
242
|
/** @hidden */
|
|
196
243
|
get _popoverMaxWidth() {
|
|
@@ -202,6 +249,10 @@ class MultiInputComponent {
|
|
|
202
249
|
}
|
|
203
250
|
return this.elementRef.nativeElement.getBoundingClientRect().width;
|
|
204
251
|
}
|
|
252
|
+
/** @hidden */
|
|
253
|
+
get _optionItems() {
|
|
254
|
+
return this.optionItems$.value;
|
|
255
|
+
}
|
|
205
256
|
/** typeahead matcher function */
|
|
206
257
|
get typeAheadMatcher() {
|
|
207
258
|
if (this.includes) {
|
|
@@ -210,14 +261,13 @@ class MultiInputComponent {
|
|
|
210
261
|
return (item, searchTerm) => item.startsWith(searchTerm);
|
|
211
262
|
}
|
|
212
263
|
/** @hidden */
|
|
213
|
-
constructor(_contentDensityObserver, elementRef, _changeDetRef, _dynamicComponentService, _injector, _viewContainerRef,
|
|
264
|
+
constructor(_contentDensityObserver, elementRef, _changeDetRef, _dynamicComponentService, _injector, _viewContainerRef, _rtlService, _focusTrapService) {
|
|
214
265
|
this._contentDensityObserver = _contentDensityObserver;
|
|
215
266
|
this.elementRef = elementRef;
|
|
216
267
|
this._changeDetRef = _changeDetRef;
|
|
217
268
|
this._dynamicComponentService = _dynamicComponentService;
|
|
218
269
|
this._injector = _injector;
|
|
219
270
|
this._viewContainerRef = _viewContainerRef;
|
|
220
|
-
this._language = _language;
|
|
221
271
|
this._rtlService = _rtlService;
|
|
222
272
|
this._focusTrapService = _focusTrapService;
|
|
223
273
|
/** Placeholder for the input field. */
|
|
@@ -330,7 +380,7 @@ class MultiInputComponent {
|
|
|
330
380
|
/** @hidden */
|
|
331
381
|
this._searchTermCtrl = new FormControl('');
|
|
332
382
|
/** @hidden */
|
|
333
|
-
this._selectionModel = new
|
|
383
|
+
this._selectionModel = new PairSelectionModel();
|
|
334
384
|
/** @hidden */
|
|
335
385
|
this._viewModel$ = this._getViewModel();
|
|
336
386
|
/** @hidden */
|
|
@@ -338,8 +388,6 @@ class MultiInputComponent {
|
|
|
338
388
|
/** @hidden */
|
|
339
389
|
this._rangeSelector = new RangeSelector();
|
|
340
390
|
/** @hidden */
|
|
341
|
-
this._translationResolver = new TranslationResolver();
|
|
342
|
-
/** @hidden */
|
|
343
391
|
this._trackBy = (index, optionItem) => this.valueFn(optionItem?.item);
|
|
344
392
|
/** @hidden */
|
|
345
393
|
this.onChange = () => { };
|
|
@@ -384,9 +432,6 @@ class MultiInputComponent {
|
|
|
384
432
|
this._subscriptions.add(this._getViewModel()
|
|
385
433
|
.pipe(map((viewModel) => !viewModel.displayedOptions.some((c) => !c.isSelected)))
|
|
386
434
|
.subscribe((allItemsSelected) => this.allItemsSelectedChange.emit(allItemsSelected)));
|
|
387
|
-
this._subscriptions.add(this._language.subscribe(() => {
|
|
388
|
-
this._getAriaLabel();
|
|
389
|
-
}));
|
|
390
435
|
}
|
|
391
436
|
/** @hidden */
|
|
392
437
|
ngOnChanges(changes) {
|
|
@@ -471,7 +516,7 @@ class MultiInputComponent {
|
|
|
471
516
|
/** Method that selects all possible options. */
|
|
472
517
|
selectAllItems(selectAll) {
|
|
473
518
|
if (selectAll) {
|
|
474
|
-
this.selected = this.
|
|
519
|
+
this.selected = this._optionItems.map((c) => c.value);
|
|
475
520
|
}
|
|
476
521
|
else {
|
|
477
522
|
this.selected = [];
|
|
@@ -480,17 +525,17 @@ class MultiInputComponent {
|
|
|
480
525
|
this._propagateChange();
|
|
481
526
|
}
|
|
482
527
|
/** @hidden */
|
|
483
|
-
_onCheckboxKeyup(
|
|
528
|
+
_onCheckboxKeyup(option, event, index) {
|
|
484
529
|
if (KeyUtil.isKeyCode(event, [SPACE, ENTER])) {
|
|
485
|
-
this._onCheckboxClick(
|
|
530
|
+
this._onCheckboxClick(option, event, index);
|
|
486
531
|
}
|
|
487
532
|
}
|
|
488
533
|
/** @hidden */
|
|
489
|
-
async _onCheckboxClick(
|
|
490
|
-
const toggledSelection = !this._selectionModel.isSelected(
|
|
534
|
+
async _onCheckboxClick(option, event, index, isListItem = false) {
|
|
535
|
+
const toggledSelection = !this._selectionModel.isSelected(option.id);
|
|
491
536
|
this._rangeSelector.onRangeElementToggled(index, event);
|
|
492
537
|
const sub = this._viewModel$.pipe(first()).subscribe((vm) => {
|
|
493
|
-
this._rangeSelector.applyValueToEachInRange((idx) => this._handleSelect(toggledSelection, vm.displayedOptions[idx]
|
|
538
|
+
this._rangeSelector.applyValueToEachInRange((idx) => this._handleSelect(toggledSelection, vm.displayedOptions[idx], false));
|
|
494
539
|
this._changeDetRef.detectChanges();
|
|
495
540
|
});
|
|
496
541
|
this._subscriptions.add(sub);
|
|
@@ -503,18 +548,18 @@ class MultiInputComponent {
|
|
|
503
548
|
}
|
|
504
549
|
}
|
|
505
550
|
/** @hidden */
|
|
506
|
-
_onTokenClick(
|
|
551
|
+
_onTokenClick(option, resetSearch, event) {
|
|
507
552
|
event?.preventDefault(); // prevent this function from being called twice when checkbox updates
|
|
508
|
-
this._handleSelect(false,
|
|
553
|
+
this._handleSelect(false, option, resetSearch, true);
|
|
509
554
|
}
|
|
510
555
|
/** @hidden */
|
|
511
|
-
_handleSelect(checked,
|
|
556
|
+
_handleSelect(checked, option, resetSearch = true, fromTokenCloseClick = false) {
|
|
512
557
|
const previousLength = this._selectionModel.selected.length;
|
|
513
558
|
if (checked) {
|
|
514
|
-
this._selectionModel.select(
|
|
559
|
+
this._selectionModel.select(option.id, option);
|
|
515
560
|
}
|
|
516
561
|
else {
|
|
517
|
-
this._selectionModel.deselect(
|
|
562
|
+
this._selectionModel.deselect(option.id);
|
|
518
563
|
}
|
|
519
564
|
// Handle popover placement update
|
|
520
565
|
if (this._shouldPopoverBeUpdated(previousLength, this._selectionModel.selected.length)) {
|
|
@@ -635,14 +680,14 @@ class MultiInputComponent {
|
|
|
635
680
|
_addNewTokenToDropDownValues(newToken) {
|
|
636
681
|
this.dropdownValues.push(newToken);
|
|
637
682
|
const newOption = this._getOptionItem(newToken);
|
|
638
|
-
this.optionItems$.next([...this.
|
|
683
|
+
this.optionItems$.next([...this._optionItems, newOption]);
|
|
639
684
|
}
|
|
640
685
|
/** @hidden */
|
|
641
686
|
_selectFirstFiltered(searchTerm) {
|
|
642
687
|
const filtered = this.filterFn(this.dropdownValues, searchTerm);
|
|
643
688
|
if (Array.isArray(filtered) && filtered.length > 0 && this.autoComplete) {
|
|
644
689
|
const optionItem = this._getOptionItem(filtered[0]);
|
|
645
|
-
this._handleSelect(true, optionItem
|
|
690
|
+
this._handleSelect(true, optionItem);
|
|
646
691
|
this._searchTermCtrl.setValue('');
|
|
647
692
|
this.open = false;
|
|
648
693
|
return true;
|
|
@@ -654,8 +699,8 @@ class MultiInputComponent {
|
|
|
654
699
|
const searchLower = searchTerm.toLocaleLowerCase();
|
|
655
700
|
return contentArray.filter((item) => {
|
|
656
701
|
if (item) {
|
|
657
|
-
const displayedValue = this.displayFn(item);
|
|
658
|
-
const term =
|
|
702
|
+
const displayedValue = isOptionItem(item) ? item.label : this.displayFn(item);
|
|
703
|
+
const term = displayedValue?.toLocaleLowerCase() || '';
|
|
659
704
|
return this.typeAheadMatcher(term, searchLower);
|
|
660
705
|
}
|
|
661
706
|
});
|
|
@@ -688,7 +733,7 @@ class MultiInputComponent {
|
|
|
688
733
|
/** @hidden */
|
|
689
734
|
_propagateChange(emitInMobile) {
|
|
690
735
|
if (!this.mobile || emitInMobile) {
|
|
691
|
-
const selected =
|
|
736
|
+
const selected = this._selectionModel.selected.map((c) => c.value);
|
|
692
737
|
this.onChange(selected);
|
|
693
738
|
this.selectedChange.emit(selected);
|
|
694
739
|
}
|
|
@@ -710,6 +755,20 @@ class MultiInputComponent {
|
|
|
710
755
|
}, MultiInputMobileModule, MultiInputMobileComponent, this._viewContainerRef, injector);
|
|
711
756
|
}
|
|
712
757
|
/** @hidden */
|
|
758
|
+
_getItemIdentifier(item) {
|
|
759
|
+
if (!this.optionItemIdentifier) {
|
|
760
|
+
const value = this.valueFn(item);
|
|
761
|
+
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'symbol' && isDevMode()) {
|
|
762
|
+
console.warn('optionItemIdentifier is not set and valueFn does not return a string, number or symbol', item);
|
|
763
|
+
}
|
|
764
|
+
return value;
|
|
765
|
+
}
|
|
766
|
+
if (typeof this.optionItemIdentifier === 'function') {
|
|
767
|
+
return this.optionItemIdentifier(item);
|
|
768
|
+
}
|
|
769
|
+
return get(item, this.optionItemIdentifier);
|
|
770
|
+
}
|
|
771
|
+
/** @hidden */
|
|
713
772
|
_resetSearchTerm() {
|
|
714
773
|
this._searchTermCtrl.setValue('');
|
|
715
774
|
this._changeDetRef.detectChanges();
|
|
@@ -721,6 +780,7 @@ class MultiInputComponent {
|
|
|
721
780
|
}
|
|
722
781
|
const { label, value } = this._getValueAndLabelOfItem(item);
|
|
723
782
|
return {
|
|
783
|
+
id: this._getItemIdentifier(item),
|
|
724
784
|
item,
|
|
725
785
|
label,
|
|
726
786
|
value,
|
|
@@ -743,33 +803,23 @@ class MultiInputComponent {
|
|
|
743
803
|
return { label, value };
|
|
744
804
|
}
|
|
745
805
|
/** @hidden */
|
|
746
|
-
_getOptionItemByValue(value, optionItems = []) {
|
|
747
|
-
return optionItems.find((c) => c.value === value);
|
|
748
|
-
}
|
|
749
|
-
/** @hidden */
|
|
750
806
|
_getViewModel() {
|
|
751
807
|
return combineLatest([
|
|
752
808
|
this._searchTermCtrl.valueChanges.pipe(startWith(this._searchTermCtrl.value)),
|
|
753
|
-
this._selectionModel.
|
|
809
|
+
this._selectionModel.selectionChanged.pipe(startWith(null)),
|
|
754
810
|
this.optionItems$
|
|
755
|
-
]).pipe(map((
|
|
756
|
-
const selected = this.selected.map((v) => this._getOptionItemByValue(v, optionItems) || this._getOptionItem(v));
|
|
811
|
+
]).pipe(map(() => {
|
|
757
812
|
// not using "searchTerm" value from combineLatest as it will be wrong for late subscribers, if any
|
|
758
813
|
const searchTerm = this._searchTermCtrl.value ?? '';
|
|
759
|
-
const filtered = this.filterFn(
|
|
814
|
+
const filtered = this.filterFn(this.dropdownValues, searchTerm);
|
|
760
815
|
const displayedOptions = (Array.isArray(filtered) ? filtered : []).map((item) => this._getOptionItem(item));
|
|
761
|
-
displayedOptions.forEach((c) => (c.isSelected =
|
|
762
|
-
return { selectedOptions: selected, displayedOptions };
|
|
816
|
+
displayedOptions.forEach((c) => (c.isSelected = this._selectionModel.isSelected(c.id)));
|
|
817
|
+
return { selectedOptions: this._selectionModel.selected, displayedOptions };
|
|
763
818
|
}));
|
|
764
819
|
}
|
|
765
|
-
/** @hidden */
|
|
766
|
-
async _getAriaLabel() {
|
|
767
|
-
const lang = await firstValueFrom(this._language);
|
|
768
|
-
this._defaultAriaLabel = this._translationResolver.resolve(lang, 'coreMultiInput.multiInputAriaLabel');
|
|
769
|
-
}
|
|
770
820
|
}
|
|
771
|
-
MultiInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MultiInputComponent, deps: [{ token: i1$1.ContentDensityObserver }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2$1.DynamicComponentService }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token:
|
|
772
|
-
MultiInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MultiInputComponent, selector: "fd-multi-input", inputs: { placeholder: "placeholder", disabled: "disabled", required: "required", compactCollapse: "compactCollapse", maxHeight: "maxHeight", glyph: "glyph", dropdownValues: "dropdownValues", openDropdownOnAddOnClicked: "openDropdownOnAddOnClicked", searchTerm: "searchTerm", inputId: "inputId", highlight: "highlight", selected: "selected", class: "class", filterFn: "filterFn", valueFn: "valueFn", displayFn: "displayFn", newTokenParseFn: "newTokenParseFn", newTokenValidateFn: "newTokenValidateFn", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", fillControlMode: "fillControlMode", state: "state", buttonFocusable: "buttonFocusable", allowNewTokens: "allowNewTokens", mobile: "mobile", showAllButton: "showAllButton", bodyMaxWidth: "bodyMaxWidth", mobileConfig: "mobileConfig", includes: "includes", itemTemplate: "itemTemplate", title: "title", byline: "byline", autoComplete: "autoComplete", open: "open", displayAddonButton: "displayAddonButton", tokenHiddenId: "tokenHiddenId" }, outputs: { searchTermChange: "searchTermChange", selectedChange: "selectedChange", openChange: "openChange", addOnButtonClicked: "addOnButtonClicked", allItemsSelectedChange: "allItemsSelectedChange" }, host: { listeners: { "focusout": "_focusOut($event)" } }, providers: [
|
|
821
|
+
MultiInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MultiInputComponent, deps: [{ token: i1$1.ContentDensityObserver }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2$1.DynamicComponentService }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: i2$1.RtlService, optional: true }, { token: i2$1.FocusTrapService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
822
|
+
MultiInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MultiInputComponent, selector: "fd-multi-input", inputs: { placeholder: "placeholder", disabled: "disabled", required: "required", compactCollapse: "compactCollapse", maxHeight: "maxHeight", glyph: "glyph", dropdownValues: "dropdownValues", openDropdownOnAddOnClicked: "openDropdownOnAddOnClicked", searchTerm: "searchTerm", inputId: "inputId", highlight: "highlight", selected: "selected", class: "class", filterFn: "filterFn", valueFn: "valueFn", displayFn: "displayFn", newTokenParseFn: "newTokenParseFn", optionItemIdentifier: "optionItemIdentifier", newTokenValidateFn: "newTokenValidateFn", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", fillControlMode: "fillControlMode", state: "state", buttonFocusable: "buttonFocusable", allowNewTokens: "allowNewTokens", mobile: "mobile", showAllButton: "showAllButton", bodyMaxWidth: "bodyMaxWidth", mobileConfig: "mobileConfig", includes: "includes", itemTemplate: "itemTemplate", title: "title", byline: "byline", autoComplete: "autoComplete", open: "open", displayAddonButton: "displayAddonButton", tokenHiddenId: "tokenHiddenId" }, outputs: { searchTermChange: "searchTermChange", selectedChange: "selectedChange", openChange: "openChange", addOnButtonClicked: "addOnButtonClicked", allItemsSelectedChange: "allItemsSelectedChange" }, host: { listeners: { "focusout": "_focusOut($event)" } }, providers: [
|
|
773
823
|
{
|
|
774
824
|
provide: NG_VALUE_ACCESSOR,
|
|
775
825
|
useExisting: forwardRef(() => MultiInputComponent),
|
|
@@ -778,7 +828,7 @@ MultiInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
|
|
|
778
828
|
MenuKeyboardService,
|
|
779
829
|
registerFormItemControl(MultiInputComponent),
|
|
780
830
|
contentDensityObserverProviders()
|
|
781
|
-
], viewQueries: [{ propertyName: "popoverRef", first: true, predicate: PopoverComponent, descendants: true }, { propertyName: "controlTemplate", first: true, predicate: ["control"], descendants: true, read: TemplateRef }, { propertyName: "listTemplate", first: true, predicate: ["list"], descendants: true, read: TemplateRef }, { propertyName: "listComponent", first: true, predicate: ListComponent, descendants: true }, { propertyName: "searchInputElement", first: true, predicate: ["searchInputElement"], descendants: true, read: ElementRef }, { propertyName: "tokenizer", first: true, predicate: TokenizerComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"_viewModel$ | async as viewModel\">\n <div class=\"fd-multi-input fd-multi-input-custom\">\n <div class=\"fd-multi-input-field\">\n <ng-container\n [ngTemplateOutlet]=\"control\"\n [ngTemplateOutletContext]=\"{ displayAddonButton: displayAddonButton }\"\n *ngIf=\"mobile\"\n ></ng-container>\n\n <fd-popover\n additionalBodyClass=\"fd-popover-custom-list\"\n *ngIf=\"!mobile\"\n [isOpen]=\"open\"\n (isOpenChange)=\"openChangeHandle($event)\"\n (input)=\"!open && openChangeHandle(true)\"\n [triggers]=\"[]\"\n [maxWidth]=\"_popoverMaxWidth\"\n [disabled]=\"disabled\"\n [fillControlMode]=\"fillControlMode\"\n class=\"fd-multi-input-popover-custom\"\n >\n <fd-popover-control>\n <form (submit)=\"_onSubmit()\">\n <ng-container\n *ngTemplateOutlet=\"control; context: { displayAddonButton: displayAddonButton }\"\n ></ng-container>\n </form>\n </fd-popover-control>\n\n <fd-popover-body\n [attr.aria-hidden]=\"!open\"\n [class.fd-popover__body--hidden]=\"!viewModel.displayedOptions.length\"\n >\n <ng-container *ngTemplateOutlet=\"list\"></ng-container>\n\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n </div>\n </div>\n\n <ng-template #control let-showAddonButton=\"displayAddonButton\">\n <fd-input-group\n class=\"fd-multi-input-input-group-custom\"\n [state]=\"state\"\n [buttonFocusable]=\"buttonFocusable\"\n [button]=\"showAddonButton\"\n [disabled]=\"disabled\"\n [isExpanded]=\"open && !mobile && viewModel.displayedOptions.length > 0\"\n [isControl]=\"true\"\n [glyph]=\"showAddonButton ? glyph : ''\"\n [iconTitle]=\"title\"\n (addOnButtonClicked)=\"_addOnButtonClicked($event)\"\n >\n <span [attr.id]=\"tokenHiddenId\" aria-hidden=\"true\" class=\"fd-multi-input__invisible-text\">{{\n 'coreMultiInput.tokensCountText' | fdTranslate : { length: selected.length }\n }}</span>\n <fd-tokenizer\n #tokenizer\n [compactCollapse]=\"compactCollapse\"\n [open]=\"open\"\n [tokenizerFocusable]=\"false\"\n (moreClickedEvent)=\"_moreClicked()\"\n class=\"fd-multi-input-tokenizer-custom\"\n tabindex=\"-1\"\n >\n <fd-token\n *ngFor=\"let option of viewModel.selectedOptions; trackBy: _trackBy\"\n [disabled]=\"disabled\"\n (onCloseClick)=\"_onTokenClick(option.value, false, $event)\"\n (onRemove)=\"_onTokenClick(option.value, false)\"\n >\n <span [innerHtml]=\"option.label\"></span>\n </fd-token>\n\n <input\n type=\"text\"\n class=\"fd-input fd-tokenizer__input fd-multi-input-tokenizer-input\"\n autocomplete=\"off\"\n fd-form-control\n fd-input-group-input\n fdkAutoComplete\n (onComplete)=\"_handleComplete($event)\"\n #searchInputElement\n [displayFn]=\"displayFn\"\n [matcher]=\"typeAheadMatcher\"\n [inputText]=\"_searchTermCtrl.value || ''\"\n [options]=\"dropdownValues\"\n [enable]=\"autoComplete && !mobile\"\n [placeholder]=\"placeholder\"\n [formControl]=\"_searchTermCtrl\"\n [attr.aria-required]=\"required\"\n [ariaLabel]=\"ariaLabel || _defaultAriaLabel\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"tokenHiddenId\"\n (keydown)=\"_handleInputKeydown($event)\"\n [attr.id]=\"inputId\"\n (focus)=\"tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n />\n </fd-tokenizer>\n </fd-input-group>\n </ng-template>\n\n <ng-template #list>\n <ul\n *ngIf=\"viewModel.displayedOptions.length\"\n fd-list\n class=\"fd-multi-input-menu-overflow\"\n [selection]=\"true\"\n [mobileMode]=\"mobile\"\n [style.max-height]=\"!mobile ? maxHeight : 'auto'\"\n [byline]=\"byline\"\n (focusEscapeList)=\"handleListFocusEscape($event)\"\n [style.minWidth]=\"'100%'\"\n aria-multiselectable=\"true\"\n >\n <li\n *ngFor=\"let option of viewModel.displayedOptions; index as idx; trackBy: _trackBy\"\n fd-list-item\n [attr.aria-label]=\"option.label\"\n (click)=\"_onCheckboxClick(option.value, $event, idx, true)\"\n (keyup)=\"_onCheckboxKeyup(option.value, $event, idx)\"\n [selected]=\"!!option.isSelected\"\n >\n <fd-checkbox (click)=\"_onCheckboxClick(option.value, $event, idx)\" [value]=\"option.isSelected\">\n <!-- TODO -->\n </fd-checkbox>\n\n <ng-container\n [ngTemplateOutlet]=\"itemSource\"\n [ngTemplateOutletContext]=\"{ option: option }\"\n ></ng-container>\n </li>\n\n <li\n *ngIf=\"showAllButton && viewModel.displayedOptions.length < dropdownValues.length\"\n fd-list-item\n class=\"fd-multi-input-show-all\"\n (keyDown)=\"_showAllKeyDown($event)\"\n (click)=\"_showAllClicked($event)\"\n >\n <a fd-link tabindex=\"0\">Show All ({{ dropdownValues.length }})</a>\n </li>\n </ul>\n </ng-template>\n\n <ng-template let-option=\"option\" #itemSource>\n <span\n *ngIf=\"!itemTemplate\"\n fd-list-title\n [innerHtml]=\"option.label | highlight : _searchTermCtrl.value || '' : highlight\"\n ></span>\n\n <ng-container *ngIf=\"itemTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: option.item }\"\n ></ng-container>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [".fd-multi-input-tokenizer-custom{width:calc(100% - 2.25rem)}[class*=--compact] .fd-multi-input-tokenizer-custom:not([class*=\"--cozy\"]):not([class*=\"--condensed\"]),.is-compact .fd-multi-input-tokenizer-custom:not(.is-cozy):not(.is-condensed),.fd-multi-input-tokenizer-custom[class*=--compact],.fd-multi-input-tokenizer-custom.is-compact{width:calc(100% - 2rem)}.fd-multi-input__invisible-text{display:none!important}.fd-multi-input-input-group-custom{max-width:100%}.fd-multi-input-custom{display:block}.fd-multi-input-item{cursor:pointer;padding:0}.fd-multi-input-popover-size{overflow:auto;display:block}.fd-multi-input-popover-custom.fd-popover-custom{max-width:100%;display:block}.fd-multi-input-show-all{width:100%;display:flex;justify-content:flex-end;background-color:transparent}.fd-multi-input-show-all .fd-link:active{color:inherit}.fd-multi-input-checkbox{width:100%;cursor:pointer}.fd-multi-input-checkbox .fd-checkbox__label{color:inherit}.fd-multi-input-menu-overflow{max-width:37.5rem}.fd-input.fd-multi-input-tokenizer-input{min-width:4rem;margin-top:0;margin-bottom:0;padding-left:0;background-color:transparent}.fd-list--multi-input{max-width:100%}.fd-popover__body--hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.TokenComponent, selector: "fd-token", inputs: ["disabled", "selected", "readOnly", "deleteButtonLabel", "ariaRoleDescription"], outputs: ["onCloseClick", "onRemove", "onTokenClick", "onTokenKeydown", "elementFocused"] }, { kind: "component", type: i4.TokenizerComponent, selector: "fd-tokenizer", inputs: ["class", "disableKeyboardDeletion", "compactCollapse", "tokenizerFocusable", "inputValue", "glyph", "moreTerm", "open"], outputs: ["moreClickedEvent"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i6.ListComponent, selector: "[fd-list], [fdList]", inputs: ["dropdownMode", "multiInputMode", "mobileMode", "hasMessage", "noBorder", "navigationIndicator", "selection", "keyboardSupport", "byline", "unreadIndicator", "role"], outputs: ["focusEscapeList"] }, { kind: "component", type: i6.ListItemComponent, selector: "[fdListItem] ,[fd-list-item]", inputs: ["selected", "ariaDescribedBy", "noData", "action", "interactive", "growing", "counter", "unread", "byline", "selectedListItemScreenReaderText", "navigatedListItemScreenReaderText", "navigatableListItemScreenReaderText"], outputs: ["keyDown"] }, { kind: "directive", type: i6.ListTitleDirective, selector: "[fd-list-title], [fdListTitle]", inputs: ["wrap"] }, { kind: "component", type: i7.PopoverControlComponent, selector: "fd-popover-control" }, { kind: "component", type: i7.PopoverBodyComponent, selector: "fd-popover-body" }, { kind: "component", type: i7.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i8.InputGroupComponent, selector: "fd-input-group", inputs: ["inputTemplate", "placement", "required", "inline", "placeholder", "addOnText", "buttonFocusable", "type", "glyph", "button", "disabled", "readonly", "state", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "iconTitle", "ariaLabelledby", "ariaLabelledBy"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: i8.InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "component", type: i9.FormControlComponent, selector: "[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "directive", type: i9.InputFormControlDirective, selector: "input[fd-form-control]" }, { kind: "component", type: i10.CheckboxComponent, selector: "fd-checkbox", inputs: ["ariaLabel", "value", "ariaLabelledBy", "ariaDescribedBy", "title", "inputId", "state", "name", "label", "disabled", "tristate", "tristateSelectable", "labelClass", "required", "values", "standalone"], outputs: ["focusChange"] }, { kind: "component", type: i11.LinkComponent, selector: "[fdLink], [fd-link], [fd-breadcrumb-link]", inputs: ["class", "emphasized", "disabled", "inverted", "subtle", "undecorated"] }, { kind: "directive", type: i2$1.AutoCompleteDirective, selector: "[fdkAutoComplete], [fdAutoComplete], [fd-auto-complete]", inputs: ["options", "inputText", "enable", "matcher", "displayFn"], outputs: ["onComplete"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.SearchHighlightPipe, name: "highlight" }, { kind: "pipe", type: i12.FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
831
|
+
], viewQueries: [{ propertyName: "popoverRef", first: true, predicate: PopoverComponent, descendants: true }, { propertyName: "controlTemplate", first: true, predicate: ["control"], descendants: true, read: TemplateRef }, { propertyName: "listTemplate", first: true, predicate: ["list"], descendants: true, read: TemplateRef }, { propertyName: "listComponent", first: true, predicate: ListComponent, descendants: true }, { propertyName: "searchInputElement", first: true, predicate: ["searchInputElement"], descendants: true, read: ElementRef }, { propertyName: "tokenizer", first: true, predicate: TokenizerComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"_viewModel$ | async as viewModel\">\n <div class=\"fd-multi-input fd-multi-input-custom\">\n <div class=\"fd-multi-input-field\">\n <ng-container\n [ngTemplateOutlet]=\"control\"\n [ngTemplateOutletContext]=\"{ displayAddonButton: displayAddonButton }\"\n *ngIf=\"mobile\"\n ></ng-container>\n\n <fd-popover\n additionalBodyClass=\"fd-popover-custom-list\"\n *ngIf=\"!mobile\"\n [isOpen]=\"open\"\n (isOpenChange)=\"openChangeHandle($event)\"\n (input)=\"!open && openChangeHandle(true)\"\n [triggers]=\"[]\"\n [maxWidth]=\"_popoverMaxWidth\"\n [disabled]=\"disabled\"\n [fillControlMode]=\"fillControlMode\"\n class=\"fd-multi-input-popover-custom\"\n >\n <fd-popover-control>\n <form (submit)=\"_onSubmit()\">\n <ng-container\n *ngTemplateOutlet=\"control; context: { displayAddonButton: displayAddonButton }\"\n ></ng-container>\n </form>\n </fd-popover-control>\n\n <fd-popover-body\n [attr.aria-hidden]=\"!open\"\n [class.fd-popover__body--hidden]=\"!viewModel.displayedOptions.length\"\n >\n <ng-container *ngTemplateOutlet=\"list\"></ng-container>\n\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n </div>\n </div>\n\n <ng-template #control let-showAddonButton=\"displayAddonButton\">\n <fd-input-group\n class=\"fd-multi-input-input-group-custom\"\n [state]=\"state\"\n [buttonFocusable]=\"buttonFocusable\"\n [button]=\"showAddonButton\"\n [disabled]=\"disabled\"\n [isExpanded]=\"open && !mobile && viewModel.displayedOptions.length > 0\"\n [isControl]=\"true\"\n [glyph]=\"showAddonButton ? glyph : ''\"\n [iconTitle]=\"title\"\n (addOnButtonClicked)=\"_addOnButtonClicked($event)\"\n >\n <span [attr.id]=\"tokenHiddenId\" aria-hidden=\"true\" class=\"fd-multi-input__invisible-text\">{{\n 'coreMultiInput.tokensCountText' | fdTranslate : { length: selected.length }\n }}</span>\n <fd-tokenizer\n #tokenizer\n [compactCollapse]=\"compactCollapse\"\n [open]=\"open\"\n [tokenizerFocusable]=\"false\"\n (moreClickedEvent)=\"_moreClicked()\"\n class=\"fd-multi-input-tokenizer-custom\"\n tabindex=\"-1\"\n >\n <fd-token\n *ngFor=\"let option of viewModel.selectedOptions; trackBy: _trackBy\"\n [disabled]=\"disabled\"\n (onCloseClick)=\"_onTokenClick(option, false, $event)\"\n (onRemove)=\"_onTokenClick(option, false)\"\n >\n <span [innerHtml]=\"option.label\"></span>\n </fd-token>\n\n <input\n type=\"text\"\n class=\"fd-input fd-tokenizer__input fd-multi-input-tokenizer-input\"\n autocomplete=\"off\"\n fd-form-control\n fd-input-group-input\n fdkAutoComplete\n (onComplete)=\"_handleComplete($event)\"\n #searchInputElement\n [displayFn]=\"displayFn\"\n [matcher]=\"typeAheadMatcher\"\n [inputText]=\"_searchTermCtrl.value || ''\"\n [options]=\"dropdownValues\"\n [enable]=\"autoComplete && !mobile\"\n [placeholder]=\"placeholder\"\n [formControl]=\"_searchTermCtrl\"\n [attr.aria-required]=\"required\"\n [ariaLabel]=\"ariaLabel || ('coreMultiInput.multiInputAriaLabel' | fdTranslate)\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"tokenHiddenId\"\n (keydown)=\"_handleInputKeydown($event)\"\n [attr.id]=\"inputId\"\n (focus)=\"tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n />\n </fd-tokenizer>\n </fd-input-group>\n </ng-template>\n\n <ng-template #list>\n <ul\n *ngIf=\"viewModel.displayedOptions.length\"\n fd-list\n class=\"fd-multi-input-menu-overflow\"\n [selection]=\"true\"\n [mobileMode]=\"mobile\"\n [style.max-height]=\"!mobile ? maxHeight : 'auto'\"\n [byline]=\"byline\"\n (focusEscapeList)=\"handleListFocusEscape($event)\"\n [style.min-width]=\"'100%'\"\n aria-multiselectable=\"true\"\n >\n <li\n *ngFor=\"let option of viewModel.displayedOptions; index as idx; trackBy: _trackBy\"\n fd-list-item\n [attr.aria-label]=\"option.label\"\n (click)=\"_onCheckboxClick(option, $event, idx, true)\"\n (keyup)=\"_onCheckboxKeyup(option, $event, idx)\"\n [selected]=\"!!option.isSelected\"\n >\n <fd-checkbox (click)=\"_onCheckboxClick(option, $event, idx)\" [value]=\"option.isSelected\">\n <!-- TODO -->\n </fd-checkbox>\n\n <ng-container\n [ngTemplateOutlet]=\"itemSource\"\n [ngTemplateOutletContext]=\"{ option: option }\"\n ></ng-container>\n </li>\n\n <li\n *ngIf=\"showAllButton && viewModel.displayedOptions.length < dropdownValues.length\"\n fd-list-item\n class=\"fd-multi-input-show-all\"\n (keyDown)=\"_showAllKeyDown($event)\"\n (click)=\"_showAllClicked($event)\"\n >\n <a fd-link tabindex=\"0\" role=\"button\">Show All ({{ dropdownValues.length }})</a>\n </li>\n </ul>\n </ng-template>\n\n <ng-template let-option=\"option\" #itemSource>\n <span\n *ngIf=\"!itemTemplate\"\n fd-list-title\n [innerHtml]=\"option.label | highlight : _searchTermCtrl.value || '' : highlight\"\n ></span>\n\n <ng-container *ngIf=\"itemTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: option.item }\"\n ></ng-container>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [".fd-multi-input-tokenizer-custom{width:calc(100% - 2.25rem)}[class*=--compact] .fd-multi-input-tokenizer-custom:not([class*=\"--cozy\"]):not([class*=\"--condensed\"]),.is-compact .fd-multi-input-tokenizer-custom:not(.is-cozy):not(.is-condensed),.fd-multi-input-tokenizer-custom[class*=--compact],.fd-multi-input-tokenizer-custom.is-compact{width:calc(100% - 2rem)}.fd-multi-input__invisible-text{display:none!important}.fd-multi-input-input-group-custom{max-width:100%}.fd-multi-input-custom{display:block}.fd-multi-input-item{cursor:pointer;padding:0}.fd-multi-input-popover-size{overflow:auto;display:block}.fd-multi-input-popover-custom.fd-popover-custom{max-width:100%;display:block}.fd-multi-input-show-all{width:100%;display:flex;justify-content:flex-end;background-color:transparent}.fd-multi-input-show-all .fd-link:active{color:inherit}.fd-multi-input-checkbox{width:100%;cursor:pointer}.fd-multi-input-checkbox .fd-checkbox__label{color:inherit}.fd-multi-input-menu-overflow{max-width:37.5rem}.fd-input.fd-multi-input-tokenizer-input{min-width:4rem;margin-top:0;margin-bottom:0;padding-left:0;background-color:transparent}.fd-list--multi-input{max-width:100%}.fd-popover__body--hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.TokenComponent, selector: "fd-token", inputs: ["disabled", "selected", "readOnly", "deleteButtonLabel", "ariaRoleDescription"], outputs: ["onCloseClick", "onRemove", "onTokenClick", "onTokenKeydown", "elementFocused"] }, { kind: "component", type: i4.TokenizerComponent, selector: "fd-tokenizer", inputs: ["class", "disableKeyboardDeletion", "compactCollapse", "tokenizerFocusable", "inputValue", "glyph", "moreTerm", "open"], outputs: ["moreClickedEvent"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i6.ListComponent, selector: "[fd-list], [fdList]", inputs: ["dropdownMode", "multiInputMode", "mobileMode", "hasMessage", "noBorder", "navigationIndicator", "selection", "keyboardSupport", "byline", "unreadIndicator", "role"], outputs: ["focusEscapeList"] }, { kind: "component", type: i6.ListItemComponent, selector: "[fdListItem] ,[fd-list-item]", inputs: ["selected", "ariaDescribedBy", "noData", "action", "interactive", "growing", "counter", "unread", "byline", "selectedListItemScreenReaderText", "navigatedListItemScreenReaderText", "navigatableListItemScreenReaderText"], outputs: ["keyDown"] }, { kind: "directive", type: i6.ListTitleDirective, selector: "[fd-list-title], [fdListTitle]", inputs: ["wrap"] }, { kind: "component", type: i7.PopoverControlComponent, selector: "fd-popover-control" }, { kind: "component", type: i7.PopoverBodyComponent, selector: "fd-popover-body" }, { kind: "component", type: i7.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i8.InputGroupComponent, selector: "fd-input-group", inputs: ["inputTemplate", "placement", "required", "inline", "placeholder", "addOnText", "buttonFocusable", "type", "glyph", "button", "disabled", "readonly", "state", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "iconTitle", "ariaLabelledby", "ariaLabelledBy"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: i8.InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "component", type: i9.FormControlComponent, selector: "[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "directive", type: i9.InputFormControlDirective, selector: "input[fd-form-control]" }, { kind: "component", type: i10.CheckboxComponent, selector: "fd-checkbox", inputs: ["ariaLabel", "value", "ariaLabelledBy", "ariaDescribedBy", "title", "inputId", "state", "name", "label", "disabled", "tristate", "tristateSelectable", "labelClass", "required", "values", "standalone"], outputs: ["focusChange"] }, { kind: "component", type: i11.LinkComponent, selector: "[fdLink], [fd-link], [fd-breadcrumb-link]", inputs: ["class", "emphasized", "disabled", "inverted", "subtle", "undecorated"] }, { kind: "directive", type: i2$1.AutoCompleteDirective, selector: "[fdkAutoComplete], [fdAutoComplete], [fd-auto-complete]", inputs: ["options", "inputText", "enable", "matcher", "displayFn"], outputs: ["onComplete"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.SearchHighlightPipe, name: "highlight" }, { kind: "pipe", type: i12.FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
782
832
|
__decorate([
|
|
783
833
|
applyCssClass,
|
|
784
834
|
__metadata("design:type", Function),
|
|
@@ -796,11 +846,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
796
846
|
MenuKeyboardService,
|
|
797
847
|
registerFormItemControl(MultiInputComponent),
|
|
798
848
|
contentDensityObserverProviders()
|
|
799
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"_viewModel$ | async as viewModel\">\n <div class=\"fd-multi-input fd-multi-input-custom\">\n <div class=\"fd-multi-input-field\">\n <ng-container\n [ngTemplateOutlet]=\"control\"\n [ngTemplateOutletContext]=\"{ displayAddonButton: displayAddonButton }\"\n *ngIf=\"mobile\"\n ></ng-container>\n\n <fd-popover\n additionalBodyClass=\"fd-popover-custom-list\"\n *ngIf=\"!mobile\"\n [isOpen]=\"open\"\n (isOpenChange)=\"openChangeHandle($event)\"\n (input)=\"!open && openChangeHandle(true)\"\n [triggers]=\"[]\"\n [maxWidth]=\"_popoverMaxWidth\"\n [disabled]=\"disabled\"\n [fillControlMode]=\"fillControlMode\"\n class=\"fd-multi-input-popover-custom\"\n >\n <fd-popover-control>\n <form (submit)=\"_onSubmit()\">\n <ng-container\n *ngTemplateOutlet=\"control; context: { displayAddonButton: displayAddonButton }\"\n ></ng-container>\n </form>\n </fd-popover-control>\n\n <fd-popover-body\n [attr.aria-hidden]=\"!open\"\n [class.fd-popover__body--hidden]=\"!viewModel.displayedOptions.length\"\n >\n <ng-container *ngTemplateOutlet=\"list\"></ng-container>\n\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n </div>\n </div>\n\n <ng-template #control let-showAddonButton=\"displayAddonButton\">\n <fd-input-group\n class=\"fd-multi-input-input-group-custom\"\n [state]=\"state\"\n [buttonFocusable]=\"buttonFocusable\"\n [button]=\"showAddonButton\"\n [disabled]=\"disabled\"\n [isExpanded]=\"open && !mobile && viewModel.displayedOptions.length > 0\"\n [isControl]=\"true\"\n [glyph]=\"showAddonButton ? glyph : ''\"\n [iconTitle]=\"title\"\n (addOnButtonClicked)=\"_addOnButtonClicked($event)\"\n >\n <span [attr.id]=\"tokenHiddenId\" aria-hidden=\"true\" class=\"fd-multi-input__invisible-text\">{{\n 'coreMultiInput.tokensCountText' | fdTranslate : { length: selected.length }\n }}</span>\n <fd-tokenizer\n #tokenizer\n [compactCollapse]=\"compactCollapse\"\n [open]=\"open\"\n [tokenizerFocusable]=\"false\"\n (moreClickedEvent)=\"_moreClicked()\"\n class=\"fd-multi-input-tokenizer-custom\"\n tabindex=\"-1\"\n >\n <fd-token\n *ngFor=\"let option of viewModel.selectedOptions; trackBy: _trackBy\"\n [disabled]=\"disabled\"\n (onCloseClick)=\"_onTokenClick(option
|
|
800
|
-
}], ctorParameters: function () { return [{ type: i1$1.ContentDensityObserver }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2$1.DynamicComponentService }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type:
|
|
801
|
-
type: Inject,
|
|
802
|
-
args: [FD_LANGUAGE]
|
|
803
|
-
}] }, { type: i2$1.RtlService, decorators: [{
|
|
849
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"_viewModel$ | async as viewModel\">\n <div class=\"fd-multi-input fd-multi-input-custom\">\n <div class=\"fd-multi-input-field\">\n <ng-container\n [ngTemplateOutlet]=\"control\"\n [ngTemplateOutletContext]=\"{ displayAddonButton: displayAddonButton }\"\n *ngIf=\"mobile\"\n ></ng-container>\n\n <fd-popover\n additionalBodyClass=\"fd-popover-custom-list\"\n *ngIf=\"!mobile\"\n [isOpen]=\"open\"\n (isOpenChange)=\"openChangeHandle($event)\"\n (input)=\"!open && openChangeHandle(true)\"\n [triggers]=\"[]\"\n [maxWidth]=\"_popoverMaxWidth\"\n [disabled]=\"disabled\"\n [fillControlMode]=\"fillControlMode\"\n class=\"fd-multi-input-popover-custom\"\n >\n <fd-popover-control>\n <form (submit)=\"_onSubmit()\">\n <ng-container\n *ngTemplateOutlet=\"control; context: { displayAddonButton: displayAddonButton }\"\n ></ng-container>\n </form>\n </fd-popover-control>\n\n <fd-popover-body\n [attr.aria-hidden]=\"!open\"\n [class.fd-popover__body--hidden]=\"!viewModel.displayedOptions.length\"\n >\n <ng-container *ngTemplateOutlet=\"list\"></ng-container>\n\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n </div>\n </div>\n\n <ng-template #control let-showAddonButton=\"displayAddonButton\">\n <fd-input-group\n class=\"fd-multi-input-input-group-custom\"\n [state]=\"state\"\n [buttonFocusable]=\"buttonFocusable\"\n [button]=\"showAddonButton\"\n [disabled]=\"disabled\"\n [isExpanded]=\"open && !mobile && viewModel.displayedOptions.length > 0\"\n [isControl]=\"true\"\n [glyph]=\"showAddonButton ? glyph : ''\"\n [iconTitle]=\"title\"\n (addOnButtonClicked)=\"_addOnButtonClicked($event)\"\n >\n <span [attr.id]=\"tokenHiddenId\" aria-hidden=\"true\" class=\"fd-multi-input__invisible-text\">{{\n 'coreMultiInput.tokensCountText' | fdTranslate : { length: selected.length }\n }}</span>\n <fd-tokenizer\n #tokenizer\n [compactCollapse]=\"compactCollapse\"\n [open]=\"open\"\n [tokenizerFocusable]=\"false\"\n (moreClickedEvent)=\"_moreClicked()\"\n class=\"fd-multi-input-tokenizer-custom\"\n tabindex=\"-1\"\n >\n <fd-token\n *ngFor=\"let option of viewModel.selectedOptions; trackBy: _trackBy\"\n [disabled]=\"disabled\"\n (onCloseClick)=\"_onTokenClick(option, false, $event)\"\n (onRemove)=\"_onTokenClick(option, false)\"\n >\n <span [innerHtml]=\"option.label\"></span>\n </fd-token>\n\n <input\n type=\"text\"\n class=\"fd-input fd-tokenizer__input fd-multi-input-tokenizer-input\"\n autocomplete=\"off\"\n fd-form-control\n fd-input-group-input\n fdkAutoComplete\n (onComplete)=\"_handleComplete($event)\"\n #searchInputElement\n [displayFn]=\"displayFn\"\n [matcher]=\"typeAheadMatcher\"\n [inputText]=\"_searchTermCtrl.value || ''\"\n [options]=\"dropdownValues\"\n [enable]=\"autoComplete && !mobile\"\n [placeholder]=\"placeholder\"\n [formControl]=\"_searchTermCtrl\"\n [attr.aria-required]=\"required\"\n [ariaLabel]=\"ariaLabel || ('coreMultiInput.multiInputAriaLabel' | fdTranslate)\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"tokenHiddenId\"\n (keydown)=\"_handleInputKeydown($event)\"\n [attr.id]=\"inputId\"\n (focus)=\"tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n />\n </fd-tokenizer>\n </fd-input-group>\n </ng-template>\n\n <ng-template #list>\n <ul\n *ngIf=\"viewModel.displayedOptions.length\"\n fd-list\n class=\"fd-multi-input-menu-overflow\"\n [selection]=\"true\"\n [mobileMode]=\"mobile\"\n [style.max-height]=\"!mobile ? maxHeight : 'auto'\"\n [byline]=\"byline\"\n (focusEscapeList)=\"handleListFocusEscape($event)\"\n [style.min-width]=\"'100%'\"\n aria-multiselectable=\"true\"\n >\n <li\n *ngFor=\"let option of viewModel.displayedOptions; index as idx; trackBy: _trackBy\"\n fd-list-item\n [attr.aria-label]=\"option.label\"\n (click)=\"_onCheckboxClick(option, $event, idx, true)\"\n (keyup)=\"_onCheckboxKeyup(option, $event, idx)\"\n [selected]=\"!!option.isSelected\"\n >\n <fd-checkbox (click)=\"_onCheckboxClick(option, $event, idx)\" [value]=\"option.isSelected\">\n <!-- TODO -->\n </fd-checkbox>\n\n <ng-container\n [ngTemplateOutlet]=\"itemSource\"\n [ngTemplateOutletContext]=\"{ option: option }\"\n ></ng-container>\n </li>\n\n <li\n *ngIf=\"showAllButton && viewModel.displayedOptions.length < dropdownValues.length\"\n fd-list-item\n class=\"fd-multi-input-show-all\"\n (keyDown)=\"_showAllKeyDown($event)\"\n (click)=\"_showAllClicked($event)\"\n >\n <a fd-link tabindex=\"0\" role=\"button\">Show All ({{ dropdownValues.length }})</a>\n </li>\n </ul>\n </ng-template>\n\n <ng-template let-option=\"option\" #itemSource>\n <span\n *ngIf=\"!itemTemplate\"\n fd-list-title\n [innerHtml]=\"option.label | highlight : _searchTermCtrl.value || '' : highlight\"\n ></span>\n\n <ng-container *ngIf=\"itemTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: option.item }\"\n ></ng-container>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [".fd-multi-input-tokenizer-custom{width:calc(100% - 2.25rem)}[class*=--compact] .fd-multi-input-tokenizer-custom:not([class*=\"--cozy\"]):not([class*=\"--condensed\"]),.is-compact .fd-multi-input-tokenizer-custom:not(.is-cozy):not(.is-condensed),.fd-multi-input-tokenizer-custom[class*=--compact],.fd-multi-input-tokenizer-custom.is-compact{width:calc(100% - 2rem)}.fd-multi-input__invisible-text{display:none!important}.fd-multi-input-input-group-custom{max-width:100%}.fd-multi-input-custom{display:block}.fd-multi-input-item{cursor:pointer;padding:0}.fd-multi-input-popover-size{overflow:auto;display:block}.fd-multi-input-popover-custom.fd-popover-custom{max-width:100%;display:block}.fd-multi-input-show-all{width:100%;display:flex;justify-content:flex-end;background-color:transparent}.fd-multi-input-show-all .fd-link:active{color:inherit}.fd-multi-input-checkbox{width:100%;cursor:pointer}.fd-multi-input-checkbox .fd-checkbox__label{color:inherit}.fd-multi-input-menu-overflow{max-width:37.5rem}.fd-input.fd-multi-input-tokenizer-input{min-width:4rem;margin-top:0;margin-bottom:0;padding-left:0;background-color:transparent}.fd-list--multi-input{max-width:100%}.fd-popover__body--hidden{display:none}\n"] }]
|
|
850
|
+
}], ctorParameters: function () { return [{ type: i1$1.ContentDensityObserver }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2$1.DynamicComponentService }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: i2$1.RtlService, decorators: [{
|
|
804
851
|
type: Optional
|
|
805
852
|
}] }, { type: i2$1.FocusTrapService, decorators: [{
|
|
806
853
|
type: Optional
|
|
@@ -838,6 +885,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
838
885
|
type: Input
|
|
839
886
|
}], newTokenParseFn: [{
|
|
840
887
|
type: Input
|
|
888
|
+
}], optionItemIdentifier: [{
|
|
889
|
+
type: Input
|
|
841
890
|
}], newTokenValidateFn: [{
|
|
842
891
|
type: Input
|
|
843
892
|
}], ariaLabel: [{
|