@fundamental-ngx/core 0.43.10 → 0.43.11
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 +3 -3
- 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 +2 -2
- 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 +2 -2
- 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.11.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 { __awaiter, __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 { MobileModeBase, MobileModeControl, MOBILE_MODE_CONFIG } from '@fundamental-ngx/core/mobile-mode';
|
|
35
34
|
import * as i1 from '@fundamental-ngx/core/dialog';
|
|
36
35
|
import { DialogModule } from '@fundamental-ngx/core/dialog';
|
|
@@ -159,8 +158,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
159
158
|
}]
|
|
160
159
|
}] });
|
|
161
160
|
|
|
161
|
+
class PairSelectionModel {
|
|
162
|
+
constructor() {
|
|
163
|
+
/** @hidden */
|
|
164
|
+
this._selected = new Map();
|
|
165
|
+
/** Event emitted when the selection has changed. */
|
|
166
|
+
this.selectionChanged = new EventEmitter();
|
|
167
|
+
}
|
|
168
|
+
/** Array of selected items */
|
|
169
|
+
get selected() {
|
|
170
|
+
return [...this._selected.values()];
|
|
171
|
+
}
|
|
172
|
+
/** Whether the given key exists in the record */
|
|
173
|
+
isSelected(key) {
|
|
174
|
+
return this._selected.has(key);
|
|
175
|
+
}
|
|
176
|
+
/** Selects the given key-value pair */
|
|
177
|
+
select(keyOrValues, value) {
|
|
178
|
+
if (value) {
|
|
179
|
+
this._selected.set(keyOrValues, value);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
keyOrValues.forEach(([key, v]) => this._selected.set(key, v));
|
|
183
|
+
}
|
|
184
|
+
this.selectionChanged.emit([...this._selected]);
|
|
185
|
+
}
|
|
186
|
+
/** Deselects the given key */
|
|
187
|
+
deselect(key) {
|
|
188
|
+
this._selected.delete(key);
|
|
189
|
+
this.selectionChanged.emit([...this._selected]);
|
|
190
|
+
}
|
|
191
|
+
/** Clears the selection information */
|
|
192
|
+
clear() {
|
|
193
|
+
this._selected.clear();
|
|
194
|
+
this.selectionChanged.emit([...this._selected]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
162
198
|
function isOptionItem(candidate) {
|
|
163
|
-
return isOptionItemBase(candidate) && 'item' in candidate;
|
|
199
|
+
return isOptionItemBase(candidate) && 'item' in candidate && 'id' in candidate;
|
|
164
200
|
}
|
|
165
201
|
function isOptionItemBase(candidate) {
|
|
166
202
|
return typeof candidate === 'object' && candidate !== null && 'value' in candidate && 'label' in candidate;
|
|
@@ -184,10 +220,21 @@ class MultiInputComponent {
|
|
|
184
220
|
/** Selected dropdown items. */
|
|
185
221
|
set selected(values) {
|
|
186
222
|
this._selectionModel.clear();
|
|
187
|
-
|
|
223
|
+
if (values) {
|
|
224
|
+
const potentialItems = [...values];
|
|
225
|
+
const options = [];
|
|
226
|
+
potentialItems.forEach((value) => {
|
|
227
|
+
let optionItem = this._optionItems.find((i) => i.value === value);
|
|
228
|
+
if (!optionItem) {
|
|
229
|
+
optionItem = this._getOptionItem(value);
|
|
230
|
+
}
|
|
231
|
+
options.push(optionItem);
|
|
232
|
+
});
|
|
233
|
+
this._selectionModel.select(options.map((item) => [item.id, item]));
|
|
234
|
+
}
|
|
188
235
|
}
|
|
189
236
|
get selected() {
|
|
190
|
-
return this._selectionModel.selected;
|
|
237
|
+
return this._selectionModel.selected.map((c) => c.value);
|
|
191
238
|
}
|
|
192
239
|
/** @hidden */
|
|
193
240
|
get _popoverMaxWidth() {
|
|
@@ -199,6 +246,10 @@ class MultiInputComponent {
|
|
|
199
246
|
}
|
|
200
247
|
return this.elementRef.nativeElement.getBoundingClientRect().width;
|
|
201
248
|
}
|
|
249
|
+
/** @hidden */
|
|
250
|
+
get _optionItems() {
|
|
251
|
+
return this.optionItems$.value;
|
|
252
|
+
}
|
|
202
253
|
/** typeahead matcher function */
|
|
203
254
|
get typeAheadMatcher() {
|
|
204
255
|
if (this.includes) {
|
|
@@ -207,14 +258,13 @@ class MultiInputComponent {
|
|
|
207
258
|
return (item, searchTerm) => item.startsWith(searchTerm);
|
|
208
259
|
}
|
|
209
260
|
/** @hidden */
|
|
210
|
-
constructor(_contentDensityObserver, elementRef, _changeDetRef, _dynamicComponentService, _injector, _viewContainerRef,
|
|
261
|
+
constructor(_contentDensityObserver, elementRef, _changeDetRef, _dynamicComponentService, _injector, _viewContainerRef, _rtlService, _focusTrapService) {
|
|
211
262
|
this._contentDensityObserver = _contentDensityObserver;
|
|
212
263
|
this.elementRef = elementRef;
|
|
213
264
|
this._changeDetRef = _changeDetRef;
|
|
214
265
|
this._dynamicComponentService = _dynamicComponentService;
|
|
215
266
|
this._injector = _injector;
|
|
216
267
|
this._viewContainerRef = _viewContainerRef;
|
|
217
|
-
this._language = _language;
|
|
218
268
|
this._rtlService = _rtlService;
|
|
219
269
|
this._focusTrapService = _focusTrapService;
|
|
220
270
|
/** Placeholder for the input field. */
|
|
@@ -327,7 +377,7 @@ class MultiInputComponent {
|
|
|
327
377
|
/** @hidden */
|
|
328
378
|
this._searchTermCtrl = new FormControl('');
|
|
329
379
|
/** @hidden */
|
|
330
|
-
this._selectionModel = new
|
|
380
|
+
this._selectionModel = new PairSelectionModel();
|
|
331
381
|
/** @hidden */
|
|
332
382
|
this._viewModel$ = this._getViewModel();
|
|
333
383
|
/** @hidden */
|
|
@@ -335,8 +385,6 @@ class MultiInputComponent {
|
|
|
335
385
|
/** @hidden */
|
|
336
386
|
this._rangeSelector = new RangeSelector();
|
|
337
387
|
/** @hidden */
|
|
338
|
-
this._translationResolver = new TranslationResolver();
|
|
339
|
-
/** @hidden */
|
|
340
388
|
this._trackBy = (index, optionItem) => this.valueFn(optionItem === null || optionItem === void 0 ? void 0 : optionItem.item);
|
|
341
389
|
/** @hidden */
|
|
342
390
|
this.onChange = () => { };
|
|
@@ -382,9 +430,6 @@ class MultiInputComponent {
|
|
|
382
430
|
this._subscriptions.add(this._getViewModel()
|
|
383
431
|
.pipe(map((viewModel) => !viewModel.displayedOptions.some((c) => !c.isSelected)))
|
|
384
432
|
.subscribe((allItemsSelected) => this.allItemsSelectedChange.emit(allItemsSelected)));
|
|
385
|
-
this._subscriptions.add(this._language.subscribe(() => {
|
|
386
|
-
this._getAriaLabel();
|
|
387
|
-
}));
|
|
388
433
|
}
|
|
389
434
|
/** @hidden */
|
|
390
435
|
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,18 +525,18 @@ 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
|
-
_onCheckboxClick(
|
|
534
|
+
_onCheckboxClick(option, event, index, isListItem = false) {
|
|
490
535
|
return __awaiter(this, void 0, void 0, function* () {
|
|
491
|
-
const toggledSelection = !this._selectionModel.isSelected(
|
|
536
|
+
const toggledSelection = !this._selectionModel.isSelected(option.id);
|
|
492
537
|
this._rangeSelector.onRangeElementToggled(index, event);
|
|
493
538
|
const sub = this._viewModel$.pipe(first()).subscribe((vm) => {
|
|
494
|
-
this._rangeSelector.applyValueToEachInRange((idx) => this._handleSelect(toggledSelection, vm.displayedOptions[idx]
|
|
539
|
+
this._rangeSelector.applyValueToEachInRange((idx) => this._handleSelect(toggledSelection, vm.displayedOptions[idx], false));
|
|
495
540
|
this._changeDetRef.detectChanges();
|
|
496
541
|
});
|
|
497
542
|
this._subscriptions.add(sub);
|
|
@@ -505,18 +550,18 @@ class MultiInputComponent {
|
|
|
505
550
|
});
|
|
506
551
|
}
|
|
507
552
|
/** @hidden */
|
|
508
|
-
_onTokenClick(
|
|
553
|
+
_onTokenClick(option, resetSearch, event) {
|
|
509
554
|
event === null || event === void 0 ? void 0 : event.preventDefault(); // prevent this function from being called twice when checkbox updates
|
|
510
|
-
this._handleSelect(false,
|
|
555
|
+
this._handleSelect(false, option, resetSearch, true);
|
|
511
556
|
}
|
|
512
557
|
/** @hidden */
|
|
513
|
-
_handleSelect(checked,
|
|
558
|
+
_handleSelect(checked, option, resetSearch = true, fromTokenCloseClick = false) {
|
|
514
559
|
const previousLength = this._selectionModel.selected.length;
|
|
515
560
|
if (checked) {
|
|
516
|
-
this._selectionModel.select(
|
|
561
|
+
this._selectionModel.select(option.id, option);
|
|
517
562
|
}
|
|
518
563
|
else {
|
|
519
|
-
this._selectionModel.deselect(
|
|
564
|
+
this._selectionModel.deselect(option.id);
|
|
520
565
|
}
|
|
521
566
|
// Handle popover placement update
|
|
522
567
|
if (this._shouldPopoverBeUpdated(previousLength, this._selectionModel.selected.length)) {
|
|
@@ -640,14 +685,14 @@ class MultiInputComponent {
|
|
|
640
685
|
_addNewTokenToDropDownValues(newToken) {
|
|
641
686
|
this.dropdownValues.push(newToken);
|
|
642
687
|
const newOption = this._getOptionItem(newToken);
|
|
643
|
-
this.optionItems$.next([...this.
|
|
688
|
+
this.optionItems$.next([...this._optionItems, newOption]);
|
|
644
689
|
}
|
|
645
690
|
/** @hidden */
|
|
646
691
|
_selectFirstFiltered(searchTerm) {
|
|
647
692
|
const filtered = this.filterFn(this.dropdownValues, searchTerm);
|
|
648
693
|
if (Array.isArray(filtered) && filtered.length > 0 && this.autoComplete) {
|
|
649
694
|
const optionItem = this._getOptionItem(filtered[0]);
|
|
650
|
-
this._handleSelect(true, optionItem
|
|
695
|
+
this._handleSelect(true, optionItem);
|
|
651
696
|
this._searchTermCtrl.setValue('');
|
|
652
697
|
this.open = false;
|
|
653
698
|
return true;
|
|
@@ -659,8 +704,8 @@ class MultiInputComponent {
|
|
|
659
704
|
const searchLower = searchTerm.toLocaleLowerCase();
|
|
660
705
|
return contentArray.filter((item) => {
|
|
661
706
|
if (item) {
|
|
662
|
-
const displayedValue = this.displayFn(item);
|
|
663
|
-
const term =
|
|
707
|
+
const displayedValue = isOptionItem(item) ? item.label : this.displayFn(item);
|
|
708
|
+
const term = (displayedValue === null || displayedValue === void 0 ? void 0 : displayedValue.toLocaleLowerCase()) || '';
|
|
664
709
|
return this.typeAheadMatcher(term, searchLower);
|
|
665
710
|
}
|
|
666
711
|
});
|
|
@@ -693,7 +738,7 @@ class MultiInputComponent {
|
|
|
693
738
|
/** @hidden */
|
|
694
739
|
_propagateChange(emitInMobile) {
|
|
695
740
|
if (!this.mobile || emitInMobile) {
|
|
696
|
-
const selected =
|
|
741
|
+
const selected = this._selectionModel.selected.map((c) => c.value);
|
|
697
742
|
this.onChange(selected);
|
|
698
743
|
this.selectedChange.emit(selected);
|
|
699
744
|
}
|
|
@@ -717,6 +762,20 @@ class MultiInputComponent {
|
|
|
717
762
|
});
|
|
718
763
|
}
|
|
719
764
|
/** @hidden */
|
|
765
|
+
_getItemIdentifier(item) {
|
|
766
|
+
if (!this.optionItemIdentifier) {
|
|
767
|
+
const value = this.valueFn(item);
|
|
768
|
+
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'symbol' && isDevMode()) {
|
|
769
|
+
console.warn('optionItemIdentifier is not set and valueFn does not return a string, number or symbol', item);
|
|
770
|
+
}
|
|
771
|
+
return value;
|
|
772
|
+
}
|
|
773
|
+
if (typeof this.optionItemIdentifier === 'function') {
|
|
774
|
+
return this.optionItemIdentifier(item);
|
|
775
|
+
}
|
|
776
|
+
return get(item, this.optionItemIdentifier);
|
|
777
|
+
}
|
|
778
|
+
/** @hidden */
|
|
720
779
|
_resetSearchTerm() {
|
|
721
780
|
this._searchTermCtrl.setValue('');
|
|
722
781
|
this._changeDetRef.detectChanges();
|
|
@@ -728,6 +787,7 @@ class MultiInputComponent {
|
|
|
728
787
|
}
|
|
729
788
|
const { label, value } = this._getValueAndLabelOfItem(item);
|
|
730
789
|
return {
|
|
790
|
+
id: this._getItemIdentifier(item),
|
|
731
791
|
item,
|
|
732
792
|
label,
|
|
733
793
|
value,
|
|
@@ -751,36 +811,24 @@ class MultiInputComponent {
|
|
|
751
811
|
return { label, value };
|
|
752
812
|
}
|
|
753
813
|
/** @hidden */
|
|
754
|
-
_getOptionItemByValue(value, optionItems = []) {
|
|
755
|
-
return optionItems.find((c) => c.value === value);
|
|
756
|
-
}
|
|
757
|
-
/** @hidden */
|
|
758
814
|
_getViewModel() {
|
|
759
815
|
return combineLatest([
|
|
760
816
|
this._searchTermCtrl.valueChanges.pipe(startWith(this._searchTermCtrl.value)),
|
|
761
|
-
this._selectionModel.
|
|
817
|
+
this._selectionModel.selectionChanged.pipe(startWith(null)),
|
|
762
818
|
this.optionItems$
|
|
763
|
-
]).pipe(map((
|
|
819
|
+
]).pipe(map(() => {
|
|
764
820
|
var _a;
|
|
765
|
-
const selected = this.selected.map((v) => this._getOptionItemByValue(v, optionItems) || this._getOptionItem(v));
|
|
766
821
|
// not using "searchTerm" value from combineLatest as it will be wrong for late subscribers, if any
|
|
767
822
|
const searchTerm = (_a = this._searchTermCtrl.value) !== null && _a !== void 0 ? _a : '';
|
|
768
|
-
const filtered = this.filterFn(
|
|
823
|
+
const filtered = this.filterFn(this.dropdownValues, searchTerm);
|
|
769
824
|
const displayedOptions = (Array.isArray(filtered) ? filtered : []).map((item) => this._getOptionItem(item));
|
|
770
|
-
displayedOptions.forEach((c) => (c.isSelected =
|
|
771
|
-
return { selectedOptions: selected, displayedOptions };
|
|
825
|
+
displayedOptions.forEach((c) => (c.isSelected = this._selectionModel.isSelected(c.id)));
|
|
826
|
+
return { selectedOptions: this._selectionModel.selected, displayedOptions };
|
|
772
827
|
}));
|
|
773
828
|
}
|
|
774
|
-
/** @hidden */
|
|
775
|
-
_getAriaLabel() {
|
|
776
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
777
|
-
const lang = yield firstValueFrom(this._language);
|
|
778
|
-
this._defaultAriaLabel = this._translationResolver.resolve(lang, 'coreMultiInput.multiInputAriaLabel');
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
829
|
}
|
|
782
|
-
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:
|
|
783
|
-
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: [
|
|
830
|
+
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 });
|
|
831
|
+
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: [
|
|
784
832
|
{
|
|
785
833
|
provide: NG_VALUE_ACCESSOR,
|
|
786
834
|
useExisting: forwardRef(() => MultiInputComponent),
|
|
@@ -789,7 +837,7 @@ MultiInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
|
|
|
789
837
|
MenuKeyboardService,
|
|
790
838
|
registerFormItemControl(MultiInputComponent),
|
|
791
839
|
contentDensityObserverProviders()
|
|
792
|
-
], 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 });
|
|
840
|
+
], 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 });
|
|
793
841
|
__decorate([
|
|
794
842
|
applyCssClass,
|
|
795
843
|
__metadata("design:type", Function),
|
|
@@ -807,12 +855,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
807
855
|
MenuKeyboardService,
|
|
808
856
|
registerFormItemControl(MultiInputComponent),
|
|
809
857
|
contentDensityObserverProviders()
|
|
810
|
-
], 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
|
|
858
|
+
], 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"] }]
|
|
811
859
|
}], ctorParameters: function () {
|
|
812
|
-
return [{ type: i1$1.ContentDensityObserver }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2$1.DynamicComponentService }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type:
|
|
813
|
-
type: Inject,
|
|
814
|
-
args: [FD_LANGUAGE]
|
|
815
|
-
}] }, { type: i2$1.RtlService, decorators: [{
|
|
860
|
+
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: [{
|
|
816
861
|
type: Optional
|
|
817
862
|
}] }, { type: i2$1.FocusTrapService, decorators: [{
|
|
818
863
|
type: Optional
|
|
@@ -851,6 +896,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
851
896
|
type: Input
|
|
852
897
|
}], newTokenParseFn: [{
|
|
853
898
|
type: Input
|
|
899
|
+
}], optionItemIdentifier: [{
|
|
900
|
+
type: Input
|
|
854
901
|
}], newTokenValidateFn: [{
|
|
855
902
|
type: Input
|
|
856
903
|
}], ariaLabel: [{
|