@ethlete/core 0.2.0-next.9 → 1.1.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/esm2020/lib/components/public-api.mjs +2 -0
- package/esm2020/lib/components/structured-data/public-api.mjs +2 -0
- package/esm2020/lib/components/structured-data/structured-data.component.mjs +37 -0
- package/esm2020/lib/directives/animatable/animatable.directive.mjs +113 -0
- package/esm2020/lib/directives/animatable/public-api.mjs +2 -0
- package/esm2020/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +115 -0
- package/esm2020/lib/directives/animated-lifecycle/public-api.mjs +2 -0
- package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +5 -5
- package/esm2020/lib/directives/let/let.directive.mjs +8 -8
- package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +7 -7
- package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +7 -7
- package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +11 -10
- package/esm2020/lib/directives/public-api.mjs +3 -2
- package/esm2020/lib/directives/repeat/repeat.directive.mjs +10 -11
- package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
- package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
- package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
- package/esm2020/lib/directives/seo/seo.directive.mjs +3 -3
- package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
- package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
- package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
- package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
- package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
- package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
- package/esm2020/lib/public-api.mjs +3 -1
- package/esm2020/lib/services/click-observer.service.mjs +6 -6
- package/esm2020/lib/services/content-observer.service.mjs +6 -6
- package/esm2020/lib/services/destroy.service.mjs +3 -3
- package/esm2020/lib/services/focus-visible.service.mjs +7 -7
- package/esm2020/lib/services/public-api.mjs +2 -1
- package/esm2020/lib/services/resize-observer.service.mjs +6 -6
- package/esm2020/lib/services/router-state.service.mjs +115 -0
- package/esm2020/lib/services/viewport.service.mjs +16 -16
- package/esm2020/lib/types/angular.types.mjs +36 -2
- package/esm2020/lib/utils/animation.utils.mjs +18 -0
- package/esm2020/lib/utils/clone.util.mjs +78 -0
- package/esm2020/lib/utils/cookie.util.mjs +48 -0
- package/esm2020/lib/utils/equal.util.mjs +118 -0
- package/esm2020/lib/utils/media-query-observable.util.mjs +18 -0
- package/esm2020/lib/utils/public-api.mjs +8 -2
- package/esm2020/lib/utils/reactive-binding.util.mjs +111 -0
- package/esm2020/lib/validators/is-array-not-empty.validator.mjs +9 -0
- package/esm2020/lib/validators/is-email.validator.mjs +10 -0
- package/esm2020/lib/validators/must-match.validator.mjs +19 -0
- package/esm2020/lib/validators/public-api.mjs +12 -0
- package/fesm2015/ethlete-core.mjs +963 -153
- package/fesm2015/ethlete-core.mjs.map +1 -1
- package/fesm2020/ethlete-core.mjs +961 -153
- package/fesm2020/ethlete-core.mjs.map +1 -1
- package/lib/components/public-api.d.ts +1 -0
- package/lib/components/structured-data/public-api.d.ts +1 -0
- package/lib/components/structured-data/structured-data.component.d.ts +11 -0
- package/lib/directives/animatable/animatable.directive.d.ts +22 -0
- package/lib/directives/animatable/public-api.d.ts +1 -0
- package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +22 -0
- package/lib/directives/animated-lifecycle/public-api.d.ts +1 -0
- package/lib/directives/observe-content/observe-content.directive.d.ts +2 -2
- package/lib/directives/observe-resize/observe-resize.directive.d.ts +2 -2
- package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +2 -2
- package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +1 -1
- package/lib/directives/public-api.d.ts +2 -1
- package/lib/directives/repeat/repeat.directive.d.ts +2 -3
- package/lib/directives/seo/seo.directive.types.d.ts +1 -1
- package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +2 -2
- package/lib/public-api.d.ts +2 -0
- package/lib/services/public-api.d.ts +1 -0
- package/lib/services/router-state.service.d.ts +40 -0
- package/lib/services/viewport.types.d.ts +1 -1
- package/lib/types/angular.types.d.ts +14 -1
- package/lib/types/viewport.types.d.ts +2 -2
- package/lib/utils/animation.utils.d.ts +4 -0
- package/lib/utils/clone.util.d.ts +15 -0
- package/lib/utils/cookie.util.d.ts +5 -0
- package/lib/utils/equal.util.d.ts +27 -0
- package/lib/utils/media-query-observable.util.d.ts +5 -0
- package/lib/utils/public-api.d.ts +7 -1
- package/lib/utils/reactive-binding.util.d.ts +19 -0
- package/lib/validators/is-array-not-empty.validator.d.ts +3 -0
- package/lib/validators/is-email.validator.d.ts +3 -0
- package/lib/validators/must-match.validator.d.ts +3 -0
- package/lib/validators/public-api.d.ts +8 -0
- package/package.json +8 -6
- package/esm2020/lib/directives/destroy/destroy.directive.mjs +0 -22
- package/esm2020/lib/directives/destroy/public-api.mjs +0 -2
- package/lib/directives/destroy/destroy.directive.d.ts +0 -9
- package/lib/directives/destroy/public-api.d.ts +0 -1
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable,
|
|
2
|
+
import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, Injectable, ElementRef, Inject, Optional, isDevMode, Directive, EventEmitter, Output, NgZone, Pipe, QueryList } from '@angular/core';
|
|
3
|
+
import { DomSanitizer, Meta, Title } from '@angular/platform-browser';
|
|
4
|
+
import { fromEvent, Observable, Subject, startWith, map, takeUntil, distinctUntilChanged, BehaviorSubject, filter, combineLatest, pairwise, debounceTime, shareReplay, tap, merge, skip, switchMap, take } from 'rxjs';
|
|
3
5
|
import { coerceElement, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
4
|
-
import { fromEvent, Observable, Subject, BehaviorSubject, combineLatest, map, shareReplay, startWith, debounceTime, tap, takeUntil, take } from 'rxjs';
|
|
5
6
|
import { DOCUMENT } from '@angular/common';
|
|
7
|
+
import { Router, NavigationEnd } from '@angular/router';
|
|
6
8
|
import { __decorate, __metadata } from 'tslib';
|
|
7
9
|
import * as i1 from '@angular/cdk/layout';
|
|
8
10
|
import { debounceTime as debounceTime$1 } from 'rxjs/operators';
|
|
9
|
-
|
|
11
|
+
|
|
12
|
+
class StructuredDataComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this._sanitizer = inject(DomSanitizer);
|
|
15
|
+
}
|
|
16
|
+
set data(currentValue) {
|
|
17
|
+
this.jsonLD = this.getSafeHTML(currentValue);
|
|
18
|
+
}
|
|
19
|
+
getSafeHTML(value) {
|
|
20
|
+
const json = value ? JSON.stringify(value, null, 2).replace(/<\/script>/g, '<\\/script>') : '';
|
|
21
|
+
const html = `<script type="application/ld+json">${json}</script>`;
|
|
22
|
+
return this._sanitizer.bypassSecurityTrustHtml(html);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
StructuredDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
StructuredDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: StructuredDataComponent, isStandalone: true, selector: "et-structured-data", inputs: { data: "data" }, host: { properties: { "innerHTML": "this.jsonLD" }, styleAttribute: "display: none" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: StructuredDataComponent, decorators: [{
|
|
28
|
+
type: Component,
|
|
29
|
+
args: [{
|
|
30
|
+
selector: 'et-structured-data',
|
|
31
|
+
standalone: true,
|
|
32
|
+
template: '',
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
encapsulation: ViewEncapsulation.None,
|
|
35
|
+
host: {
|
|
36
|
+
style: 'display: none',
|
|
37
|
+
},
|
|
38
|
+
}]
|
|
39
|
+
}], propDecorators: { data: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], jsonLD: [{
|
|
42
|
+
type: HostBinding,
|
|
43
|
+
args: ['innerHTML']
|
|
44
|
+
}] } });
|
|
10
45
|
|
|
11
46
|
const VIEWPORT_CONFIG = new InjectionToken('ViewportConfig');
|
|
12
47
|
/**
|
|
@@ -57,9 +92,9 @@ class ClickObserverFactory {
|
|
|
57
92
|
return fromEvent(document, 'click');
|
|
58
93
|
}
|
|
59
94
|
}
|
|
60
|
-
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
61
|
-
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
95
|
+
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
96
|
+
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
63
98
|
type: Injectable,
|
|
64
99
|
args: [{ providedIn: 'root' }]
|
|
65
100
|
}] });
|
|
@@ -113,9 +148,9 @@ class ClickObserverService {
|
|
|
113
148
|
}
|
|
114
149
|
}
|
|
115
150
|
}
|
|
116
|
-
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
117
|
-
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
151
|
+
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
152
|
+
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
119
154
|
type: Injectable,
|
|
120
155
|
args: [{ providedIn: 'root' }]
|
|
121
156
|
}], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
|
|
@@ -126,9 +161,9 @@ class MutationObserverFactory {
|
|
|
126
161
|
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
127
162
|
}
|
|
128
163
|
}
|
|
129
|
-
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
130
|
-
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
164
|
+
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
165
|
+
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
132
167
|
type: Injectable,
|
|
133
168
|
args: [{ providedIn: 'root' }]
|
|
134
169
|
}] });
|
|
@@ -188,9 +223,9 @@ class ContentObserverService {
|
|
|
188
223
|
}
|
|
189
224
|
}
|
|
190
225
|
}
|
|
191
|
-
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
192
|
-
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
226
|
+
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
227
|
+
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, decorators: [{
|
|
194
229
|
type: Injectable,
|
|
195
230
|
args: [{ providedIn: 'root' }]
|
|
196
231
|
}], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
|
|
@@ -205,13 +240,16 @@ class DestroyService {
|
|
|
205
240
|
this._destroy$.unsubscribe();
|
|
206
241
|
}
|
|
207
242
|
}
|
|
208
|
-
DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
209
|
-
DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
243
|
+
DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
244
|
+
DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService });
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, decorators: [{
|
|
211
246
|
type: Injectable
|
|
212
247
|
}] });
|
|
213
248
|
|
|
214
249
|
class FocusVisibleService {
|
|
250
|
+
get isFocusVisible() {
|
|
251
|
+
return this._hadKeyboardEvent;
|
|
252
|
+
}
|
|
215
253
|
constructor() {
|
|
216
254
|
this._document = inject(DOCUMENT);
|
|
217
255
|
this._hadKeyboardEvent = false;
|
|
@@ -220,9 +258,6 @@ class FocusVisibleService {
|
|
|
220
258
|
this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
|
|
221
259
|
this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
|
|
222
260
|
}
|
|
223
|
-
get isFocusVisible() {
|
|
224
|
-
return this._hadKeyboardEvent;
|
|
225
|
-
}
|
|
226
261
|
onKeyDown(e) {
|
|
227
262
|
if (e.metaKey || e.altKey || e.ctrlKey) {
|
|
228
263
|
return;
|
|
@@ -233,9 +268,9 @@ class FocusVisibleService {
|
|
|
233
268
|
this._hadKeyboardEvent = false;
|
|
234
269
|
}
|
|
235
270
|
}
|
|
236
|
-
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
237
|
-
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
271
|
+
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
272
|
+
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, decorators: [{
|
|
239
274
|
type: Injectable,
|
|
240
275
|
args: [{
|
|
241
276
|
providedIn: 'root',
|
|
@@ -248,9 +283,9 @@ class ResizeObserverFactory {
|
|
|
248
283
|
return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
|
|
249
284
|
}
|
|
250
285
|
}
|
|
251
|
-
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
252
|
-
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
253
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
286
|
+
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
287
|
+
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, decorators: [{
|
|
254
289
|
type: Injectable,
|
|
255
290
|
args: [{ providedIn: 'root' }]
|
|
256
291
|
}] });
|
|
@@ -306,26 +341,525 @@ class ResizeObserverService {
|
|
|
306
341
|
}
|
|
307
342
|
}
|
|
308
343
|
}
|
|
309
|
-
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
310
|
-
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
344
|
+
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
345
|
+
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, decorators: [{
|
|
312
347
|
type: Injectable,
|
|
313
348
|
args: [{ providedIn: 'root' }]
|
|
314
349
|
}], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
|
|
315
350
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
351
|
+
const nextFrame = (cb) => {
|
|
352
|
+
requestAnimationFrame(() => {
|
|
353
|
+
requestAnimationFrame(cb);
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
const fromNextFrame = () => {
|
|
357
|
+
return new Observable((observer) => {
|
|
358
|
+
nextFrame(() => {
|
|
359
|
+
observer.next();
|
|
360
|
+
observer.complete();
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
const forceReflow = (element = document.body) => {
|
|
365
|
+
return element.offsetHeight;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const clamp = (value, min = 0, max = 100) => {
|
|
369
|
+
return Math.max(min, Math.min(max, value));
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
373
|
+
/* eslint-disable no-var */
|
|
374
|
+
/**
|
|
375
|
+
* Stolen from klona to avoid adding a dependency
|
|
376
|
+
* https://github.com/lukeed/klona
|
|
377
|
+
*
|
|
378
|
+
* MIT License
|
|
379
|
+
*
|
|
380
|
+
* Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
381
|
+
*
|
|
382
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
383
|
+
*
|
|
384
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
385
|
+
*
|
|
386
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
387
|
+
*/
|
|
388
|
+
const set = (obj, key, val) => {
|
|
389
|
+
if (typeof val.value === 'object')
|
|
390
|
+
val.value = clone(val.value);
|
|
391
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
392
|
+
Object.defineProperty(obj, key, val);
|
|
393
|
+
}
|
|
394
|
+
else
|
|
395
|
+
obj[key] = val.value;
|
|
396
|
+
};
|
|
397
|
+
const clone = (original) => {
|
|
398
|
+
if (typeof original !== 'object')
|
|
399
|
+
return original;
|
|
400
|
+
var _og = original;
|
|
401
|
+
var i = 0, k, list, tmp, str = Object.prototype.toString.call(_og);
|
|
402
|
+
if (str === '[object Object]') {
|
|
403
|
+
tmp = Object.create(_og.__proto__ || null);
|
|
404
|
+
}
|
|
405
|
+
else if (str === '[object Array]') {
|
|
406
|
+
tmp = Array(_og.length);
|
|
407
|
+
}
|
|
408
|
+
else if (str === '[object Set]') {
|
|
409
|
+
tmp = new Set();
|
|
410
|
+
_og.forEach(function (val) {
|
|
411
|
+
tmp.add(clone(val));
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
else if (str === '[object Map]') {
|
|
415
|
+
tmp = new Map();
|
|
416
|
+
_og.forEach(function (val, key) {
|
|
417
|
+
tmp.set(clone(key), clone(val));
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
else if (str === '[object Date]') {
|
|
421
|
+
tmp = new Date(+_og);
|
|
422
|
+
}
|
|
423
|
+
else if (str === '[object RegExp]') {
|
|
424
|
+
tmp = new RegExp(_og.source, _og.flags);
|
|
425
|
+
}
|
|
426
|
+
else if (str === '[object DataView]') {
|
|
427
|
+
tmp = new _og.constructor(clone(_og.buffer));
|
|
428
|
+
}
|
|
429
|
+
else if (str === '[object ArrayBuffer]') {
|
|
430
|
+
tmp = _og.slice(0);
|
|
431
|
+
}
|
|
432
|
+
else if (str.slice(-6) === 'Array]') {
|
|
433
|
+
// ArrayBuffer.isView(x)
|
|
434
|
+
// ~> `new` bcuz `Buffer.slice` => ref
|
|
435
|
+
tmp = new _og.constructor(_og);
|
|
436
|
+
}
|
|
437
|
+
if (tmp) {
|
|
438
|
+
for (list = Object.getOwnPropertySymbols(_og); i < list.length; i++) {
|
|
439
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(_og, list[i]));
|
|
440
|
+
}
|
|
441
|
+
for (i = 0, list = Object.getOwnPropertyNames(_og); i < list.length; i++) {
|
|
442
|
+
if (Object.hasOwnProperty.call(tmp, (k = list[i])) && tmp[k] === _og[k])
|
|
443
|
+
continue;
|
|
444
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(_og, k));
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return tmp || _og;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const hasCookie = (name) => {
|
|
451
|
+
if (typeof document === 'undefined') {
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
return document.cookie.split(';').some((c) => {
|
|
455
|
+
return c.trim().startsWith(name + '=');
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
const getCookie = (name) => {
|
|
459
|
+
var _a;
|
|
460
|
+
if (typeof document === 'undefined') {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
// From https://stackoverflow.com/questions/10730362/get-cookie-by-name
|
|
464
|
+
return (_a = ('; ' + document.cookie).split(`; ${name}=`).pop()) === null || _a === void 0 ? void 0 : _a.split(';')[0];
|
|
465
|
+
};
|
|
466
|
+
const setCookie = (name, data, expiresInDays = 30, domain = getDomain()) => {
|
|
467
|
+
if (typeof document === 'undefined') {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const date = new Date();
|
|
471
|
+
date.setTime(date.getTime() + expiresInDays * 24 * 60 * 60 * 1000);
|
|
472
|
+
document.cookie = `${name}=${data}; path=/; expires=${date.toUTCString()}; domain=${domain}; SameSite=Lax;`;
|
|
473
|
+
};
|
|
474
|
+
const deleteCookie = (name, path, domain = getDomain()) => {
|
|
475
|
+
if (hasCookie(name)) {
|
|
476
|
+
document.cookie =
|
|
477
|
+
name +
|
|
478
|
+
'=' +
|
|
479
|
+
(path ? ';path=' + path : '') +
|
|
480
|
+
(domain ? ';domain=' + domain : '') +
|
|
481
|
+
';expires=Thu, 01 Jan 1970 00:00:01 GMT';
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
const getDomain = () => {
|
|
485
|
+
if (typeof navigator === 'undefined') {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
const hostname = window.location.hostname;
|
|
489
|
+
if (hostname.includes('localhost')) {
|
|
490
|
+
return 'localhost';
|
|
491
|
+
}
|
|
492
|
+
const splitHost = hostname.split('.');
|
|
493
|
+
if (splitHost.length > 2) {
|
|
494
|
+
return `${splitHost[splitHost.length - 2]}.${splitHost[splitHost.length - 1]}`;
|
|
495
|
+
}
|
|
496
|
+
return hostname;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
500
|
+
/* eslint-disable no-var */
|
|
501
|
+
/**
|
|
502
|
+
* Stolen from dequal to avoid adding a dependency
|
|
503
|
+
* https://github.com/lukeed/dequal
|
|
504
|
+
*
|
|
505
|
+
* The MIT License (MIT)
|
|
506
|
+
*
|
|
507
|
+
* Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
508
|
+
*
|
|
509
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
510
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
511
|
+
* in the Software without restriction, including without limitation the rights
|
|
512
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
513
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
514
|
+
* furnished to do so, subject to the following conditions:
|
|
515
|
+
*
|
|
516
|
+
* The above copyright notice and this permission notice shall be included in
|
|
517
|
+
* all copies or substantial portions of the Software.
|
|
518
|
+
*
|
|
519
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
520
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
521
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
522
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
523
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
524
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
525
|
+
* THE SOFTWARE.
|
|
526
|
+
*/
|
|
527
|
+
const has = Object.prototype.hasOwnProperty;
|
|
528
|
+
function find(iter, tar, key) {
|
|
529
|
+
for (key of iter.keys()) {
|
|
530
|
+
if (equal(key, tar))
|
|
531
|
+
return key;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const equal = (foo, bar) => {
|
|
535
|
+
var ctor, len, tmp;
|
|
536
|
+
if (foo === bar)
|
|
537
|
+
return true;
|
|
538
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
539
|
+
if (ctor === Date)
|
|
540
|
+
return foo.getTime() === bar.getTime();
|
|
541
|
+
if (ctor === RegExp)
|
|
542
|
+
return foo.toString() === bar.toString();
|
|
543
|
+
if (ctor === Array) {
|
|
544
|
+
if ((len = foo.length) === bar.length) {
|
|
545
|
+
while (len-- && equal(foo[len], bar[len]))
|
|
546
|
+
;
|
|
547
|
+
}
|
|
548
|
+
return len === -1;
|
|
549
|
+
}
|
|
550
|
+
if (ctor === Set) {
|
|
551
|
+
if (foo.size !== bar.size) {
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
for (len of foo) {
|
|
555
|
+
tmp = len;
|
|
556
|
+
if (tmp && typeof tmp === 'object') {
|
|
557
|
+
tmp = find(bar, tmp);
|
|
558
|
+
if (!tmp)
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
if (!bar.has(tmp))
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
if (ctor === Map) {
|
|
567
|
+
if (foo.size !== bar.size) {
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
for (len of foo) {
|
|
571
|
+
tmp = len[0];
|
|
572
|
+
if (tmp && typeof tmp === 'object') {
|
|
573
|
+
tmp = find(bar, tmp);
|
|
574
|
+
if (!tmp)
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
if (!equal(len[1], bar.get(tmp))) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
if (ctor === ArrayBuffer) {
|
|
584
|
+
foo = new Uint8Array(foo);
|
|
585
|
+
bar = new Uint8Array(bar);
|
|
586
|
+
}
|
|
587
|
+
else if (ctor === DataView) {
|
|
588
|
+
if ((len = foo.byteLength) === bar.byteLength) {
|
|
589
|
+
while (len-- && foo.getInt8(len) === bar.getInt8(len))
|
|
590
|
+
;
|
|
591
|
+
}
|
|
592
|
+
return len === -1;
|
|
593
|
+
}
|
|
594
|
+
if (ArrayBuffer.isView(foo)) {
|
|
595
|
+
if ((len = foo.byteLength) === bar.byteLength) {
|
|
596
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
597
|
+
//@ts-ignore
|
|
598
|
+
while (len-- && foo[len] === bar[len])
|
|
599
|
+
;
|
|
600
|
+
}
|
|
601
|
+
return len === -1;
|
|
602
|
+
}
|
|
603
|
+
if (!ctor || typeof foo === 'object') {
|
|
604
|
+
len = 0;
|
|
605
|
+
for (ctor in foo) {
|
|
606
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor))
|
|
607
|
+
return false;
|
|
608
|
+
if (!(ctor in bar) || !equal(foo[ctor], bar[ctor]))
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
611
|
+
return Object.keys(bar).length === len;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return foo !== foo && bar !== bar;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
const createMediaQueryObservable = (query) => {
|
|
618
|
+
const mq = window.matchMedia(query);
|
|
619
|
+
const observable = new Observable((observer) => {
|
|
620
|
+
const eventHandler = (event) => {
|
|
621
|
+
observer.next(event);
|
|
622
|
+
};
|
|
623
|
+
mq.addEventListener('change', eventHandler);
|
|
624
|
+
return () => {
|
|
625
|
+
mq.removeEventListener('change', eventHandler);
|
|
626
|
+
};
|
|
627
|
+
}).pipe(startWith(mq), map(({ matches }) => ({
|
|
628
|
+
matches,
|
|
629
|
+
query,
|
|
630
|
+
})));
|
|
631
|
+
return observable;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
const isAttributeRenderBinding = (value) => typeof value === 'boolean';
|
|
635
|
+
const isAttributeValueBinding = (value) => typeof value === 'object';
|
|
636
|
+
const createReactiveBindings = (...values) => {
|
|
637
|
+
const rootElementRef = inject(ElementRef);
|
|
638
|
+
const destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
639
|
+
const subscriptions = [];
|
|
640
|
+
const pushedAttributes = [];
|
|
641
|
+
const defaults = {};
|
|
642
|
+
const push = (value) => {
|
|
643
|
+
const { attribute, observable, elementRef } = value;
|
|
644
|
+
const elRef = elementRef || rootElementRef;
|
|
645
|
+
const attributes = Array.isArray(attribute) ? attribute : [attribute];
|
|
646
|
+
pushedAttributes.push(attributes);
|
|
647
|
+
for (const attribute of attributes) {
|
|
648
|
+
if (!defaults[attribute]) {
|
|
649
|
+
defaults[attribute] = elRef.nativeElement.getAttribute(attribute) || undefined;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const subscription = observable
|
|
653
|
+
.pipe(takeUntil(destroy$), distinctUntilChanged((a, b) => {
|
|
654
|
+
if (isAttributeRenderBinding(a) && isAttributeRenderBinding(b)) {
|
|
655
|
+
return a === b;
|
|
656
|
+
}
|
|
657
|
+
else if (isAttributeValueBinding(a) && isAttributeValueBinding(b)) {
|
|
658
|
+
return a.render === b.render && a.value === b.value;
|
|
659
|
+
}
|
|
660
|
+
return false;
|
|
661
|
+
}))
|
|
662
|
+
.subscribe((value) => {
|
|
663
|
+
const currentAttributes = pushedAttributes.find((s) => s.some((current) => attributes.includes(current))) || [];
|
|
664
|
+
for (const attribute of currentAttributes) {
|
|
665
|
+
const isSingleClassMutation = attribute.startsWith('class.');
|
|
666
|
+
const isMultipleClassMutation = attribute === 'class';
|
|
667
|
+
const render = isAttributeRenderBinding(value) ? value : value.render;
|
|
668
|
+
if (isSingleClassMutation) {
|
|
669
|
+
const className = attribute.replace('class.', '');
|
|
670
|
+
if (!className) {
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
673
|
+
if (!render) {
|
|
674
|
+
elRef.nativeElement.classList.remove(className);
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
elRef.nativeElement.classList.add(className);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
else if (isMultipleClassMutation) {
|
|
681
|
+
const classes = isAttributeRenderBinding(value) ? '' : `${value.value}`;
|
|
682
|
+
if (!classes) {
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
if (!render) {
|
|
686
|
+
elRef.nativeElement.classList.remove(...classes.split(' '));
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
elRef.nativeElement.classList.add(...classes.split(' '));
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
else {
|
|
693
|
+
const attributeValue = isAttributeRenderBinding(value) ? true : `${value.value}`;
|
|
694
|
+
if (!attribute) {
|
|
695
|
+
continue;
|
|
696
|
+
}
|
|
697
|
+
if (!render) {
|
|
698
|
+
elRef.nativeElement.removeAttribute(attribute);
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
elRef.nativeElement.setAttribute(attribute, `${attributeValue}`);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
subscriptions.push({ attributes, subscription });
|
|
707
|
+
};
|
|
708
|
+
const remove = (...attributes) => {
|
|
709
|
+
for (const attribute of attributes) {
|
|
710
|
+
const sub = subscriptions.find((s) => s.attributes.includes(attribute));
|
|
711
|
+
const attributeStack = pushedAttributes.find((a) => a.includes(attribute));
|
|
712
|
+
if (sub) {
|
|
713
|
+
sub.attributes = sub.attributes.filter((a) => a !== attribute);
|
|
714
|
+
attributeStack === null || attributeStack === void 0 ? void 0 : attributeStack.splice(attributeStack.indexOf(attribute), 1);
|
|
715
|
+
if (sub.attributes.length === 0) {
|
|
716
|
+
sub.subscription.unsubscribe();
|
|
717
|
+
subscriptions.splice(subscriptions.indexOf(sub), 1);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
const reset = () => {
|
|
723
|
+
for (const attribute in defaults) {
|
|
724
|
+
if (defaults[attribute] === undefined) {
|
|
725
|
+
rootElementRef.nativeElement.removeAttribute(attribute);
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
rootElementRef.nativeElement.setAttribute(attribute, defaults[attribute]);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
for (const value of values) {
|
|
733
|
+
push(value);
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
push,
|
|
737
|
+
remove,
|
|
738
|
+
reset,
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
const elementCanScroll = (element) => {
|
|
743
|
+
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
744
|
+
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
const provideViewportConfig = (viewportConfig) => {
|
|
748
|
+
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
const routerDisableScrollTop = (config = {}) => {
|
|
752
|
+
if (!config.asReturnRoute) {
|
|
753
|
+
return {
|
|
754
|
+
disableScrollTop: true,
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
return {
|
|
758
|
+
disableScrollTopAsReturnRoute: true,
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
class RouterStateService {
|
|
762
|
+
get route$() {
|
|
763
|
+
return this._route$.asObservable();
|
|
764
|
+
}
|
|
765
|
+
get state$() {
|
|
766
|
+
return this._state$.asObservable();
|
|
767
|
+
}
|
|
768
|
+
constructor() {
|
|
769
|
+
this._isScrollTopOnNavigationEnabled = false;
|
|
770
|
+
this._router = inject(Router);
|
|
771
|
+
this._route$ = new BehaviorSubject('/');
|
|
772
|
+
this._state$ = new BehaviorSubject({
|
|
773
|
+
title: null,
|
|
774
|
+
fragment: null,
|
|
775
|
+
data: {},
|
|
776
|
+
pathParams: {},
|
|
777
|
+
queryParams: {},
|
|
778
|
+
});
|
|
779
|
+
this._router.events
|
|
780
|
+
.pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => {
|
|
781
|
+
const { url } = event;
|
|
782
|
+
const urlWithoutQueryParams = url.split('?')[0];
|
|
783
|
+
const withoutFragment = urlWithoutQueryParams.split('#')[0];
|
|
784
|
+
return withoutFragment;
|
|
785
|
+
}))
|
|
786
|
+
.subscribe(this._route$);
|
|
787
|
+
this._route$
|
|
788
|
+
.pipe(map(() => {
|
|
789
|
+
let route = this._router.routerState.snapshot.root;
|
|
790
|
+
while (route.firstChild) {
|
|
791
|
+
route = route.firstChild;
|
|
792
|
+
}
|
|
793
|
+
const { data, params, queryParams, title, fragment } = route;
|
|
794
|
+
return {
|
|
795
|
+
data,
|
|
796
|
+
pathParams: params,
|
|
797
|
+
queryParams,
|
|
798
|
+
title: title !== null && title !== void 0 ? title : null,
|
|
799
|
+
fragment,
|
|
800
|
+
};
|
|
801
|
+
}))
|
|
802
|
+
.subscribe(this._state$);
|
|
803
|
+
}
|
|
804
|
+
enableScrollEnhancements(config = {}) {
|
|
805
|
+
if (this._isScrollTopOnNavigationEnabled) {
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
this._isScrollTopOnNavigationEnabled = true;
|
|
809
|
+
combineLatest([this._state$.pipe(pairwise()), this._route$.pipe(pairwise())])
|
|
810
|
+
.pipe(debounceTime(1))
|
|
811
|
+
.subscribe(([[prevState, currState], [prevRoute, currRoute]]) => {
|
|
812
|
+
var _a, _b, _c, _d, _e, _f;
|
|
813
|
+
const sameUrlNavigation = prevRoute === currRoute && equal(prevState.pathParams, currState.pathParams);
|
|
814
|
+
const didFragmentChange = prevState.fragment !== currState.fragment;
|
|
815
|
+
if (sameUrlNavigation) {
|
|
816
|
+
const allQueryParams = [
|
|
817
|
+
...new Set(Object.keys(prevState.queryParams).concat(Object.keys(currState.queryParams))),
|
|
818
|
+
];
|
|
819
|
+
const changedQueryParams = allQueryParams.filter((key) => currState.queryParams[key] !== prevState.queryParams[key]);
|
|
820
|
+
if (!((_a = config.queryParamTriggerList) === null || _a === void 0 ? void 0 : _a.length) && !didFragmentChange) {
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
const caseQueryParams = changedQueryParams.some((key) => { var _a; return (_a = config.queryParamTriggerList) === null || _a === void 0 ? void 0 : _a.includes(key); });
|
|
824
|
+
const caseFragment = didFragmentChange && ((_b = config.fragment) === null || _b === void 0 ? void 0 : _b.enabled);
|
|
825
|
+
if (caseQueryParams) {
|
|
826
|
+
((_c = config.scrollElement) !== null && _c !== void 0 ? _c : document.documentElement).scrollTop = 0;
|
|
827
|
+
}
|
|
828
|
+
else if (caseFragment) {
|
|
829
|
+
const fragmentElement = document.getElementById((_d = currState.fragment) !== null && _d !== void 0 ? _d : '');
|
|
830
|
+
if (fragmentElement) {
|
|
831
|
+
fragmentElement.scrollIntoView({ behavior: ((_e = config.fragment) === null || _e === void 0 ? void 0 : _e.smooth) ? 'smooth' : 'auto' });
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
if (!(currState.data['disableScrollTopAsReturnRoute'] && prevState.data['disableScrollTop']) &&
|
|
837
|
+
!currState.data['disableScrollTop']) {
|
|
838
|
+
((_f = config.scrollElement) !== null && _f !== void 0 ? _f : document.documentElement).scrollTop = 0;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
});
|
|
328
842
|
}
|
|
843
|
+
selectQueryParam(key) {
|
|
844
|
+
return this._state$.pipe(map((state) => state.queryParams[key]));
|
|
845
|
+
}
|
|
846
|
+
selectPathParam(key) {
|
|
847
|
+
return this._state$.pipe(map((state) => state.pathParams[key]));
|
|
848
|
+
}
|
|
849
|
+
selectData(key) {
|
|
850
|
+
return this._state$.pipe(map((state) => state.data[key]));
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
RouterStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
854
|
+
RouterStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, providedIn: 'root' });
|
|
855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, decorators: [{
|
|
856
|
+
type: Injectable,
|
|
857
|
+
args: [{
|
|
858
|
+
providedIn: 'root',
|
|
859
|
+
}]
|
|
860
|
+
}], ctorParameters: function () { return []; } });
|
|
861
|
+
|
|
862
|
+
class ViewportService {
|
|
329
863
|
get isXs$() {
|
|
330
864
|
return this._isXs$.asObservable();
|
|
331
865
|
}
|
|
@@ -365,6 +899,18 @@ class ViewportService {
|
|
|
365
899
|
get currentViewport() {
|
|
366
900
|
return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
|
|
367
901
|
}
|
|
902
|
+
constructor(_viewportConfig, _breakpointObserver) {
|
|
903
|
+
this._breakpointObserver = _breakpointObserver;
|
|
904
|
+
this._isXs$ = new BehaviorSubject(false);
|
|
905
|
+
this._isSm$ = new BehaviorSubject(false);
|
|
906
|
+
this._isMd$ = new BehaviorSubject(false);
|
|
907
|
+
this._isLg$ = new BehaviorSubject(false);
|
|
908
|
+
this._isXl$ = new BehaviorSubject(false);
|
|
909
|
+
this._is2Xl$ = new BehaviorSubject(false);
|
|
910
|
+
this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
|
|
911
|
+
this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
|
|
912
|
+
this._observeDefaultBreakpoints();
|
|
913
|
+
}
|
|
368
914
|
observe(options) {
|
|
369
915
|
const mediaQuery = this._buildMediaQuery(options);
|
|
370
916
|
return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay());
|
|
@@ -443,8 +989,8 @@ class ViewportService {
|
|
|
443
989
|
return 'xs';
|
|
444
990
|
}
|
|
445
991
|
}
|
|
446
|
-
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
447
|
-
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
992
|
+
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
993
|
+
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, providedIn: 'root' });
|
|
448
994
|
__decorate([
|
|
449
995
|
Memo(),
|
|
450
996
|
__metadata("design:type", Function),
|
|
@@ -462,7 +1008,7 @@ __decorate([
|
|
|
462
1008
|
__metadata("design:paramtypes", [Object]),
|
|
463
1009
|
__metadata("design:returntype", void 0)
|
|
464
1010
|
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
465
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1011
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, decorators: [{
|
|
466
1012
|
type: Injectable,
|
|
467
1013
|
args: [{
|
|
468
1014
|
providedIn: 'root',
|
|
@@ -476,6 +1022,223 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
476
1022
|
}] }, { type: i1.BreakpointObserver }];
|
|
477
1023
|
}, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
|
|
478
1024
|
|
|
1025
|
+
const ANIMATABLE_TOKEN = new InjectionToken('ANIMATABLE_DIRECTIVE_TOKEN');
|
|
1026
|
+
class AnimatableDirective {
|
|
1027
|
+
constructor() {
|
|
1028
|
+
this._didEmitStart = false;
|
|
1029
|
+
this._parent = inject(ANIMATABLE_TOKEN, { optional: true, skipSelf: true });
|
|
1030
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
1031
|
+
this._elementRef = inject(ElementRef);
|
|
1032
|
+
this._animationStart$ = new Subject();
|
|
1033
|
+
this._animationEnd$ = new Subject();
|
|
1034
|
+
this._animatedElement$ = new BehaviorSubject(this._elementRef.nativeElement);
|
|
1035
|
+
this.animationStart$ = this._animationStart$.asObservable().pipe(debounceTime(0));
|
|
1036
|
+
this.animationEnd$ = this._animationEnd$.asObservable().pipe(debounceTime(0));
|
|
1037
|
+
this._hostActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1038
|
+
this._totalActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1039
|
+
this.isAnimating$ = this._totalActiveAnimationCount$.pipe(map((count) => count > 0), debounceTime(0));
|
|
1040
|
+
}
|
|
1041
|
+
set animatedElement(value) {
|
|
1042
|
+
let newElement = null;
|
|
1043
|
+
if (value === null || value === undefined) {
|
|
1044
|
+
newElement = this._elementRef.nativeElement;
|
|
1045
|
+
}
|
|
1046
|
+
else if (typeof value === 'string') {
|
|
1047
|
+
const el = document.querySelector(value);
|
|
1048
|
+
if (el) {
|
|
1049
|
+
newElement = el;
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
if (isDevMode()) {
|
|
1053
|
+
console.warn(`Element with selector ${value} not found. Animatable directive will use host element.`);
|
|
1054
|
+
}
|
|
1055
|
+
newElement = this._elementRef.nativeElement;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
newElement = value;
|
|
1060
|
+
}
|
|
1061
|
+
if (this._animatedElement$.value !== newElement) {
|
|
1062
|
+
this._animatedElement$.next(newElement);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
ngOnInit() {
|
|
1066
|
+
this._animatedElement$
|
|
1067
|
+
.pipe(tap((el) => {
|
|
1068
|
+
this._totalActiveAnimationCount$.next(this._totalActiveAnimationCount$.value - this._hostActiveAnimationCount$.value);
|
|
1069
|
+
this._hostActiveAnimationCount$.next(0);
|
|
1070
|
+
merge(fromEvent(el, 'animationstart'), fromEvent(el, 'transitionstart'))
|
|
1071
|
+
.pipe(tap(() => {
|
|
1072
|
+
const count = this._hostActiveAnimationCount$.value + 1;
|
|
1073
|
+
this._hostActiveAnimationCount$.next(count);
|
|
1074
|
+
this._totalActiveAnimationCount$.next(count);
|
|
1075
|
+
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
1076
|
+
.subscribe();
|
|
1077
|
+
merge(fromEvent(el, 'animationend'), fromEvent(el, 'animationcancel'), fromEvent(el, 'transitionend'), fromEvent(el, 'transitioncancel'))
|
|
1078
|
+
.pipe(tap(() => {
|
|
1079
|
+
const count = this._hostActiveAnimationCount$.value - 1;
|
|
1080
|
+
this._hostActiveAnimationCount$.next(count);
|
|
1081
|
+
this._totalActiveAnimationCount$.next(count);
|
|
1082
|
+
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
1083
|
+
.subscribe();
|
|
1084
|
+
}), takeUntil(this._destroy$))
|
|
1085
|
+
.subscribe();
|
|
1086
|
+
this._totalActiveAnimationCount$
|
|
1087
|
+
.pipe(tap((count) => {
|
|
1088
|
+
if (count > 0 && !this._didEmitStart) {
|
|
1089
|
+
this._animationStart$.next();
|
|
1090
|
+
this._didEmitStart = true;
|
|
1091
|
+
}
|
|
1092
|
+
else if (count === 0) {
|
|
1093
|
+
this._animationEnd$.next();
|
|
1094
|
+
this._didEmitStart = false;
|
|
1095
|
+
}
|
|
1096
|
+
}), takeUntil(this._destroy$))
|
|
1097
|
+
.subscribe();
|
|
1098
|
+
if (this._parent) {
|
|
1099
|
+
this._parent._hostActiveAnimationCount$
|
|
1100
|
+
.pipe(takeUntil(this._destroy$), tap((count) => {
|
|
1101
|
+
this._totalActiveAnimationCount$.next(count + this._hostActiveAnimationCount$.value);
|
|
1102
|
+
}))
|
|
1103
|
+
.subscribe();
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
AnimatableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1108
|
+
AnimatableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatableDirective, isStandalone: true, selector: "[etAnimatable]", inputs: { animatedElement: ["etAnimatable", "animatedElement"] }, providers: [
|
|
1109
|
+
{
|
|
1110
|
+
provide: ANIMATABLE_TOKEN,
|
|
1111
|
+
useExisting: AnimatableDirective,
|
|
1112
|
+
},
|
|
1113
|
+
DestroyService,
|
|
1114
|
+
], exportAs: ["etAnimatable"], ngImport: i0 });
|
|
1115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, decorators: [{
|
|
1116
|
+
type: Directive,
|
|
1117
|
+
args: [{
|
|
1118
|
+
selector: '[etAnimatable]',
|
|
1119
|
+
exportAs: 'etAnimatable',
|
|
1120
|
+
standalone: true,
|
|
1121
|
+
providers: [
|
|
1122
|
+
{
|
|
1123
|
+
provide: ANIMATABLE_TOKEN,
|
|
1124
|
+
useExisting: AnimatableDirective,
|
|
1125
|
+
},
|
|
1126
|
+
DestroyService,
|
|
1127
|
+
],
|
|
1128
|
+
}]
|
|
1129
|
+
}], propDecorators: { animatedElement: [{
|
|
1130
|
+
type: Input,
|
|
1131
|
+
args: ['etAnimatable']
|
|
1132
|
+
}] } });
|
|
1133
|
+
|
|
1134
|
+
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
1135
|
+
const ANIMATION_CLASSES = {
|
|
1136
|
+
enterFrom: 'et-animation-enter-from',
|
|
1137
|
+
enterActive: 'et-animation-enter-active',
|
|
1138
|
+
enterTo: 'et-animation-enter-to',
|
|
1139
|
+
leaveFrom: 'et-animation-leave-from',
|
|
1140
|
+
leaveActive: 'et-animation-leave-active',
|
|
1141
|
+
leaveTo: 'et-animation-leave-to',
|
|
1142
|
+
};
|
|
1143
|
+
class AnimatedLifecycleDirective {
|
|
1144
|
+
constructor() {
|
|
1145
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
1146
|
+
this._elementRef = inject(ElementRef);
|
|
1147
|
+
this._animatable = inject(ANIMATABLE_TOKEN);
|
|
1148
|
+
this._classList = this._elementRef.nativeElement.classList;
|
|
1149
|
+
this._state$ = new BehaviorSubject('init');
|
|
1150
|
+
this.state$ = this._state$.asObservable();
|
|
1151
|
+
this._bindings = createReactiveBindings({
|
|
1152
|
+
attribute: 'class.et-force-invisible',
|
|
1153
|
+
observable: this._state$.pipe(map((state) => state === 'init')),
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
get state() {
|
|
1157
|
+
return this._state$.value;
|
|
1158
|
+
}
|
|
1159
|
+
enter(config) {
|
|
1160
|
+
if (this.state !== 'init' && this.state !== 'left' && isDevMode()) {
|
|
1161
|
+
console.warn('Tried to enter but the element is not in the initial state. This may result in unexpected behavior.', this);
|
|
1162
|
+
}
|
|
1163
|
+
this._state$.next('entering');
|
|
1164
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1165
|
+
this._classList.add(ANIMATION_CLASSES.enterFrom);
|
|
1166
|
+
}
|
|
1167
|
+
forceReflow();
|
|
1168
|
+
this._classList.add(ANIMATION_CLASSES.enterActive);
|
|
1169
|
+
fromNextFrame()
|
|
1170
|
+
.pipe(tap(() => {
|
|
1171
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1172
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1173
|
+
this._classList.add(ANIMATION_CLASSES.enterTo);
|
|
1174
|
+
}
|
|
1175
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1176
|
+
this._state$.next('entered');
|
|
1177
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1178
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1179
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1180
|
+
}
|
|
1181
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1182
|
+
.subscribe();
|
|
1183
|
+
}
|
|
1184
|
+
leave(config) {
|
|
1185
|
+
if (this.state !== 'entered' && this.state !== 'entering' && isDevMode()) {
|
|
1186
|
+
console.warn('Tried to leave while already leaving or left. This may result in unexpected behavior.', this);
|
|
1187
|
+
}
|
|
1188
|
+
if (this._classList.contains(ANIMATION_CLASSES.enterFrom) ||
|
|
1189
|
+
this._classList.contains(ANIMATION_CLASSES.enterActive) ||
|
|
1190
|
+
this._classList.contains(ANIMATION_CLASSES.enterTo)) {
|
|
1191
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1192
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1193
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1194
|
+
}
|
|
1195
|
+
this._state$.next('leaving');
|
|
1196
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1197
|
+
this._classList.add(ANIMATION_CLASSES.leaveFrom);
|
|
1198
|
+
}
|
|
1199
|
+
forceReflow();
|
|
1200
|
+
this._classList.add(ANIMATION_CLASSES.leaveActive);
|
|
1201
|
+
fromNextFrame()
|
|
1202
|
+
.pipe(tap(() => {
|
|
1203
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1204
|
+
this._classList.remove(ANIMATION_CLASSES.leaveFrom);
|
|
1205
|
+
this._classList.add(ANIMATION_CLASSES.leaveTo);
|
|
1206
|
+
}
|
|
1207
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1208
|
+
this._state$.next('left');
|
|
1209
|
+
this._classList.remove(ANIMATION_CLASSES.leaveActive);
|
|
1210
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1211
|
+
this._classList.remove(ANIMATION_CLASSES.leaveTo);
|
|
1212
|
+
}
|
|
1213
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1214
|
+
.subscribe();
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
AnimatedLifecycleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1218
|
+
AnimatedLifecycleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatedLifecycleDirective, isStandalone: true, selector: "[etAnimatedLifecycle]", providers: [
|
|
1219
|
+
{
|
|
1220
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1221
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1222
|
+
},
|
|
1223
|
+
DestroyService,
|
|
1224
|
+
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 });
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
1226
|
+
type: Directive,
|
|
1227
|
+
args: [{
|
|
1228
|
+
selector: '[etAnimatedLifecycle]',
|
|
1229
|
+
exportAs: 'etAnimatedLifecycle',
|
|
1230
|
+
standalone: true,
|
|
1231
|
+
providers: [
|
|
1232
|
+
{
|
|
1233
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1234
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1235
|
+
},
|
|
1236
|
+
DestroyService,
|
|
1237
|
+
],
|
|
1238
|
+
hostDirectives: [AnimatableDirective],
|
|
1239
|
+
}]
|
|
1240
|
+
}] });
|
|
1241
|
+
|
|
479
1242
|
class ClickOutsideDirective {
|
|
480
1243
|
constructor() {
|
|
481
1244
|
this._elementRef = inject(ElementRef);
|
|
@@ -499,9 +1262,9 @@ class ClickOutsideDirective {
|
|
|
499
1262
|
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
500
1263
|
}
|
|
501
1264
|
}
|
|
502
|
-
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
503
|
-
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
504
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1265
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1266
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
|
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
505
1268
|
type: Directive,
|
|
506
1269
|
args: [{
|
|
507
1270
|
selector: '[etClickOutside]',
|
|
@@ -511,26 +1274,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
511
1274
|
type: Output
|
|
512
1275
|
}] } });
|
|
513
1276
|
|
|
514
|
-
const provideViewportConfig = (viewportConfig) => {
|
|
515
|
-
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
const clamp = (value, min = 0, max = 100) => {
|
|
519
|
-
return Math.max(min, Math.min(max, value));
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
const elementCanScroll = (element) => {
|
|
523
|
-
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
524
|
-
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
525
|
-
};
|
|
526
|
-
|
|
527
1277
|
const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
|
|
528
1278
|
const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
|
|
529
1279
|
|
|
530
1280
|
class CursorDragScrollDirective {
|
|
531
1281
|
constructor() {
|
|
532
1282
|
this._subscriptions = [];
|
|
533
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1283
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
534
1284
|
this._elementRef = inject(ElementRef);
|
|
535
1285
|
this._contentObserverService = inject(ContentObserverService);
|
|
536
1286
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -655,9 +1405,9 @@ class CursorDragScrollDirective {
|
|
|
655
1405
|
}
|
|
656
1406
|
}
|
|
657
1407
|
}
|
|
658
|
-
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
659
|
-
CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
660
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1408
|
+
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1409
|
+
CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"] }, providers: [DestroyService], exportAs: ["etCursorDragScroll"], ngImport: i0 });
|
|
1410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
661
1411
|
type: Directive,
|
|
662
1412
|
args: [{
|
|
663
1413
|
selector: '[etCursorDragScroll]',
|
|
@@ -670,25 +1420,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
670
1420
|
args: ['etCursorDragScroll']
|
|
671
1421
|
}] } });
|
|
672
1422
|
|
|
673
|
-
class DestroyDirective {
|
|
674
|
-
constructor() {
|
|
675
|
-
this._destroy$ = new Subject();
|
|
676
|
-
this.destroy$ = this._destroy$.asObservable();
|
|
677
|
-
}
|
|
678
|
-
ngOnDestroy() {
|
|
679
|
-
this._destroy$.next(true);
|
|
680
|
-
this._destroy$.unsubscribe();
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
DestroyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: DestroyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
684
|
-
DestroyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: DestroyDirective, isStandalone: true, ngImport: i0 });
|
|
685
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: DestroyDirective, decorators: [{
|
|
686
|
-
type: Directive,
|
|
687
|
-
args: [{
|
|
688
|
-
standalone: true,
|
|
689
|
-
}]
|
|
690
|
-
}] });
|
|
691
|
-
|
|
692
1423
|
class LetContext {
|
|
693
1424
|
constructor() {
|
|
694
1425
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -699,6 +1430,10 @@ class LetContext {
|
|
|
699
1430
|
}
|
|
700
1431
|
|
|
701
1432
|
class LetDirective {
|
|
1433
|
+
set etLet(value) {
|
|
1434
|
+
this._context.$implicit = this._context.etLet = value;
|
|
1435
|
+
this._updateView();
|
|
1436
|
+
}
|
|
702
1437
|
constructor(_viewContainer, templateRef) {
|
|
703
1438
|
this._viewContainer = _viewContainer;
|
|
704
1439
|
this._context = new LetContext();
|
|
@@ -706,10 +1441,6 @@ class LetDirective {
|
|
|
706
1441
|
this._viewRef = null;
|
|
707
1442
|
this._templateRef = templateRef;
|
|
708
1443
|
}
|
|
709
|
-
set etLet(value) {
|
|
710
|
-
this._context.$implicit = this._context.etLet = value;
|
|
711
|
-
this._updateView();
|
|
712
|
-
}
|
|
713
1444
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
714
1445
|
static ngTemplateContextGuard(dir, ctx) {
|
|
715
1446
|
return true;
|
|
@@ -723,9 +1454,9 @@ class LetDirective {
|
|
|
723
1454
|
}
|
|
724
1455
|
}
|
|
725
1456
|
}
|
|
726
|
-
LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
727
|
-
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
728
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1457
|
+
LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1458
|
+
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
|
|
1459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, decorators: [{
|
|
729
1460
|
type: Directive,
|
|
730
1461
|
args: [{
|
|
731
1462
|
selector: '[etLet]',
|
|
@@ -740,7 +1471,7 @@ class ObserveContentDirective {
|
|
|
740
1471
|
this._contentObserver = inject(ContentObserverService);
|
|
741
1472
|
this._elementRef = inject(ElementRef);
|
|
742
1473
|
this._ngZone = inject(NgZone);
|
|
743
|
-
this.
|
|
1474
|
+
this.valueChange = new EventEmitter();
|
|
744
1475
|
this._disabled = false;
|
|
745
1476
|
this._debounce = null;
|
|
746
1477
|
this._currentSubscription = null;
|
|
@@ -771,7 +1502,7 @@ class ObserveContentDirective {
|
|
|
771
1502
|
this._unsubscribe();
|
|
772
1503
|
const stream = this._contentObserver.observe(this._elementRef);
|
|
773
1504
|
this._ngZone.runOutsideAngular(() => {
|
|
774
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.
|
|
1505
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.valueChange);
|
|
775
1506
|
});
|
|
776
1507
|
}
|
|
777
1508
|
_unsubscribe() {
|
|
@@ -779,16 +1510,16 @@ class ObserveContentDirective {
|
|
|
779
1510
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
780
1511
|
}
|
|
781
1512
|
}
|
|
782
|
-
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
783
|
-
ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
784
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1513
|
+
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1514
|
+
ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { valueChange: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
|
|
1515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
785
1516
|
type: Directive,
|
|
786
1517
|
args: [{
|
|
787
1518
|
selector: '[etObserveContent]',
|
|
788
1519
|
exportAs: 'etObserveContent',
|
|
789
1520
|
standalone: true,
|
|
790
1521
|
}]
|
|
791
|
-
}], propDecorators: {
|
|
1522
|
+
}], propDecorators: { valueChange: [{
|
|
792
1523
|
type: Output,
|
|
793
1524
|
args: ['etObserveContent']
|
|
794
1525
|
}], disabled: [{
|
|
@@ -804,7 +1535,7 @@ class ObserveResizeDirective {
|
|
|
804
1535
|
this._resizeObserver = inject(ResizeObserverService);
|
|
805
1536
|
this._elementRef = inject(ElementRef);
|
|
806
1537
|
this._ngZone = inject(NgZone);
|
|
807
|
-
this.
|
|
1538
|
+
this.valueChange = new EventEmitter();
|
|
808
1539
|
this._disabled = false;
|
|
809
1540
|
this._debounce = null;
|
|
810
1541
|
this._currentSubscription = null;
|
|
@@ -835,7 +1566,7 @@ class ObserveResizeDirective {
|
|
|
835
1566
|
this._unsubscribe();
|
|
836
1567
|
const stream = this._resizeObserver.observe(this._elementRef);
|
|
837
1568
|
this._ngZone.runOutsideAngular(() => {
|
|
838
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.
|
|
1569
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.valueChange);
|
|
839
1570
|
});
|
|
840
1571
|
}
|
|
841
1572
|
_unsubscribe() {
|
|
@@ -843,16 +1574,16 @@ class ObserveResizeDirective {
|
|
|
843
1574
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
844
1575
|
}
|
|
845
1576
|
}
|
|
846
|
-
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
847
|
-
ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
848
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1577
|
+
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1578
|
+
ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { valueChange: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
|
|
1579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
849
1580
|
type: Directive,
|
|
850
1581
|
args: [{
|
|
851
1582
|
selector: '[etObserveResize]',
|
|
852
1583
|
exportAs: 'etObserveResize',
|
|
853
1584
|
standalone: true,
|
|
854
1585
|
}]
|
|
855
|
-
}], propDecorators: {
|
|
1586
|
+
}], propDecorators: { valueChange: [{
|
|
856
1587
|
type: Output,
|
|
857
1588
|
args: ['etObserveResize']
|
|
858
1589
|
}], disabled: [{
|
|
@@ -875,9 +1606,9 @@ class ScrollObserverFirstElementDirective {
|
|
|
875
1606
|
this._isFirstElement = coerceBooleanProperty(value);
|
|
876
1607
|
}
|
|
877
1608
|
}
|
|
878
|
-
ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
879
|
-
ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
880
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1609
|
+
ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1610
|
+
ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement"] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 });
|
|
1611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
|
|
881
1612
|
type: Directive,
|
|
882
1613
|
args: [{
|
|
883
1614
|
selector: '[etScrollObserverFirstElement]',
|
|
@@ -894,9 +1625,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
894
1625
|
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
895
1626
|
class ScrollObserverIgnoreTargetDirective {
|
|
896
1627
|
}
|
|
897
|
-
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
898
|
-
ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
899
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1628
|
+
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1629
|
+
ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
|
|
1630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
900
1631
|
type: Directive,
|
|
901
1632
|
args: [{
|
|
902
1633
|
selector: '[etScrollObserverIgnoreTarget]',
|
|
@@ -919,9 +1650,9 @@ class ScrollObserverLastElementDirective {
|
|
|
919
1650
|
this._isLastElement = coerceBooleanProperty(value);
|
|
920
1651
|
}
|
|
921
1652
|
}
|
|
922
|
-
ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
923
|
-
ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
924
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1653
|
+
ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1654
|
+
ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ScrollObserverLastElementDirective, isStandalone: true, selector: "[etScrollObserverLastElement]", inputs: { isLastElement: ["etScrollObserverLastElement", "isLastElement"] }, host: { properties: { "class.et-scroll-observer-last-element": "this.isLastElement" }, classAttribute: "et-scroll-observer-last-element" }, ngImport: i0 });
|
|
1655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
|
|
925
1656
|
type: Directive,
|
|
926
1657
|
args: [{
|
|
927
1658
|
selector: '[etScrollObserverLastElement]',
|
|
@@ -942,7 +1673,7 @@ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
|
|
|
942
1673
|
|
|
943
1674
|
class ObserveScrollStateDirective {
|
|
944
1675
|
constructor() {
|
|
945
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1676
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
946
1677
|
this._elementRef = inject(ElementRef);
|
|
947
1678
|
this._contentObserverService = inject(ContentObserverService);
|
|
948
1679
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -953,7 +1684,7 @@ class ObserveScrollStateDirective {
|
|
|
953
1684
|
this._rootMargin = 0;
|
|
954
1685
|
this._threshold = 1;
|
|
955
1686
|
this._intersectionObserver = null;
|
|
956
|
-
this.
|
|
1687
|
+
this.valueChange = new EventEmitter();
|
|
957
1688
|
}
|
|
958
1689
|
get _firstCurrentChild() {
|
|
959
1690
|
const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
|
|
@@ -1010,7 +1741,7 @@ class ObserveScrollStateDirective {
|
|
|
1010
1741
|
!elementCanScroll(this._elementRef.nativeElement)) {
|
|
1011
1742
|
this._unobserveChild('first');
|
|
1012
1743
|
this._unobserveChild('last');
|
|
1013
|
-
this.
|
|
1744
|
+
this.valueChange.emit({
|
|
1014
1745
|
isAtStart: true,
|
|
1015
1746
|
isAtEnd: true,
|
|
1016
1747
|
canScroll: false,
|
|
@@ -1028,7 +1759,7 @@ class ObserveScrollStateDirective {
|
|
|
1028
1759
|
const { first, last } = this._observedChildren;
|
|
1029
1760
|
const isAtStart = (_b = (_a = entries.find((entry) => entry.target === first)) === null || _a === void 0 ? void 0 : _a.isIntersecting) !== null && _b !== void 0 ? _b : false;
|
|
1030
1761
|
const isAtEnd = (_d = (_c = entries.find((entry) => entry.target === last)) === null || _c === void 0 ? void 0 : _c.isIntersecting) !== null && _d !== void 0 ? _d : false;
|
|
1031
|
-
this.
|
|
1762
|
+
this.valueChange.emit({
|
|
1032
1763
|
isAtStart,
|
|
1033
1764
|
isAtEnd,
|
|
1034
1765
|
canScroll: !isAtStart || !isAtEnd,
|
|
@@ -1075,15 +1806,15 @@ class ObserveScrollStateDirective {
|
|
|
1075
1806
|
return element;
|
|
1076
1807
|
}
|
|
1077
1808
|
}
|
|
1078
|
-
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1079
|
-
ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1809
|
+
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1810
|
+
ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { valueChange: "etObserveScrollState" }, providers: [
|
|
1080
1811
|
{
|
|
1081
1812
|
provide: OBSERVE_SCROLL_STATE,
|
|
1082
1813
|
useExisting: ObserveScrollStateDirective,
|
|
1083
1814
|
},
|
|
1084
1815
|
DestroyService,
|
|
1085
1816
|
], exportAs: ["etObserveScrollState"], ngImport: i0 });
|
|
1086
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
1087
1818
|
type: Directive,
|
|
1088
1819
|
args: [{
|
|
1089
1820
|
selector: '[etObserveScrollState]',
|
|
@@ -1101,34 +1832,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
1101
1832
|
type: Input
|
|
1102
1833
|
}], observerThreshold: [{
|
|
1103
1834
|
type: Input
|
|
1104
|
-
}],
|
|
1105
|
-
type: Output
|
|
1835
|
+
}], valueChange: [{
|
|
1836
|
+
type: Output,
|
|
1837
|
+
args: ['etObserveScrollState']
|
|
1106
1838
|
}] } });
|
|
1107
1839
|
|
|
1108
1840
|
class RepeatDirective {
|
|
1109
|
-
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1110
|
-
this._mainTemplateRef = _mainTemplateRef;
|
|
1111
|
-
this._viewContainerRef = _viewContainerRef;
|
|
1112
|
-
this._repeatCount = 2;
|
|
1113
|
-
}
|
|
1114
1841
|
get repeatCount() {
|
|
1115
1842
|
return this._repeatCount;
|
|
1116
1843
|
}
|
|
1117
1844
|
set repeatCount(value) {
|
|
1118
1845
|
this._repeatCount = coerceNumberProperty(value);
|
|
1119
|
-
}
|
|
1120
|
-
ngOnInit() {
|
|
1121
1846
|
this._render();
|
|
1122
1847
|
}
|
|
1848
|
+
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1849
|
+
this._mainTemplateRef = _mainTemplateRef;
|
|
1850
|
+
this._viewContainerRef = _viewContainerRef;
|
|
1851
|
+
this._repeatCount = 2;
|
|
1852
|
+
}
|
|
1123
1853
|
_render() {
|
|
1854
|
+
this._viewContainerRef.clear();
|
|
1124
1855
|
for (let i = 0; i < this.repeatCount; i++) {
|
|
1125
1856
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
|
|
1126
1857
|
}
|
|
1127
1858
|
}
|
|
1128
1859
|
}
|
|
1129
|
-
RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1130
|
-
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1860
|
+
RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1861
|
+
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
|
|
1862
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
1132
1863
|
type: Directive,
|
|
1133
1864
|
args: [{
|
|
1134
1865
|
selector: '[etRepeat]',
|
|
@@ -1299,9 +2030,9 @@ class SeoDirective {
|
|
|
1299
2030
|
}
|
|
1300
2031
|
}
|
|
1301
2032
|
}
|
|
1302
|
-
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1303
|
-
SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2033
|
+
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2034
|
+
SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 });
|
|
2035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, decorators: [{
|
|
1305
2036
|
type: Directive,
|
|
1306
2037
|
args: [{
|
|
1307
2038
|
standalone: true,
|
|
@@ -1348,9 +2079,9 @@ class NormalizeGameResultTypePipe {
|
|
|
1348
2079
|
this.transform = normalizeGameResultType;
|
|
1349
2080
|
}
|
|
1350
2081
|
}
|
|
1351
|
-
NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1352
|
-
NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2082
|
+
NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2083
|
+
NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
|
|
2084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
|
|
1354
2085
|
type: Pipe,
|
|
1355
2086
|
args: [{ name: 'etNormalizeGameResultType', standalone: true }]
|
|
1356
2087
|
}] });
|
|
@@ -1379,9 +2110,9 @@ class NormalizeMatchStatePipe {
|
|
|
1379
2110
|
this.transform = normalizeMatchState;
|
|
1380
2111
|
}
|
|
1381
2112
|
}
|
|
1382
|
-
NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1383
|
-
NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2113
|
+
NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2114
|
+
NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
|
|
2115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
|
|
1385
2116
|
type: Pipe,
|
|
1386
2117
|
args: [{ name: 'etNormalizeMatchState', standalone: true }]
|
|
1387
2118
|
}] });
|
|
@@ -1438,9 +2169,9 @@ class NormalizeMatchParticipantsPipe {
|
|
|
1438
2169
|
this.transform = normalizeMatchParticipants;
|
|
1439
2170
|
}
|
|
1440
2171
|
}
|
|
1441
|
-
NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1442
|
-
NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2172
|
+
NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2173
|
+
NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
|
|
2174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
|
|
1444
2175
|
type: Pipe,
|
|
1445
2176
|
args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
|
|
1446
2177
|
}] });
|
|
@@ -1566,9 +2297,9 @@ class NormalizeMatchScorePipe {
|
|
|
1566
2297
|
this.transform = normalizeMatchScore;
|
|
1567
2298
|
}
|
|
1568
2299
|
}
|
|
1569
|
-
NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1570
|
-
NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2300
|
+
NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2301
|
+
NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
|
|
2302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
|
|
1572
2303
|
type: Pipe,
|
|
1573
2304
|
args: [{ name: 'etNormalizeMatchScore', standalone: true }]
|
|
1574
2305
|
}] });
|
|
@@ -1616,9 +2347,9 @@ class NormalizeMatchTypePipe {
|
|
|
1616
2347
|
this.transform = normalizeMatchType;
|
|
1617
2348
|
}
|
|
1618
2349
|
}
|
|
1619
|
-
NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1620
|
-
NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1621
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2350
|
+
NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2351
|
+
NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
|
|
2352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
|
|
1622
2353
|
type: Pipe,
|
|
1623
2354
|
args: [{ name: 'etNormalizeMatchType', standalone: true }]
|
|
1624
2355
|
}] });
|
|
@@ -1633,16 +2364,95 @@ class ToArrayPipe {
|
|
|
1633
2364
|
this.transform = toArray;
|
|
1634
2365
|
}
|
|
1635
2366
|
}
|
|
1636
|
-
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1637
|
-
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2367
|
+
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2368
|
+
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
|
|
2369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
1639
2370
|
type: Pipe,
|
|
1640
2371
|
args: [{ name: 'toArray', standalone: true }]
|
|
1641
2372
|
}] });
|
|
1642
2373
|
|
|
2374
|
+
var _a;
|
|
2375
|
+
class TypedQueryList extends QueryList {
|
|
2376
|
+
constructor() {
|
|
2377
|
+
super(...arguments);
|
|
2378
|
+
this[_a] = () => {
|
|
2379
|
+
return super[Symbol.iterator]();
|
|
2380
|
+
};
|
|
2381
|
+
}
|
|
2382
|
+
get changes() {
|
|
2383
|
+
return super.changes;
|
|
2384
|
+
}
|
|
2385
|
+
toArray() {
|
|
2386
|
+
return super.toArray();
|
|
2387
|
+
}
|
|
2388
|
+
forEach(fn) {
|
|
2389
|
+
super.forEach(fn);
|
|
2390
|
+
}
|
|
2391
|
+
filter(fn) {
|
|
2392
|
+
return super.filter(fn);
|
|
2393
|
+
}
|
|
2394
|
+
map(fn) {
|
|
2395
|
+
return super.map(fn);
|
|
2396
|
+
}
|
|
2397
|
+
reduce(fn, initialValue) {
|
|
2398
|
+
return super.reduce(fn, initialValue);
|
|
2399
|
+
}
|
|
2400
|
+
some(fn) {
|
|
2401
|
+
return super.some(fn);
|
|
2402
|
+
}
|
|
2403
|
+
find(fn) {
|
|
2404
|
+
return super.find(fn);
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
_a = Symbol.iterator;
|
|
2408
|
+
|
|
2409
|
+
const IS_ARRAY_NOT_EMPTY = 'isArrayNotEmpty';
|
|
2410
|
+
const IsArrayNotEmpty = (control) => {
|
|
2411
|
+
const value = control.value;
|
|
2412
|
+
if (!value) {
|
|
2413
|
+
return null;
|
|
2414
|
+
}
|
|
2415
|
+
return value.length > 0 ? null : { [IS_ARRAY_NOT_EMPTY]: true };
|
|
2416
|
+
};
|
|
2417
|
+
|
|
2418
|
+
const IS_EMAIL = 'isEmail';
|
|
2419
|
+
const IsEmail = (control) => {
|
|
2420
|
+
const value = control.value;
|
|
2421
|
+
if (!value) {
|
|
2422
|
+
return null;
|
|
2423
|
+
}
|
|
2424
|
+
const regex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
|
|
2425
|
+
return regex.test(value) ? null : { [IS_EMAIL]: true };
|
|
2426
|
+
};
|
|
2427
|
+
|
|
2428
|
+
const MUST_MATCH = 'mustMatch';
|
|
2429
|
+
const MustMatch = (controlName, matchingControlName) => {
|
|
2430
|
+
return (formGroup) => {
|
|
2431
|
+
const control = formGroup.controls[controlName];
|
|
2432
|
+
const matchingControl = formGroup.controls[matchingControlName];
|
|
2433
|
+
// set error on matchingControl if validation fails
|
|
2434
|
+
if (matchingControl.errors && !matchingControl.errors[MUST_MATCH]) {
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
// set error on matchingControl if validation fails
|
|
2438
|
+
if (control.value !== matchingControl.value) {
|
|
2439
|
+
matchingControl.setErrors({ [MUST_MATCH]: true });
|
|
2440
|
+
}
|
|
2441
|
+
else {
|
|
2442
|
+
matchingControl.setErrors(null);
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
|
|
2447
|
+
const Validators = {
|
|
2448
|
+
MustMatch,
|
|
2449
|
+
IsEmail,
|
|
2450
|
+
IsArrayNotEmpty,
|
|
2451
|
+
};
|
|
2452
|
+
|
|
1643
2453
|
/**
|
|
1644
2454
|
* Generated bundle index. Do not edit.
|
|
1645
2455
|
*/
|
|
1646
2456
|
|
|
1647
|
-
export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG,
|
|
2457
|
+
export { ANIMATABLE_TOKEN, ANIMATED_LIFECYCLE_TOKEN, AnimatableDirective, AnimatedLifecycleDirective, ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DestroyService, FocusVisibleService, IS_ARRAY_NOT_EMPTY, IS_EMAIL, IsArrayNotEmpty, IsEmail, LetContext, LetDirective, MUST_MATCH, Memo, MustMatch, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RouterStateService, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, Validators, ViewportService, clamp, clone, createMediaQueryObservable, createReactiveBindings, deleteCookie, elementCanScroll, equal, forceReflow, fromNextFrame, getCookie, getDomain, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, hasCookie, isGroupMatch, isKnockoutMatch, mergeSeoConfig, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, routerDisableScrollTop, setCookie, toArray, toArrayTrackByFn };
|
|
1648
2458
|
//# sourceMappingURL=ethlete-core.mjs.map
|