@fundamental-ngx/platform 0.64.2-rc.29 → 0.64.2-rc.30
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Input, Optional, Inject, Directive, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, Component, Injectable, forwardRef, EventEmitter, inject, DestroyRef, TemplateRef, ElementRef, booleanAttribute, ViewChildren, ContentChildren, ViewChild, Output, Self, SkipSelf, Attribute, NgModule, input, HostListener, Injector, computed, Pipe, ChangeDetectorRef,
|
|
2
|
+
import { InjectionToken, Input, Optional, Inject, Directive, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, Component, Injectable, forwardRef, EventEmitter, inject, DestroyRef, TemplateRef, ElementRef, booleanAttribute, ViewChildren, ContentChildren, ViewChild, Output, Self, SkipSelf, Attribute, NgModule, input, signal, HostListener, Injector, computed, Pipe, ChangeDetectorRef, effect, isDevMode, Renderer2, LOCALE_ID } from '@angular/core';
|
|
3
3
|
import * as i1$4 from '@fundamental-ngx/cdk/forms';
|
|
4
4
|
import { FD_FORM_FIELD, FD_FORM_FIELD_CONTROL, CvaControl, CvaDirective } from '@fundamental-ngx/cdk/forms';
|
|
5
5
|
import * as i1 from '@fundamental-ngx/platform/shared';
|
|
@@ -1861,10 +1861,13 @@ class TextAreaComponent extends BaseInput {
|
|
|
1861
1861
|
set value(value) {
|
|
1862
1862
|
if (value) {
|
|
1863
1863
|
super.setValue(value);
|
|
1864
|
+
this.updateCounterInteractions();
|
|
1864
1865
|
}
|
|
1865
1866
|
else {
|
|
1866
1867
|
// when custom value not set, we should set/reset counter to maxlength value when it becomes undefined
|
|
1867
|
-
this.
|
|
1868
|
+
this._textAreaCharCount.set(0);
|
|
1869
|
+
this.counterExcessOrRemaining.set(this.remainingText);
|
|
1870
|
+
this.exceededCharCount.set(this.maxLength ? this.maxLength : 0);
|
|
1868
1871
|
// reset state by resetting value
|
|
1869
1872
|
super.setValue('');
|
|
1870
1873
|
}
|
|
@@ -1904,14 +1907,17 @@ class TextAreaComponent extends BaseInput {
|
|
|
1904
1907
|
/** @hidden */
|
|
1905
1908
|
this.hasTextExceeded = false;
|
|
1906
1909
|
/** @hidden excess character count */
|
|
1907
|
-
this.exceededCharCount = 0
|
|
1910
|
+
this.exceededCharCount = signal(0, /* @ts-ignore */
|
|
1911
|
+
...(ngDevMode ? [{ debugName: "exceededCharCount" }] : /* istanbul ignore next */ []));
|
|
1908
1912
|
/** @hidden a string placeholder that toggles between 'remaining' and 'excess' for the select ICU expression */
|
|
1909
|
-
this.counterExcessOrRemaining = 'remaining'
|
|
1913
|
+
this.counterExcessOrRemaining = signal('remaining', /* @ts-ignore */
|
|
1914
|
+
...(ngDevMode ? [{ debugName: "counterExcessOrRemaining" }] : /* istanbul ignore next */ []));
|
|
1910
1915
|
/** @hidden flag to check if there is an initial value set */
|
|
1911
1916
|
this.isValueCustomSet = false;
|
|
1912
1917
|
/** @hidden */
|
|
1913
1918
|
/** to keep track of number of characters in the textarea */
|
|
1914
|
-
this._textAreaCharCount = 0
|
|
1919
|
+
this._textAreaCharCount = signal(0, /* @ts-ignore */
|
|
1920
|
+
...(ngDevMode ? [{ debugName: "_textAreaCharCount" }] : /* istanbul ignore next */ []));
|
|
1915
1921
|
/** @hidden */
|
|
1916
1922
|
this._isPasted = false;
|
|
1917
1923
|
/** for i18n counter message translation */
|
|
@@ -1934,8 +1940,8 @@ class TextAreaComponent extends BaseInput {
|
|
|
1934
1940
|
if (this._shouldTrackTextLimit && KeyUtil.isKeyCode(event, [DELETE, BACKSPACE])) {
|
|
1935
1941
|
// for the custom value set and showExceededText=false case, on any key press, remove excess characters
|
|
1936
1942
|
if (this.value) {
|
|
1937
|
-
this._textAreaCharCount
|
|
1938
|
-
if (this._textAreaCharCount > this.maxLength) {
|
|
1943
|
+
this._textAreaCharCount.set(this.value.length);
|
|
1944
|
+
if (this._textAreaCharCount() > this.maxLength) {
|
|
1939
1945
|
// remove excess characters
|
|
1940
1946
|
this.value = this.value.substring(0, this.maxLength);
|
|
1941
1947
|
this.isValueCustomSet = false; // since value is now changed, it is no longer custom set
|
|
@@ -1950,7 +1956,7 @@ class TextAreaComponent extends BaseInput {
|
|
|
1950
1956
|
}
|
|
1951
1957
|
// if not custom set, set counter to max length value, else it calculates remaining/exceeded characters.
|
|
1952
1958
|
if (!this.value) {
|
|
1953
|
-
this.exceededCharCount
|
|
1959
|
+
this.exceededCharCount.set(this.maxLength || 0);
|
|
1954
1960
|
}
|
|
1955
1961
|
else {
|
|
1956
1962
|
this.isValueCustomSet = true;
|
|
@@ -1985,7 +1991,7 @@ class TextAreaComponent extends BaseInput {
|
|
|
1985
1991
|
}
|
|
1986
1992
|
/** update the counter message and related interactions */
|
|
1987
1993
|
updateCounterInteractions() {
|
|
1988
|
-
this._textAreaCharCount
|
|
1994
|
+
this._textAreaCharCount.set(this.value?.length ?? 0);
|
|
1989
1995
|
if (this.maxLength) {
|
|
1990
1996
|
// newly added to avoid unnecessary iteration, remove if issue found
|
|
1991
1997
|
this.validateLengthOnCustomSet();
|
|
@@ -1993,17 +1999,17 @@ class TextAreaComponent extends BaseInput {
|
|
|
1993
1999
|
}
|
|
1994
2000
|
/** if exceeded maxlength when set as a value in code, highlight the exceeded text. */
|
|
1995
2001
|
validateLengthOnCustomSet() {
|
|
1996
|
-
if (this._textAreaCharCount > this.maxLength) {
|
|
2002
|
+
if (this._textAreaCharCount() > this.maxLength) {
|
|
1997
2003
|
if (this._isPasted) {
|
|
1998
2004
|
this._targetElement.focus();
|
|
1999
|
-
this._targetElement.setSelectionRange(this.maxLength, this._textAreaCharCount);
|
|
2005
|
+
this._targetElement.setSelectionRange(this.maxLength, this._textAreaCharCount());
|
|
2000
2006
|
}
|
|
2001
|
-
this.counterExcessOrRemaining
|
|
2002
|
-
this.exceededCharCount
|
|
2007
|
+
this.counterExcessOrRemaining.set(this.excessText);
|
|
2008
|
+
this.exceededCharCount.set(this._textAreaCharCount() - this.maxLength);
|
|
2003
2009
|
}
|
|
2004
2010
|
else {
|
|
2005
|
-
this.counterExcessOrRemaining
|
|
2006
|
-
this.exceededCharCount
|
|
2011
|
+
this.counterExcessOrRemaining.set(this.remainingText);
|
|
2012
|
+
this.exceededCharCount.set(this.maxLength - this._textAreaCharCount());
|
|
2007
2013
|
}
|
|
2008
2014
|
this._isPasted = false;
|
|
2009
2015
|
}
|
|
@@ -2056,11 +2062,9 @@ class TextAreaComponent extends BaseInput {
|
|
|
2056
2062
|
getUpdatedState() {
|
|
2057
2063
|
if (this._getContentLength() > this.maxLength) {
|
|
2058
2064
|
this.hasTextExceeded = true; // set flag for error message to also change accordingly
|
|
2059
|
-
this.counterExcessOrRemaining = this.excessText;
|
|
2060
2065
|
return this.state;
|
|
2061
2066
|
}
|
|
2062
2067
|
this.hasTextExceeded = false;
|
|
2063
|
-
this.counterExcessOrRemaining = this.remainingText;
|
|
2064
2068
|
return this.state; // return any other errors found by parent form field
|
|
2065
2069
|
}
|
|
2066
2070
|
/** @hidden Native element */
|
|
@@ -2113,7 +2117,7 @@ class TextAreaComponent extends BaseInput {
|
|
|
2113
2117
|
useExisting: TextAreaComponent,
|
|
2114
2118
|
multi: true
|
|
2115
2119
|
}
|
|
2116
|
-
], viewQueries: [{ propertyName: "_textareaCounter", first: true, predicate: ["counter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<textarea\n #inputElementRef\n fd-form-control\n [disabled]=\"disabled\"\n [attr.id]=\"id\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"id + '-counter'\"\n [attr.aria-required]=\"required\"\n [attr.placeholder]=\"placeholder\"\n [attr.rows]=\"growing ? 2 : height ? 2 : growingMaxLines\"\n [attr.cols]=\"cols\"\n [attr.wrap]=\"wrapType\"\n [attr.maxlength]=\"!showExceededText ? maxLength : null\"\n [attr.readonly]=\"readonly ? true : null\"\n [(ngModel)]=\"value\"\n [state]=\"getUpdatedState()\"\n (paste)=\"handlePasteInteraction()\"\n (blur)=\"_onFocusChanged(false)\"\n (focus)=\"_onFocusChanged(true)\"\n></textarea>\n<!-- ICU recommends full text in format -->\n@if (showExceededText) {\n <div class=\"fd-textarea-counter\" aria-live=\"polite\" aria-atomic=\"true\" [attr.id]=\"id + '-counter'\" #counter>\n <!-- render spaces instead of the actual value while translation string is loading in order to avoid content jumps -->\n @if (counterExcessOrRemaining === 'excess') {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount === 1\n ? 'platformTextarea.counterMessageCharactersOverTheLimitSingular'\n : 'platformTextarea.counterMessageCharactersOverTheLimitPlural'\n ) | fdTranslate: { count: exceededCharCount } : ' '\n )()\n \"\n ></span>\n } @else {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount === 1\n ? 'platformTextarea.counterMessageCharactersRemainingSingular'\n : 'platformTextarea.counterMessageCharactersRemainingPlural'\n ) | fdTranslate: { count: exceededCharCount } : ' '\n )()\n \"\n ></span>\n }\n </div>\n}\n", styles: [".fd-textarea-counter{display:inline-block;width:100%}\n"], dependencies: [{ kind: "component", type: FormControlComponent, selector: "input[fd-form-control], textarea[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2120
|
+
], viewQueries: [{ propertyName: "_textareaCounter", first: true, predicate: ["counter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<textarea\n #inputElementRef\n fd-form-control\n [disabled]=\"disabled\"\n [attr.id]=\"id\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"id + '-counter'\"\n [attr.aria-required]=\"required\"\n [attr.placeholder]=\"placeholder\"\n [attr.rows]=\"growing ? 2 : height ? 2 : growingMaxLines\"\n [attr.cols]=\"cols\"\n [attr.wrap]=\"wrapType\"\n [attr.maxlength]=\"!showExceededText ? maxLength : null\"\n [attr.readonly]=\"readonly ? true : null\"\n [(ngModel)]=\"value\"\n [state]=\"getUpdatedState()\"\n (paste)=\"handlePasteInteraction()\"\n (blur)=\"_onFocusChanged(false)\"\n (focus)=\"_onFocusChanged(true)\"\n></textarea>\n<!-- ICU recommends full text in format -->\n@if (showExceededText) {\n <div class=\"fd-textarea-counter\" aria-live=\"polite\" aria-atomic=\"true\" [attr.id]=\"id + '-counter'\" #counter>\n <!-- render spaces instead of the actual value while translation string is loading in order to avoid content jumps -->\n @if (counterExcessOrRemaining() === 'excess') {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount() === 1\n ? 'platformTextarea.counterMessageCharactersOverTheLimitSingular'\n : 'platformTextarea.counterMessageCharactersOverTheLimitPlural'\n ) | fdTranslate: { count: exceededCharCount() } : ' '\n )()\n \"\n ></span>\n } @else {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount() === 1\n ? 'platformTextarea.counterMessageCharactersRemainingSingular'\n : 'platformTextarea.counterMessageCharactersRemainingPlural'\n ) | fdTranslate: { count: exceededCharCount() } : ' '\n )()\n \"\n ></span>\n }\n </div>\n}\n", styles: [".fd-textarea-counter{display:inline-block;width:100%}\n"], dependencies: [{ kind: "component", type: FormControlComponent, selector: "input[fd-form-control], textarea[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2117
2121
|
}
|
|
2118
2122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextAreaComponent, decorators: [{
|
|
2119
2123
|
type: Component,
|
|
@@ -2123,7 +2127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2123
2127
|
useExisting: TextAreaComponent,
|
|
2124
2128
|
multi: true
|
|
2125
2129
|
}
|
|
2126
|
-
], imports: [FormControlComponent, FormsModule, FdTranslatePipe], template: "<textarea\n #inputElementRef\n fd-form-control\n [disabled]=\"disabled\"\n [attr.id]=\"id\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"id + '-counter'\"\n [attr.aria-required]=\"required\"\n [attr.placeholder]=\"placeholder\"\n [attr.rows]=\"growing ? 2 : height ? 2 : growingMaxLines\"\n [attr.cols]=\"cols\"\n [attr.wrap]=\"wrapType\"\n [attr.maxlength]=\"!showExceededText ? maxLength : null\"\n [attr.readonly]=\"readonly ? true : null\"\n [(ngModel)]=\"value\"\n [state]=\"getUpdatedState()\"\n (paste)=\"handlePasteInteraction()\"\n (blur)=\"_onFocusChanged(false)\"\n (focus)=\"_onFocusChanged(true)\"\n></textarea>\n<!-- ICU recommends full text in format -->\n@if (showExceededText) {\n <div class=\"fd-textarea-counter\" aria-live=\"polite\" aria-atomic=\"true\" [attr.id]=\"id + '-counter'\" #counter>\n <!-- render spaces instead of the actual value while translation string is loading in order to avoid content jumps -->\n @if (counterExcessOrRemaining === 'excess') {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount === 1\n ? 'platformTextarea.counterMessageCharactersOverTheLimitSingular'\n : 'platformTextarea.counterMessageCharactersOverTheLimitPlural'\n ) | fdTranslate: { count: exceededCharCount } : ' '\n )()\n \"\n ></span>\n } @else {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount === 1\n ? 'platformTextarea.counterMessageCharactersRemainingSingular'\n : 'platformTextarea.counterMessageCharactersRemainingPlural'\n ) | fdTranslate: { count: exceededCharCount } : ' '\n )()\n \"\n ></span>\n }\n </div>\n}\n", styles: [".fd-textarea-counter{display:inline-block;width:100%}\n"] }]
|
|
2130
|
+
], imports: [FormControlComponent, FormsModule, FdTranslatePipe], template: "<textarea\n #inputElementRef\n fd-form-control\n [disabled]=\"disabled\"\n [attr.id]=\"id\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-describedby]=\"id + '-counter'\"\n [attr.aria-required]=\"required\"\n [attr.placeholder]=\"placeholder\"\n [attr.rows]=\"growing ? 2 : height ? 2 : growingMaxLines\"\n [attr.cols]=\"cols\"\n [attr.wrap]=\"wrapType\"\n [attr.maxlength]=\"!showExceededText ? maxLength : null\"\n [attr.readonly]=\"readonly ? true : null\"\n [(ngModel)]=\"value\"\n [state]=\"getUpdatedState()\"\n (paste)=\"handlePasteInteraction()\"\n (blur)=\"_onFocusChanged(false)\"\n (focus)=\"_onFocusChanged(true)\"\n></textarea>\n<!-- ICU recommends full text in format -->\n@if (showExceededText) {\n <div class=\"fd-textarea-counter\" aria-live=\"polite\" aria-atomic=\"true\" [attr.id]=\"id + '-counter'\" #counter>\n <!-- render spaces instead of the actual value while translation string is loading in order to avoid content jumps -->\n @if (counterExcessOrRemaining() === 'excess') {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount() === 1\n ? 'platformTextarea.counterMessageCharactersOverTheLimitSingular'\n : 'platformTextarea.counterMessageCharactersOverTheLimitPlural'\n ) | fdTranslate: { count: exceededCharCount() } : ' '\n )()\n \"\n ></span>\n } @else {\n <span\n [innerHtml]=\"\n (\n (exceededCharCount() === 1\n ? 'platformTextarea.counterMessageCharactersRemainingSingular'\n : 'platformTextarea.counterMessageCharactersRemainingPlural'\n ) | fdTranslate: { count: exceededCharCount() } : ' '\n )()\n \"\n ></span>\n }\n </div>\n}\n", styles: [".fd-textarea-counter{display:inline-block;width:100%}\n"] }]
|
|
2127
2131
|
}], ctorParameters: () => [{ type: TextAreaConfig }], propDecorators: { height: [{
|
|
2128
2132
|
type: Input
|
|
2129
2133
|
}], growingMaxLines: [{
|
|
@@ -2311,6 +2315,16 @@ class BaseMultiInput extends CollectionBaseInput {
|
|
|
2311
2315
|
this.addOnButtonClicked = new EventEmitter();
|
|
2312
2316
|
/** Whether the Multi Input is opened. */
|
|
2313
2317
|
this.isOpen = false;
|
|
2318
|
+
/** @hidden
|
|
2319
|
+
* Max width of list container
|
|
2320
|
+
* */
|
|
2321
|
+
this.maxWidth = signal(null, /* @ts-ignore */
|
|
2322
|
+
...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
2323
|
+
/** @hidden
|
|
2324
|
+
* Min width of list container
|
|
2325
|
+
* */
|
|
2326
|
+
this.minWidth = signal(null, /* @ts-ignore */
|
|
2327
|
+
...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
2314
2328
|
/**
|
|
2315
2329
|
* Need for opening mobile version
|
|
2316
2330
|
*
|
|
@@ -2614,8 +2628,8 @@ class BaseMultiInput extends CollectionBaseInput {
|
|
|
2614
2628
|
const body = document.body;
|
|
2615
2629
|
const rect = this._element.querySelector('fd-input-group').getBoundingClientRect();
|
|
2616
2630
|
const scrollBarWidth = body.offsetWidth - body.clientWidth;
|
|
2617
|
-
this.maxWidth
|
|
2618
|
-
this.minWidth
|
|
2631
|
+
this.maxWidth.set(window.innerWidth - scrollBarWidth - rect.left);
|
|
2632
|
+
this.minWidth.set(rect.width - 2);
|
|
2619
2633
|
}
|
|
2620
2634
|
/**
|
|
2621
2635
|
* Convert original data to OptionItems Interface
|
|
@@ -3357,7 +3371,7 @@ class PlatformMultiInputComponent extends BaseMultiInput {
|
|
|
3357
3371
|
multi: true
|
|
3358
3372
|
},
|
|
3359
3373
|
contentDensityObserverProviders()
|
|
3360
|
-
], viewQueries: [{ propertyName: "listTemplateDD", first: true, predicate: ListComponent, descendants: true }, { propertyName: "tokenizer", first: true, predicate: TokenizerComponent, descendants: true }, { propertyName: "controlTemplate", first: true, predicate: ["controlTemplate"], descendants: true }, { propertyName: "listTemplate", first: true, predicate: ["listTemplate"], descendants: true }, { propertyName: "_listItems", predicate: BaseListItem, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"fd-multi-input\">\n <ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n</div>\n<ng-template #desktopTemplate>\n <fd-popover\n additionalBodyClass=\"fdp-multi-input__list-container\"\n [isOpen]=\"isOpen && _suggestions.length > 0\"\n (isOpenChange)=\"_popoverOpenChangeHandle($event)\"\n [fillControlMode]=\"fillControlMode\"\n [focusTrapped]=\"true\"\n [triggers]=\"triggers\"\n [disabled]=\"disabled || readonly\"\n [maxWidth]=\"autoResize ? (maxWidth ?? null) : (minWidth ?? null)\"\n [closeOnOutsideClick]=\"closeOnOutsideClick\"\n >\n <fd-popover-control>\n <ng-template [ngTemplateOutlet]=\"controlTemplate\"></ng-template>\n </fd-popover-control>\n <fd-popover-body>\n <ng-template [ngTemplateOutlet]=\"listTemplate\"></ng-template>\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n</ng-template>\n<ng-template #controlTemplate>\n <fd-input-group\n [button]=\"true\"\n [buttonFocusable]=\"buttonFocusable\"\n [isControl]=\"true\"\n glyph=\"value-help\"\n [state]=\"state\"\n [disabled]=\"disabled\"\n (keydown)=\"removeSelectedTokens($event)\"\n (addOnButtonClicked)=\"addOnButtonClick($event)\"\n (click)=\"onInputGroupClicked()\"\n [glyphAriaLabel]=\"glyphAriaLabel\"\n [iconTitle]=\"addonIconTitle\"\n >\n <fd-tokenizer\n [tokenizerFocusable]=\"false\"\n [compactCollapse]=\"true\"\n [showOverflowPopover]=\"false\"\n #tokenizer\n class=\"fd-multi-input-tokenizer-custom\"\n (moreClickedEvent)=\"moreClicked()\"\n tabindex=\"-1\"\n role=\"listbox\"\n fdMultiAnnouncer\n [multiAnnouncerOptions]=\"isOpen ? _suggestions : []\"\n >\n @for (token of selected; track token; let i = $index) {\n <fd-token\n [readOnly]=\"disabled\"\n (onCloseClick)=\"removeToken(token)\"\n [attr.aria-posinset]=\"i\"\n [attr.aria-setsize]=\"selected.length\"\n >\n <span>{{ token.label | displayFnPipe: displayFn }}</span>\n </fd-token>\n }\n <input\n #searchInputElement\n type=\"text\"\n class=\"fd-input fd-multi-input-tokenizer-input fd-tokenizer__input fd-input-group__input\"\n fdp-auto-complete\n autocomplete=\"off\"\n (onComplete)=\"_onAutoComplete($event)\"\n (keydown.enter)=\"_onKeydownEnter($event)\"\n (keydown)=\"onInputKeydownHandler($event)\"\n [inputText]=\"inputText\"\n [options]=\"_suggestions\"\n fd-input-group-input\n fd-form-control\n [attr.id]=\"id\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"inputText\"\n (ngModelChange)=\"searchTermChanged()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.placeholder]=\"selected.length ? null : placeholder\"\n (focus)=\"onTouched(); tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n [attr.aria-expanded]=\"isOpen && _suggestions.length > 0\"\n [readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-readonly]=\"readonly\"\n [ariaLabel]=\"ariaLabel || ('coreMultiInput.multiInputAriaLabel' | fdTranslate)()\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required\"\n aria-roledescription=\"Multi Value Input\"\n fdkInitialFocus\n [enabled]=\"autofocus\"\n />\n </fd-tokenizer>\n </fd-input-group>\n</ng-template>\n<ng-template #listTemplate>\n @if (_suggestions && _suggestions.length) {\n <fdp-list\n [noBorder]=\"true\"\n #listTemplateDD\n [hasByLine]=\"hasByLine\"\n [selectionMode]=\"selectionMode\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [interceptTabKey]=\"false\"\n (keydown.tab)=\"close()\"\n (keydown.escape)=\"close()\"\n >\n @if (!isGroup) {\n @for (listItem of _suggestions; track listItem) {\n <fdp-standard-list-item\n [title]=\"listItem.label\"\n [description]=\"listItem.description || ''\"\n [avatar]=\"listItem.avatarSrc\"\n [value]=\"listItem.value\"\n (itemSelected)=\"selectionMode !== 'multi' && addToArray(listItem, true)\"\n (itemCheckboxSelected)=\"_checkboxSelected(listItem, $event)\"\n (buttonClicked)=\"deleteToken(listItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n @if (isGroup) {\n @for (group of _suggestions; track group) {\n @if (!groupItemTemplate) {\n <fdp-list-group-header [groupHeaderTitle]=\"group.label\"></fdp-list-group-header>\n }\n @if (groupItemTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: { label: group.label } }\"\n ></ng-template>\n }\n @for (optionItem of group.children; track optionItem; let i = $index) {\n <fdp-standard-list-item\n [title]=\"optionItem.label\"\n [value]=\"optionItem.value\"\n (itemSelected)=\"addToArray(optionItem, true)\"\n (itemCheckboxSelected)=\"addToArray(optionItem, false)\"\n (buttonClicked)=\"deleteToken(optionItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n }\n </fdp-list>\n }\n</ng-template>\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)}.fdp-multi-input__list-container.fd-popover__body{width:100%;overflow:hidden;position:relative}.fdp-multi-input__invisible-text{display:none!important}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "bodyAriaLabel", "bodyRole", "bodyAriaLabelledBy", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "component", type: PopoverControlComponent, selector: "fd-popover-control, [fdPopoverControl]" }, { kind: "component", type: PopoverBodyComponent, selector: "fd-popover-body", inputs: ["minWidth", "maxWidth", "minHeight", "maxHeight", "ariaModal"], outputs: ["onClose"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i3$2.InputGroupComponent, selector: "fd-input-group", inputs: ["placement", "required", "inline", "addOnText", "buttonFocusable", "type", "glyph", "glyphFont", "button", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "addonButtonAriaHidden", "iconTitle", "ariaLabelledBy", "ariaLabel"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: i3$2.InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "component", type: TokenComponent, selector: "fd-token", inputs: ["disabled", "selected", "readOnly"], outputs: ["onCloseClick", "onRemove", "onTokenClick", "onTokenKeydown", "elementFocused", "selectedChange"] }, { kind: "component", type: TokenizerComponent, selector: "fd-tokenizer", inputs: ["class", "disableKeyboardDeletion", "compactCollapse", "tokenizerFocusable", "inputValue", "glyph", "glyphFont", "moreTerm", "open", "showOverflowPopover", "externalHiddenCount"], outputs: ["moreClickedEvent"] }, { kind: "component", type: FormControlComponent, selector: "input[fd-form-control], textarea[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AutoCompleteDirective, selector: "[fdp-auto-complete]", inputs: ["options", "inputText", "mobile"], outputs: ["onComplete"] }, { kind: "directive", type: InitialFocusDirective, selector: "[fdkInitialFocus]", inputs: ["fdkInitialFocus", "enabled", "focusLastElement"] }, { kind: "ngmodule", type: PlatformListModule }, { kind: "component", type: i5.ListComponent, selector: "fdp-list", inputs: ["selectedItems", "ariaSetsize", "ariaMultiselectable", "loadTitle", "loadingLabel", "delayTime", "itemSize", "loadMore", "loadOnScroll", "role", "listType", "maxHeight", "noBorder", "scrollOffsetPercentage", "selection", "selectionMode", "value", "rowSelection", "dataSource", "navigated", "navigationIndicator", "hasByLine", "hasObject", "unreadIndicator", "interceptTabKey"], outputs: ["selectedItemChange"] }, { kind: "component", type: i5.ListGroupHeaderComponent, selector: "fdp-list-group-header", inputs: ["groupHeaderTitle"] }, { kind: "component", type: i5.StandardListItemComponent, selector: "fdp-standard-list-item" }, { kind: "ngmodule", type: ContentDensityModule }, { kind: "directive", type: MultiAnnouncerDirective, selector: "[fdMultiAnnouncer]", inputs: ["multiAnnouncerOptions"], exportAs: ["fdMultiAnnouncer"] }, { kind: "pipe", type: DisplayFnPipe, name: "displayFnPipe" }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3374
|
+
], viewQueries: [{ propertyName: "listTemplateDD", first: true, predicate: ListComponent, descendants: true }, { propertyName: "tokenizer", first: true, predicate: TokenizerComponent, descendants: true }, { propertyName: "controlTemplate", first: true, predicate: ["controlTemplate"], descendants: true }, { propertyName: "listTemplate", first: true, predicate: ["listTemplate"], descendants: true }, { propertyName: "_listItems", predicate: BaseListItem, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"fd-multi-input\">\n <ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n</div>\n<ng-template #desktopTemplate>\n <fd-popover\n additionalBodyClass=\"fdp-multi-input__list-container\"\n [isOpen]=\"isOpen && _suggestions.length > 0\"\n (isOpenChange)=\"_popoverOpenChangeHandle($event)\"\n [fillControlMode]=\"fillControlMode\"\n [focusTrapped]=\"true\"\n [triggers]=\"triggers\"\n [disabled]=\"disabled || readonly\"\n [maxWidth]=\"autoResize ? maxWidth() : minWidth()\"\n [closeOnOutsideClick]=\"closeOnOutsideClick\"\n >\n <fd-popover-control>\n <ng-template [ngTemplateOutlet]=\"controlTemplate\"></ng-template>\n </fd-popover-control>\n <fd-popover-body>\n <ng-template [ngTemplateOutlet]=\"listTemplate\"></ng-template>\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n</ng-template>\n<ng-template #controlTemplate>\n <fd-input-group\n [button]=\"true\"\n [buttonFocusable]=\"buttonFocusable\"\n [isControl]=\"true\"\n glyph=\"value-help\"\n [state]=\"state\"\n [disabled]=\"disabled\"\n (keydown)=\"removeSelectedTokens($event)\"\n (addOnButtonClicked)=\"addOnButtonClick($event)\"\n (click)=\"onInputGroupClicked()\"\n [glyphAriaLabel]=\"glyphAriaLabel\"\n [iconTitle]=\"addonIconTitle\"\n >\n <fd-tokenizer\n [tokenizerFocusable]=\"false\"\n [compactCollapse]=\"true\"\n [showOverflowPopover]=\"false\"\n #tokenizer\n class=\"fd-multi-input-tokenizer-custom\"\n (moreClickedEvent)=\"moreClicked()\"\n tabindex=\"-1\"\n role=\"listbox\"\n fdMultiAnnouncer\n [multiAnnouncerOptions]=\"isOpen ? _suggestions : []\"\n >\n @for (token of selected; track token; let i = $index) {\n <fd-token\n [readOnly]=\"disabled\"\n (onCloseClick)=\"removeToken(token)\"\n [attr.aria-posinset]=\"i\"\n [attr.aria-setsize]=\"selected.length\"\n >\n <span>{{ token.label | displayFnPipe: displayFn }}</span>\n </fd-token>\n }\n <input\n #searchInputElement\n type=\"text\"\n class=\"fd-input fd-multi-input-tokenizer-input fd-tokenizer__input fd-input-group__input\"\n fdp-auto-complete\n autocomplete=\"off\"\n (onComplete)=\"_onAutoComplete($event)\"\n (keydown.enter)=\"_onKeydownEnter($event)\"\n (keydown)=\"onInputKeydownHandler($event)\"\n [inputText]=\"inputText\"\n [options]=\"_suggestions\"\n fd-input-group-input\n fd-form-control\n [attr.id]=\"id\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"inputText\"\n (ngModelChange)=\"searchTermChanged()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.placeholder]=\"selected.length ? null : placeholder\"\n (focus)=\"onTouched(); tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n [attr.aria-expanded]=\"isOpen && _suggestions.length > 0\"\n [readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-readonly]=\"readonly\"\n [ariaLabel]=\"ariaLabel || ('coreMultiInput.multiInputAriaLabel' | fdTranslate)()\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required\"\n aria-roledescription=\"Multi Value Input\"\n fdkInitialFocus\n [enabled]=\"autofocus\"\n />\n </fd-tokenizer>\n </fd-input-group>\n</ng-template>\n<ng-template #listTemplate>\n @if (_suggestions && _suggestions.length) {\n <fdp-list\n [noBorder]=\"true\"\n #listTemplateDD\n [hasByLine]=\"hasByLine\"\n [selectionMode]=\"selectionMode\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [interceptTabKey]=\"false\"\n (keydown.tab)=\"close()\"\n (keydown.escape)=\"close()\"\n >\n @if (!isGroup) {\n @for (listItem of _suggestions; track listItem) {\n <fdp-standard-list-item\n [title]=\"listItem.label\"\n [description]=\"listItem.description || ''\"\n [avatar]=\"listItem.avatarSrc\"\n [value]=\"listItem.value\"\n (itemSelected)=\"selectionMode !== 'multi' && addToArray(listItem, true)\"\n (itemCheckboxSelected)=\"_checkboxSelected(listItem, $event)\"\n (buttonClicked)=\"deleteToken(listItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n @if (isGroup) {\n @for (group of _suggestions; track group) {\n @if (!groupItemTemplate) {\n <fdp-list-group-header [groupHeaderTitle]=\"group.label\"></fdp-list-group-header>\n }\n @if (groupItemTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: { label: group.label } }\"\n ></ng-template>\n }\n @for (optionItem of group.children; track optionItem; let i = $index) {\n <fdp-standard-list-item\n [title]=\"optionItem.label\"\n [value]=\"optionItem.value\"\n (itemSelected)=\"addToArray(optionItem, true)\"\n (itemCheckboxSelected)=\"addToArray(optionItem, false)\"\n (buttonClicked)=\"deleteToken(optionItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n }\n </fdp-list>\n }\n</ng-template>\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)}.fdp-multi-input__list-container.fd-popover__body{width:100%;overflow:hidden;position:relative}.fdp-multi-input__invisible-text{display:none!important}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "bodyAriaLabel", "bodyRole", "bodyAriaLabelledBy", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "component", type: PopoverControlComponent, selector: "fd-popover-control, [fdPopoverControl]" }, { kind: "component", type: PopoverBodyComponent, selector: "fd-popover-body", inputs: ["minWidth", "maxWidth", "minHeight", "maxHeight", "ariaModal"], outputs: ["onClose"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i3$2.InputGroupComponent, selector: "fd-input-group", inputs: ["placement", "required", "inline", "addOnText", "buttonFocusable", "type", "glyph", "glyphFont", "button", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "addonButtonAriaHidden", "iconTitle", "ariaLabelledBy", "ariaLabel"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: i3$2.InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "component", type: TokenComponent, selector: "fd-token", inputs: ["disabled", "selected", "readOnly"], outputs: ["onCloseClick", "onRemove", "onTokenClick", "onTokenKeydown", "elementFocused", "selectedChange"] }, { kind: "component", type: TokenizerComponent, selector: "fd-tokenizer", inputs: ["class", "disableKeyboardDeletion", "compactCollapse", "tokenizerFocusable", "inputValue", "glyph", "glyphFont", "moreTerm", "open", "showOverflowPopover", "externalHiddenCount"], outputs: ["moreClickedEvent"] }, { kind: "component", type: FormControlComponent, selector: "input[fd-form-control], textarea[fd-form-control]", inputs: ["state", "type", "class", "ariaLabel", "ariaLabelledBy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AutoCompleteDirective, selector: "[fdp-auto-complete]", inputs: ["options", "inputText", "mobile"], outputs: ["onComplete"] }, { kind: "directive", type: InitialFocusDirective, selector: "[fdkInitialFocus]", inputs: ["fdkInitialFocus", "enabled", "focusLastElement"] }, { kind: "ngmodule", type: PlatformListModule }, { kind: "component", type: i5.ListComponent, selector: "fdp-list", inputs: ["selectedItems", "ariaSetsize", "ariaMultiselectable", "loadTitle", "loadingLabel", "delayTime", "itemSize", "loadMore", "loadOnScroll", "role", "listType", "maxHeight", "noBorder", "scrollOffsetPercentage", "selection", "selectionMode", "value", "rowSelection", "dataSource", "navigated", "navigationIndicator", "hasByLine", "hasObject", "unreadIndicator", "interceptTabKey"], outputs: ["selectedItemChange"] }, { kind: "component", type: i5.ListGroupHeaderComponent, selector: "fdp-list-group-header", inputs: ["groupHeaderTitle"] }, { kind: "component", type: i5.StandardListItemComponent, selector: "fdp-standard-list-item" }, { kind: "ngmodule", type: ContentDensityModule }, { kind: "directive", type: MultiAnnouncerDirective, selector: "[fdMultiAnnouncer]", inputs: ["multiAnnouncerOptions"], exportAs: ["fdMultiAnnouncer"] }, { kind: "pipe", type: DisplayFnPipe, name: "displayFnPipe" }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3361
3375
|
}
|
|
3362
3376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PlatformMultiInputComponent, decorators: [{
|
|
3363
3377
|
type: Component,
|
|
@@ -3386,7 +3400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
3386
3400
|
ContentDensityModule,
|
|
3387
3401
|
FdTranslatePipe,
|
|
3388
3402
|
MultiAnnouncerDirective
|
|
3389
|
-
], template: "<div class=\"fd-multi-input\">\n <ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n</div>\n<ng-template #desktopTemplate>\n <fd-popover\n additionalBodyClass=\"fdp-multi-input__list-container\"\n [isOpen]=\"isOpen && _suggestions.length > 0\"\n (isOpenChange)=\"_popoverOpenChangeHandle($event)\"\n [fillControlMode]=\"fillControlMode\"\n [focusTrapped]=\"true\"\n [triggers]=\"triggers\"\n [disabled]=\"disabled || readonly\"\n [maxWidth]=\"autoResize ? (
|
|
3403
|
+
], template: "<div class=\"fd-multi-input\">\n <ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n</div>\n<ng-template #desktopTemplate>\n <fd-popover\n additionalBodyClass=\"fdp-multi-input__list-container\"\n [isOpen]=\"isOpen && _suggestions.length > 0\"\n (isOpenChange)=\"_popoverOpenChangeHandle($event)\"\n [fillControlMode]=\"fillControlMode\"\n [focusTrapped]=\"true\"\n [triggers]=\"triggers\"\n [disabled]=\"disabled || readonly\"\n [maxWidth]=\"autoResize ? maxWidth() : minWidth()\"\n [closeOnOutsideClick]=\"closeOnOutsideClick\"\n >\n <fd-popover-control>\n <ng-template [ngTemplateOutlet]=\"controlTemplate\"></ng-template>\n </fd-popover-control>\n <fd-popover-body>\n <ng-template [ngTemplateOutlet]=\"listTemplate\"></ng-template>\n <ng-content></ng-content>\n </fd-popover-body>\n </fd-popover>\n</ng-template>\n<ng-template #controlTemplate>\n <fd-input-group\n [button]=\"true\"\n [buttonFocusable]=\"buttonFocusable\"\n [isControl]=\"true\"\n glyph=\"value-help\"\n [state]=\"state\"\n [disabled]=\"disabled\"\n (keydown)=\"removeSelectedTokens($event)\"\n (addOnButtonClicked)=\"addOnButtonClick($event)\"\n (click)=\"onInputGroupClicked()\"\n [glyphAriaLabel]=\"glyphAriaLabel\"\n [iconTitle]=\"addonIconTitle\"\n >\n <fd-tokenizer\n [tokenizerFocusable]=\"false\"\n [compactCollapse]=\"true\"\n [showOverflowPopover]=\"false\"\n #tokenizer\n class=\"fd-multi-input-tokenizer-custom\"\n (moreClickedEvent)=\"moreClicked()\"\n tabindex=\"-1\"\n role=\"listbox\"\n fdMultiAnnouncer\n [multiAnnouncerOptions]=\"isOpen ? _suggestions : []\"\n >\n @for (token of selected; track token; let i = $index) {\n <fd-token\n [readOnly]=\"disabled\"\n (onCloseClick)=\"removeToken(token)\"\n [attr.aria-posinset]=\"i\"\n [attr.aria-setsize]=\"selected.length\"\n >\n <span>{{ token.label | displayFnPipe: displayFn }}</span>\n </fd-token>\n }\n <input\n #searchInputElement\n type=\"text\"\n class=\"fd-input fd-multi-input-tokenizer-input fd-tokenizer__input fd-input-group__input\"\n fdp-auto-complete\n autocomplete=\"off\"\n (onComplete)=\"_onAutoComplete($event)\"\n (keydown.enter)=\"_onKeydownEnter($event)\"\n (keydown)=\"onInputKeydownHandler($event)\"\n [inputText]=\"inputText\"\n [options]=\"_suggestions\"\n fd-input-group-input\n fd-form-control\n [attr.id]=\"id\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"inputText\"\n (ngModelChange)=\"searchTermChanged()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.placeholder]=\"selected.length ? null : placeholder\"\n (focus)=\"onTouched(); tokenizer._showAllTokens()\"\n (blur)=\"tokenizer._hideTokens()\"\n [attr.aria-expanded]=\"isOpen && _suggestions.length > 0\"\n [readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-readonly]=\"readonly\"\n [ariaLabel]=\"ariaLabel || ('coreMultiInput.multiInputAriaLabel' | fdTranslate)()\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [attr.aria-required]=\"required\"\n aria-roledescription=\"Multi Value Input\"\n fdkInitialFocus\n [enabled]=\"autofocus\"\n />\n </fd-tokenizer>\n </fd-input-group>\n</ng-template>\n<ng-template #listTemplate>\n @if (_suggestions && _suggestions.length) {\n <fdp-list\n [noBorder]=\"true\"\n #listTemplateDD\n [hasByLine]=\"hasByLine\"\n [selectionMode]=\"selectionMode\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [interceptTabKey]=\"false\"\n (keydown.tab)=\"close()\"\n (keydown.escape)=\"close()\"\n >\n @if (!isGroup) {\n @for (listItem of _suggestions; track listItem) {\n <fdp-standard-list-item\n [title]=\"listItem.label\"\n [description]=\"listItem.description || ''\"\n [avatar]=\"listItem.avatarSrc\"\n [value]=\"listItem.value\"\n (itemSelected)=\"selectionMode !== 'multi' && addToArray(listItem, true)\"\n (itemCheckboxSelected)=\"_checkboxSelected(listItem, $event)\"\n (buttonClicked)=\"deleteToken(listItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n @if (isGroup) {\n @for (group of _suggestions; track group) {\n @if (!groupItemTemplate) {\n <fdp-list-group-header [groupHeaderTitle]=\"group.label\"></fdp-list-group-header>\n }\n @if (groupItemTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupItemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: { label: group.label } }\"\n ></ng-template>\n }\n @for (optionItem of group.children; track optionItem; let i = $index) {\n <fdp-standard-list-item\n [title]=\"optionItem.label\"\n [value]=\"optionItem.value\"\n (itemSelected)=\"addToArray(optionItem, true)\"\n (itemCheckboxSelected)=\"addToArray(optionItem, false)\"\n (buttonClicked)=\"deleteToken(optionItem)\"\n role=\"option\"\n >\n </fdp-standard-list-item>\n }\n }\n }\n </fdp-list>\n }\n</ng-template>\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)}.fdp-multi-input__list-container.fd-popover__body{width:100%;overflow:hidden;position:relative}.fdp-multi-input__invisible-text{display:none!important}\n"] }]
|
|
3390
3404
|
}], ctorParameters: () => [{ type: i2.DynamicComponentService }, { type: i0.ViewContainerRef }, { type: i0.Injector }, { type: Map, decorators: [{
|
|
3391
3405
|
type: Optional
|
|
3392
3406
|
}, {
|