@ethlete/cdk 3.18.0 → 3.18.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 +18 -0
- package/esm2022/lib/components/filter/filter-overlay/components/filter-overlay-page-outlet/filter-overlay-page-outlet.component.mjs +20 -10
- package/esm2022/lib/components/filter/filter-overlay/types/filter-overlay-config.types.mjs +1 -1
- package/esm2022/lib/components/filter/filter-overlay/utils/filter-overlay-ref.mjs +6 -10
- package/esm2022/lib/components/forms/components/input/components/search-input/search-input.component.mjs +3 -3
- package/esm2022/lib/components/forms/components/input/directives/search-input/search-input.directive.mjs +3 -1
- package/esm2022/lib/components/forms/components/select/components/combobox/directives/combobox/combobox.directive.mjs +7 -1
- package/esm2022/lib/components/forms/components/select/components/select/directives/select/select.directive.mjs +2 -1
- package/esm2022/lib/components/forms/components/selection-list/components/selection-list-option/selection-list-option.component.mjs +3 -3
- package/esm2022/lib/components/forms/components/selection-list/directives/selection-list-field/selection-list-field.directive.mjs +3 -3
- package/esm2022/lib/components/forms/components/selection-list/directives/selection-list-option/selection-list-option.directive.mjs +19 -5
- package/fesm2022/ethlete-cdk.mjs +57 -28
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/filter/filter-overlay/components/filter-overlay-page-outlet/filter-overlay-page-outlet.component.d.ts +3 -2
- package/lib/components/filter/filter-overlay/types/filter-overlay-config.types.d.ts +0 -4
- package/lib/components/filter/filter-overlay/utils/filter-overlay-ref.d.ts +3 -3
- package/lib/components/forms/components/selection-list/components/selection-list-option/selection-list-option.component.d.ts +1 -1
- package/lib/components/forms/components/selection-list/directives/selection-list-option/selection-list-option.directive.d.ts +5 -1
- package/package.json +3 -3
package/fesm2022/ethlete-cdk.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import * as i1 from '@angular/cdk/portal';
|
|
|
2
2
|
import { CdkPortal, PortalModule, ComponentPortal, TemplatePortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
3
3
|
import { AsyncPipe, NgIf, NgClass, NgTemplateOutlet, NgForOf, NgFor, NgComponentOutlet, DOCUMENT, JsonPipe, formatDate } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, InjectionToken, booleanAttribute, Input, ContentChild, ContentChildren, inject, ElementRef, Injector, HostBinding, signal, Optional, Inject, Injectable, SkipSelf, HostListener, ViewContainerRef, EventEmitter, NgZone, isDevMode, Output, NgModule, ChangeDetectorRef, ViewChild,
|
|
5
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, InjectionToken, booleanAttribute, Input, ContentChild, ContentChildren, inject, ElementRef, Injector, HostBinding, computed, signal, Optional, Inject, Injectable, SkipSelf, HostListener, ViewContainerRef, EventEmitter, NgZone, isDevMode, Output, NgModule, ChangeDetectorRef, ViewChild, runInInjectionContext, TemplateRef, forwardRef, LOCALE_ID, numberAttribute, ViewChildren, Renderer2, Attribute } from '@angular/core';
|
|
6
6
|
import * as i1$2 from '@ethlete/core';
|
|
7
|
-
import { LetDirective, createDestroy, ScrollObserverFirstElementDirective, ScrollObserverLastElementDirective, Memo, createReactiveBindings, AnimatedIfDirective, AnimatedLifecycleDirective, SmartBlockScrollStrategy, RouterStateService, ANIMATED_LIFECYCLE_TOKEN, nextFrame, elementCanScroll, equal, ViewportService, AnimatedOverlayDirective, ClickObserverService, FocusVisibleService, cloneFormGroup, ObserveVisibilityDirective,
|
|
7
|
+
import { LetDirective, createDestroy, ScrollObserverFirstElementDirective, ScrollObserverLastElementDirective, Memo, createReactiveBindings, signalHostClasses, AnimatedIfDirective, AnimatedLifecycleDirective, SmartBlockScrollStrategy, RouterStateService, ANIMATED_LIFECYCLE_TOKEN, nextFrame, elementCanScroll, equal, ViewportService, AnimatedOverlayDirective, ClickObserverService, FocusVisibleService, cloneFormGroup, ObserveVisibilityDirective, signalVisibilityChangeClasses, IS_EMAIL, MUST_MATCH, IS_ARRAY_NOT_EMPTY, AT_LEAST_ONE_REQUIRED, ResizeObserverService, createFlipAnimation, RuntimeError, SelectionModel, ActiveSelectionModel, KeyPressManager, scrollToElement, isEmptyArray, isObjectArray, isPrimitiveArray, ClickOutsideDirective, ObserveContentDirective, clamp, DELAYABLE_TOKEN, ObserveResizeDirective, 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, filter, take, merge, skipUntil, defer, fromEvent, partition, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, withLatestFrom, skipWhile, catchError, throwError, firstValueFrom, timer, Subscription, Observable } from 'rxjs';
|
|
9
9
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
10
10
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -1269,32 +1269,42 @@ class FilterOverlayPageOutletComponent {
|
|
|
1269
1269
|
constructor() {
|
|
1270
1270
|
this.filterOverlayRef = inject(FILTER_OVERLAY_REF);
|
|
1271
1271
|
this.trackByRoute = (_, page) => page.route;
|
|
1272
|
+
signalHostClasses({
|
|
1273
|
+
'et-filter-overlay-page-outlet--backward': computed(() => {
|
|
1274
|
+
const page = this.filterOverlayRef.currentPage();
|
|
1275
|
+
return page?.route === '' || page?.route === '/';
|
|
1276
|
+
}),
|
|
1277
|
+
'et-filter-overlay-page-outlet--forward': computed(() => {
|
|
1278
|
+
const page = this.filterOverlayRef.currentPage();
|
|
1279
|
+
return page?.route !== '' && page?.route !== '/';
|
|
1280
|
+
}),
|
|
1281
|
+
});
|
|
1272
1282
|
}
|
|
1273
1283
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: FilterOverlayPageOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1274
1284
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: FilterOverlayPageOutletComponent, isStandalone: true, selector: "et-filter-overlay-page-outlet", host: { classAttribute: "et-filter-overlay-page-outlet" }, ngImport: i0, template: `
|
|
1275
|
-
<ng-container *ngFor="let page of filterOverlayRef.pages
|
|
1285
|
+
<ng-container *ngFor="let page of filterOverlayRef.pages; trackBy: trackByRoute">
|
|
1276
1286
|
<div class="et-filter-overlay-page-outlet-page" etAnimatedLifecycle>
|
|
1277
|
-
<ng-container *etAnimatedIf="page.
|
|
1287
|
+
<ng-container *etAnimatedIf="page === filterOverlayRef.currentPage()">
|
|
1278
1288
|
<ng-container *ngComponentOutlet="page.component; inputs: page.inputs" />
|
|
1279
1289
|
</ng-container>
|
|
1280
1290
|
</div>
|
|
1281
1291
|
</ng-container>
|
|
1282
|
-
`, isInline: true, styles: [".et-filter-overlay-page-outlet{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);overflow-x:hidden}.et-filter-overlay-page-outlet-page{--transition-easing: var(--ease-in-out-5);grid-area:1 / 1 / 2 / 2;pointer-events:none}.et-filter-overlay-page-outlet-page>*{pointer-events:auto}.et-filter-overlay-page-outlet-page.et-animation-enter-from{transform:
|
|
1292
|
+
`, isInline: true, styles: [".et-filter-overlay-page-outlet{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);overflow-x:hidden;--_et-filter-transform-from: translateX(100%);--_et-filter-transform-to: translateX(-100%)}.et-filter-overlay-page-outlet.et-filter-overlay-page-outlet--backward{--_et-filter-transform-from: translateX(-100%);--_et-filter-transform-to: translateX(100%)}.et-filter-overlay-page-outlet-page{--transition-easing: var(--ease-in-out-5);grid-area:1 / 1 / 2 / 2;pointer-events:none}.et-filter-overlay-page-outlet-page>*{pointer-events:auto}.et-filter-overlay-page-outlet-page.et-animation-enter-from{transform:var(--_et-filter-transform-from);opacity:0}.et-filter-overlay-page-outlet-page.et-animation-leave-to{transform:var(--_et-filter-transform-to);opacity:0}.et-filter-overlay-page-outlet-page:is(.et-animation-enter-active,.et-animation-leave-active){transition:transform .3s var(--transition-easing),opacity .3s var(--transition-easing)}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: AnimatedIfDirective, selector: "[etAnimatedIf]", inputs: ["etAnimatedIf"] }, { kind: "directive", type: AnimatedLifecycleDirective, selector: "[etAnimatedLifecycle]", exportAs: ["etAnimatedLifecycle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1283
1293
|
}
|
|
1284
1294
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: FilterOverlayPageOutletComponent, decorators: [{
|
|
1285
1295
|
type: Component,
|
|
1286
1296
|
args: [{ selector: 'et-filter-overlay-page-outlet', template: `
|
|
1287
|
-
<ng-container *ngFor="let page of filterOverlayRef.pages
|
|
1297
|
+
<ng-container *ngFor="let page of filterOverlayRef.pages; trackBy: trackByRoute">
|
|
1288
1298
|
<div class="et-filter-overlay-page-outlet-page" etAnimatedLifecycle>
|
|
1289
|
-
<ng-container *etAnimatedIf="page.
|
|
1299
|
+
<ng-container *etAnimatedIf="page === filterOverlayRef.currentPage()">
|
|
1290
1300
|
<ng-container *ngComponentOutlet="page.component; inputs: page.inputs" />
|
|
1291
1301
|
</ng-container>
|
|
1292
1302
|
</div>
|
|
1293
1303
|
</ng-container>
|
|
1294
1304
|
`, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1295
1305
|
class: 'et-filter-overlay-page-outlet',
|
|
1296
|
-
}, imports: [NgFor, NgComponentOutlet, AnimatedIfDirective, AnimatedLifecycleDirective], hostDirectives: [], styles: [".et-filter-overlay-page-outlet{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);overflow-x:hidden}.et-filter-overlay-page-outlet-page{--transition-easing: var(--ease-in-out-5);grid-area:1 / 1 / 2 / 2;pointer-events:none}.et-filter-overlay-page-outlet-page>*{pointer-events:auto}.et-filter-overlay-page-outlet-page.et-animation-enter-from{transform:
|
|
1297
|
-
}] });
|
|
1306
|
+
}, imports: [NgFor, NgComponentOutlet, AnimatedIfDirective, AnimatedLifecycleDirective], hostDirectives: [], styles: [".et-filter-overlay-page-outlet{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);overflow-x:hidden;--_et-filter-transform-from: translateX(100%);--_et-filter-transform-to: translateX(-100%)}.et-filter-overlay-page-outlet.et-filter-overlay-page-outlet--backward{--_et-filter-transform-from: translateX(-100%);--_et-filter-transform-to: translateX(100%)}.et-filter-overlay-page-outlet-page{--transition-easing: var(--ease-in-out-5);grid-area:1 / 1 / 2 / 2;pointer-events:none}.et-filter-overlay-page-outlet-page>*{pointer-events:auto}.et-filter-overlay-page-outlet-page.et-animation-enter-from{transform:var(--_et-filter-transform-from);opacity:0}.et-filter-overlay-page-outlet-page.et-animation-leave-to{transform:var(--_et-filter-transform-to);opacity:0}.et-filter-overlay-page-outlet-page:is(.et-animation-enter-active,.et-animation-leave-active){transition:transform .3s var(--transition-easing),opacity .3s var(--transition-easing)}\n"] }]
|
|
1307
|
+
}], ctorParameters: function () { return []; } });
|
|
1298
1308
|
|
|
1299
1309
|
const FILTER_OVERLAY_BACK_OR_CLOSE_TOKEN = new InjectionToken('FILTER_OVERLAY_BACK_OR_CLOSE_TOKEN');
|
|
1300
1310
|
class FilterOverlayBackOrCloseDirective {
|
|
@@ -5449,15 +5459,11 @@ class FilterOverlayRef {
|
|
|
5449
5459
|
this._config = _config;
|
|
5450
5460
|
this._currentRoute = signal('');
|
|
5451
5461
|
this.currentRoute = this._currentRoute.asReadonly();
|
|
5452
|
-
this.pages =
|
|
5453
|
-
|
|
5454
|
-
const
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
};
|
|
5458
|
-
return data;
|
|
5459
|
-
}));
|
|
5460
|
-
this.currentPage = computed(() => this.pages().find((page) => page.isActive()));
|
|
5462
|
+
this.pages = this._config.pages;
|
|
5463
|
+
this.currentPage = computed(() => {
|
|
5464
|
+
const currentRoute = this.currentRoute();
|
|
5465
|
+
return this.pages.find((page) => this._buildRoute(page.route) === currentRoute);
|
|
5466
|
+
});
|
|
5461
5467
|
this.currentPageTitle = computed(() => this.currentPage()?.title ?? null);
|
|
5462
5468
|
this.canGoBack = computed(() => !!this.currentRoute());
|
|
5463
5469
|
this.form = cloneFormGroup(this._config.form);
|
|
@@ -7307,6 +7313,8 @@ class SearchInputDirective {
|
|
|
7307
7313
|
this.input._setShouldDisplayError(true);
|
|
7308
7314
|
}
|
|
7309
7315
|
_clear(event) {
|
|
7316
|
+
if (this.input.value === null)
|
|
7317
|
+
return;
|
|
7310
7318
|
event?.preventDefault();
|
|
7311
7319
|
event?.stopPropagation();
|
|
7312
7320
|
this.input._updateValue(null);
|
|
@@ -7523,13 +7531,13 @@ class SearchInputComponent extends DecoratedInputBase {
|
|
|
7523
7531
|
this.searchInput = inject(SEARCH_INPUT_TOKEN);
|
|
7524
7532
|
}
|
|
7525
7533
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SearchInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
7526
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: SearchInputComponent, isStandalone: true, selector: "et-search-input", host: { classAttribute: "et-search-input" }, usesInheritance: true, hostDirectives: [{ directive: SearchInputDirective }, { directive: InputDirective, inputs: ["autocomplete", "autocomplete", "placeholder", "placeholder"] }], ngImport: i0, template: "<ng-content select=\"[etInputPrefix]\" />\n\n<input\n [attr.id]=\"input.id\"\n [attr.aria-labelledby]=\"input.labelId$ | async\"\n [required]=\"input.required$ | async\"\n [disabled]=\"input.disabled$ | async\"\n [attr.autocomplete]=\"input.autocomplete || null\"\n [attr.placeholder]=\"input.placeholder || null\"\n [attr.aria-describedby]=\"input.describedBy$ | async\"\n (input)=\"searchInput._onInputInteraction($event)\"\n (blur)=\"searchInput._controlTouched()\"\n (
|
|
7534
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: SearchInputComponent, isStandalone: true, selector: "et-search-input", host: { classAttribute: "et-search-input" }, usesInheritance: true, hostDirectives: [{ directive: SearchInputDirective }, { directive: InputDirective, inputs: ["autocomplete", "autocomplete", "placeholder", "placeholder"] }], ngImport: i0, template: "<ng-content select=\"[etInputPrefix]\" />\n\n<input\n [attr.id]=\"input.id\"\n [attr.aria-labelledby]=\"input.labelId$ | async\"\n [required]=\"input.required$ | async\"\n [disabled]=\"input.disabled$ | async\"\n [attr.autocomplete]=\"input.autocomplete || null\"\n [attr.placeholder]=\"input.placeholder || null\"\n [attr.aria-describedby]=\"input.describedBy$ | async\"\n (input)=\"searchInput._onInputInteraction($event)\"\n (blur)=\"searchInput._controlTouched()\"\n (keydown.escape)=\"searchInput._clear($event)\"\n class=\"et-input-native-control et-search-input-native-control\"\n type=\"search\"\n etNativeInputRef\n/>\n\n<ng-content select=\"[etInputSuffix]\" />\n", styles: [".et-search-input input[type=search]::-webkit-search-cancel-button,.et-search-input input[type=search]::-webkit-search-decoration{-webkit-appearance:none}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NativeInputRefDirective, selector: "input[etNativeInputRef], textarea[etNativeInputRef], select[etNativeInputRef], button[etNativeInputRef]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
7527
7535
|
}
|
|
7528
7536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SearchInputComponent, decorators: [{
|
|
7529
7537
|
type: Component,
|
|
7530
7538
|
args: [{ selector: 'et-search-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
7531
7539
|
class: 'et-search-input',
|
|
7532
|
-
}, imports: [AsyncPipe, NativeInputRefDirective], hostDirectives: [SearchInputDirective, { directive: InputDirective, inputs: ['autocomplete', 'placeholder'] }], template: "<ng-content select=\"[etInputPrefix]\" />\n\n<input\n [attr.id]=\"input.id\"\n [attr.aria-labelledby]=\"input.labelId$ | async\"\n [required]=\"input.required$ | async\"\n [disabled]=\"input.disabled$ | async\"\n [attr.autocomplete]=\"input.autocomplete || null\"\n [attr.placeholder]=\"input.placeholder || null\"\n [attr.aria-describedby]=\"input.describedBy$ | async\"\n (input)=\"searchInput._onInputInteraction($event)\"\n (blur)=\"searchInput._controlTouched()\"\n (
|
|
7540
|
+
}, imports: [AsyncPipe, NativeInputRefDirective], hostDirectives: [SearchInputDirective, { directive: InputDirective, inputs: ['autocomplete', 'placeholder'] }], template: "<ng-content select=\"[etInputPrefix]\" />\n\n<input\n [attr.id]=\"input.id\"\n [attr.aria-labelledby]=\"input.labelId$ | async\"\n [required]=\"input.required$ | async\"\n [disabled]=\"input.disabled$ | async\"\n [attr.autocomplete]=\"input.autocomplete || null\"\n [attr.placeholder]=\"input.placeholder || null\"\n [attr.aria-describedby]=\"input.describedBy$ | async\"\n (input)=\"searchInput._onInputInteraction($event)\"\n (blur)=\"searchInput._controlTouched()\"\n (keydown.escape)=\"searchInput._clear($event)\"\n class=\"et-input-native-control et-search-input-native-control\"\n type=\"search\"\n etNativeInputRef\n/>\n\n<ng-content select=\"[etInputSuffix]\" />\n", styles: [".et-search-input input[type=search]::-webkit-search-cancel-button,.et-search-input input[type=search]::-webkit-search-decoration{-webkit-appearance:none}\n"] }]
|
|
7533
7541
|
}] });
|
|
7534
7542
|
|
|
7535
7543
|
class TextInputComponent extends DecoratedInputBase {
|
|
@@ -8726,8 +8734,14 @@ class ComboboxDirective {
|
|
|
8726
8734
|
if (keyCode === ESCAPE) {
|
|
8727
8735
|
if (isOpen) {
|
|
8728
8736
|
result.overlayOperation = 'close';
|
|
8737
|
+
event.preventDefault();
|
|
8738
|
+
event.stopPropagation();
|
|
8729
8739
|
}
|
|
8730
8740
|
else if (!isMultiple) {
|
|
8741
|
+
if (this.currentFilter) {
|
|
8742
|
+
event.preventDefault();
|
|
8743
|
+
event.stopPropagation();
|
|
8744
|
+
}
|
|
8731
8745
|
result.setFilter = '';
|
|
8732
8746
|
result.optionAction = 'clear';
|
|
8733
8747
|
}
|
|
@@ -9700,6 +9714,7 @@ class SelectDirective {
|
|
|
9700
9714
|
}
|
|
9701
9715
|
else if (keyCode === ESCAPE && !hasModifierKey(event)) {
|
|
9702
9716
|
event.preventDefault();
|
|
9717
|
+
event.stopPropagation();
|
|
9703
9718
|
this.unmountSelectBody();
|
|
9704
9719
|
}
|
|
9705
9720
|
else if (keyCode === ENTER || keyCode === SPACE) {
|
|
@@ -10080,9 +10095,12 @@ class SelectionListOptionDirective {
|
|
|
10080
10095
|
this.elementRef = inject(ElementRef);
|
|
10081
10096
|
this._value = signal(undefined);
|
|
10082
10097
|
this._disabled = signal(false);
|
|
10098
|
+
this._isResetOption = signal(false);
|
|
10083
10099
|
this.selected = computed(() => {
|
|
10084
10100
|
const value = this.input.value;
|
|
10085
|
-
return (Array.isArray(value) && value.includes(this.value)) ||
|
|
10101
|
+
return ((Array.isArray(value) && value.includes(this.value)) ||
|
|
10102
|
+
value === this.value ||
|
|
10103
|
+
(this.field.multiple && this.isResetOption && Array.isArray(value) && value.length === 0));
|
|
10086
10104
|
});
|
|
10087
10105
|
}
|
|
10088
10106
|
get value() {
|
|
@@ -10097,6 +10115,12 @@ class SelectionListOptionDirective {
|
|
|
10097
10115
|
set disabled(value) {
|
|
10098
10116
|
this._disabled.set(value);
|
|
10099
10117
|
}
|
|
10118
|
+
get isResetOption() {
|
|
10119
|
+
return this._isResetOption();
|
|
10120
|
+
}
|
|
10121
|
+
set isResetOption(value) {
|
|
10122
|
+
this._isResetOption.set(value);
|
|
10123
|
+
}
|
|
10100
10124
|
focus() {
|
|
10101
10125
|
this.elementRef.nativeElement.focus();
|
|
10102
10126
|
}
|
|
@@ -10124,6 +10148,9 @@ class SelectionListOptionDirective {
|
|
|
10124
10148
|
if (!Array.isArray(this.input.value)) {
|
|
10125
10149
|
this.input._updateValue([this.value]);
|
|
10126
10150
|
}
|
|
10151
|
+
else if (this.isResetOption) {
|
|
10152
|
+
this.input._updateValue([]);
|
|
10153
|
+
}
|
|
10127
10154
|
else if (this.selected()) {
|
|
10128
10155
|
this.input._updateValue(this.input.value.filter((value) => value !== this.value));
|
|
10129
10156
|
}
|
|
@@ -10136,7 +10163,7 @@ class SelectionListOptionDirective {
|
|
|
10136
10163
|
}
|
|
10137
10164
|
}
|
|
10138
10165
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SelectionListOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
10139
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "16.2.5", type: SelectionListOptionDirective, isStandalone: true, inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "role": "option", "tabindex": "0" }, listeners: { "click": "_onInputInteraction($event)", "blur": "_controlTouched()" }, properties: { "class.et-selection-list-option--selected": "selected()", "class.et-selection-list-option--disabled": "disabled || input.disabled", "attr.aria-selected": "selected()", "attr.aria-disabled": "disabled || input.disabled" }, classAttribute: "et-selection-list-option" }, providers: [{ provide: SELECTION_LIST_OPTION, useExisting: SelectionListOptionDirective }], exportAs: ["etSelectionListOption"], ngImport: i0 }); }
|
|
10166
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "16.2.5", type: SelectionListOptionDirective, isStandalone: true, inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], isResetOption: ["isResetOption", "isResetOption", booleanAttribute] }, host: { attributes: { "role": "option", "tabindex": "0" }, listeners: { "click": "_onInputInteraction($event)", "blur": "_controlTouched()" }, properties: { "class.et-selection-list-option--selected": "selected()", "class.et-selection-list-option--disabled": "disabled || input.disabled", "attr.aria-selected": "selected()", "attr.aria-disabled": "disabled || input.disabled" }, classAttribute: "et-selection-list-option" }, providers: [{ provide: SELECTION_LIST_OPTION, useExisting: SelectionListOptionDirective }], exportAs: ["etSelectionListOption"], ngImport: i0 }); }
|
|
10140
10167
|
}
|
|
10141
10168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SelectionListOptionDirective, decorators: [{
|
|
10142
10169
|
type: Directive,
|
|
@@ -10157,11 +10184,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
10157
10184
|
},
|
|
10158
10185
|
}]
|
|
10159
10186
|
}], propDecorators: { value: [{
|
|
10160
|
-
type: Input
|
|
10161
|
-
args: [{ required: true }]
|
|
10187
|
+
type: Input
|
|
10162
10188
|
}], disabled: [{
|
|
10163
10189
|
type: Input,
|
|
10164
10190
|
args: [{ transform: booleanAttribute }]
|
|
10191
|
+
}], isResetOption: [{
|
|
10192
|
+
type: Input,
|
|
10193
|
+
args: [{ transform: booleanAttribute }]
|
|
10165
10194
|
}] } });
|
|
10166
10195
|
|
|
10167
10196
|
const SELECTION_LIST_FIELD = new InjectionToken('ET_SELECTION_LIST_FIELD_DIRECTIVE_TOKEN');
|
|
@@ -10198,7 +10227,7 @@ class SelectionListFieldDirective {
|
|
|
10198
10227
|
this.multiple &&
|
|
10199
10228
|
!this._keyManager?.isTyping() &&
|
|
10200
10229
|
hasModifierKey(event, 'ctrlKey')) {
|
|
10201
|
-
const shouldSelect = this._options()?.some((option) => !option?.disabled && !option?.selected());
|
|
10230
|
+
const shouldSelect = this._options()?.some((option) => !option?.disabled && !option?.selected() && !option?.isResetOption);
|
|
10202
10231
|
event.preventDefault();
|
|
10203
10232
|
this._setAllOptionsSelected(shouldSelect ?? true);
|
|
10204
10233
|
}
|
|
@@ -10248,7 +10277,7 @@ class SelectionListFieldDirective {
|
|
|
10248
10277
|
if (!options)
|
|
10249
10278
|
return;
|
|
10250
10279
|
if (shouldSelectAll) {
|
|
10251
|
-
const values = options.filter((o) => !o.disabled).map((o) => o.value);
|
|
10280
|
+
const values = options.filter((o) => !o.disabled && !o.isResetOption).map((o) => o.value);
|
|
10252
10281
|
this.input._updateValue(values);
|
|
10253
10282
|
}
|
|
10254
10283
|
else {
|
|
@@ -10312,7 +10341,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
10312
10341
|
|
|
10313
10342
|
class SelectionListOptionComponent {
|
|
10314
10343
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SelectionListOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10315
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: SelectionListOptionComponent, isStandalone: true, selector: "et-selection-list-option", hostDirectives: [{ directive: SelectionListOptionDirective, inputs: ["value", "value", "disabled", "disabled"] }], ngImport: i0, template: `
|
|
10344
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: SelectionListOptionComponent, isStandalone: true, selector: "et-selection-list-option", hostDirectives: [{ directive: SelectionListOptionDirective, inputs: ["value", "value", "disabled", "disabled", "isResetOption", "isResetOption"] }], ngImport: i0, template: `
|
|
10316
10345
|
<div class="et-selection-list-option-content">
|
|
10317
10346
|
<ng-content />
|
|
10318
10347
|
</div>
|
|
@@ -10332,7 +10361,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
10332
10361
|
<div class="et-selection-list-option-state">
|
|
10333
10362
|
<div class="et-selection-list-option-state-check"></div>
|
|
10334
10363
|
</div>
|
|
10335
|
-
`, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], hostDirectives: [{ directive: SelectionListOptionDirective, inputs: ['value', 'disabled'] }], styles: [":where(.et-selection-list-option){--et-selection-list-option-state-size: 25px;--et-selection-list-option-state-check-size: 10px;--et-selection-list-option-state-border-color: #e5e5e5;--et-selection-list-option-state-state-color: #e5e5e5;--et-selection-list-option-state-indeterminate-width: 10px;--et-selection-list-option-state-indeterminate-height: 2px}.et-selection-list-option{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px}.et-selection-list-field--multiple .et-selection-list-option-state,.et-selection-list-field--multiple .et-selection-list-option-state .et-selection-list-option-state-check{border-radius:0%}.et-selection-list-option-state{inline-size:var(--et-selection-list-option-state-size);block-size:var(--et-selection-list-option-state-size);border:1px solid var(--et-selection-list-option-state-border-color);display:inline-grid;position:relative;align-items:center;border-radius:50%;justify-items:center}.et-selection-list-option-state-check{inline-size:var(--et-selection-list-option-state-check-size);block-size:var(--et-selection-list-option-state-check-size);border-radius:50%}.et-selection-list-option--selected .et-selection-list-option-state-check{background-color:var(--et-selection-list-option-state-state-color)}\n"] }]
|
|
10364
|
+
`, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], hostDirectives: [{ directive: SelectionListOptionDirective, inputs: ['value', 'disabled', 'isResetOption'] }], styles: [":where(.et-selection-list-option){--et-selection-list-option-state-size: 25px;--et-selection-list-option-state-check-size: 10px;--et-selection-list-option-state-border-color: #e5e5e5;--et-selection-list-option-state-state-color: #e5e5e5;--et-selection-list-option-state-indeterminate-width: 10px;--et-selection-list-option-state-indeterminate-height: 2px}.et-selection-list-option{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px}.et-selection-list-field--multiple .et-selection-list-option-state,.et-selection-list-field--multiple .et-selection-list-option-state .et-selection-list-option-state-check{border-radius:0%}.et-selection-list-option-state{inline-size:var(--et-selection-list-option-state-size);block-size:var(--et-selection-list-option-state-size);border:1px solid var(--et-selection-list-option-state-border-color);display:inline-grid;position:relative;align-items:center;border-radius:50%;justify-items:center}.et-selection-list-option-state-check{inline-size:var(--et-selection-list-option-state-check-size);block-size:var(--et-selection-list-option-state-check-size);border-radius:50%}.et-selection-list-option--selected .et-selection-list-option-state-check{background-color:var(--et-selection-list-option-state-state-color)}\n"] }]
|
|
10336
10365
|
}] });
|
|
10337
10366
|
|
|
10338
10367
|
const SelectionListImports = [SelectionListFieldComponent, SelectionListOptionComponent];
|