@recursyve/ngx-material-components 19.0.0-beta.9 → 20.0.1
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/chip-list/index.d.ts +41 -0
- package/common/index.d.ts +24 -0
- package/dropzone/index.d.ts +125 -0
- package/fesm2022/recursyve-ngx-material-components-chip-list.mjs +157 -0
- package/fesm2022/recursyve-ngx-material-components-chip-list.mjs.map +1 -0
- package/fesm2022/recursyve-ngx-material-components-common.mjs +39 -0
- package/fesm2022/recursyve-ngx-material-components-common.mjs.map +1 -0
- package/fesm2022/recursyve-ngx-material-components-dropzone.mjs +354 -0
- package/fesm2022/recursyve-ngx-material-components-dropzone.mjs.map +1 -0
- package/fesm2022/recursyve-ngx-material-components-form-field-error.mjs +6 -6
- package/fesm2022/recursyve-ngx-material-components-form-field-error.mjs.map +1 -1
- package/fesm2022/recursyve-ngx-material-components-loading.mjs +10 -10
- package/fesm2022/recursyve-ngx-material-components-loading.mjs.map +1 -1
- package/fesm2022/recursyve-ngx-material-components-typeahead.mjs +113 -65
- package/fesm2022/recursyve-ngx-material-components-typeahead.mjs.map +1 -1
- package/form-field-error/index.d.ts +53 -5
- package/index.d.ts +3 -1
- package/loading/index.d.ts +31 -3
- package/package.json +15 -3
- package/typeahead/index.d.ts +213 -4
- package/form-field-error/constant.d.ts +0 -3
- package/form-field-error/error-transformer.d.ts +0 -13
- package/form-field-error/error-translater.d.ts +0 -1
- package/form-field-error/form-field-error.d.ts +0 -8
- package/form-field-error/form-field-error.directive.d.ts +0 -17
- package/form-field-error/options.d.ts +0 -9
- package/form-field-error/provider.d.ts +0 -3
- package/loading/constant.d.ts +0 -2
- package/loading/loading-spinner.d.ts +0 -9
- package/loading/loading.d.ts +0 -13
- package/loading/options.d.ts +0 -4
- package/loading/provider.d.ts +0 -3
- package/typeahead/async-typeahead.d.ts +0 -24
- package/typeahead/constants.d.ts +0 -2
- package/typeahead/provider.d.ts +0 -3
- package/typeahead/providers/async-typeahead.provider.d.ts +0 -11
- package/typeahead/providers/async-typeahead.service.d.ts +0 -39
- package/typeahead/providers/index.d.ts +0 -2
- package/typeahead/typeahead-base.d.ts +0 -110
- package/typeahead/typeahead.d.ts +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, DestroyRef, signal, computed, Injectable, input, viewChild, ElementRef, ChangeDetectorRef, effect, ViewChildren, Directive, ViewEncapsulation, ChangeDetectionStrategy
|
|
2
|
+
import { InjectionToken, inject, DestroyRef, signal, computed, Injectable, Component, input, output, viewChild, ElementRef, ChangeDetectorRef, effect, ViewChildren, Directive, booleanAttribute, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Subject, switchMap, defer, EMPTY, map, catchError, finalize, startWith, merge, debounceTime, distinctUntilChanged, take, takeUntil } from 'rxjs';
|
|
5
5
|
import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
@@ -8,7 +8,7 @@ import * as i1 from '@angular/forms';
|
|
|
8
8
|
import { FormBuilder, NgControl, Validators, FormGroupDirective, NgForm, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { MatIconButton } from '@angular/material/button';
|
|
10
10
|
import { ErrorStateMatcher, _ErrorStateTracker, _getOptionScrollPosition, MatOption } from '@angular/material/core';
|
|
11
|
-
import { MAT_FORM_FIELD, MatFormField, MatFormFieldControl } from '@angular/material/form-field';
|
|
11
|
+
import { MAT_FORM_FIELD, MatFormField, MatPrefix, MatFormFieldControl } from '@angular/material/form-field';
|
|
12
12
|
import { MatInput } from '@angular/material/input';
|
|
13
13
|
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
14
14
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
@@ -25,22 +25,31 @@ class NiceTypeaheadService {
|
|
|
25
25
|
fetchResources$ = new Subject();
|
|
26
26
|
fetchActive$ = new Subject();
|
|
27
27
|
resourceProvider = null;
|
|
28
|
-
_items = signal([]);
|
|
29
|
-
_active = signal(null);
|
|
30
|
-
_searchOptions = signal(null);
|
|
31
|
-
_request = signal(null);
|
|
32
|
-
_nextRequest = signal(null);
|
|
33
|
-
|
|
28
|
+
_items = signal([], ...(ngDevMode ? [{ debugName: "_items" }] : []));
|
|
29
|
+
_active = signal(null, ...(ngDevMode ? [{ debugName: "_active" }] : []));
|
|
30
|
+
_searchOptions = signal(null, ...(ngDevMode ? [{ debugName: "_searchOptions" }] : []));
|
|
31
|
+
_request = signal(null, ...(ngDevMode ? [{ debugName: "_request" }] : []));
|
|
32
|
+
_nextRequest = signal(null, ...(ngDevMode ? [{ debugName: "_nextRequest" }] : []));
|
|
33
|
+
_preloaded = signal(false, ...(ngDevMode ? [{ debugName: "_preloaded" }] : []));
|
|
34
|
+
_autoSelectFirstValue = signal(false, ...(ngDevMode ? [{ debugName: "_autoSelectFirstValue" }] : []));
|
|
35
|
+
_loading = signal(true, ...(ngDevMode ? [{ debugName: "_loading" }] : []));
|
|
34
36
|
items = this._items.asReadonly();
|
|
35
37
|
active = this._active.asReadonly();
|
|
36
38
|
loading = this._loading.asReadonly();
|
|
37
|
-
isLastPage = computed(() => !this._nextRequest());
|
|
38
|
-
init(resource) {
|
|
39
|
+
isLastPage = computed(() => !this._nextRequest(), ...(ngDevMode ? [{ debugName: "isLastPage" }] : []));
|
|
40
|
+
init(resource, options) {
|
|
39
41
|
this.fetchResources$.pipe(takeUntilDestroyed(this.destroyRef)).pipe(switchMap((request) => this.fetchResources(request))).subscribe();
|
|
40
42
|
this.fetchActive$.pipe(takeUntilDestroyed(this.destroyRef)).pipe(switchMap((request) => this.fetchActive(request))).subscribe();
|
|
41
43
|
const provider = this.resources.find((resources) => resources.resource === resource);
|
|
42
|
-
if (provider) {
|
|
43
|
-
|
|
44
|
+
if (!provider) {
|
|
45
|
+
throw new Error("No provider found for resource " + resource);
|
|
46
|
+
}
|
|
47
|
+
this.resourceProvider = provider;
|
|
48
|
+
if (options?.autoSelectFirstValue) {
|
|
49
|
+
this._autoSelectFirstValue.set(options.autoSelectFirstValue);
|
|
50
|
+
}
|
|
51
|
+
if (options?.searchOptions) {
|
|
52
|
+
this._searchOptions.set(options.searchOptions);
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
setSearchOptions(options) {
|
|
@@ -52,6 +61,9 @@ class NiceTypeaheadService {
|
|
|
52
61
|
setActiveFromId(id) {
|
|
53
62
|
this.fetchActive$.next({ id });
|
|
54
63
|
}
|
|
64
|
+
reload() {
|
|
65
|
+
this.fetchResources$.next({ page: 0, searchQuery: this._request()?.searchQuery ?? "" });
|
|
66
|
+
}
|
|
55
67
|
reloadActive() {
|
|
56
68
|
const active = this._active();
|
|
57
69
|
if (!active || !("id" in active)) {
|
|
@@ -126,6 +138,10 @@ class NiceTypeaheadService {
|
|
|
126
138
|
else {
|
|
127
139
|
this._nextRequest.set(null);
|
|
128
140
|
}
|
|
141
|
+
if (this._autoSelectFirstValue() && !this._preloaded()) {
|
|
142
|
+
this._preloaded.set(true);
|
|
143
|
+
this._active.set(result.items[0]);
|
|
144
|
+
}
|
|
129
145
|
}), catchError(() => EMPTY), finalize(() => {
|
|
130
146
|
this._loading.set(false);
|
|
131
147
|
}));
|
|
@@ -136,10 +152,10 @@ class NiceTypeaheadService {
|
|
|
136
152
|
}
|
|
137
153
|
return this.resourceProvider.format(item);
|
|
138
154
|
}
|
|
139
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
140
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
156
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadService });
|
|
141
157
|
}
|
|
142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadService, decorators: [{
|
|
143
159
|
type: Injectable
|
|
144
160
|
}] });
|
|
145
161
|
|
|
@@ -151,32 +167,42 @@ function provideAsyncTypeaheadResources(providers) {
|
|
|
151
167
|
}));
|
|
152
168
|
}
|
|
153
169
|
|
|
170
|
+
class NiceTypeaheadSearchIcon {
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadSearchIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: NiceTypeaheadSearchIcon, isStandalone: true, selector: "nice-typeahead-search-icon", ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M1.4720451262 13.356970375A9.063 9.063 0 1 0 18.154024235 6.267298379a9.063 9.063 0 1 0 -16.6819791088 7.089671996Z\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <path d=\"m16.221 16.22 7.029 7.03\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n</svg>\n" });
|
|
173
|
+
}
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadSearchIcon, decorators: [{
|
|
175
|
+
type: Component,
|
|
176
|
+
args: [{ selector: "nice-typeahead-search-icon", template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M1.4720451262 13.356970375A9.063 9.063 0 1 0 18.154024235 6.267298379a9.063 9.063 0 1 0 -16.6819791088 7.089671996Z\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n <path d=\"m16.221 16.22 7.029 7.03\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"></path>\n</svg>\n" }]
|
|
177
|
+
}] });
|
|
178
|
+
|
|
154
179
|
/**
|
|
155
180
|
* Implementation of the same panel and overlay logic as the official Angular MatSelect.
|
|
156
181
|
* This used some of the logic from MatSelect to make this component look and feel like a MatSelect.
|
|
157
182
|
*/
|
|
158
183
|
class NiceTypeaheadBase {
|
|
159
184
|
options;
|
|
160
|
-
noItemsFoundLabel = input("No items found");
|
|
161
|
-
labelProperty = input();
|
|
162
|
-
formatLabelFn = input();
|
|
163
|
-
optionTemplate = input();
|
|
164
|
-
panelClass = input([]);
|
|
165
|
-
canRemoveValue = input(true);
|
|
185
|
+
noItemsFoundLabel = input("No items found", ...(ngDevMode ? [{ debugName: "noItemsFoundLabel" }] : []));
|
|
186
|
+
labelProperty = input(...(ngDevMode ? [undefined, { debugName: "labelProperty" }] : []));
|
|
187
|
+
formatLabelFn = input(...(ngDevMode ? [undefined, { debugName: "formatLabelFn" }] : []));
|
|
188
|
+
optionTemplate = input(...(ngDevMode ? [undefined, { debugName: "optionTemplate" }] : []));
|
|
189
|
+
panelClass = input([], ...(ngDevMode ? [{ debugName: "panelClass" }] : []));
|
|
190
|
+
canRemoveValue = input(true, ...(ngDevMode ? [{ debugName: "canRemoveValue" }] : []));
|
|
191
|
+
selected = output();
|
|
166
192
|
static nextId = 0;
|
|
167
|
-
_input = viewChild("input");
|
|
168
|
-
_panel = viewChild("panel");
|
|
169
|
-
_overlayDir = viewChild(CdkConnectedOverlay);
|
|
193
|
+
_input = viewChild("input", ...(ngDevMode ? [{ debugName: "_input" }] : []));
|
|
194
|
+
_panel = viewChild("panel", ...(ngDevMode ? [{ debugName: "_panel" }] : []));
|
|
195
|
+
_overlayDir = viewChild(CdkConnectedOverlay, ...(ngDevMode ? [{ debugName: "_overlayDir" }] : []));
|
|
170
196
|
_errorStateTracker;
|
|
171
197
|
_required = null;
|
|
172
198
|
_focused = false;
|
|
173
199
|
_disabled = false;
|
|
174
200
|
_panelOpen = false;
|
|
175
201
|
_compareWith = (o1, o2) => o1 === o2;
|
|
176
|
-
_value = signal(null);
|
|
177
|
-
_empty = computed(() => !this._value());
|
|
178
|
-
_placeholder = signal("");
|
|
179
|
-
_searchValue = signal("");
|
|
202
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
203
|
+
_empty = computed(() => !this._value(), ...(ngDevMode ? [{ debugName: "_empty" }] : []));
|
|
204
|
+
_placeholder = signal("", ...(ngDevMode ? [{ debugName: "_placeholder" }] : []));
|
|
205
|
+
_searchValue = signal("", ...(ngDevMode ? [{ debugName: "_searchValue" }] : []));
|
|
180
206
|
_elementRef = inject(ElementRef);
|
|
181
207
|
_destroyRef = inject(DestroyRef);
|
|
182
208
|
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
@@ -237,6 +263,7 @@ class NiceTypeaheadBase {
|
|
|
237
263
|
const hasAssigned = this._assignValue(value);
|
|
238
264
|
if (hasAssigned) {
|
|
239
265
|
this._onChange?.(value);
|
|
266
|
+
this.selected.emit(value);
|
|
240
267
|
}
|
|
241
268
|
}
|
|
242
269
|
get empty() {
|
|
@@ -258,9 +285,7 @@ class NiceTypeaheadBase {
|
|
|
258
285
|
return this._panelOpen;
|
|
259
286
|
}
|
|
260
287
|
constructor() {
|
|
261
|
-
effect(() =>
|
|
262
|
-
this._input()?.nativeElement.focus();
|
|
263
|
-
});
|
|
288
|
+
effect(() => this._input()?.nativeElement.focus());
|
|
264
289
|
if (this.ngControl) {
|
|
265
290
|
// Note: we provide the value accessor through here, instead of
|
|
266
291
|
// the `providers` to avoid running into a circular import.
|
|
@@ -404,9 +429,7 @@ class NiceTypeaheadBase {
|
|
|
404
429
|
this._handleClosedKeydown(event);
|
|
405
430
|
}
|
|
406
431
|
}
|
|
407
|
-
_handleScrollEnd() {
|
|
408
|
-
console.log("scroll end");
|
|
409
|
-
}
|
|
432
|
+
_handleScrollEnd() { }
|
|
410
433
|
_canOpen() {
|
|
411
434
|
return !this._panelOpen && !this.disabled;
|
|
412
435
|
}
|
|
@@ -495,7 +518,7 @@ class NiceTypeaheadBase {
|
|
|
495
518
|
// Defer setting the value in order to avoid the "Expression
|
|
496
519
|
// has changed after it was checked" errors from Angular.
|
|
497
520
|
Promise.resolve().then(() => {
|
|
498
|
-
if (this.ngControl) {
|
|
521
|
+
if (this.ngControl && this.ngControl.valueAccessor === this) {
|
|
499
522
|
this._value.set(this.ngControl.value);
|
|
500
523
|
}
|
|
501
524
|
const _value = this.value;
|
|
@@ -616,10 +639,10 @@ class NiceTypeaheadBase {
|
|
|
616
639
|
}
|
|
617
640
|
return false;
|
|
618
641
|
}
|
|
619
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
620
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
642
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
643
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.2.1", type: NiceTypeaheadBase, isStandalone: true, inputs: { noItemsFoundLabel: { classPropertyName: "noItemsFoundLabel", publicName: "noItemsFoundLabel", isSignal: true, isRequired: false, transformFunction: null }, labelProperty: { classPropertyName: "labelProperty", publicName: "labelProperty", isSignal: true, isRequired: false, transformFunction: null }, formatLabelFn: { classPropertyName: "formatLabelFn", publicName: "formatLabelFn", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, canRemoveValue: { classPropertyName: "canRemoveValue", publicName: "canRemoveValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "_panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "_overlayDir", first: true, predicate: CdkConnectedOverlay, descendants: true, isSignal: true }, { propertyName: "options", predicate: MatOption, descendants: true }], ngImport: i0 });
|
|
621
644
|
}
|
|
622
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
645
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeaheadBase, decorators: [{
|
|
623
646
|
type: Directive
|
|
624
647
|
}], ctorParameters: () => [], propDecorators: { options: [{
|
|
625
648
|
type: ViewChildren,
|
|
@@ -627,10 +650,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
627
650
|
}] } });
|
|
628
651
|
|
|
629
652
|
class NiceAsyncTypeahead extends NiceTypeaheadBase {
|
|
630
|
-
resource = input.required();
|
|
631
|
-
searchOptions = input(null);
|
|
632
|
-
|
|
633
|
-
|
|
653
|
+
resource = input.required(...(ngDevMode ? [{ debugName: "resource" }] : []));
|
|
654
|
+
searchOptions = input(null, ...(ngDevMode ? [{ debugName: "searchOptions" }] : []));
|
|
655
|
+
autoSelectFirstValue = input(false, ...(ngDevMode ? [{ debugName: "autoSelectFirstValue", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
656
|
+
filteredValues = computed(() => this.service.items(), ...(ngDevMode ? [{ debugName: "filteredValues" }] : []));
|
|
657
|
+
optionsContainer = viewChild("optionsContainer", ...(ngDevMode ? [{ debugName: "optionsContainer" }] : []));
|
|
634
658
|
service = inject(NiceTypeaheadService);
|
|
635
659
|
_compareWith = (o1, o2) => {
|
|
636
660
|
if (!(typeof o1 === "object" && o1 && typeof o2 === "object" && o2)) {
|
|
@@ -648,14 +672,8 @@ class NiceAsyncTypeahead extends NiceTypeaheadBase {
|
|
|
648
672
|
lastScrollHeight = 0;
|
|
649
673
|
constructor() {
|
|
650
674
|
super();
|
|
651
|
-
effect(() =>
|
|
652
|
-
|
|
653
|
-
}, {
|
|
654
|
-
allowSignalWrites: true
|
|
655
|
-
});
|
|
656
|
-
effect(() => this.service.search(this._searchValue()), {
|
|
657
|
-
allowSignalWrites: true
|
|
658
|
-
});
|
|
675
|
+
effect(() => this.service.setSearchOptions(this.searchOptions()));
|
|
676
|
+
effect(() => this.service.search(this._searchValue()));
|
|
659
677
|
effect(() => {
|
|
660
678
|
const container = this.optionsContainer();
|
|
661
679
|
if (!container) {
|
|
@@ -663,10 +681,21 @@ class NiceAsyncTypeahead extends NiceTypeaheadBase {
|
|
|
663
681
|
}
|
|
664
682
|
container.nativeElement.addEventListener("scroll", this.onScroll.bind(this));
|
|
665
683
|
});
|
|
684
|
+
effect(() => {
|
|
685
|
+
this.value = this.service.active();
|
|
686
|
+
});
|
|
666
687
|
}
|
|
667
688
|
ngOnInit() {
|
|
668
689
|
super.ngOnInit();
|
|
669
|
-
this.
|
|
690
|
+
const searchOptions = this.optionsContainer();
|
|
691
|
+
this.service.init(this.resource(), {
|
|
692
|
+
autoSelectFirstValue: this.autoSelectFirstValue(),
|
|
693
|
+
...(searchOptions && { searchOptions: searchOptions })
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
writeValue(value) {
|
|
697
|
+
super.writeValue(value);
|
|
698
|
+
this.service.setActive(value);
|
|
670
699
|
}
|
|
671
700
|
onFocusChanged(isFocused) {
|
|
672
701
|
super.onFocusChanged(isFocused);
|
|
@@ -681,6 +710,21 @@ class NiceAsyncTypeahead extends NiceTypeaheadBase {
|
|
|
681
710
|
super.removeActiveValue();
|
|
682
711
|
this.service.setActive(null);
|
|
683
712
|
}
|
|
713
|
+
_onSelect(option) {
|
|
714
|
+
this.service.setActive(option.value);
|
|
715
|
+
this._setSelectionByValue(option.value);
|
|
716
|
+
this._selectOptionByValue(option.value);
|
|
717
|
+
this.stateChanges.next();
|
|
718
|
+
}
|
|
719
|
+
setSearchOptions(options) {
|
|
720
|
+
this.service.setSearchOptions(options);
|
|
721
|
+
}
|
|
722
|
+
reload() {
|
|
723
|
+
this.service.reload();
|
|
724
|
+
}
|
|
725
|
+
reloadActive() {
|
|
726
|
+
this.service.reloadActive();
|
|
727
|
+
}
|
|
684
728
|
onScroll(event) {
|
|
685
729
|
const target = event.target;
|
|
686
730
|
const threshold = (this.scrollThresholdPercent * 100 * target.scrollHeight) / 100;
|
|
@@ -693,13 +737,13 @@ class NiceAsyncTypeahead extends NiceTypeaheadBase {
|
|
|
693
737
|
this.lastScrollHeight = target.scrollHeight;
|
|
694
738
|
}
|
|
695
739
|
}
|
|
696
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
697
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
740
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceAsyncTypeahead, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
741
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: NiceAsyncTypeahead, isStandalone: true, selector: "nice-async-typeahead", inputs: { resource: { classPropertyName: "resource", publicName: "resource", isSignal: true, isRequired: true, transformFunction: null }, searchOptions: { classPropertyName: "searchOptions", publicName: "searchOptions", isSignal: true, isRequired: false, transformFunction: null }, autoSelectFirstValue: { classPropertyName: "autoSelectFirstValue", publicName: "autoSelectFirstValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "keydown": "_handleKeydown($event)", "focus": "onFocusChanged(true)", "blur": "onFocusChanged(false)" }, properties: { "attr.id": "id", "attr.aria-controls": "panelOpen ? id + \"-panel\" : null", "attr.aria-expanded": "panelOpen", "attr.aria-required": "required.toString()", "attr.aria-disabled": "disabled.toString()", "attr.aria-invalid": "errorState", "class.nice-typeahead-disabled": "disabled", "class.nice-typeahead-invalid": "errorState", "class.nice-typeahead-required": "required", "class.nice-typeahead-empty": "empty" }, classAttribute: "nice-typeahead" }, providers: [
|
|
698
742
|
{ provide: MatFormFieldControl, useExisting: NiceAsyncTypeahead },
|
|
699
743
|
NiceTypeaheadService
|
|
700
|
-
], viewQueries: [{ propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
744
|
+
], viewQueries: [{ propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n\n <nice-typeahead-search-icon matIconPrefix />\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel nice-typeahead-search-icon{width:16px;height:16px;margin-right:8px;margin-left:16px}div.nice-typeahead-panel nice-typeahead-search-icon svg{width:16px;height:16px}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NiceTypeaheadSearchIcon, selector: "nice-typeahead-search-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
701
745
|
}
|
|
702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceAsyncTypeahead, decorators: [{
|
|
703
747
|
type: Component,
|
|
704
748
|
args: [{ selector: "nice-async-typeahead", imports: [
|
|
705
749
|
CdkOverlayOrigin,
|
|
@@ -709,8 +753,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
709
753
|
MatFormField,
|
|
710
754
|
MatInput,
|
|
711
755
|
MatIconButton,
|
|
756
|
+
MatPrefix,
|
|
712
757
|
NgClass,
|
|
713
|
-
NgTemplateOutlet
|
|
758
|
+
NgTemplateOutlet,
|
|
759
|
+
NiceTypeaheadSearchIcon
|
|
714
760
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
715
761
|
{ provide: MatFormFieldControl, useExisting: NiceAsyncTypeahead },
|
|
716
762
|
NiceTypeaheadService
|
|
@@ -731,13 +777,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
731
777
|
"(keydown)": "_handleKeydown($event)",
|
|
732
778
|
"(focus)": "onFocusChanged(true)",
|
|
733
779
|
"(blur)": "onFocusChanged(false)"
|
|
734
|
-
}, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"] }]
|
|
780
|
+
}, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n\n <nice-typeahead-search-icon matIconPrefix />\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel nice-typeahead-search-icon{width:16px;height:16px;margin-right:8px;margin-left:16px}div.nice-typeahead-panel nice-typeahead-search-icon svg{width:16px;height:16px}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"] }]
|
|
735
781
|
}], ctorParameters: () => [] });
|
|
736
782
|
|
|
737
783
|
class NiceTypeahead extends NiceTypeaheadBase {
|
|
738
|
-
values = input.required();
|
|
739
|
-
searchFn = input();
|
|
740
|
-
filteredValues = computed(() => this.filterValuesFromSearch(this._searchValue(), this.values()));
|
|
784
|
+
values = input.required(...(ngDevMode ? [{ debugName: "values" }] : []));
|
|
785
|
+
searchFn = input(...(ngDevMode ? [undefined, { debugName: "searchFn" }] : []));
|
|
786
|
+
filteredValues = computed(() => this.filterValuesFromSearch(this._searchValue(), this.values()), ...(ngDevMode ? [{ debugName: "filteredValues" }] : []));
|
|
741
787
|
onFocusChanged(isFocused) {
|
|
742
788
|
super.onFocusChanged(isFocused);
|
|
743
789
|
if (isFocused) {
|
|
@@ -769,10 +815,10 @@ class NiceTypeahead extends NiceTypeaheadBase {
|
|
|
769
815
|
return false;
|
|
770
816
|
});
|
|
771
817
|
}
|
|
772
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
773
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: NiceTypeahead, isStandalone: true, selector: "nice-typeahead", inputs: { values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: true, transformFunction: null }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "keydown": "_handleKeydown($event)", "focus": "onFocusChanged(true)", "blur": "onFocusChanged(false)" }, properties: { "attr.id": "id", "attr.aria-controls": "panelOpen ? id + \"-panel\" : null", "attr.aria-expanded": "panelOpen", "attr.aria-required": "required.toString()", "attr.aria-disabled": "disabled.toString()", "attr.aria-invalid": "errorState", "class.nice-typeahead-disabled": "disabled", "class.nice-typeahead-invalid": "errorState", "class.nice-typeahead-required": "required", "class.nice-typeahead-empty": "empty" }, classAttribute: "nice-typeahead" }, providers: [{ provide: MatFormFieldControl, useExisting: NiceTypeahead }], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
818
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeahead, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
819
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: NiceTypeahead, isStandalone: true, selector: "nice-typeahead", inputs: { values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: true, transformFunction: null }, searchFn: { classPropertyName: "searchFn", publicName: "searchFn", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "keydown": "_handleKeydown($event)", "focus": "onFocusChanged(true)", "blur": "onFocusChanged(false)" }, properties: { "attr.id": "id", "attr.aria-controls": "panelOpen ? id + \"-panel\" : null", "attr.aria-expanded": "panelOpen", "attr.aria-required": "required.toString()", "attr.aria-disabled": "disabled.toString()", "attr.aria-invalid": "errorState", "class.nice-typeahead-disabled": "disabled", "class.nice-typeahead-invalid": "errorState", "class.nice-typeahead-required": "required", "class.nice-typeahead-empty": "empty" }, classAttribute: "nice-typeahead" }, providers: [{ provide: MatFormFieldControl, useExisting: NiceTypeahead }], usesInheritance: true, ngImport: i0, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n\n <nice-typeahead-search-icon matIconPrefix />\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel nice-typeahead-search-icon{width:16px;height:16px;margin-right:8px;margin-left:16px}div.nice-typeahead-panel nice-typeahead-search-icon svg{width:16px;height:16px}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"], dependencies: [{ kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NiceTypeaheadSearchIcon, selector: "nice-typeahead-search-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
774
820
|
}
|
|
775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NiceTypeahead, decorators: [{
|
|
776
822
|
type: Component,
|
|
777
823
|
args: [{ selector: "nice-typeahead", imports: [
|
|
778
824
|
CdkOverlayOrigin,
|
|
@@ -782,8 +828,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
782
828
|
MatFormField,
|
|
783
829
|
MatInput,
|
|
784
830
|
MatIconButton,
|
|
831
|
+
MatPrefix,
|
|
785
832
|
NgClass,
|
|
786
|
-
NgTemplateOutlet
|
|
833
|
+
NgTemplateOutlet,
|
|
834
|
+
NiceTypeaheadSearchIcon
|
|
787
835
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: MatFormFieldControl, useExisting: NiceTypeahead }], host: {
|
|
788
836
|
"role": "combobox",
|
|
789
837
|
"aria-haspopup": "listbox",
|
|
@@ -801,7 +849,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
801
849
|
"(keydown)": "_handleKeydown($event)",
|
|
802
850
|
"(focus)": "onFocusChanged(true)",
|
|
803
851
|
"(blur)": "onFocusChanged(false)"
|
|
804
|
-
}, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"] }]
|
|
852
|
+
}, template: "<div\n #fallbackOverlayOrigin=\"cdkOverlayOrigin\"\n class=\"nice-typeahead\"\n cdk-overlay-origin\n>\n <div class=\"nice-typeahead-value\">\n @if (_empty()) {\n <span class=\"nice-typeahead-placeholder mat-mdc-select-min-line\">{{ _placeholder() }}</span>\n } @else {\n <span class=\"nice-typeahead-value-text\">\n <span class=\"mat-mdc-select-min-line\">\n @if (_value(); as activeValue) {\n {{ formatLabel(activeValue) }}\n }\n </span>\n </span>\n }\n </div>\n\n <div class=\"nice-typeahead-suffix\">\n @if (_empty()) {\n <div class=\"mat-mdc-select-arrow\">\n <svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M7 10l5 5 5-5z\"></path>\n </svg>\n </div>\n } @else if (canRemoveValue()) {\n <button class=\"nice-typeahead-remove\" mat-icon-button (click)=\"$event.stopPropagation(); removeActiveValue()\">\n <svg viewBox=\"0 -960 960 960\">\n <path d=\"m291-240-51-51 189-189-189-189 51-51 189 189 189-189 51 51-189 189 189 189-51 51-189-189-189 189Z\"/>\n </svg>\n </button>\n }\n </div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayWidth]=\"_overlayWidth\"\n [cdkConnectedOverlayOrigin]=\"_preferredOverlayOrigin || fallbackOverlayOrigin\"\n (attach)=\"_onAttached()\"\n (backdropClick)=\"close()\"\n (detach)=\"close()\"\n>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"nice-typeahead-panel nice-typeahead--open nice-typehead-animations-enabled\"\n [ngClass]=\"panelClass()\"\n [attr.id]=\"id + '-panel'\"\n (keydown)=\"_handleKeydown($event)\"\n (scrollend)=\"_handleScrollEnd()\"\n >\n <div class=\"nice-typeahead-search-input\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input\n #input\n class=\"nice-typeahead__input\"\n matInput\n [formControl]=\"_searchControl\"\n >\n\n <nice-typeahead-search-icon matIconPrefix />\n </mat-form-field>\n </div>\n\n <div #optionsContainer class=\"nice-typeahead-options\" role=\"presentation\">\n @for (item of filteredValues(); track item) {\n <mat-option [value]=\"item\">\n @if (optionTemplate(); as optionTemplate) {\n <ng-container *ngTemplateOutlet=\"optionTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ formatLabel(item) }}\n }\n </mat-option>\n } @empty {\n <mat-option disabled>\n <span class=\"nice-typeahead__no-items\">\n {{ noItemsFoundLabel() }}\n </span>\n </mat-option>\n }\n </div>\n </div>\n</ng-template>\n", styles: ["nice-typeahead,nice-async-typeahead{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}nice-typeahead.nice-typeahead-disabled,nice-async-typeahead.nice-typeahead-disabled{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-typeahead.nice-typeahead-disabled .nice-typeahead-remove,nice-async-typeahead.nice-typeahead-disabled .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-disabled .nice-typeahead-remove{color:var(--mat-select-disabled-trigger-text-color)}nice-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow,nice-async-typeahead.nice-typeahead-invalid .mat-mdc-select-arrow{color:var(--mat-select-invalid-arrow-color)}nice-typeahead .nice-typeahead,nice-async-typeahead .nice-typeahead{width:100%;display:inline-flex;align-items:center;justify-content:space-between;cursor:pointer;position:relative;box-sizing:border-box}nice-typeahead .nice-typeahead-suffix,nice-async-typeahead .nice-typeahead-suffix{height:24px;flex-shrink:0;display:inline-flex;align-items:center;--mdc-icon-button-state-layer-size: 24px}nice-typeahead .nice-typeahead-suffix .nice-typeahead-remove,nice-async-typeahead .nice-typeahead-suffix .nice-typeahead-remove{margin-right:-6px}nice-typeahead .nice-typeahead-value,nice-async-typeahead .nice-typeahead-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nice-typeahead .nice-typeahead-value-text,nice-async-typeahead .nice-typeahead-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nice-typeahead .mat-mdc-select-min-line:empty:before,nice-async-typeahead .mat-mdc-select-min-line:empty:before{content:\" \";white-space:pre;width:1px;display:inline-block;visibility:hidden}nice-typeahead .nice-typeahead__input,nice-async-typeahead .nice-typeahead__input{border:none;outline:none;box-shadow:none;background:none;padding:0;margin:0;color:inherit}.mat-mdc-form-field-type-nice-typeahead:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-nice-typeahead.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}@keyframes _nice-typeahead-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:none}}@keyframes _nice-typeahead-exit{0%{opacity:1}to{opacity:0}}div.nice-typeahead-panel{width:100%;outline:0;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}div.nice-typeahead-panel nice-typeahead-search-icon{width:16px;height:16px;margin-right:8px;margin-left:16px}div.nice-typeahead-panel nice-typeahead-search-icon svg{width:16px;height:16px}div.nice-typeahead-panel .nice-typeahead-search-input{padding-left:8px;padding-right:8px;padding-bottom:8px}div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field,div.nice-typeahead-panel .nice-typeahead-search-input .mat-mdc-form-field-infix{width:100%}div.nice-typeahead-panel .nice-typeahead-options{overflow:auto;max-height:384px}div.nice-typeahead-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.nice-typehead-animations-enabled{animation:_nice-typeahead-enter .12s cubic-bezier(0,0,.2,1)}.nice-typehead-animations-enabled.mat-select-panel-exit{animation:_nice-typeahead-exit .1s linear}\n"] }]
|
|
805
853
|
}] });
|
|
806
854
|
|
|
807
855
|
/**
|