@ethlete/core 0.2.0-next.8 → 1.0.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 +79 -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 +8 -4
- package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +15 -0
- package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.mjs +2 -0
- package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.mjs +34 -0
- package/esm2020/lib/pipes/normalize-game-result-type/public-api.mjs +4 -0
- package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +15 -0
- package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.types.mjs +2 -0
- package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.util.mjs +47 -0
- package/esm2020/lib/pipes/normalize-match-participants/public-api.mjs +4 -0
- package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +15 -0
- package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.types.mjs +2 -0
- package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.util.mjs +126 -0
- package/esm2020/lib/pipes/normalize-match-score/public-api.mjs +4 -0
- package/esm2020/lib/pipes/normalize-match-state/index.mjs +2 -0
- package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.constants.mjs +2 -0
- package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +15 -0
- package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.util.mjs +19 -0
- package/esm2020/lib/pipes/normalize-match-state/public-api.mjs +4 -0
- package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +15 -0
- package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.util.mjs +38 -0
- package/esm2020/lib/pipes/normalize-match-type/public-api.mjs +3 -0
- package/esm2020/lib/pipes/public-api.mjs +6 -1
- 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/types/i18n.types.mjs +2 -0
- package/esm2020/lib/types/public-api.mjs +3 -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 +1232 -138
- package/fesm2015/ethlete-core.mjs.map +1 -1
- package/fesm2020/ethlete-core.mjs +1238 -138
- 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 +20 -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-game-result-type/normalize-game-result-type.pipe.d.ts +7 -0
- package/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.d.ts +4 -0
- package/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.d.ts +2 -0
- package/lib/pipes/normalize-game-result-type/public-api.d.ts +3 -0
- package/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.d.ts +7 -0
- package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +21 -0
- package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +4 -0
- package/lib/pipes/normalize-match-participants/public-api.d.ts +3 -0
- package/lib/pipes/normalize-match-score/normalize-match-score.pipe.d.ts +7 -0
- package/lib/pipes/normalize-match-score/normalize-match-score.types.d.ts +12 -0
- package/lib/pipes/normalize-match-score/normalize-match-score.util.d.ts +27 -0
- package/lib/pipes/normalize-match-score/public-api.d.ts +3 -0
- package/lib/pipes/normalize-match-state/index.d.ts +1 -0
- package/lib/pipes/normalize-match-state/normalize-match-state.constants.d.ts +7 -0
- package/lib/pipes/normalize-match-state/normalize-match-state.pipe.d.ts +7 -0
- package/lib/pipes/normalize-match-state/normalize-match-state.util.d.ts +3 -0
- package/lib/pipes/normalize-match-state/public-api.d.ts +3 -0
- package/lib/pipes/normalize-match-type/normalize-match-type.pipe.d.ts +7 -0
- package/lib/pipes/normalize-match-type/normalize-match-type.util.d.ts +3 -0
- package/lib/pipes/normalize-match-type/public-api.d.ts +2 -0
- package/lib/pipes/public-api.d.ts +5 -0
- 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/i18n.types.d.ts +4 -0
- package/lib/types/public-api.d.ts +2 -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 -5
- 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, Directive, isDevMode, 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, merge, tap, 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,189 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", 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.animationStart$ = this._animationStart$.asObservable().pipe(debounceTime(0));
|
|
1035
|
+
this.animationEnd$ = this._animationEnd$.asObservable().pipe(debounceTime(0));
|
|
1036
|
+
this._hostActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1037
|
+
this._totalActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1038
|
+
this.isAnimating$ = this._totalActiveAnimationCount$.pipe(map((count) => count > 0), debounceTime(0));
|
|
1039
|
+
}
|
|
1040
|
+
ngOnInit() {
|
|
1041
|
+
merge(fromEvent(this._elementRef.nativeElement, 'animationstart'), fromEvent(this._elementRef.nativeElement, 'transitionstart'))
|
|
1042
|
+
.pipe(tap(() => {
|
|
1043
|
+
const count = this._hostActiveAnimationCount$.value + 1;
|
|
1044
|
+
this._hostActiveAnimationCount$.next(count);
|
|
1045
|
+
this._totalActiveAnimationCount$.next(count);
|
|
1046
|
+
}), takeUntil(this._destroy$))
|
|
1047
|
+
.subscribe();
|
|
1048
|
+
merge(fromEvent(this._elementRef.nativeElement, 'animationend'), fromEvent(this._elementRef.nativeElement, 'animationcancel'), fromEvent(this._elementRef.nativeElement, 'transitionend'), fromEvent(this._elementRef.nativeElement, 'transitioncancel'))
|
|
1049
|
+
.pipe(tap(() => {
|
|
1050
|
+
const count = this._hostActiveAnimationCount$.value - 1;
|
|
1051
|
+
this._hostActiveAnimationCount$.next(count);
|
|
1052
|
+
this._totalActiveAnimationCount$.next(count);
|
|
1053
|
+
}), takeUntil(this._destroy$))
|
|
1054
|
+
.subscribe();
|
|
1055
|
+
this._totalActiveAnimationCount$
|
|
1056
|
+
.pipe(tap((count) => {
|
|
1057
|
+
if (count > 0 && !this._didEmitStart) {
|
|
1058
|
+
this._animationStart$.next();
|
|
1059
|
+
this._didEmitStart = true;
|
|
1060
|
+
}
|
|
1061
|
+
else if (count === 0) {
|
|
1062
|
+
this._animationEnd$.next();
|
|
1063
|
+
this._didEmitStart = false;
|
|
1064
|
+
}
|
|
1065
|
+
}), takeUntil(this._destroy$))
|
|
1066
|
+
.subscribe();
|
|
1067
|
+
if (this._parent) {
|
|
1068
|
+
this._parent._hostActiveAnimationCount$
|
|
1069
|
+
.pipe(takeUntil(this._destroy$), tap((count) => {
|
|
1070
|
+
this._totalActiveAnimationCount$.next(count + this._hostActiveAnimationCount$.value);
|
|
1071
|
+
}))
|
|
1072
|
+
.subscribe();
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
AnimatableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1077
|
+
AnimatableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatableDirective, isStandalone: true, selector: "[etAnimatable]", providers: [
|
|
1078
|
+
{
|
|
1079
|
+
provide: ANIMATABLE_TOKEN,
|
|
1080
|
+
useExisting: AnimatableDirective,
|
|
1081
|
+
},
|
|
1082
|
+
DestroyService,
|
|
1083
|
+
], exportAs: ["etAnimatable"], ngImport: i0 });
|
|
1084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, decorators: [{
|
|
1085
|
+
type: Directive,
|
|
1086
|
+
args: [{
|
|
1087
|
+
selector: '[etAnimatable]',
|
|
1088
|
+
exportAs: 'etAnimatable',
|
|
1089
|
+
standalone: true,
|
|
1090
|
+
providers: [
|
|
1091
|
+
{
|
|
1092
|
+
provide: ANIMATABLE_TOKEN,
|
|
1093
|
+
useExisting: AnimatableDirective,
|
|
1094
|
+
},
|
|
1095
|
+
DestroyService,
|
|
1096
|
+
],
|
|
1097
|
+
}]
|
|
1098
|
+
}] });
|
|
1099
|
+
|
|
1100
|
+
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
1101
|
+
const ANIMATION_CLASSES = {
|
|
1102
|
+
enterFrom: 'et-animation-enter-from',
|
|
1103
|
+
enterActive: 'et-animation-enter-active',
|
|
1104
|
+
enterTo: 'et-animation-enter-to',
|
|
1105
|
+
leaveFrom: 'et-animation-leave-from',
|
|
1106
|
+
leaveActive: 'et-animation-leave-active',
|
|
1107
|
+
leaveTo: 'et-animation-leave-to',
|
|
1108
|
+
};
|
|
1109
|
+
class AnimatedLifecycleDirective {
|
|
1110
|
+
constructor() {
|
|
1111
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
1112
|
+
this._elementRef = inject(ElementRef);
|
|
1113
|
+
this._animatable = inject(ANIMATABLE_TOKEN);
|
|
1114
|
+
this._classList = this._elementRef.nativeElement.classList;
|
|
1115
|
+
this._state$ = new BehaviorSubject('init');
|
|
1116
|
+
this.state$ = this._state$.asObservable();
|
|
1117
|
+
this._bindings = createReactiveBindings({
|
|
1118
|
+
attribute: 'class.et-force-invisible',
|
|
1119
|
+
observable: this._state$.pipe(map((state) => state === 'init')),
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
get state() {
|
|
1123
|
+
return this._state$.value;
|
|
1124
|
+
}
|
|
1125
|
+
enter(config) {
|
|
1126
|
+
if (this.state !== 'init' && this.state !== 'left' && isDevMode()) {
|
|
1127
|
+
throw new Error('Tried to enter but the element is not in the initial state.');
|
|
1128
|
+
}
|
|
1129
|
+
this._state$.next('entering');
|
|
1130
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1131
|
+
this._classList.add(ANIMATION_CLASSES.enterFrom);
|
|
1132
|
+
}
|
|
1133
|
+
forceReflow();
|
|
1134
|
+
this._classList.add(ANIMATION_CLASSES.enterActive);
|
|
1135
|
+
fromNextFrame()
|
|
1136
|
+
.pipe(tap(() => {
|
|
1137
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1138
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1139
|
+
this._classList.add(ANIMATION_CLASSES.enterTo);
|
|
1140
|
+
}
|
|
1141
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1142
|
+
this._state$.next('entered');
|
|
1143
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1144
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1145
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1146
|
+
}
|
|
1147
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1148
|
+
.subscribe();
|
|
1149
|
+
}
|
|
1150
|
+
leave(config) {
|
|
1151
|
+
if (this.state !== 'entered' && this.state !== 'entering' && isDevMode()) {
|
|
1152
|
+
throw new Error('Tried to leave while already leaving or left');
|
|
1153
|
+
}
|
|
1154
|
+
if (this._classList.contains(ANIMATION_CLASSES.enterFrom) ||
|
|
1155
|
+
this._classList.contains(ANIMATION_CLASSES.enterActive) ||
|
|
1156
|
+
this._classList.contains(ANIMATION_CLASSES.enterTo)) {
|
|
1157
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1158
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1159
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1160
|
+
}
|
|
1161
|
+
this._state$.next('leaving');
|
|
1162
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1163
|
+
this._classList.add(ANIMATION_CLASSES.leaveFrom);
|
|
1164
|
+
}
|
|
1165
|
+
forceReflow();
|
|
1166
|
+
this._classList.add(ANIMATION_CLASSES.leaveActive);
|
|
1167
|
+
fromNextFrame()
|
|
1168
|
+
.pipe(tap(() => {
|
|
1169
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1170
|
+
this._classList.remove(ANIMATION_CLASSES.leaveFrom);
|
|
1171
|
+
this._classList.add(ANIMATION_CLASSES.leaveTo);
|
|
1172
|
+
}
|
|
1173
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1174
|
+
this._state$.next('left');
|
|
1175
|
+
this._classList.remove(ANIMATION_CLASSES.leaveActive);
|
|
1176
|
+
if (!(config === null || config === void 0 ? void 0 : config.onlyTransition)) {
|
|
1177
|
+
this._classList.remove(ANIMATION_CLASSES.leaveTo);
|
|
1178
|
+
}
|
|
1179
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1180
|
+
.subscribe();
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
AnimatedLifecycleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1184
|
+
AnimatedLifecycleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatedLifecycleDirective, isStandalone: true, selector: "[etAnimatedLifecycle]", providers: [
|
|
1185
|
+
{
|
|
1186
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1187
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1188
|
+
},
|
|
1189
|
+
DestroyService,
|
|
1190
|
+
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 });
|
|
1191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
1192
|
+
type: Directive,
|
|
1193
|
+
args: [{
|
|
1194
|
+
selector: '[etAnimatedLifecycle]',
|
|
1195
|
+
exportAs: 'etAnimatedLifecycle',
|
|
1196
|
+
standalone: true,
|
|
1197
|
+
providers: [
|
|
1198
|
+
{
|
|
1199
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1200
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1201
|
+
},
|
|
1202
|
+
DestroyService,
|
|
1203
|
+
],
|
|
1204
|
+
hostDirectives: [AnimatableDirective],
|
|
1205
|
+
}]
|
|
1206
|
+
}] });
|
|
1207
|
+
|
|
479
1208
|
class ClickOutsideDirective {
|
|
480
1209
|
constructor() {
|
|
481
1210
|
this._elementRef = inject(ElementRef);
|
|
@@ -499,9 +1228,9 @@ class ClickOutsideDirective {
|
|
|
499
1228
|
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
500
1229
|
}
|
|
501
1230
|
}
|
|
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.
|
|
1231
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1232
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
|
|
1233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
505
1234
|
type: Directive,
|
|
506
1235
|
args: [{
|
|
507
1236
|
selector: '[etClickOutside]',
|
|
@@ -511,26 +1240,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
511
1240
|
type: Output
|
|
512
1241
|
}] } });
|
|
513
1242
|
|
|
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
1243
|
const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
|
|
528
1244
|
const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
|
|
529
1245
|
|
|
530
1246
|
class CursorDragScrollDirective {
|
|
531
1247
|
constructor() {
|
|
532
1248
|
this._subscriptions = [];
|
|
533
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1249
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
534
1250
|
this._elementRef = inject(ElementRef);
|
|
535
1251
|
this._contentObserverService = inject(ContentObserverService);
|
|
536
1252
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -655,9 +1371,9 @@ class CursorDragScrollDirective {
|
|
|
655
1371
|
}
|
|
656
1372
|
}
|
|
657
1373
|
}
|
|
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.
|
|
1374
|
+
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1375
|
+
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 });
|
|
1376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
661
1377
|
type: Directive,
|
|
662
1378
|
args: [{
|
|
663
1379
|
selector: '[etCursorDragScroll]',
|
|
@@ -670,25 +1386,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
670
1386
|
args: ['etCursorDragScroll']
|
|
671
1387
|
}] } });
|
|
672
1388
|
|
|
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.0", ngImport: i0, type: DestroyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
684
|
-
DestroyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0", type: DestroyDirective, isStandalone: true, ngImport: i0 });
|
|
685
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: DestroyDirective, decorators: [{
|
|
686
|
-
type: Directive,
|
|
687
|
-
args: [{
|
|
688
|
-
standalone: true,
|
|
689
|
-
}]
|
|
690
|
-
}] });
|
|
691
|
-
|
|
692
1389
|
class LetContext {
|
|
693
1390
|
constructor() {
|
|
694
1391
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -699,6 +1396,10 @@ class LetContext {
|
|
|
699
1396
|
}
|
|
700
1397
|
|
|
701
1398
|
class LetDirective {
|
|
1399
|
+
set etLet(value) {
|
|
1400
|
+
this._context.$implicit = this._context.etLet = value;
|
|
1401
|
+
this._updateView();
|
|
1402
|
+
}
|
|
702
1403
|
constructor(_viewContainer, templateRef) {
|
|
703
1404
|
this._viewContainer = _viewContainer;
|
|
704
1405
|
this._context = new LetContext();
|
|
@@ -706,10 +1407,6 @@ class LetDirective {
|
|
|
706
1407
|
this._viewRef = null;
|
|
707
1408
|
this._templateRef = templateRef;
|
|
708
1409
|
}
|
|
709
|
-
set etLet(value) {
|
|
710
|
-
this._context.$implicit = this._context.etLet = value;
|
|
711
|
-
this._updateView();
|
|
712
|
-
}
|
|
713
1410
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
714
1411
|
static ngTemplateContextGuard(dir, ctx) {
|
|
715
1412
|
return true;
|
|
@@ -723,9 +1420,9 @@ class LetDirective {
|
|
|
723
1420
|
}
|
|
724
1421
|
}
|
|
725
1422
|
}
|
|
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.
|
|
1423
|
+
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 });
|
|
1424
|
+
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
|
|
1425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, decorators: [{
|
|
729
1426
|
type: Directive,
|
|
730
1427
|
args: [{
|
|
731
1428
|
selector: '[etLet]',
|
|
@@ -740,7 +1437,7 @@ class ObserveContentDirective {
|
|
|
740
1437
|
this._contentObserver = inject(ContentObserverService);
|
|
741
1438
|
this._elementRef = inject(ElementRef);
|
|
742
1439
|
this._ngZone = inject(NgZone);
|
|
743
|
-
this.
|
|
1440
|
+
this.valueChange = new EventEmitter();
|
|
744
1441
|
this._disabled = false;
|
|
745
1442
|
this._debounce = null;
|
|
746
1443
|
this._currentSubscription = null;
|
|
@@ -771,7 +1468,7 @@ class ObserveContentDirective {
|
|
|
771
1468
|
this._unsubscribe();
|
|
772
1469
|
const stream = this._contentObserver.observe(this._elementRef);
|
|
773
1470
|
this._ngZone.runOutsideAngular(() => {
|
|
774
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.
|
|
1471
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.valueChange);
|
|
775
1472
|
});
|
|
776
1473
|
}
|
|
777
1474
|
_unsubscribe() {
|
|
@@ -779,16 +1476,16 @@ class ObserveContentDirective {
|
|
|
779
1476
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
780
1477
|
}
|
|
781
1478
|
}
|
|
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.
|
|
1479
|
+
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1480
|
+
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 });
|
|
1481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
785
1482
|
type: Directive,
|
|
786
1483
|
args: [{
|
|
787
1484
|
selector: '[etObserveContent]',
|
|
788
1485
|
exportAs: 'etObserveContent',
|
|
789
1486
|
standalone: true,
|
|
790
1487
|
}]
|
|
791
|
-
}], propDecorators: {
|
|
1488
|
+
}], propDecorators: { valueChange: [{
|
|
792
1489
|
type: Output,
|
|
793
1490
|
args: ['etObserveContent']
|
|
794
1491
|
}], disabled: [{
|
|
@@ -804,7 +1501,7 @@ class ObserveResizeDirective {
|
|
|
804
1501
|
this._resizeObserver = inject(ResizeObserverService);
|
|
805
1502
|
this._elementRef = inject(ElementRef);
|
|
806
1503
|
this._ngZone = inject(NgZone);
|
|
807
|
-
this.
|
|
1504
|
+
this.valueChange = new EventEmitter();
|
|
808
1505
|
this._disabled = false;
|
|
809
1506
|
this._debounce = null;
|
|
810
1507
|
this._currentSubscription = null;
|
|
@@ -835,7 +1532,7 @@ class ObserveResizeDirective {
|
|
|
835
1532
|
this._unsubscribe();
|
|
836
1533
|
const stream = this._resizeObserver.observe(this._elementRef);
|
|
837
1534
|
this._ngZone.runOutsideAngular(() => {
|
|
838
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.
|
|
1535
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.valueChange);
|
|
839
1536
|
});
|
|
840
1537
|
}
|
|
841
1538
|
_unsubscribe() {
|
|
@@ -843,16 +1540,16 @@ class ObserveResizeDirective {
|
|
|
843
1540
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
844
1541
|
}
|
|
845
1542
|
}
|
|
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.
|
|
1543
|
+
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1544
|
+
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 });
|
|
1545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
849
1546
|
type: Directive,
|
|
850
1547
|
args: [{
|
|
851
1548
|
selector: '[etObserveResize]',
|
|
852
1549
|
exportAs: 'etObserveResize',
|
|
853
1550
|
standalone: true,
|
|
854
1551
|
}]
|
|
855
|
-
}], propDecorators: {
|
|
1552
|
+
}], propDecorators: { valueChange: [{
|
|
856
1553
|
type: Output,
|
|
857
1554
|
args: ['etObserveResize']
|
|
858
1555
|
}], disabled: [{
|
|
@@ -875,9 +1572,9 @@ class ScrollObserverFirstElementDirective {
|
|
|
875
1572
|
this._isFirstElement = coerceBooleanProperty(value);
|
|
876
1573
|
}
|
|
877
1574
|
}
|
|
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.
|
|
1575
|
+
ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1576
|
+
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 });
|
|
1577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
|
|
881
1578
|
type: Directive,
|
|
882
1579
|
args: [{
|
|
883
1580
|
selector: '[etScrollObserverFirstElement]',
|
|
@@ -894,9 +1591,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
894
1591
|
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
895
1592
|
class ScrollObserverIgnoreTargetDirective {
|
|
896
1593
|
}
|
|
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.
|
|
1594
|
+
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1595
|
+
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 });
|
|
1596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
900
1597
|
type: Directive,
|
|
901
1598
|
args: [{
|
|
902
1599
|
selector: '[etScrollObserverIgnoreTarget]',
|
|
@@ -919,9 +1616,9 @@ class ScrollObserverLastElementDirective {
|
|
|
919
1616
|
this._isLastElement = coerceBooleanProperty(value);
|
|
920
1617
|
}
|
|
921
1618
|
}
|
|
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.
|
|
1619
|
+
ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1620
|
+
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 });
|
|
1621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
|
|
925
1622
|
type: Directive,
|
|
926
1623
|
args: [{
|
|
927
1624
|
selector: '[etScrollObserverLastElement]',
|
|
@@ -942,7 +1639,7 @@ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
|
|
|
942
1639
|
|
|
943
1640
|
class ObserveScrollStateDirective {
|
|
944
1641
|
constructor() {
|
|
945
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1642
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
946
1643
|
this._elementRef = inject(ElementRef);
|
|
947
1644
|
this._contentObserverService = inject(ContentObserverService);
|
|
948
1645
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -953,7 +1650,7 @@ class ObserveScrollStateDirective {
|
|
|
953
1650
|
this._rootMargin = 0;
|
|
954
1651
|
this._threshold = 1;
|
|
955
1652
|
this._intersectionObserver = null;
|
|
956
|
-
this.
|
|
1653
|
+
this.valueChange = new EventEmitter();
|
|
957
1654
|
}
|
|
958
1655
|
get _firstCurrentChild() {
|
|
959
1656
|
const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
|
|
@@ -1010,7 +1707,7 @@ class ObserveScrollStateDirective {
|
|
|
1010
1707
|
!elementCanScroll(this._elementRef.nativeElement)) {
|
|
1011
1708
|
this._unobserveChild('first');
|
|
1012
1709
|
this._unobserveChild('last');
|
|
1013
|
-
this.
|
|
1710
|
+
this.valueChange.emit({
|
|
1014
1711
|
isAtStart: true,
|
|
1015
1712
|
isAtEnd: true,
|
|
1016
1713
|
canScroll: false,
|
|
@@ -1028,7 +1725,7 @@ class ObserveScrollStateDirective {
|
|
|
1028
1725
|
const { first, last } = this._observedChildren;
|
|
1029
1726
|
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
1727
|
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.
|
|
1728
|
+
this.valueChange.emit({
|
|
1032
1729
|
isAtStart,
|
|
1033
1730
|
isAtEnd,
|
|
1034
1731
|
canScroll: !isAtStart || !isAtEnd,
|
|
@@ -1075,15 +1772,15 @@ class ObserveScrollStateDirective {
|
|
|
1075
1772
|
return element;
|
|
1076
1773
|
}
|
|
1077
1774
|
}
|
|
1078
|
-
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1079
|
-
ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1775
|
+
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1776
|
+
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
1777
|
{
|
|
1081
1778
|
provide: OBSERVE_SCROLL_STATE,
|
|
1082
1779
|
useExisting: ObserveScrollStateDirective,
|
|
1083
1780
|
},
|
|
1084
1781
|
DestroyService,
|
|
1085
1782
|
], exportAs: ["etObserveScrollState"], ngImport: i0 });
|
|
1086
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
1087
1784
|
type: Directive,
|
|
1088
1785
|
args: [{
|
|
1089
1786
|
selector: '[etObserveScrollState]',
|
|
@@ -1101,34 +1798,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
1101
1798
|
type: Input
|
|
1102
1799
|
}], observerThreshold: [{
|
|
1103
1800
|
type: Input
|
|
1104
|
-
}],
|
|
1105
|
-
type: Output
|
|
1801
|
+
}], valueChange: [{
|
|
1802
|
+
type: Output,
|
|
1803
|
+
args: ['etObserveScrollState']
|
|
1106
1804
|
}] } });
|
|
1107
1805
|
|
|
1108
1806
|
class RepeatDirective {
|
|
1109
|
-
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1110
|
-
this._mainTemplateRef = _mainTemplateRef;
|
|
1111
|
-
this._viewContainerRef = _viewContainerRef;
|
|
1112
|
-
this._repeatCount = 2;
|
|
1113
|
-
}
|
|
1114
1807
|
get repeatCount() {
|
|
1115
1808
|
return this._repeatCount;
|
|
1116
1809
|
}
|
|
1117
1810
|
set repeatCount(value) {
|
|
1118
1811
|
this._repeatCount = coerceNumberProperty(value);
|
|
1119
|
-
}
|
|
1120
|
-
ngOnInit() {
|
|
1121
1812
|
this._render();
|
|
1122
1813
|
}
|
|
1814
|
+
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1815
|
+
this._mainTemplateRef = _mainTemplateRef;
|
|
1816
|
+
this._viewContainerRef = _viewContainerRef;
|
|
1817
|
+
this._repeatCount = 2;
|
|
1818
|
+
}
|
|
1123
1819
|
_render() {
|
|
1820
|
+
this._viewContainerRef.clear();
|
|
1124
1821
|
for (let i = 0; i < this.repeatCount; i++) {
|
|
1125
1822
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
|
|
1126
1823
|
}
|
|
1127
1824
|
}
|
|
1128
1825
|
}
|
|
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.
|
|
1826
|
+
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 });
|
|
1827
|
+
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
|
|
1828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
1132
1829
|
type: Directive,
|
|
1133
1830
|
args: [{
|
|
1134
1831
|
selector: '[etRepeat]',
|
|
@@ -1167,6 +1864,10 @@ class SeoDirective {
|
|
|
1167
1864
|
this._cleanUp();
|
|
1168
1865
|
(_a = this.parent) === null || _a === void 0 ? void 0 : _a._activate();
|
|
1169
1866
|
}
|
|
1867
|
+
// TODO(TRB): This should get split up into multiple methods to make it more readable
|
|
1868
|
+
// - updateTitle
|
|
1869
|
+
// - updateMeta
|
|
1870
|
+
// - updateLink
|
|
1170
1871
|
updateConfig(config) {
|
|
1171
1872
|
var _a;
|
|
1172
1873
|
this._config = mergeSeoConfig(config, ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.config) || {});
|
|
@@ -1295,9 +1996,9 @@ class SeoDirective {
|
|
|
1295
1996
|
}
|
|
1296
1997
|
}
|
|
1297
1998
|
}
|
|
1298
|
-
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1299
|
-
SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1999
|
+
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2000
|
+
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 });
|
|
2001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, decorators: [{
|
|
1301
2002
|
type: Directive,
|
|
1302
2003
|
args: [{
|
|
1303
2004
|
standalone: true,
|
|
@@ -1305,6 +2006,320 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
1305
2006
|
}]
|
|
1306
2007
|
}] });
|
|
1307
2008
|
|
|
2009
|
+
// TODO(TRB): Add correct type once provided by API
|
|
2010
|
+
const normalizeGameResultType = (type) => {
|
|
2011
|
+
if (!type) {
|
|
2012
|
+
return null;
|
|
2013
|
+
}
|
|
2014
|
+
switch (type) {
|
|
2015
|
+
case 'extra_time':
|
|
2016
|
+
return {
|
|
2017
|
+
i18n: 'game-result-type.extra-time',
|
|
2018
|
+
shortCode: 'AET',
|
|
2019
|
+
text: 'After Extra Time',
|
|
2020
|
+
};
|
|
2021
|
+
case 'penalty':
|
|
2022
|
+
return {
|
|
2023
|
+
i18n: 'game-result-type.penalty',
|
|
2024
|
+
shortCode: 'PSO',
|
|
2025
|
+
text: 'Penalty shootout',
|
|
2026
|
+
};
|
|
2027
|
+
case 'golden_goal':
|
|
2028
|
+
return {
|
|
2029
|
+
i18n: 'game-result-type.golden-goal',
|
|
2030
|
+
shortCode: 'GG',
|
|
2031
|
+
text: 'Golden Goal',
|
|
2032
|
+
};
|
|
2033
|
+
case 'default':
|
|
2034
|
+
default:
|
|
2035
|
+
return {
|
|
2036
|
+
i18n: 'game-result-type.full-time',
|
|
2037
|
+
shortCode: 'FT',
|
|
2038
|
+
text: 'Full Time',
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
};
|
|
2042
|
+
|
|
2043
|
+
class NormalizeGameResultTypePipe {
|
|
2044
|
+
constructor() {
|
|
2045
|
+
this.transform = normalizeGameResultType;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2049
|
+
NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
|
|
2050
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
|
|
2051
|
+
type: Pipe,
|
|
2052
|
+
args: [{ name: 'etNormalizeGameResultType', standalone: true }]
|
|
2053
|
+
}] });
|
|
2054
|
+
|
|
2055
|
+
const normalizeMatchState = (match) => {
|
|
2056
|
+
if (match === null || match === void 0 ? void 0 : match.isCompletedByReferee) {
|
|
2057
|
+
return "autoWin" /* MatchStateType.AUTO_WIN */;
|
|
2058
|
+
}
|
|
2059
|
+
else if ((match === null || match === void 0 ? void 0 : match.status) === 'preparing') {
|
|
2060
|
+
return "preMatch" /* MatchStateType.PRE_MATCH */;
|
|
2061
|
+
}
|
|
2062
|
+
else if ((match === null || match === void 0 ? void 0 : match.status) === 'started') {
|
|
2063
|
+
return "live" /* MatchStateType.LIVE */;
|
|
2064
|
+
}
|
|
2065
|
+
else if ((match === null || match === void 0 ? void 0 : match.status) === 'published' || (match === null || match === void 0 ? void 0 : match.status) === 'finished') {
|
|
2066
|
+
return "postMatch" /* MatchStateType.POST_MATCH */;
|
|
2067
|
+
}
|
|
2068
|
+
else if ((match === null || match === void 0 ? void 0 : match.round.state) !== 'preparing') {
|
|
2069
|
+
return "preparingRound" /* MatchStateType.PREPARING_ROUND */;
|
|
2070
|
+
}
|
|
2071
|
+
return null;
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
class NormalizeMatchStatePipe {
|
|
2075
|
+
constructor() {
|
|
2076
|
+
this.transform = normalizeMatchState;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2080
|
+
NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
|
|
2081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
|
|
2082
|
+
type: Pipe,
|
|
2083
|
+
args: [{ name: 'etNormalizeMatchState', standalone: true }]
|
|
2084
|
+
}] });
|
|
2085
|
+
|
|
2086
|
+
const normalizeMatchParticipants = (match) => {
|
|
2087
|
+
const matchState = normalizeMatchState(match);
|
|
2088
|
+
if (!match || !matchState) {
|
|
2089
|
+
return null;
|
|
2090
|
+
}
|
|
2091
|
+
return {
|
|
2092
|
+
home: normalizeMatchParticipant(match, 'home'),
|
|
2093
|
+
away: normalizeMatchParticipant(match, 'away'),
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
const normalizeMatchParticipant = (match, side) => {
|
|
2097
|
+
var _a, _b, _c, _d;
|
|
2098
|
+
const matchState = normalizeMatchState(match);
|
|
2099
|
+
if (!match || !matchState) {
|
|
2100
|
+
return null;
|
|
2101
|
+
}
|
|
2102
|
+
const participant = match[side];
|
|
2103
|
+
const participantType = (_d = (_b = (_a = match.home) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (_c = match.away) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 'unknown';
|
|
2104
|
+
if (!participant) {
|
|
2105
|
+
if (matchState === "postMatch" /* MatchStateType.POST_MATCH */ || matchState === "autoWin" /* MatchStateType.AUTO_WIN */) {
|
|
2106
|
+
return {
|
|
2107
|
+
participantType,
|
|
2108
|
+
type: 'none',
|
|
2109
|
+
i18n: 'match-participant.none',
|
|
2110
|
+
text: 'No opponent',
|
|
2111
|
+
data: participant,
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
else {
|
|
2115
|
+
return {
|
|
2116
|
+
participantType,
|
|
2117
|
+
type: 'tbd',
|
|
2118
|
+
i18n: 'match-participant.tbd',
|
|
2119
|
+
text: 'TBD',
|
|
2120
|
+
data: participant,
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
else {
|
|
2125
|
+
return {
|
|
2126
|
+
participantType,
|
|
2127
|
+
type: 'participant',
|
|
2128
|
+
data: participant,
|
|
2129
|
+
};
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
|
|
2133
|
+
class NormalizeMatchParticipantsPipe {
|
|
2134
|
+
constructor() {
|
|
2135
|
+
this.transform = normalizeMatchParticipants;
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2139
|
+
NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
|
|
2140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
|
|
2141
|
+
type: Pipe,
|
|
2142
|
+
args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
|
|
2143
|
+
}] });
|
|
2144
|
+
|
|
2145
|
+
const EMPTY_SCORE = {
|
|
2146
|
+
home: { score: 'match-score.placeholder', isWinner: false },
|
|
2147
|
+
away: { score: 'match-score.placeholder', isWinner: false },
|
|
2148
|
+
isNumeric: false,
|
|
2149
|
+
subLine: null,
|
|
2150
|
+
};
|
|
2151
|
+
const normalizeMatchScore = (match) => {
|
|
2152
|
+
var _a, _b;
|
|
2153
|
+
if (!match) {
|
|
2154
|
+
return null;
|
|
2155
|
+
}
|
|
2156
|
+
const matchState = normalizeMatchState(match);
|
|
2157
|
+
const subLine = getMatchScoreSubLine(match);
|
|
2158
|
+
if (!match.homeScore && !match.awayScore) {
|
|
2159
|
+
return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
|
|
2160
|
+
}
|
|
2161
|
+
if (isKnockoutMatch(match)) {
|
|
2162
|
+
if (matchState === "preMatch" /* MatchStateType.PRE_MATCH */ || matchState === "live" /* MatchStateType.LIVE */) {
|
|
2163
|
+
return Object.assign(Object.assign({}, EMPTY_SCORE), { subLine, isNumeric: false });
|
|
2164
|
+
}
|
|
2165
|
+
return {
|
|
2166
|
+
home: {
|
|
2167
|
+
score: getKnockoutMatchScore(match.homeScore),
|
|
2168
|
+
isWinner: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.status) === 'won',
|
|
2169
|
+
},
|
|
2170
|
+
away: {
|
|
2171
|
+
score: getKnockoutMatchScore(match.awayScore),
|
|
2172
|
+
isWinner: ((_b = match.awayScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
|
|
2173
|
+
},
|
|
2174
|
+
subLine,
|
|
2175
|
+
isNumeric: false,
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
else if (isGroupMatch(match)) {
|
|
2179
|
+
if (match.games.length === 1) {
|
|
2180
|
+
// Return the score if only one game has been played
|
|
2181
|
+
return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
return Object.assign(Object.assign({}, getGroupMatchPoints(match)), { subLine, isNumeric: true });
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
else {
|
|
2188
|
+
return Object.assign(Object.assign({}, getGroupMatchScore(match)), { subLine, isNumeric: true });
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
const isKnockoutMatch = (match) => {
|
|
2192
|
+
if (!match) {
|
|
2193
|
+
return false;
|
|
2194
|
+
}
|
|
2195
|
+
return (match.matchType === 'single_elimination' ||
|
|
2196
|
+
match.matchType === 'double_elimination' ||
|
|
2197
|
+
match.matchType === 'fifa_swiss');
|
|
2198
|
+
};
|
|
2199
|
+
const isGroupMatch = (match) => {
|
|
2200
|
+
if (!match) {
|
|
2201
|
+
return false;
|
|
2202
|
+
}
|
|
2203
|
+
return match.matchType === 'groups' || match.matchType === 'league';
|
|
2204
|
+
};
|
|
2205
|
+
const getKnockoutMatchScore = (score) => {
|
|
2206
|
+
if ((score === null || score === void 0 ? void 0 : score.status) === 'won') {
|
|
2207
|
+
return 'match-score.knockout.won';
|
|
2208
|
+
}
|
|
2209
|
+
else if ((score === null || score === void 0 ? void 0 : score.status) === 'lost') {
|
|
2210
|
+
return 'match-score.knockout.lost';
|
|
2211
|
+
}
|
|
2212
|
+
else if ((score === null || score === void 0 ? void 0 : score.status) === 'tie') {
|
|
2213
|
+
return 'match-score.knockout.tie';
|
|
2214
|
+
}
|
|
2215
|
+
return null;
|
|
2216
|
+
};
|
|
2217
|
+
const getMatchScoreSubLine = (match) => {
|
|
2218
|
+
if (isKnockoutMatch(match)) {
|
|
2219
|
+
return null;
|
|
2220
|
+
}
|
|
2221
|
+
else if (isGroupMatch(match)) {
|
|
2222
|
+
return 'match-score.groups.sub-line';
|
|
2223
|
+
}
|
|
2224
|
+
else {
|
|
2225
|
+
return null;
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2228
|
+
const getGroupMatchScore = (match) => {
|
|
2229
|
+
var _a, _b, _c, _d;
|
|
2230
|
+
if (!match) {
|
|
2231
|
+
return null;
|
|
2232
|
+
}
|
|
2233
|
+
return {
|
|
2234
|
+
home: {
|
|
2235
|
+
score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.ownPoints) || 0,
|
|
2236
|
+
isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
|
|
2237
|
+
},
|
|
2238
|
+
away: {
|
|
2239
|
+
score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.ownPoints) || 0,
|
|
2240
|
+
isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
|
|
2241
|
+
},
|
|
2242
|
+
};
|
|
2243
|
+
};
|
|
2244
|
+
const getGroupMatchPoints = (match) => {
|
|
2245
|
+
var _a, _b, _c, _d;
|
|
2246
|
+
if (!match) {
|
|
2247
|
+
return null;
|
|
2248
|
+
}
|
|
2249
|
+
return {
|
|
2250
|
+
home: {
|
|
2251
|
+
score: ((_a = match.homeScore) === null || _a === void 0 ? void 0 : _a.score) || 0,
|
|
2252
|
+
isWinner: ((_b = match.homeScore) === null || _b === void 0 ? void 0 : _b.status) === 'won',
|
|
2253
|
+
},
|
|
2254
|
+
away: {
|
|
2255
|
+
score: ((_c = match.awayScore) === null || _c === void 0 ? void 0 : _c.score) || 0,
|
|
2256
|
+
isWinner: ((_d = match.awayScore) === null || _d === void 0 ? void 0 : _d.status) === 'won',
|
|
2257
|
+
},
|
|
2258
|
+
};
|
|
2259
|
+
};
|
|
2260
|
+
|
|
2261
|
+
class NormalizeMatchScorePipe {
|
|
2262
|
+
constructor() {
|
|
2263
|
+
this.transform = normalizeMatchScore;
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2267
|
+
NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
|
|
2268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
|
|
2269
|
+
type: Pipe,
|
|
2270
|
+
args: [{ name: 'etNormalizeMatchScore', standalone: true }]
|
|
2271
|
+
}] });
|
|
2272
|
+
|
|
2273
|
+
const normalizeMatchType = (matchType) => {
|
|
2274
|
+
if (!matchType) {
|
|
2275
|
+
return null;
|
|
2276
|
+
}
|
|
2277
|
+
switch (matchType) {
|
|
2278
|
+
case 'double_elimination':
|
|
2279
|
+
return {
|
|
2280
|
+
i18n: 'match-type.double-elimination',
|
|
2281
|
+
text: 'Double Elimination',
|
|
2282
|
+
};
|
|
2283
|
+
case 'single_elimination':
|
|
2284
|
+
return {
|
|
2285
|
+
i18n: 'match-type.single-elimination',
|
|
2286
|
+
text: 'Single Elimination',
|
|
2287
|
+
};
|
|
2288
|
+
case 'fifa_swiss':
|
|
2289
|
+
return {
|
|
2290
|
+
i18n: 'match-type.fifa-swiss',
|
|
2291
|
+
text: 'FIFA Swiss',
|
|
2292
|
+
};
|
|
2293
|
+
case 'groups':
|
|
2294
|
+
return {
|
|
2295
|
+
i18n: 'match-type.groups',
|
|
2296
|
+
text: 'Groups',
|
|
2297
|
+
};
|
|
2298
|
+
case 'league':
|
|
2299
|
+
return {
|
|
2300
|
+
i18n: 'match-type.league',
|
|
2301
|
+
text: 'League',
|
|
2302
|
+
};
|
|
2303
|
+
case 'pools':
|
|
2304
|
+
return {
|
|
2305
|
+
i18n: 'match-type.pools',
|
|
2306
|
+
text: 'Pools',
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2311
|
+
class NormalizeMatchTypePipe {
|
|
2312
|
+
constructor() {
|
|
2313
|
+
this.transform = normalizeMatchType;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2317
|
+
NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
|
|
2318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
|
|
2319
|
+
type: Pipe,
|
|
2320
|
+
args: [{ name: 'etNormalizeMatchType', standalone: true }]
|
|
2321
|
+
}] });
|
|
2322
|
+
|
|
1308
2323
|
const toArray = (value) => {
|
|
1309
2324
|
return Array.from({ length: value }, (_, i) => i);
|
|
1310
2325
|
};
|
|
@@ -1315,16 +2330,95 @@ class ToArrayPipe {
|
|
|
1315
2330
|
this.transform = toArray;
|
|
1316
2331
|
}
|
|
1317
2332
|
}
|
|
1318
|
-
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1319
|
-
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1320
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2333
|
+
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2334
|
+
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
|
|
2335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
1321
2336
|
type: Pipe,
|
|
1322
2337
|
args: [{ name: 'toArray', standalone: true }]
|
|
1323
2338
|
}] });
|
|
1324
2339
|
|
|
2340
|
+
var _a;
|
|
2341
|
+
class TypedQueryList extends QueryList {
|
|
2342
|
+
constructor() {
|
|
2343
|
+
super(...arguments);
|
|
2344
|
+
this[_a] = () => {
|
|
2345
|
+
return super[Symbol.iterator]();
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
get changes() {
|
|
2349
|
+
return super.changes;
|
|
2350
|
+
}
|
|
2351
|
+
toArray() {
|
|
2352
|
+
return super.toArray();
|
|
2353
|
+
}
|
|
2354
|
+
forEach(fn) {
|
|
2355
|
+
super.forEach(fn);
|
|
2356
|
+
}
|
|
2357
|
+
filter(fn) {
|
|
2358
|
+
return super.filter(fn);
|
|
2359
|
+
}
|
|
2360
|
+
map(fn) {
|
|
2361
|
+
return super.map(fn);
|
|
2362
|
+
}
|
|
2363
|
+
reduce(fn, initialValue) {
|
|
2364
|
+
return super.reduce(fn, initialValue);
|
|
2365
|
+
}
|
|
2366
|
+
some(fn) {
|
|
2367
|
+
return super.some(fn);
|
|
2368
|
+
}
|
|
2369
|
+
find(fn) {
|
|
2370
|
+
return super.find(fn);
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
_a = Symbol.iterator;
|
|
2374
|
+
|
|
2375
|
+
const IS_ARRAY_NOT_EMPTY = 'isArrayNotEmpty';
|
|
2376
|
+
const IsArrayNotEmpty = (control) => {
|
|
2377
|
+
const value = control.value;
|
|
2378
|
+
if (!value) {
|
|
2379
|
+
return null;
|
|
2380
|
+
}
|
|
2381
|
+
return value.length > 0 ? null : { [IS_ARRAY_NOT_EMPTY]: true };
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2384
|
+
const IS_EMAIL = 'isEmail';
|
|
2385
|
+
const IsEmail = (control) => {
|
|
2386
|
+
const value = control.value;
|
|
2387
|
+
if (!value) {
|
|
2388
|
+
return null;
|
|
2389
|
+
}
|
|
2390
|
+
const regex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
|
|
2391
|
+
return regex.test(value) ? null : { [IS_EMAIL]: true };
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
const MUST_MATCH = 'mustMatch';
|
|
2395
|
+
const MustMatch = (controlName, matchingControlName) => {
|
|
2396
|
+
return (formGroup) => {
|
|
2397
|
+
const control = formGroup.controls[controlName];
|
|
2398
|
+
const matchingControl = formGroup.controls[matchingControlName];
|
|
2399
|
+
// set error on matchingControl if validation fails
|
|
2400
|
+
if (matchingControl.errors && !matchingControl.errors[MUST_MATCH]) {
|
|
2401
|
+
return;
|
|
2402
|
+
}
|
|
2403
|
+
// set error on matchingControl if validation fails
|
|
2404
|
+
if (control.value !== matchingControl.value) {
|
|
2405
|
+
matchingControl.setErrors({ [MUST_MATCH]: true });
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
matchingControl.setErrors(null);
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
};
|
|
2412
|
+
|
|
2413
|
+
const Validators = {
|
|
2414
|
+
MustMatch,
|
|
2415
|
+
IsEmail,
|
|
2416
|
+
IsArrayNotEmpty,
|
|
2417
|
+
};
|
|
2418
|
+
|
|
1325
2419
|
/**
|
|
1326
2420
|
* Generated bundle index. Do not edit.
|
|
1327
2421
|
*/
|
|
1328
2422
|
|
|
1329
|
-
export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG,
|
|
2423
|
+
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 };
|
|
1330
2424
|
//# sourceMappingURL=ethlete-core.mjs.map
|