@ethlete/cdk 4.53.5 → 4.54.0
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 +6 -0
- package/fesm2022/ethlete-cdk.mjs +107 -141
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/accordion/{partials/accordion-hint-wrapper → accordion}/accordion-hint-wrapper.directive.d.ts +2 -1
- package/lib/components/accordion/{partials/accordion-label-wrapper → accordion}/accordion-label-wrapper.directive.d.ts +2 -1
- package/lib/components/accordion/accordion/accordion.component.d.ts +19 -0
- package/lib/components/accordion/accordion/index.d.ts +7 -0
- package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +8 -0
- package/lib/components/accordion/accordion.imports.d.ts +2 -6
- package/lib/components/accordion/public-api/index.d.ts +2 -6
- package/package.json +1 -1
- package/lib/components/accordion/components/accordion/accordion.component.d.ts +0 -28
- package/lib/components/accordion/components/accordion/index.d.ts +0 -3
- package/lib/components/accordion/components/accordion-group/accordion-group.component.d.ts +0 -11
- package/lib/components/accordion/partials/accordion-hint/index.d.ts +0 -1
- package/lib/components/accordion/partials/accordion-hint-wrapper/accordion-hint-wrapper.directive.constants.d.ts +0 -3
- package/lib/components/accordion/partials/accordion-hint-wrapper/index.d.ts +0 -2
- package/lib/components/accordion/partials/accordion-label/index.d.ts +0 -1
- package/lib/components/accordion/partials/accordion-label-wrapper/accordion-label-wrapper.directive.constants.d.ts +0 -3
- package/lib/components/accordion/partials/accordion-label-wrapper/index.d.ts +0 -2
- /package/lib/components/accordion/{partials/accordion-hint → accordion}/accordion-hint.directive.d.ts +0 -0
- /package/lib/components/accordion/{partials/accordion-label → accordion}/accordion-label.directive.d.ts +0 -0
- /package/lib/components/accordion/{components/accordion → accordion}/accordion.component.animations.d.ts +0 -0
- /package/lib/components/accordion/{components/accordion → accordion}/accordion.component.constants.d.ts +0 -0
- /package/lib/components/accordion/{components/accordion-group → accordion-group}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ethlete/cdk
|
|
2
2
|
|
|
3
|
+
## 4.54.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2587](https://github.com/ethlete-io/ethdk/pull/2587) [`fe51b05`](https://github.com/ethlete-io/ethdk/commit/fe51b05889db5822679b0892434e37a1933d86a8) Thanks [@nicks-passiert](https://github.com/nicks-passiert)! - Change accordion to signal structure
|
|
8
|
+
|
|
3
9
|
## 4.53.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/fesm2022/ethlete-cdk.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Directive, inject, input, booleanAttribute, computed, isDevMode, model, contentChild, effect, untracked, Component, ViewEncapsulation, ChangeDetectionStrategy, contentChildren, ElementRef, Injector, Input, HostBinding, numberAttribute, PLATFORM_ID, Renderer2, DestroyRef, signal, viewChild, viewChildren, ContentChild, Injectable, ChangeDetectorRef, TemplateRef, ViewContainerRef, ViewChild, ContentChildren, assertInInjectionContext, forwardRef, EventEmitter, Output, ViewChildren, runInInjectionContext, Optional, Inject, SkipSelf, HostListener, NgZone, NgModule, isSignal, Attribute } from '@angular/core';
|
|
1
3
|
import * as i1 from '@angular/cdk/portal';
|
|
2
4
|
import { CdkPortal, PortalModule, ComponentPortal, TemplatePortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
3
|
-
import { AsyncPipe, isPlatformBrowser, NgComponentOutlet, NgClass, NgTemplateOutlet, DOCUMENT, Location, NgStyle } from '@angular/common';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { InjectionToken, inject, input, booleanAttribute, computed, isDevMode, Directive, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, ContentChild, ContentChildren, ElementRef, Injector, HostBinding, numberAttribute, PLATFORM_ID, Renderer2, effect, DestroyRef, signal, contentChildren, viewChild, viewChildren, Injectable, ChangeDetectorRef, TemplateRef, ViewContainerRef, ViewChild, assertInInjectionContext, forwardRef, EventEmitter, Output, ViewChildren, contentChild, runInInjectionContext, Optional, Inject, SkipSelf, HostListener, untracked, NgZone, NgModule, isSignal, Attribute } from '@angular/core';
|
|
6
|
-
import { BehaviorSubject, startWith, map, switchMap, combineLatest, pairwise, tap, takeUntil, skip, of, merge, timer, takeWhile, filter, fromEvent, Subject, Observable, debounceTime, withLatestFrom, distinctUntilChanged, take, skipUntil, skipWhile, catchError, throwError, defer, partition, from, finalize, Subscription } from 'rxjs';
|
|
7
5
|
import { DomSanitizer, Title } from '@angular/platform-browser';
|
|
8
6
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
7
|
+
import { toObservable, takeUntilDestroyed, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { map, switchMap, combineLatest, pairwise, tap, BehaviorSubject, takeUntil, skip, of, merge, timer, takeWhile, filter, fromEvent, Subject, Observable, startWith, debounceTime, withLatestFrom, distinctUntilChanged, take, skipUntil, skipWhile, catchError, throwError, defer, partition, from, finalize, Subscription } from 'rxjs';
|
|
11
9
|
import { __decorate, __metadata } from 'tslib';
|
|
12
|
-
import {
|
|
10
|
+
import { AsyncPipe, isPlatformBrowser, NgComponentOutlet, NgClass, NgTemplateOutlet, DOCUMENT, Location, NgStyle } from '@angular/common';
|
|
11
|
+
import * as i1$1 from '@ethlete/core';
|
|
12
|
+
import { Memo, createComponentId, signalHostAttributes, signalHostClasses, createDestroy, previousSignalValue, signalHostStyles, nextFrame, syncSignal, signalStyles, injectHostElement, ObserveVisibilityDirective, signalVisibilityChangeClasses, IS_EMAIL, MUST_MATCH, IS_ARRAY_NOT_EMPTY, AT_LEAST_ONE_REQUIRED, equal, switchQueryListChanges, controlValueSignal, signalAttributes, ResizeObserverService, createFlipAnimation, AnimatedOverlayDirective, RuntimeError, SelectionModel, ActiveSelectionModel, KeyPressManager, signalClasses, scrollToElement, isEmptyArray, isObjectArray, isPrimitiveArray, ClickOutsideDirective, ANIMATED_LIFECYCLE_TOKEN, AnimatedLifecycleDirective, ObserveContentDirective, clamp, DELAYABLE_TOKEN, ObserveResizeDirective, SmartBlockScrollStrategy, signalElementDimensions, signalElementScrollState, createIsRenderedSignal, createCanAnimateSignal, useCursorDragScroll, signalElementIntersection, signalElementChildren, getIntersectionInfo, getElementScrollCoordinates, ClickObserverService, RootBoundaryDirective, elementCanScroll, cloneFormGroup, getFormGroupValue, ViewportService, injectRoute, ROOT_BOUNDARY_TOKEN, injectQueryParam, RouterStateService, fromNextFrame, isElementVisible, AnimatedIfDirective, FocusVisibleService, inferMimeType, TypedQueryList } from '@ethlete/core';
|
|
13
13
|
import { extractQuery, isQueryStateSuccess, isQueryStateFailure, isQueryStateLoading, QueryDirective, queryComputed, switchQueryState, shouldRetryRequest, ExperimentalQuery, isClassValidatorError, isSymfonyFormViolationListError, isSymfonyListError } from '@ethlete/query';
|
|
14
14
|
import * as i1$2 from '@angular/cdk/a11y';
|
|
15
15
|
import { FocusMonitor, FocusKeyManager, InputModalityDetector, FocusTrapFactory, InteractivityChecker, AriaDescriber, A11yModule } from '@angular/cdk/a11y';
|
|
@@ -33,6 +33,72 @@ import * as i1$4 from '@angular/cdk/table';
|
|
|
33
33
|
import { CdkColumnDef, CDK_TABLE, CdkTable, _COALESCED_STYLE_SCHEDULER, _CoalescedStyleScheduler, STICKY_POSITIONING_LISTENER, HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet, CdkCell, CdkCellDef, CdkFooterCell, CdkFooterCellDef, CdkHeaderCell, CdkHeaderCellDef, CdkTextColumn, TEXT_COLUMN_OPTIONS, CdkFooterRow, CdkTableModule, CDK_ROW_TEMPLATE, CdkFooterRowDef, CdkHeaderRow, CdkHeaderRowDef, CdkNoDataRow, CdkRow, CdkRowDef } from '@angular/cdk/table';
|
|
34
34
|
import { CdkScrollableModule, ViewportRuler as ViewportRuler$1 } from '@angular/cdk/scrolling';
|
|
35
35
|
|
|
36
|
+
const ACCORDION_HINT_WRAPPER_DIRECTIVE = new InjectionToken('AccordionHintWrapperDirective');
|
|
37
|
+
class AccordionHintWrapperDirective extends CdkPortal {
|
|
38
|
+
constructor(templateRef, viewContainerRef) {
|
|
39
|
+
super(templateRef, viewContainerRef);
|
|
40
|
+
}
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintWrapperDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
42
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionHintWrapperDirective, isStandalone: true, selector: "ng-template[et-accordion-hint-wrapper]", providers: [{ provide: ACCORDION_HINT_WRAPPER_DIRECTIVE, useExisting: AccordionHintWrapperDirective }], usesInheritance: true, ngImport: i0 }); }
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintWrapperDirective, decorators: [{
|
|
45
|
+
type: Directive,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: 'ng-template[et-accordion-hint-wrapper]',
|
|
48
|
+
providers: [{ provide: ACCORDION_HINT_WRAPPER_DIRECTIVE, useExisting: AccordionHintWrapperDirective }],
|
|
49
|
+
standalone: true,
|
|
50
|
+
}]
|
|
51
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
52
|
+
|
|
53
|
+
class AccordionHintDirective {
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
55
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionHintDirective, isStandalone: true, selector: "[et-accordion-hint]", host: { classAttribute: "et-accordion-hint" }, ngImport: i0 }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintDirective, decorators: [{
|
|
58
|
+
type: Directive,
|
|
59
|
+
args: [{
|
|
60
|
+
selector: '[et-accordion-hint]',
|
|
61
|
+
standalone: true,
|
|
62
|
+
host: {
|
|
63
|
+
class: 'et-accordion-hint',
|
|
64
|
+
},
|
|
65
|
+
}]
|
|
66
|
+
}] });
|
|
67
|
+
|
|
68
|
+
const ACCORDION_LABEL_WRAPPER_DIRECTIVE = new InjectionToken('AccordionLabelWrapperDirective');
|
|
69
|
+
class AccordionLabelWrapperDirective extends CdkPortal {
|
|
70
|
+
constructor(templateRef, viewContainerRef) {
|
|
71
|
+
super(templateRef, viewContainerRef);
|
|
72
|
+
}
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelWrapperDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
74
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionLabelWrapperDirective, isStandalone: true, selector: "ng-template[et-accordion-label-wrapper]", providers: [{ provide: ACCORDION_LABEL_WRAPPER_DIRECTIVE, useExisting: AccordionLabelWrapperDirective }], usesInheritance: true, ngImport: i0 }); }
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelWrapperDirective, decorators: [{
|
|
77
|
+
type: Directive,
|
|
78
|
+
args: [{
|
|
79
|
+
selector: 'ng-template[et-accordion-label-wrapper]',
|
|
80
|
+
providers: [{ provide: ACCORDION_LABEL_WRAPPER_DIRECTIVE, useExisting: AccordionLabelWrapperDirective }],
|
|
81
|
+
standalone: true,
|
|
82
|
+
}]
|
|
83
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
84
|
+
|
|
85
|
+
class AccordionLabelDirective {
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
87
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionLabelDirective, isStandalone: true, selector: "[et-accordion-label]", host: { classAttribute: "et-accordion-label" }, ngImport: i0 }); }
|
|
88
|
+
}
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelDirective, decorators: [{
|
|
90
|
+
type: Directive,
|
|
91
|
+
args: [{
|
|
92
|
+
selector: '[et-accordion-label]',
|
|
93
|
+
standalone: true,
|
|
94
|
+
host: {
|
|
95
|
+
class: 'et-accordion-label',
|
|
96
|
+
},
|
|
97
|
+
}]
|
|
98
|
+
}] });
|
|
99
|
+
|
|
100
|
+
const ACCORDION_COMPONENT = new InjectionToken('AccordionComponent');
|
|
101
|
+
|
|
36
102
|
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
37
103
|
const CHEVRON_ICON = {
|
|
38
104
|
name: 'et-chevron',
|
|
@@ -131,57 +197,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
131
197
|
}]
|
|
132
198
|
}], ctorParameters: () => [] });
|
|
133
199
|
|
|
134
|
-
const ACCORDION_HINT_WRAPPER_DIRECTIVE = new InjectionToken('AccordionHintWrapperDirective');
|
|
135
|
-
|
|
136
|
-
class AccordionHintWrapperDirective extends CdkPortal {
|
|
137
|
-
constructor(templateRef, viewContainerRef) {
|
|
138
|
-
super(templateRef, viewContainerRef);
|
|
139
|
-
}
|
|
140
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintWrapperDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
141
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionHintWrapperDirective, isStandalone: true, selector: "ng-template[et-accordion-hint-wrapper]", providers: [{ provide: ACCORDION_HINT_WRAPPER_DIRECTIVE, useExisting: AccordionHintWrapperDirective }], usesInheritance: true, ngImport: i0 }); }
|
|
142
|
-
}
|
|
143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintWrapperDirective, decorators: [{
|
|
144
|
-
type: Directive,
|
|
145
|
-
args: [{
|
|
146
|
-
selector: 'ng-template[et-accordion-hint-wrapper]',
|
|
147
|
-
providers: [{ provide: ACCORDION_HINT_WRAPPER_DIRECTIVE, useExisting: AccordionHintWrapperDirective }],
|
|
148
|
-
standalone: true,
|
|
149
|
-
}]
|
|
150
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
151
|
-
|
|
152
|
-
class AccordionLabelDirective {
|
|
153
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
154
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionLabelDirective, isStandalone: true, selector: "[et-accordion-label]", host: { classAttribute: "et-accordion-label" }, ngImport: i0 }); }
|
|
155
|
-
}
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelDirective, decorators: [{
|
|
157
|
-
type: Directive,
|
|
158
|
-
args: [{
|
|
159
|
-
selector: '[et-accordion-label]',
|
|
160
|
-
standalone: true,
|
|
161
|
-
host: {
|
|
162
|
-
class: 'et-accordion-label',
|
|
163
|
-
},
|
|
164
|
-
}]
|
|
165
|
-
}] });
|
|
166
|
-
|
|
167
|
-
const ACCORDION_LABEL_WRAPPER_DIRECTIVE = new InjectionToken('AccordionLabelWrapperDirective');
|
|
168
|
-
|
|
169
|
-
class AccordionLabelWrapperDirective extends CdkPortal {
|
|
170
|
-
constructor(templateRef, viewContainerRef) {
|
|
171
|
-
super(templateRef, viewContainerRef);
|
|
172
|
-
}
|
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelWrapperDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
174
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionLabelWrapperDirective, isStandalone: true, selector: "ng-template[et-accordion-label-wrapper]", providers: [{ provide: ACCORDION_LABEL_WRAPPER_DIRECTIVE, useExisting: AccordionLabelWrapperDirective }], usesInheritance: true, ngImport: i0 }); }
|
|
175
|
-
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionLabelWrapperDirective, decorators: [{
|
|
177
|
-
type: Directive,
|
|
178
|
-
args: [{
|
|
179
|
-
selector: 'ng-template[et-accordion-label-wrapper]',
|
|
180
|
-
providers: [{ provide: ACCORDION_LABEL_WRAPPER_DIRECTIVE, useExisting: AccordionLabelWrapperDirective }],
|
|
181
|
-
standalone: true,
|
|
182
|
-
}]
|
|
183
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
184
|
-
|
|
185
200
|
const accordionAnimations = {
|
|
186
201
|
animateOpenClose: trigger('animateOpenClose', [
|
|
187
202
|
state('close, void', style({ height: '0px', visibility: 'hidden' })),
|
|
@@ -190,125 +205,76 @@ const accordionAnimations = {
|
|
|
190
205
|
]),
|
|
191
206
|
};
|
|
192
207
|
|
|
193
|
-
const ACCORDION_COMPONENT = new InjectionToken('AccordionComponent');
|
|
194
|
-
|
|
195
208
|
let accordionId = 0;
|
|
196
209
|
class AccordionComponent {
|
|
197
210
|
constructor() {
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
203
|
-
this.
|
|
204
|
-
this.
|
|
205
|
-
this.
|
|
206
|
-
this.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
this._isOpen$.next(this.isOpenByDefault);
|
|
211
|
+
this.isOpenByDefault = input(false, { transform: booleanAttribute });
|
|
212
|
+
this.disabled = input(false, { transform: booleanAttribute });
|
|
213
|
+
this.label = input('');
|
|
214
|
+
this.isOpen = model(false);
|
|
215
|
+
this.isOpen$ = toObservable(this.isOpen);
|
|
216
|
+
this.templateLabel = contentChild(ACCORDION_LABEL_WRAPPER_DIRECTIVE);
|
|
217
|
+
this.templateHint = contentChild(ACCORDION_HINT_WRAPPER_DIRECTIVE);
|
|
218
|
+
this.ID = `et-accordion-${accordionId++}`;
|
|
219
|
+
this.BODY_ID = `${this.ID}-body`;
|
|
220
|
+
this.HEADER_ID = `${this.ID}-header`;
|
|
221
|
+
const ref = effect(() => {
|
|
222
|
+
const isOpenByDefault = this.isOpenByDefault();
|
|
223
|
+
untracked(() => {
|
|
224
|
+
this.isOpen.set(isOpenByDefault);
|
|
225
|
+
ref.destroy();
|
|
226
|
+
});
|
|
227
|
+
});
|
|
216
228
|
}
|
|
217
229
|
toggleAccordionOpen() {
|
|
218
|
-
this.
|
|
230
|
+
this.isOpen.set(!this.isOpen());
|
|
219
231
|
}
|
|
220
232
|
open() {
|
|
221
|
-
this.
|
|
233
|
+
this.isOpen.set(true);
|
|
222
234
|
}
|
|
223
235
|
close() {
|
|
224
|
-
this.
|
|
236
|
+
this.isOpen.set(false);
|
|
225
237
|
}
|
|
226
238
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
227
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AccordionComponent, isStandalone: true, selector: "et-accordion", inputs: { isOpenByDefault:
|
|
239
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: AccordionComponent, isStandalone: true, selector: "et-accordion", inputs: { isOpenByDefault: { classPropertyName: "isOpenByDefault", publicName: "isOpenByDefault", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange" }, host: { classAttribute: "et-accordion" }, providers: [{ provide: ACCORDION_COMPONENT, useExisting: AccordionComponent }, provideIcons(CHEVRON_ICON)], queries: [{ propertyName: "templateLabel", first: true, predicate: ACCORDION_LABEL_WRAPPER_DIRECTIVE, descendants: true, isSignal: true }, { propertyName: "templateHint", first: true, predicate: ACCORDION_HINT_WRAPPER_DIRECTIVE, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"et-accordion-container\">\n <h3 class=\"et-accordion-header-wrapper\">\n <button\n [disabled]=\"disabled()\"\n [id]=\"HEADER_ID\"\n [attr.aria-controls]=\"BODY_ID\"\n [attr.aria-expanded]=\"isOpen()\"\n [class.et-accordion-has-hint]=\"!!templateHint\"\n (click)=\"toggleAccordionOpen()\"\n class=\"et-accordion-header\"\n type=\"button\"\n >\n <div>\n @if (templateLabel(); as templateLabel) {\n <ng-template [cdkPortalOutlet]=\"templateLabel\" />\n } @else {\n <span et-accordion-label>{{ label() }} </span>\n }\n </div>\n\n @if (templateHint(); as templateHint) {\n <ng-template [cdkPortalOutlet]=\"templateHint\" />\n }\n\n <i etIcon=\"et-chevron\"> </i>\n </button>\n </h3>\n <div\n [@animateOpenClose]=\"isOpen() ? 'open' : 'close'\"\n [attr.aria-labelledby]=\"HEADER_ID\"\n [id]=\"BODY_ID\"\n class=\"et-accordion-body\"\n role=\"region\"\n >\n <div class=\"et-accordion-body-container\">\n <ng-content />\n </div>\n </div>\n <hr class=\"et-accordion-separator\" />\n</div>\n", styles: [":where(.et-accordion){--chevron-size: 15px}.et-accordion .et-accordion-container{position:relative;z-index:1}.et-accordion .et-icon--et-chevron{display:block;transform:rotate(180deg);transition:transform .3s var(--ease-5);inline-size:var(--chevron-size);block-size:var(--chevron-size)}.et-accordion [aria-expanded=true] .et-icon--et-chevron{transform:rotate(0)}.et-accordion .et-accordion-header{display:grid;grid-template-columns:1fr auto;inline-size:100%;block-size:100%;text-align:left;background-color:transparent;border:none;align-items:center;padding:0;gap:15px}.et-accordion .et-accordion-header:not(:disabled){cursor:pointer}.et-accordion .et-accordion-header.et-accordion-has-hint{grid-template-columns:1fr auto auto}.et-accordion .et-accordion-header-wrapper{margin:0}.et-accordion .et-accordion-body{overflow:hidden}.et-accordion .et-accordion-separator{position:relative;z-index:-1}\n"], dependencies: [{ kind: "directive", type: AccordionLabelDirective, selector: "[et-accordion-label]" }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: IconDirective, selector: "[etIcon]", inputs: ["etIcon", "allowHardcodedColor"] }], animations: [accordionAnimations.animateOpenClose], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
228
240
|
}
|
|
229
241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionComponent, decorators: [{
|
|
230
242
|
type: Component,
|
|
231
|
-
args: [{ selector: 'et-accordion', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: ACCORDION_COMPONENT, useExisting: AccordionComponent }, provideIcons(CHEVRON_ICON)], imports: [
|
|
243
|
+
args: [{ selector: 'et-accordion', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: ACCORDION_COMPONENT, useExisting: AccordionComponent }, provideIcons(CHEVRON_ICON)], imports: [AccordionLabelDirective, PortalModule, IconDirective], animations: [accordionAnimations.animateOpenClose], host: {
|
|
232
244
|
class: 'et-accordion',
|
|
233
|
-
}, template: "
|
|
234
|
-
}],
|
|
235
|
-
type: Input,
|
|
236
|
-
args: [{ transform: booleanAttribute }]
|
|
237
|
-
}], disabled: [{
|
|
238
|
-
type: Input,
|
|
239
|
-
args: [{ transform: booleanAttribute }]
|
|
240
|
-
}], label: [{
|
|
241
|
-
type: Input
|
|
242
|
-
}], templateLabel: [{
|
|
243
|
-
type: ContentChild,
|
|
244
|
-
args: [ACCORDION_LABEL_WRAPPER_DIRECTIVE]
|
|
245
|
-
}], templateHint: [{
|
|
246
|
-
type: ContentChild,
|
|
247
|
-
args: [ACCORDION_HINT_WRAPPER_DIRECTIVE]
|
|
248
|
-
}] } });
|
|
245
|
+
}, template: "<div class=\"et-accordion-container\">\n <h3 class=\"et-accordion-header-wrapper\">\n <button\n [disabled]=\"disabled()\"\n [id]=\"HEADER_ID\"\n [attr.aria-controls]=\"BODY_ID\"\n [attr.aria-expanded]=\"isOpen()\"\n [class.et-accordion-has-hint]=\"!!templateHint\"\n (click)=\"toggleAccordionOpen()\"\n class=\"et-accordion-header\"\n type=\"button\"\n >\n <div>\n @if (templateLabel(); as templateLabel) {\n <ng-template [cdkPortalOutlet]=\"templateLabel\" />\n } @else {\n <span et-accordion-label>{{ label() }} </span>\n }\n </div>\n\n @if (templateHint(); as templateHint) {\n <ng-template [cdkPortalOutlet]=\"templateHint\" />\n }\n\n <i etIcon=\"et-chevron\"> </i>\n </button>\n </h3>\n <div\n [@animateOpenClose]=\"isOpen() ? 'open' : 'close'\"\n [attr.aria-labelledby]=\"HEADER_ID\"\n [id]=\"BODY_ID\"\n class=\"et-accordion-body\"\n role=\"region\"\n >\n <div class=\"et-accordion-body-container\">\n <ng-content />\n </div>\n </div>\n <hr class=\"et-accordion-separator\" />\n</div>\n", styles: [":where(.et-accordion){--chevron-size: 15px}.et-accordion .et-accordion-container{position:relative;z-index:1}.et-accordion .et-icon--et-chevron{display:block;transform:rotate(180deg);transition:transform .3s var(--ease-5);inline-size:var(--chevron-size);block-size:var(--chevron-size)}.et-accordion [aria-expanded=true] .et-icon--et-chevron{transform:rotate(0)}.et-accordion .et-accordion-header{display:grid;grid-template-columns:1fr auto;inline-size:100%;block-size:100%;text-align:left;background-color:transparent;border:none;align-items:center;padding:0;gap:15px}.et-accordion .et-accordion-header:not(:disabled){cursor:pointer}.et-accordion .et-accordion-header.et-accordion-has-hint{grid-template-columns:1fr auto auto}.et-accordion .et-accordion-header-wrapper{margin:0}.et-accordion .et-accordion-body{overflow:hidden}.et-accordion .et-accordion-separator{position:relative;z-index:-1}\n"] }]
|
|
246
|
+
}], ctorParameters: () => [] });
|
|
249
247
|
|
|
250
248
|
class AccordionGroupComponent {
|
|
251
249
|
constructor() {
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
this._accordions.changes
|
|
260
|
-
.pipe(startWith(this._accordions), map((accordions) => accordions
|
|
261
|
-
?.toArray()
|
|
262
|
-
.filter((a) => !!a)
|
|
263
|
-
.map((a) => a.isOpen$) ?? []), switchMap((d) => combineLatest(d)), pairwise(), tap(([prev, curr]) => {
|
|
264
|
-
if (!this.autoCloseOthers) {
|
|
250
|
+
this.autoCloseOthers = input(false, { transform: booleanAttribute });
|
|
251
|
+
this.accordions = contentChildren(ACCORDION_COMPONENT);
|
|
252
|
+
toObservable(this.accordions)
|
|
253
|
+
.pipe(map((accordions) => accordions.map((a) => a.isOpen$)), switchMap((d) => combineLatest(d)), pairwise(), tap(([prev, curr]) => {
|
|
254
|
+
if (!this.autoCloseOthers()) {
|
|
265
255
|
return;
|
|
266
256
|
}
|
|
267
257
|
const isOpenedNow = curr.findIndex((a, i) => a && !prev[i]);
|
|
268
258
|
if (isOpenedNow === -1) {
|
|
269
259
|
return;
|
|
270
260
|
}
|
|
271
|
-
for (const [i, item] of this.
|
|
272
|
-
|
|
273
|
-
.filter((a) => !!a)
|
|
274
|
-
.entries() ?? [].entries()) {
|
|
275
|
-
if (i !== isOpenedNow && item.isOpen) {
|
|
261
|
+
for (const [i, item] of this.accordions().entries()) {
|
|
262
|
+
if (i !== isOpenedNow && item.isOpen()) {
|
|
276
263
|
item.close();
|
|
277
264
|
}
|
|
278
265
|
}
|
|
279
|
-
}),
|
|
266
|
+
}), takeUntilDestroyed())
|
|
280
267
|
.subscribe();
|
|
281
268
|
}
|
|
282
269
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
283
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
270
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.5", type: AccordionGroupComponent, isStandalone: true, selector: "et-accordion-group", inputs: { autoCloseOthers: { classPropertyName: "autoCloseOthers", publicName: "autoCloseOthers", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "et-accordion-group" }, queries: [{ propertyName: "accordions", predicate: ACCORDION_COMPONENT, isSignal: true }], ngImport: i0, template: "<ng-content select=\"et-accordion\" />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
284
271
|
}
|
|
285
272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionGroupComponent, decorators: [{
|
|
286
273
|
type: Component,
|
|
287
274
|
args: [{ selector: 'et-accordion-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
288
275
|
class: 'et-accordion-group',
|
|
289
276
|
}, template: "<ng-content select=\"et-accordion\" />\n" }]
|
|
290
|
-
}],
|
|
291
|
-
type: Input,
|
|
292
|
-
args: [{ transform: booleanAttribute }]
|
|
293
|
-
}], _accordions: [{
|
|
294
|
-
type: ContentChildren,
|
|
295
|
-
args: [ACCORDION_COMPONENT]
|
|
296
|
-
}] } });
|
|
297
|
-
|
|
298
|
-
class AccordionHintDirective {
|
|
299
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
300
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AccordionHintDirective, isStandalone: true, selector: "[et-accordion-hint]", host: { classAttribute: "et-accordion-hint" }, ngImport: i0 }); }
|
|
301
|
-
}
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AccordionHintDirective, decorators: [{
|
|
303
|
-
type: Directive,
|
|
304
|
-
args: [{
|
|
305
|
-
selector: '[et-accordion-hint]',
|
|
306
|
-
standalone: true,
|
|
307
|
-
host: {
|
|
308
|
-
class: 'et-accordion-hint',
|
|
309
|
-
},
|
|
310
|
-
}]
|
|
311
|
-
}] });
|
|
277
|
+
}], ctorParameters: () => [] });
|
|
312
278
|
|
|
313
279
|
const AccordionImports = [
|
|
314
280
|
AccordionHintDirective,
|