@ethlete/cdk 3.5.0 → 3.5.2
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/CHANGELOG.md +12 -0
- package/esm2022/lib/components/forms/components/select/components/combobox/components/combobox/combobox.component.mjs +3 -3
- package/esm2022/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.mjs +38 -5
- package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-body/combobox-body.component.mjs +3 -2
- package/esm2022/lib/components/forms/components/select/components/combobox/partials/combobox-option/combobox-option.component.mjs +7 -2
- package/fesm2022/ethlete-cdk.mjs +47 -8
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.d.ts +6 -0
- package/lib/components/forms/components/select/components/combobox/partials/combobox-option/combobox-option.component.d.ts +1 -0
- package/package.json +2 -2
package/fesm2022/ethlete-cdk.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { AsyncPipe, NgIf, NgClass, NgTemplateOutlet, NgForOf, JsonPipe, formatDa
|
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, InjectionToken, booleanAttribute, Input, ContentChild, ContentChildren, inject, ElementRef, Injector, HostBinding, isDevMode, Injectable, TemplateRef, ViewContainerRef, forwardRef, ViewChild, LOCALE_ID, numberAttribute, EventEmitter, Output, signal, computed, Optional, Inject, SkipSelf, HostListener, NgZone, NgModule, ChangeDetectorRef, Renderer2, Attribute } from '@angular/core';
|
|
6
6
|
import * as i1$1 from '@ethlete/core';
|
|
7
|
-
import { LetDirective, createDestroy, ScrollObserverFirstElementDirective, ScrollObserverLastElementDirective, Memo, createReactiveBindings, IS_EMAIL, MUST_MATCH, IS_ARRAY_NOT_EMPTY, AT_LEAST_ONE_REQUIRED, equal, ResizeObserverService, createFlipAnimation, RuntimeError, AnimatedOverlayDirective, SelectionModel, ActiveSelectionModel, isEmptyArray, isObjectArray, isPrimitiveArray, ClickOutsideDirective, ANIMATED_LIFECYCLE_TOKEN, AnimatedLifecycleDirective, ObserveContentDirective, clamp, nextFrame, DELAYABLE_TOKEN, ObserveResizeDirective, SmartBlockScrollStrategy, RouterStateService, ClickObserverService, FocusVisibleService, ViewportService, scrollToElement, getElementVisibleStates, IS_ACTIVE_ELEMENT, IS_ELEMENT, CursorDragScrollDirective, ObserveScrollStateDirective, IsElementDirective, IsActiveElementDirective, ScrollObserverIgnoreTargetDirective, TypedQueryList } from '@ethlete/core';
|
|
7
|
+
import { LetDirective, createDestroy, ScrollObserverFirstElementDirective, ScrollObserverLastElementDirective, Memo, createReactiveBindings, IS_EMAIL, MUST_MATCH, IS_ARRAY_NOT_EMPTY, AT_LEAST_ONE_REQUIRED, equal, ResizeObserverService, createFlipAnimation, RuntimeError, AnimatedOverlayDirective, SelectionModel, ActiveSelectionModel, KeyPressManager, isEmptyArray, isObjectArray, isPrimitiveArray, ClickOutsideDirective, ANIMATED_LIFECYCLE_TOKEN, AnimatedLifecycleDirective, ObserveContentDirective, clamp, nextFrame, DELAYABLE_TOKEN, ObserveResizeDirective, SmartBlockScrollStrategy, RouterStateService, ClickObserverService, FocusVisibleService, ViewportService, scrollToElement, getElementVisibleStates, IS_ACTIVE_ELEMENT, IS_ELEMENT, CursorDragScrollDirective, ObserveScrollStateDirective, IsElementDirective, IsActiveElementDirective, ScrollObserverIgnoreTargetDirective, TypedQueryList } from '@ethlete/core';
|
|
8
8
|
import { BehaviorSubject, startWith, map, switchMap, combineLatest, pairwise, tap, takeUntil, skip, of, Subject, debounceTime, filter, distinctUntilChanged, withLatestFrom, take, skipWhile, catchError, throwError, firstValueFrom, fromEvent, merge, timer, skipUntil, defer, partition, Subscription, Observable } from 'rxjs';
|
|
9
9
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
10
10
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -14,7 +14,7 @@ import * as i1$2 from '@angular/cdk/a11y';
|
|
|
14
14
|
import { FocusMonitor, LiveAnnouncer, FocusKeyManager, InputModalityDetector, AriaDescriber, A11yModule } from '@angular/cdk/a11y';
|
|
15
15
|
import { AutofillMonitor } from '@angular/cdk/text-field';
|
|
16
16
|
import { FormControl, NgControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
-
import { ENTER, ESCAPE, TAB as TAB$1, A, DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, SPACE, hasModifierKey, PAGE_DOWN, PAGE_UP, END, HOME } from '@angular/cdk/keycodes';
|
|
17
|
+
import { BACKSPACE, ENTER, ESCAPE, TAB as TAB$1, A, DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, SPACE, hasModifierKey, PAGE_DOWN, PAGE_UP, END, HOME } from '@angular/cdk/keycodes';
|
|
18
18
|
import * as i1$4 from '@angular/cdk/bidi';
|
|
19
19
|
import { Directionality } from '@angular/cdk/bidi';
|
|
20
20
|
import { CdkDialogContainer, Dialog, DialogConfig, DIALOG_SCROLL_STRATEGY_PROVIDER as DIALOG_SCROLL_STRATEGY_PROVIDER$1 } from '@angular/cdk/dialog';
|
|
@@ -3730,8 +3730,6 @@ class ComboboxDirective {
|
|
|
3730
3730
|
set selectedOptionComponent(component) {
|
|
3731
3731
|
this._selectedOptionComponent$.next(component);
|
|
3732
3732
|
}
|
|
3733
|
-
//#endregion
|
|
3734
|
-
//#region Members
|
|
3735
3733
|
get _currentFilter() {
|
|
3736
3734
|
return this._currentFilter$.value;
|
|
3737
3735
|
}
|
|
@@ -3764,10 +3762,15 @@ class ComboboxDirective {
|
|
|
3764
3762
|
//#endregion
|
|
3765
3763
|
//#region Outputs
|
|
3766
3764
|
this.filterChange = new EventEmitter();
|
|
3765
|
+
//#endregion
|
|
3766
|
+
//#region Members
|
|
3767
|
+
this._shouldIgnoreNextBlurEvent = false;
|
|
3768
|
+
this._deletedSearchWithKeyPress = false;
|
|
3767
3769
|
this._currentFilter$ = new BehaviorSubject('');
|
|
3768
3770
|
this._isOpen$ = this._animatedOverlay.isMounted$;
|
|
3769
3771
|
this._selectionModel = new SelectionModel();
|
|
3770
3772
|
this._activeSelectionModel = new ActiveSelectionModel();
|
|
3773
|
+
this._backspaceKeyPressManager = new KeyPressManager(BACKSPACE);
|
|
3771
3774
|
this.selectedOptions$ = this._selectionModel.selection$;
|
|
3772
3775
|
this.multiple$ = this._selectionModel.allowMultiple$;
|
|
3773
3776
|
this.options$ = this._selectionModel.filteredOptions$;
|
|
@@ -3848,6 +3851,9 @@ class ComboboxDirective {
|
|
|
3848
3851
|
return;
|
|
3849
3852
|
this._animatedOverlay.unmount();
|
|
3850
3853
|
}
|
|
3854
|
+
focus() {
|
|
3855
|
+
this._input.nativeInputRef?.element.nativeElement.focus();
|
|
3856
|
+
}
|
|
3851
3857
|
selectInputAndOpen() {
|
|
3852
3858
|
if (this._input.disabled)
|
|
3853
3859
|
return;
|
|
@@ -3878,6 +3884,9 @@ class ComboboxDirective {
|
|
|
3878
3884
|
}
|
|
3879
3885
|
//#endregion
|
|
3880
3886
|
//#region Protected Methods
|
|
3887
|
+
_ignoreNextBlurEvent() {
|
|
3888
|
+
this._shouldIgnoreNextBlurEvent = true;
|
|
3889
|
+
}
|
|
3881
3890
|
_processKeydownEvent(event) {
|
|
3882
3891
|
const keyCode = event.keyCode;
|
|
3883
3892
|
const isOpen = this._isOpen;
|
|
@@ -3885,6 +3894,8 @@ class ComboboxDirective {
|
|
|
3885
3894
|
const canAddCustomValue = this.allowCustomValues;
|
|
3886
3895
|
const value = event.target.value;
|
|
3887
3896
|
const hasFilterValue = !!value;
|
|
3897
|
+
const selection = this._selectionModel.selection;
|
|
3898
|
+
const isBackspacePressed = this._backspaceKeyPressManager.isPressed(event);
|
|
3888
3899
|
const result = {};
|
|
3889
3900
|
if (keyCode === ENTER) {
|
|
3890
3901
|
event.preventDefault();
|
|
@@ -3930,6 +3941,21 @@ class ComboboxDirective {
|
|
|
3930
3941
|
result.overlayOperation = 'close';
|
|
3931
3942
|
return this._interpretKeyHandlerResult(result);
|
|
3932
3943
|
}
|
|
3944
|
+
if (keyCode === BACKSPACE) {
|
|
3945
|
+
if (isBackspacePressed && value) {
|
|
3946
|
+
this._deletedSearchWithKeyPress = true;
|
|
3947
|
+
}
|
|
3948
|
+
if (!hasFilterValue && isMultiple && selection.length && !this._deletedSearchWithKeyPress) {
|
|
3949
|
+
result.optionAction = { type: 'remove', option: selection[selection.length - 1] };
|
|
3950
|
+
return this._interpretKeyHandlerResult(result);
|
|
3951
|
+
}
|
|
3952
|
+
if (!isBackspacePressed) {
|
|
3953
|
+
this._deletedSearchWithKeyPress = false;
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
else {
|
|
3957
|
+
this._deletedSearchWithKeyPress = false;
|
|
3958
|
+
}
|
|
3933
3959
|
if (!isOpen) {
|
|
3934
3960
|
result.overlayOperation = 'open';
|
|
3935
3961
|
}
|
|
@@ -3940,11 +3966,18 @@ class ComboboxDirective {
|
|
|
3940
3966
|
}
|
|
3941
3967
|
return this._interpretKeyHandlerResult(result);
|
|
3942
3968
|
}
|
|
3969
|
+
_processKeyupEvent() {
|
|
3970
|
+
this._backspaceKeyPressManager.clear();
|
|
3971
|
+
}
|
|
3943
3972
|
_processInputEvent(event) {
|
|
3944
3973
|
const value = event.target.value;
|
|
3945
3974
|
this._updateFilter(value);
|
|
3946
3975
|
}
|
|
3947
3976
|
_handleBlurEvent() {
|
|
3977
|
+
if (this._shouldIgnoreNextBlurEvent) {
|
|
3978
|
+
this._shouldIgnoreNextBlurEvent = false;
|
|
3979
|
+
return;
|
|
3980
|
+
}
|
|
3948
3981
|
this._input._markAsTouched();
|
|
3949
3982
|
this._input._setShouldDisplayError(true);
|
|
3950
3983
|
if (this._selectionModel.allowMultiple) {
|
|
@@ -4172,9 +4205,13 @@ class ComboboxOptionComponent {
|
|
|
4172
4205
|
return;
|
|
4173
4206
|
}
|
|
4174
4207
|
this.combobox.writeValueFromOption(this.option);
|
|
4208
|
+
this.combobox.focus();
|
|
4209
|
+
}
|
|
4210
|
+
ignoreBlur() {
|
|
4211
|
+
this.combobox._ignoreNextBlurEvent();
|
|
4175
4212
|
}
|
|
4176
4213
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ComboboxOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4177
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxOptionComponent, isStandalone: true, selector: "et-combobox-option", inputs: { option: "option" }, host: { listeners: { "click": "selectOption()" }, classAttribute: "et-combobox-option" }, providers: [
|
|
4214
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxOptionComponent, isStandalone: true, selector: "et-combobox-option", inputs: { option: "option" }, host: { listeners: { "mousedown": "ignoreBlur()", "click": "selectOption()" }, classAttribute: "et-combobox-option" }, providers: [
|
|
4178
4215
|
{
|
|
4179
4216
|
provide: COMBOBOX_OPTION_TOKEN,
|
|
4180
4217
|
useExisting: ComboboxOptionComponent,
|
|
@@ -4185,6 +4222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
4185
4222
|
type: Component,
|
|
4186
4223
|
args: [{ selector: 'et-combobox-option', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
4187
4224
|
class: 'et-combobox-option',
|
|
4225
|
+
'(mousedown)': 'ignoreBlur()',
|
|
4188
4226
|
'(click)': 'selectOption()',
|
|
4189
4227
|
}, imports: [AsyncPipe, NgIf, NgTemplateOutlet, NgComponentOutlet], hostDirectives: [], providers: [
|
|
4190
4228
|
{
|
|
@@ -4219,7 +4257,7 @@ class ComboboxBodyComponent {
|
|
|
4219
4257
|
.subscribe();
|
|
4220
4258
|
}
|
|
4221
4259
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ComboboxBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4222
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxBodyComponent, isStandalone: true, selector: "et-combobox-body", host: { classAttribute: "et-combobox-body et-with-default-animation" }, providers: [
|
|
4260
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxBodyComponent, isStandalone: true, selector: "et-combobox-body", host: { attributes: { "tabindex": "-1" }, classAttribute: "et-combobox-body et-with-default-animation" }, providers: [
|
|
4223
4261
|
{
|
|
4224
4262
|
provide: COMBOBOX_BODY_TOKEN,
|
|
4225
4263
|
useExisting: ComboboxBodyComponent,
|
|
@@ -4230,6 +4268,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
4230
4268
|
type: Component,
|
|
4231
4269
|
args: [{ selector: 'et-combobox-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
4232
4270
|
class: 'et-combobox-body et-with-default-animation',
|
|
4271
|
+
tabindex: '-1',
|
|
4233
4272
|
}, imports: [
|
|
4234
4273
|
NgTemplateOutlet,
|
|
4235
4274
|
NgFor,
|
|
@@ -4256,7 +4295,7 @@ class ComboboxComponent extends DecoratedInputBase {
|
|
|
4256
4295
|
this.combobox.setBodyComponent(ComboboxBodyComponent);
|
|
4257
4296
|
}
|
|
4258
4297
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4259
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxComponent, isStandalone: true, selector: "et-combobox", host: { listeners: { "click": "combobox.selectInputAndOpen()" }, classAttribute: "et-combobox" }, usesInheritance: true, hostDirectives: [{ directive: i1$1.AnimatedOverlayDirective }, { directive: InputDirective }, { directive: ComboboxDirective, inputs: ["options", "options", "initialValue", "initialValue", "filterInternal", "filterInternal", "loading", "loading", "error", "error", "emptyText", "emptyText", "placeholder", "placeholder", "multiple", "multiple", "bindLabel", "bindLabel", "bindValue", "bindValue", "allowCustomValues", "allowCustomValues", "selectedOptionComponent", "selectedOptionComponent", "optionComponent", "optionComponent"], outputs: ["filterChange", "filterChange"] }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<ng-content select=\"[etInputPrefix]\" />\n\n<div class=\"et-combobox-wrapper\">\n <ul *ngIf=\"combobox.multiple$ | async\" class=\"et-combobox-selected-options\">\n <li\n *ngFor=\"let item of combobox.selectedOptions$ | async; trackBy: combobox.trackByOptionKeyFn\"\n class=\"et-combobox-selected-option\"\n >\n <ng-container\n *ngIf=\"\n combobox.customSelectedOptionTpl$ | async as customSelectedOptionTpl;\n else compOrDefaultSelectedOptionLabelTpl\n \"\n >\n <ng-container *ngTemplateOutlet=\"customSelectedOptionTpl; context: { option: item }\" />\n </ng-container>\n\n <ng-template #compOrDefaultSelectedOptionLabelTpl>\n <ng-container\n *ngIf=\"combobox.customSelectedOptionComponent$ | async as comp; else defaultSelectedOptionLabelTpl\"\n >\n <ng-container *ngComponentOutlet=\"comp; inputs: { option: item }\"></ng-container>\n </ng-container>\n <ng-template #defaultSelectedOptionLabelTpl>\n {{ combobox.getOptionLabel(item) | async }}\n </ng-template>\n </ng-template>\n\n <span\n (click)=\"combobox.removeSelectedOption(item); $event.stopPropagation()\"\n class=\"et-combobox-selected-option-remove\"\n tabindex=\"-1\"\n >\n x\n </span>\n </li>\n <li class=\"et-combobox-muliple-input\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </li>\n </ul>\n\n <ng-template #inputTpl>\n <input\n (keydown)=\"combobox._processKeydownEvent($event)\"\n (click)=\"combobox.open()\"\n (blur)=\"combobox._handleBlurEvent()\"\n (input)=\"combobox._processInputEvent($event)\"\n type=\"text\"\n etNativeInputRef\n />\n </ng-template>\n\n <ng-container *ngIf=\"(combobox.multiple$ | async) === false\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </ng-container>\n\n <et-chevron-icon class=\"et-combobox-chevron\" />\n</div>\n\n<ng-content select=\"[etInputSuffix]\" />\n\n<ng-template>\n <ng-content />\n</ng-template>\n", styles: [".et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-from,.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-to{opacity:0;transform:scaleY(0)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-active{transition:transform 125ms var(--ease-out-5),opacity 125ms var(--ease-out-5)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-active{transition:transform 50ms var(--ease-in-5),opacity 50ms var(--ease-in-5)}.et-combobox-body.et-with-default-animation[et-floating-placement^=top] .et-combobox-body-container{transform-origin:bottom}.et-combobox-body.et-with-default-animation[et-floating-placement^=bottom] .et-combobox-body-container{transform-origin:top}.et-combobox-body-container{display:block;background-color:#3d3d3d;color:#fff;max-height:min(200px,var(--et-floating-max-height, 200px));overflow:auto}@supports (overflow: overlay){.et-combobox-body-container{overflow:overlay}}.et-combobox-body{width:100%;display:grid;transform:var(--et-floating-translate);will-change:transform}.et-combobox-option{display:block}:where(.et-combobox-option--active){background-color:#1e1e1e}.et-combobox{display:block;border:1px solid #ccc;padding:15px;position:relative}.et-combobox-chevron{transform:rotate(180deg);display:block;inline-size:15px;block-size:15px;position:absolute;inset-inline-end:15px;inset-block-start:7px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NativeInputRefDirective, selector: "input[etNativeInputRef], textarea[etNativeInputRef], select[etNativeInputRef], button[etNativeInputRef]" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: ChevronIconComponent, selector: "et-chevron-icon" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ComboboxComponent, isStandalone: true, selector: "et-combobox", host: { listeners: { "click": "combobox.selectInputAndOpen()" }, classAttribute: "et-combobox" }, usesInheritance: true, hostDirectives: [{ directive: i1$1.AnimatedOverlayDirective }, { directive: InputDirective }, { directive: ComboboxDirective, inputs: ["options", "options", "initialValue", "initialValue", "filterInternal", "filterInternal", "loading", "loading", "error", "error", "emptyText", "emptyText", "placeholder", "placeholder", "multiple", "multiple", "bindLabel", "bindLabel", "bindValue", "bindValue", "allowCustomValues", "allowCustomValues", "selectedOptionComponent", "selectedOptionComponent", "optionComponent", "optionComponent"], outputs: ["filterChange", "filterChange"] }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<ng-content select=\"[etInputPrefix]\" />\n\n<div class=\"et-combobox-wrapper\">\n <ul *ngIf=\"combobox.multiple$ | async\" class=\"et-combobox-selected-options\">\n <li\n *ngFor=\"let item of combobox.selectedOptions$ | async; trackBy: combobox.trackByOptionKeyFn\"\n class=\"et-combobox-selected-option\"\n >\n <ng-container\n *ngIf=\"\n combobox.customSelectedOptionTpl$ | async as customSelectedOptionTpl;\n else compOrDefaultSelectedOptionLabelTpl\n \"\n >\n <ng-container *ngTemplateOutlet=\"customSelectedOptionTpl; context: { option: item }\" />\n </ng-container>\n\n <ng-template #compOrDefaultSelectedOptionLabelTpl>\n <ng-container\n *ngIf=\"combobox.customSelectedOptionComponent$ | async as comp; else defaultSelectedOptionLabelTpl\"\n >\n <ng-container *ngComponentOutlet=\"comp; inputs: { option: item }\"></ng-container>\n </ng-container>\n <ng-template #defaultSelectedOptionLabelTpl>\n {{ combobox.getOptionLabel(item) | async }}\n </ng-template>\n </ng-template>\n\n <span\n (click)=\"combobox.removeSelectedOption(item); $event.stopPropagation()\"\n class=\"et-combobox-selected-option-remove\"\n tabindex=\"-1\"\n >\n x\n </span>\n </li>\n <li class=\"et-combobox-muliple-input\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </li>\n </ul>\n\n <ng-template #inputTpl>\n <input\n (keydown)=\"combobox._processKeydownEvent($event)\"\n (keyup)=\"combobox._processKeyupEvent()\"\n (click)=\"combobox.open()\"\n (blur)=\"combobox._handleBlurEvent()\"\n (input)=\"combobox._processInputEvent($event)\"\n type=\"text\"\n etNativeInputRef\n />\n </ng-template>\n\n <ng-container *ngIf=\"(combobox.multiple$ | async) === false\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </ng-container>\n\n <et-chevron-icon class=\"et-combobox-chevron\" />\n</div>\n\n<ng-content select=\"[etInputSuffix]\" />\n\n<ng-template>\n <ng-content />\n</ng-template>\n", styles: [".et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-from,.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-to{opacity:0;transform:scaleY(0)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-active{transition:transform 125ms var(--ease-out-5),opacity 125ms var(--ease-out-5)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-active{transition:transform 50ms var(--ease-in-5),opacity 50ms var(--ease-in-5)}.et-combobox-body.et-with-default-animation[et-floating-placement^=top] .et-combobox-body-container{transform-origin:bottom}.et-combobox-body.et-with-default-animation[et-floating-placement^=bottom] .et-combobox-body-container{transform-origin:top}.et-combobox-body-container{display:block;background-color:#3d3d3d;color:#fff;max-height:min(200px,var(--et-floating-max-height, 200px));overflow:auto}@supports (overflow: overlay){.et-combobox-body-container{overflow:overlay}}.et-combobox-body{width:100%;display:grid;transform:var(--et-floating-translate);will-change:transform}.et-combobox-option{display:block}:where(.et-combobox-option--active){background-color:#1e1e1e}.et-combobox{display:block;border:1px solid #ccc;padding:15px;position:relative}.et-combobox-chevron{transform:rotate(180deg);display:block;inline-size:15px;block-size:15px;position:absolute;inset-inline-end:15px;inset-block-start:7px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NativeInputRefDirective, selector: "input[etNativeInputRef], textarea[etNativeInputRef], select[etNativeInputRef], button[etNativeInputRef]" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: ChevronIconComponent, selector: "et-chevron-icon" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4260
4299
|
}
|
|
4261
4300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
4262
4301
|
type: Component,
|
|
@@ -4295,7 +4334,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
|
|
|
4295
4334
|
// eslint-disable-next-line @angular-eslint/no-outputs-metadata-property
|
|
4296
4335
|
outputs: ['filterChange'],
|
|
4297
4336
|
},
|
|
4298
|
-
], template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<ng-content select=\"[etInputPrefix]\" />\n\n<div class=\"et-combobox-wrapper\">\n <ul *ngIf=\"combobox.multiple$ | async\" class=\"et-combobox-selected-options\">\n <li\n *ngFor=\"let item of combobox.selectedOptions$ | async; trackBy: combobox.trackByOptionKeyFn\"\n class=\"et-combobox-selected-option\"\n >\n <ng-container\n *ngIf=\"\n combobox.customSelectedOptionTpl$ | async as customSelectedOptionTpl;\n else compOrDefaultSelectedOptionLabelTpl\n \"\n >\n <ng-container *ngTemplateOutlet=\"customSelectedOptionTpl; context: { option: item }\" />\n </ng-container>\n\n <ng-template #compOrDefaultSelectedOptionLabelTpl>\n <ng-container\n *ngIf=\"combobox.customSelectedOptionComponent$ | async as comp; else defaultSelectedOptionLabelTpl\"\n >\n <ng-container *ngComponentOutlet=\"comp; inputs: { option: item }\"></ng-container>\n </ng-container>\n <ng-template #defaultSelectedOptionLabelTpl>\n {{ combobox.getOptionLabel(item) | async }}\n </ng-template>\n </ng-template>\n\n <span\n (click)=\"combobox.removeSelectedOption(item); $event.stopPropagation()\"\n class=\"et-combobox-selected-option-remove\"\n tabindex=\"-1\"\n >\n x\n </span>\n </li>\n <li class=\"et-combobox-muliple-input\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </li>\n </ul>\n\n <ng-template #inputTpl>\n <input\n (keydown)=\"combobox._processKeydownEvent($event)\"\n (click)=\"combobox.open()\"\n (blur)=\"combobox._handleBlurEvent()\"\n (input)=\"combobox._processInputEvent($event)\"\n type=\"text\"\n etNativeInputRef\n />\n </ng-template>\n\n <ng-container *ngIf=\"(combobox.multiple$ | async) === false\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </ng-container>\n\n <et-chevron-icon class=\"et-combobox-chevron\" />\n</div>\n\n<ng-content select=\"[etInputSuffix]\" />\n\n<ng-template>\n <ng-content />\n</ng-template>\n", styles: [".et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-from,.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-to{opacity:0;transform:scaleY(0)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-active{transition:transform 125ms var(--ease-out-5),opacity 125ms var(--ease-out-5)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-active{transition:transform 50ms var(--ease-in-5),opacity 50ms var(--ease-in-5)}.et-combobox-body.et-with-default-animation[et-floating-placement^=top] .et-combobox-body-container{transform-origin:bottom}.et-combobox-body.et-with-default-animation[et-floating-placement^=bottom] .et-combobox-body-container{transform-origin:top}.et-combobox-body-container{display:block;background-color:#3d3d3d;color:#fff;max-height:min(200px,var(--et-floating-max-height, 200px));overflow:auto}@supports (overflow: overlay){.et-combobox-body-container{overflow:overlay}}.et-combobox-body{width:100%;display:grid;transform:var(--et-floating-translate);will-change:transform}.et-combobox-option{display:block}:where(.et-combobox-option--active){background-color:#1e1e1e}.et-combobox{display:block;border:1px solid #ccc;padding:15px;position:relative}.et-combobox-chevron{transform:rotate(180deg);display:block;inline-size:15px;block-size:15px;position:absolute;inset-inline-end:15px;inset-block-start:7px}\n"] }]
|
|
4337
|
+
], template: "<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n<ng-content select=\"[etInputPrefix]\" />\n\n<div class=\"et-combobox-wrapper\">\n <ul *ngIf=\"combobox.multiple$ | async\" class=\"et-combobox-selected-options\">\n <li\n *ngFor=\"let item of combobox.selectedOptions$ | async; trackBy: combobox.trackByOptionKeyFn\"\n class=\"et-combobox-selected-option\"\n >\n <ng-container\n *ngIf=\"\n combobox.customSelectedOptionTpl$ | async as customSelectedOptionTpl;\n else compOrDefaultSelectedOptionLabelTpl\n \"\n >\n <ng-container *ngTemplateOutlet=\"customSelectedOptionTpl; context: { option: item }\" />\n </ng-container>\n\n <ng-template #compOrDefaultSelectedOptionLabelTpl>\n <ng-container\n *ngIf=\"combobox.customSelectedOptionComponent$ | async as comp; else defaultSelectedOptionLabelTpl\"\n >\n <ng-container *ngComponentOutlet=\"comp; inputs: { option: item }\"></ng-container>\n </ng-container>\n <ng-template #defaultSelectedOptionLabelTpl>\n {{ combobox.getOptionLabel(item) | async }}\n </ng-template>\n </ng-template>\n\n <span\n (click)=\"combobox.removeSelectedOption(item); $event.stopPropagation()\"\n class=\"et-combobox-selected-option-remove\"\n tabindex=\"-1\"\n >\n x\n </span>\n </li>\n <li class=\"et-combobox-muliple-input\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </li>\n </ul>\n\n <ng-template #inputTpl>\n <input\n (keydown)=\"combobox._processKeydownEvent($event)\"\n (keyup)=\"combobox._processKeyupEvent()\"\n (click)=\"combobox.open()\"\n (blur)=\"combobox._handleBlurEvent()\"\n (input)=\"combobox._processInputEvent($event)\"\n type=\"text\"\n etNativeInputRef\n />\n </ng-template>\n\n <ng-container *ngIf=\"(combobox.multiple$ | async) === false\">\n <ng-container *ngTemplateOutlet=\"inputTpl\" />\n </ng-container>\n\n <et-chevron-icon class=\"et-combobox-chevron\" />\n</div>\n\n<ng-content select=\"[etInputSuffix]\" />\n\n<ng-template>\n <ng-content />\n</ng-template>\n", styles: [".et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-from,.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-to{opacity:0;transform:scaleY(0)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-enter-active{transition:transform 125ms var(--ease-out-5),opacity 125ms var(--ease-out-5)}.et-combobox-body.et-with-default-animation .et-combobox-body-container.et-animation-leave-active{transition:transform 50ms var(--ease-in-5),opacity 50ms var(--ease-in-5)}.et-combobox-body.et-with-default-animation[et-floating-placement^=top] .et-combobox-body-container{transform-origin:bottom}.et-combobox-body.et-with-default-animation[et-floating-placement^=bottom] .et-combobox-body-container{transform-origin:top}.et-combobox-body-container{display:block;background-color:#3d3d3d;color:#fff;max-height:min(200px,var(--et-floating-max-height, 200px));overflow:auto}@supports (overflow: overlay){.et-combobox-body-container{overflow:overlay}}.et-combobox-body{width:100%;display:grid;transform:var(--et-floating-translate);will-change:transform}.et-combobox-option{display:block}:where(.et-combobox-option--active){background-color:#1e1e1e}.et-combobox{display:block;border:1px solid #ccc;padding:15px;position:relative}.et-combobox-chevron{transform:rotate(180deg);display:block;inline-size:15px;block-size:15px;position:absolute;inset-inline-end:15px;inset-block-start:7px}\n"] }]
|
|
4299
4338
|
}], ctorParameters: function () { return []; } });
|
|
4300
4339
|
|
|
4301
4340
|
const ComboboxImports = [
|