@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
|
/**
|
|
@@ -55,9 +90,9 @@ class ClickObserverFactory {
|
|
|
55
90
|
return fromEvent(document, 'click');
|
|
56
91
|
}
|
|
57
92
|
}
|
|
58
|
-
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
59
|
-
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
93
|
+
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
94
|
+
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
61
96
|
type: Injectable,
|
|
62
97
|
args: [{ providedIn: 'root' }]
|
|
63
98
|
}] });
|
|
@@ -111,9 +146,9 @@ class ClickObserverService {
|
|
|
111
146
|
}
|
|
112
147
|
}
|
|
113
148
|
}
|
|
114
|
-
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
115
|
-
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
149
|
+
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
150
|
+
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
117
152
|
type: Injectable,
|
|
118
153
|
args: [{ providedIn: 'root' }]
|
|
119
154
|
}], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
|
|
@@ -124,9 +159,9 @@ class MutationObserverFactory {
|
|
|
124
159
|
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
125
160
|
}
|
|
126
161
|
}
|
|
127
|
-
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
128
|
-
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
162
|
+
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
163
|
+
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
130
165
|
type: Injectable,
|
|
131
166
|
args: [{ providedIn: 'root' }]
|
|
132
167
|
}] });
|
|
@@ -186,9 +221,9 @@ class ContentObserverService {
|
|
|
186
221
|
}
|
|
187
222
|
}
|
|
188
223
|
}
|
|
189
|
-
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
190
|
-
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
224
|
+
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
225
|
+
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ContentObserverService, decorators: [{
|
|
192
227
|
type: Injectable,
|
|
193
228
|
args: [{ providedIn: 'root' }]
|
|
194
229
|
}], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
|
|
@@ -203,13 +238,16 @@ class DestroyService {
|
|
|
203
238
|
this._destroy$.unsubscribe();
|
|
204
239
|
}
|
|
205
240
|
}
|
|
206
|
-
DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
207
|
-
DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
241
|
+
DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
242
|
+
DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService });
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: DestroyService, decorators: [{
|
|
209
244
|
type: Injectable
|
|
210
245
|
}] });
|
|
211
246
|
|
|
212
247
|
class FocusVisibleService {
|
|
248
|
+
get isFocusVisible() {
|
|
249
|
+
return this._hadKeyboardEvent;
|
|
250
|
+
}
|
|
213
251
|
constructor() {
|
|
214
252
|
this._document = inject(DOCUMENT);
|
|
215
253
|
this._hadKeyboardEvent = false;
|
|
@@ -218,9 +256,6 @@ class FocusVisibleService {
|
|
|
218
256
|
this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
|
|
219
257
|
this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
|
|
220
258
|
}
|
|
221
|
-
get isFocusVisible() {
|
|
222
|
-
return this._hadKeyboardEvent;
|
|
223
|
-
}
|
|
224
259
|
onKeyDown(e) {
|
|
225
260
|
if (e.metaKey || e.altKey || e.ctrlKey) {
|
|
226
261
|
return;
|
|
@@ -231,9 +266,9 @@ class FocusVisibleService {
|
|
|
231
266
|
this._hadKeyboardEvent = false;
|
|
232
267
|
}
|
|
233
268
|
}
|
|
234
|
-
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
235
|
-
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
269
|
+
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
270
|
+
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: FocusVisibleService, decorators: [{
|
|
237
272
|
type: Injectable,
|
|
238
273
|
args: [{
|
|
239
274
|
providedIn: 'root',
|
|
@@ -246,9 +281,9 @@ class ResizeObserverFactory {
|
|
|
246
281
|
return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
|
|
247
282
|
}
|
|
248
283
|
}
|
|
249
|
-
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
250
|
-
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
284
|
+
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
285
|
+
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
|
|
286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverFactory, decorators: [{
|
|
252
287
|
type: Injectable,
|
|
253
288
|
args: [{ providedIn: 'root' }]
|
|
254
289
|
}] });
|
|
@@ -304,26 +339,523 @@ class ResizeObserverService {
|
|
|
304
339
|
}
|
|
305
340
|
}
|
|
306
341
|
}
|
|
307
|
-
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
308
|
-
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
309
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
342
|
+
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
343
|
+
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ResizeObserverService, decorators: [{
|
|
310
345
|
type: Injectable,
|
|
311
346
|
args: [{ providedIn: 'root' }]
|
|
312
347
|
}], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
|
|
313
348
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
349
|
+
const nextFrame = (cb) => {
|
|
350
|
+
requestAnimationFrame(() => {
|
|
351
|
+
requestAnimationFrame(cb);
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
const fromNextFrame = () => {
|
|
355
|
+
return new Observable((observer) => {
|
|
356
|
+
nextFrame(() => {
|
|
357
|
+
observer.next();
|
|
358
|
+
observer.complete();
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
const forceReflow = (element = document.body) => {
|
|
363
|
+
return element.offsetHeight;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
const clamp = (value, min = 0, max = 100) => {
|
|
367
|
+
return Math.max(min, Math.min(max, value));
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
371
|
+
/* eslint-disable no-var */
|
|
372
|
+
/**
|
|
373
|
+
* Stolen from klona to avoid adding a dependency
|
|
374
|
+
* https://github.com/lukeed/klona
|
|
375
|
+
*
|
|
376
|
+
* MIT License
|
|
377
|
+
*
|
|
378
|
+
* Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
379
|
+
*
|
|
380
|
+
* 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:
|
|
381
|
+
*
|
|
382
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
383
|
+
*
|
|
384
|
+
* 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.
|
|
385
|
+
*/
|
|
386
|
+
const set = (obj, key, val) => {
|
|
387
|
+
if (typeof val.value === 'object')
|
|
388
|
+
val.value = clone(val.value);
|
|
389
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
390
|
+
Object.defineProperty(obj, key, val);
|
|
391
|
+
}
|
|
392
|
+
else
|
|
393
|
+
obj[key] = val.value;
|
|
394
|
+
};
|
|
395
|
+
const clone = (original) => {
|
|
396
|
+
if (typeof original !== 'object')
|
|
397
|
+
return original;
|
|
398
|
+
var _og = original;
|
|
399
|
+
var i = 0, k, list, tmp, str = Object.prototype.toString.call(_og);
|
|
400
|
+
if (str === '[object Object]') {
|
|
401
|
+
tmp = Object.create(_og.__proto__ || null);
|
|
402
|
+
}
|
|
403
|
+
else if (str === '[object Array]') {
|
|
404
|
+
tmp = Array(_og.length);
|
|
405
|
+
}
|
|
406
|
+
else if (str === '[object Set]') {
|
|
407
|
+
tmp = new Set();
|
|
408
|
+
_og.forEach(function (val) {
|
|
409
|
+
tmp.add(clone(val));
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
else if (str === '[object Map]') {
|
|
413
|
+
tmp = new Map();
|
|
414
|
+
_og.forEach(function (val, key) {
|
|
415
|
+
tmp.set(clone(key), clone(val));
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
else if (str === '[object Date]') {
|
|
419
|
+
tmp = new Date(+_og);
|
|
420
|
+
}
|
|
421
|
+
else if (str === '[object RegExp]') {
|
|
422
|
+
tmp = new RegExp(_og.source, _og.flags);
|
|
423
|
+
}
|
|
424
|
+
else if (str === '[object DataView]') {
|
|
425
|
+
tmp = new _og.constructor(clone(_og.buffer));
|
|
426
|
+
}
|
|
427
|
+
else if (str === '[object ArrayBuffer]') {
|
|
428
|
+
tmp = _og.slice(0);
|
|
429
|
+
}
|
|
430
|
+
else if (str.slice(-6) === 'Array]') {
|
|
431
|
+
// ArrayBuffer.isView(x)
|
|
432
|
+
// ~> `new` bcuz `Buffer.slice` => ref
|
|
433
|
+
tmp = new _og.constructor(_og);
|
|
434
|
+
}
|
|
435
|
+
if (tmp) {
|
|
436
|
+
for (list = Object.getOwnPropertySymbols(_og); i < list.length; i++) {
|
|
437
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(_og, list[i]));
|
|
438
|
+
}
|
|
439
|
+
for (i = 0, list = Object.getOwnPropertyNames(_og); i < list.length; i++) {
|
|
440
|
+
if (Object.hasOwnProperty.call(tmp, (k = list[i])) && tmp[k] === _og[k])
|
|
441
|
+
continue;
|
|
442
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(_og, k));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return tmp || _og;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
const hasCookie = (name) => {
|
|
449
|
+
if (typeof document === 'undefined') {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
return document.cookie.split(';').some((c) => {
|
|
453
|
+
return c.trim().startsWith(name + '=');
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
const getCookie = (name) => {
|
|
457
|
+
if (typeof document === 'undefined') {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
// From https://stackoverflow.com/questions/10730362/get-cookie-by-name
|
|
461
|
+
return ('; ' + document.cookie).split(`; ${name}=`).pop()?.split(';')[0];
|
|
462
|
+
};
|
|
463
|
+
const setCookie = (name, data, expiresInDays = 30, domain = getDomain()) => {
|
|
464
|
+
if (typeof document === 'undefined') {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const date = new Date();
|
|
468
|
+
date.setTime(date.getTime() + expiresInDays * 24 * 60 * 60 * 1000);
|
|
469
|
+
document.cookie = `${name}=${data}; path=/; expires=${date.toUTCString()}; domain=${domain}; SameSite=Lax;`;
|
|
470
|
+
};
|
|
471
|
+
const deleteCookie = (name, path, domain = getDomain()) => {
|
|
472
|
+
if (hasCookie(name)) {
|
|
473
|
+
document.cookie =
|
|
474
|
+
name +
|
|
475
|
+
'=' +
|
|
476
|
+
(path ? ';path=' + path : '') +
|
|
477
|
+
(domain ? ';domain=' + domain : '') +
|
|
478
|
+
';expires=Thu, 01 Jan 1970 00:00:01 GMT';
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
const getDomain = () => {
|
|
482
|
+
if (typeof navigator === 'undefined') {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
const hostname = window.location.hostname;
|
|
486
|
+
if (hostname.includes('localhost')) {
|
|
487
|
+
return 'localhost';
|
|
488
|
+
}
|
|
489
|
+
const splitHost = hostname.split('.');
|
|
490
|
+
if (splitHost.length > 2) {
|
|
491
|
+
return `${splitHost[splitHost.length - 2]}.${splitHost[splitHost.length - 1]}`;
|
|
492
|
+
}
|
|
493
|
+
return hostname;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
497
|
+
/* eslint-disable no-var */
|
|
498
|
+
/**
|
|
499
|
+
* Stolen from dequal to avoid adding a dependency
|
|
500
|
+
* https://github.com/lukeed/dequal
|
|
501
|
+
*
|
|
502
|
+
* The MIT License (MIT)
|
|
503
|
+
*
|
|
504
|
+
* Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
505
|
+
*
|
|
506
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
507
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
508
|
+
* in the Software without restriction, including without limitation the rights
|
|
509
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
510
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
511
|
+
* furnished to do so, subject to the following conditions:
|
|
512
|
+
*
|
|
513
|
+
* The above copyright notice and this permission notice shall be included in
|
|
514
|
+
* all copies or substantial portions of the Software.
|
|
515
|
+
*
|
|
516
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
517
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
518
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
519
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
520
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
521
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
522
|
+
* THE SOFTWARE.
|
|
523
|
+
*/
|
|
524
|
+
const has = Object.prototype.hasOwnProperty;
|
|
525
|
+
function find(iter, tar, key) {
|
|
526
|
+
for (key of iter.keys()) {
|
|
527
|
+
if (equal(key, tar))
|
|
528
|
+
return key;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const equal = (foo, bar) => {
|
|
532
|
+
var ctor, len, tmp;
|
|
533
|
+
if (foo === bar)
|
|
534
|
+
return true;
|
|
535
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
536
|
+
if (ctor === Date)
|
|
537
|
+
return foo.getTime() === bar.getTime();
|
|
538
|
+
if (ctor === RegExp)
|
|
539
|
+
return foo.toString() === bar.toString();
|
|
540
|
+
if (ctor === Array) {
|
|
541
|
+
if ((len = foo.length) === bar.length) {
|
|
542
|
+
while (len-- && equal(foo[len], bar[len]))
|
|
543
|
+
;
|
|
544
|
+
}
|
|
545
|
+
return len === -1;
|
|
546
|
+
}
|
|
547
|
+
if (ctor === Set) {
|
|
548
|
+
if (foo.size !== bar.size) {
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
for (len of foo) {
|
|
552
|
+
tmp = len;
|
|
553
|
+
if (tmp && typeof tmp === 'object') {
|
|
554
|
+
tmp = find(bar, tmp);
|
|
555
|
+
if (!tmp)
|
|
556
|
+
return false;
|
|
557
|
+
}
|
|
558
|
+
if (!bar.has(tmp))
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
if (ctor === Map) {
|
|
564
|
+
if (foo.size !== bar.size) {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
for (len of foo) {
|
|
568
|
+
tmp = len[0];
|
|
569
|
+
if (tmp && typeof tmp === 'object') {
|
|
570
|
+
tmp = find(bar, tmp);
|
|
571
|
+
if (!tmp)
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
if (!equal(len[1], bar.get(tmp))) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return true;
|
|
579
|
+
}
|
|
580
|
+
if (ctor === ArrayBuffer) {
|
|
581
|
+
foo = new Uint8Array(foo);
|
|
582
|
+
bar = new Uint8Array(bar);
|
|
583
|
+
}
|
|
584
|
+
else if (ctor === DataView) {
|
|
585
|
+
if ((len = foo.byteLength) === bar.byteLength) {
|
|
586
|
+
while (len-- && foo.getInt8(len) === bar.getInt8(len))
|
|
587
|
+
;
|
|
588
|
+
}
|
|
589
|
+
return len === -1;
|
|
590
|
+
}
|
|
591
|
+
if (ArrayBuffer.isView(foo)) {
|
|
592
|
+
if ((len = foo.byteLength) === bar.byteLength) {
|
|
593
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
594
|
+
//@ts-ignore
|
|
595
|
+
while (len-- && foo[len] === bar[len])
|
|
596
|
+
;
|
|
597
|
+
}
|
|
598
|
+
return len === -1;
|
|
599
|
+
}
|
|
600
|
+
if (!ctor || typeof foo === 'object') {
|
|
601
|
+
len = 0;
|
|
602
|
+
for (ctor in foo) {
|
|
603
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor))
|
|
604
|
+
return false;
|
|
605
|
+
if (!(ctor in bar) || !equal(foo[ctor], bar[ctor]))
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
return Object.keys(bar).length === len;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return foo !== foo && bar !== bar;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
const createMediaQueryObservable = (query) => {
|
|
615
|
+
const mq = window.matchMedia(query);
|
|
616
|
+
const observable = new Observable((observer) => {
|
|
617
|
+
const eventHandler = (event) => {
|
|
618
|
+
observer.next(event);
|
|
619
|
+
};
|
|
620
|
+
mq.addEventListener('change', eventHandler);
|
|
621
|
+
return () => {
|
|
622
|
+
mq.removeEventListener('change', eventHandler);
|
|
623
|
+
};
|
|
624
|
+
}).pipe(startWith(mq), map(({ matches }) => ({
|
|
625
|
+
matches,
|
|
626
|
+
query,
|
|
627
|
+
})));
|
|
628
|
+
return observable;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
const isAttributeRenderBinding = (value) => typeof value === 'boolean';
|
|
632
|
+
const isAttributeValueBinding = (value) => typeof value === 'object';
|
|
633
|
+
const createReactiveBindings = (...values) => {
|
|
634
|
+
const rootElementRef = inject(ElementRef);
|
|
635
|
+
const destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
636
|
+
const subscriptions = [];
|
|
637
|
+
const pushedAttributes = [];
|
|
638
|
+
const defaults = {};
|
|
639
|
+
const push = (value) => {
|
|
640
|
+
const { attribute, observable, elementRef } = value;
|
|
641
|
+
const elRef = elementRef || rootElementRef;
|
|
642
|
+
const attributes = Array.isArray(attribute) ? attribute : [attribute];
|
|
643
|
+
pushedAttributes.push(attributes);
|
|
644
|
+
for (const attribute of attributes) {
|
|
645
|
+
if (!defaults[attribute]) {
|
|
646
|
+
defaults[attribute] = elRef.nativeElement.getAttribute(attribute) || undefined;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
const subscription = observable
|
|
650
|
+
.pipe(takeUntil(destroy$), distinctUntilChanged((a, b) => {
|
|
651
|
+
if (isAttributeRenderBinding(a) && isAttributeRenderBinding(b)) {
|
|
652
|
+
return a === b;
|
|
653
|
+
}
|
|
654
|
+
else if (isAttributeValueBinding(a) && isAttributeValueBinding(b)) {
|
|
655
|
+
return a.render === b.render && a.value === b.value;
|
|
656
|
+
}
|
|
657
|
+
return false;
|
|
658
|
+
}))
|
|
659
|
+
.subscribe((value) => {
|
|
660
|
+
const currentAttributes = pushedAttributes.find((s) => s.some((current) => attributes.includes(current))) || [];
|
|
661
|
+
for (const attribute of currentAttributes) {
|
|
662
|
+
const isSingleClassMutation = attribute.startsWith('class.');
|
|
663
|
+
const isMultipleClassMutation = attribute === 'class';
|
|
664
|
+
const render = isAttributeRenderBinding(value) ? value : value.render;
|
|
665
|
+
if (isSingleClassMutation) {
|
|
666
|
+
const className = attribute.replace('class.', '');
|
|
667
|
+
if (!className) {
|
|
668
|
+
continue;
|
|
669
|
+
}
|
|
670
|
+
if (!render) {
|
|
671
|
+
elRef.nativeElement.classList.remove(className);
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
elRef.nativeElement.classList.add(className);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
else if (isMultipleClassMutation) {
|
|
678
|
+
const classes = isAttributeRenderBinding(value) ? '' : `${value.value}`;
|
|
679
|
+
if (!classes) {
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
if (!render) {
|
|
683
|
+
elRef.nativeElement.classList.remove(...classes.split(' '));
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
elRef.nativeElement.classList.add(...classes.split(' '));
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
const attributeValue = isAttributeRenderBinding(value) ? true : `${value.value}`;
|
|
691
|
+
if (!attribute) {
|
|
692
|
+
continue;
|
|
693
|
+
}
|
|
694
|
+
if (!render) {
|
|
695
|
+
elRef.nativeElement.removeAttribute(attribute);
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
elRef.nativeElement.setAttribute(attribute, `${attributeValue}`);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
subscriptions.push({ attributes, subscription });
|
|
704
|
+
};
|
|
705
|
+
const remove = (...attributes) => {
|
|
706
|
+
for (const attribute of attributes) {
|
|
707
|
+
const sub = subscriptions.find((s) => s.attributes.includes(attribute));
|
|
708
|
+
const attributeStack = pushedAttributes.find((a) => a.includes(attribute));
|
|
709
|
+
if (sub) {
|
|
710
|
+
sub.attributes = sub.attributes.filter((a) => a !== attribute);
|
|
711
|
+
attributeStack?.splice(attributeStack.indexOf(attribute), 1);
|
|
712
|
+
if (sub.attributes.length === 0) {
|
|
713
|
+
sub.subscription.unsubscribe();
|
|
714
|
+
subscriptions.splice(subscriptions.indexOf(sub), 1);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const reset = () => {
|
|
720
|
+
for (const attribute in defaults) {
|
|
721
|
+
if (defaults[attribute] === undefined) {
|
|
722
|
+
rootElementRef.nativeElement.removeAttribute(attribute);
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
rootElementRef.nativeElement.setAttribute(attribute, defaults[attribute]);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
for (const value of values) {
|
|
730
|
+
push(value);
|
|
731
|
+
}
|
|
732
|
+
return {
|
|
733
|
+
push,
|
|
734
|
+
remove,
|
|
735
|
+
reset,
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
const elementCanScroll = (element) => {
|
|
740
|
+
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
741
|
+
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const provideViewportConfig = (viewportConfig) => {
|
|
745
|
+
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const routerDisableScrollTop = (config = {}) => {
|
|
749
|
+
if (!config.asReturnRoute) {
|
|
750
|
+
return {
|
|
751
|
+
disableScrollTop: true,
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
return {
|
|
755
|
+
disableScrollTopAsReturnRoute: true,
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
class RouterStateService {
|
|
759
|
+
get route$() {
|
|
760
|
+
return this._route$.asObservable();
|
|
761
|
+
}
|
|
762
|
+
get state$() {
|
|
763
|
+
return this._state$.asObservable();
|
|
764
|
+
}
|
|
765
|
+
constructor() {
|
|
766
|
+
this._isScrollTopOnNavigationEnabled = false;
|
|
767
|
+
this._router = inject(Router);
|
|
768
|
+
this._route$ = new BehaviorSubject('/');
|
|
769
|
+
this._state$ = new BehaviorSubject({
|
|
770
|
+
title: null,
|
|
771
|
+
fragment: null,
|
|
772
|
+
data: {},
|
|
773
|
+
pathParams: {},
|
|
774
|
+
queryParams: {},
|
|
775
|
+
});
|
|
776
|
+
this._router.events
|
|
777
|
+
.pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => {
|
|
778
|
+
const { url } = event;
|
|
779
|
+
const urlWithoutQueryParams = url.split('?')[0];
|
|
780
|
+
const withoutFragment = urlWithoutQueryParams.split('#')[0];
|
|
781
|
+
return withoutFragment;
|
|
782
|
+
}))
|
|
783
|
+
.subscribe(this._route$);
|
|
784
|
+
this._route$
|
|
785
|
+
.pipe(map(() => {
|
|
786
|
+
let route = this._router.routerState.snapshot.root;
|
|
787
|
+
while (route.firstChild) {
|
|
788
|
+
route = route.firstChild;
|
|
789
|
+
}
|
|
790
|
+
const { data, params, queryParams, title, fragment } = route;
|
|
791
|
+
return {
|
|
792
|
+
data,
|
|
793
|
+
pathParams: params,
|
|
794
|
+
queryParams,
|
|
795
|
+
title: title ?? null,
|
|
796
|
+
fragment,
|
|
797
|
+
};
|
|
798
|
+
}))
|
|
799
|
+
.subscribe(this._state$);
|
|
800
|
+
}
|
|
801
|
+
enableScrollEnhancements(config = {}) {
|
|
802
|
+
if (this._isScrollTopOnNavigationEnabled) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
this._isScrollTopOnNavigationEnabled = true;
|
|
806
|
+
combineLatest([this._state$.pipe(pairwise()), this._route$.pipe(pairwise())])
|
|
807
|
+
.pipe(debounceTime(1))
|
|
808
|
+
.subscribe(([[prevState, currState], [prevRoute, currRoute]]) => {
|
|
809
|
+
const sameUrlNavigation = prevRoute === currRoute && equal(prevState.pathParams, currState.pathParams);
|
|
810
|
+
const didFragmentChange = prevState.fragment !== currState.fragment;
|
|
811
|
+
if (sameUrlNavigation) {
|
|
812
|
+
const allQueryParams = [
|
|
813
|
+
...new Set(Object.keys(prevState.queryParams).concat(Object.keys(currState.queryParams))),
|
|
814
|
+
];
|
|
815
|
+
const changedQueryParams = allQueryParams.filter((key) => currState.queryParams[key] !== prevState.queryParams[key]);
|
|
816
|
+
if (!config.queryParamTriggerList?.length && !didFragmentChange) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
const caseQueryParams = changedQueryParams.some((key) => config.queryParamTriggerList?.includes(key));
|
|
820
|
+
const caseFragment = didFragmentChange && config.fragment?.enabled;
|
|
821
|
+
if (caseQueryParams) {
|
|
822
|
+
(config.scrollElement ?? document.documentElement).scrollTop = 0;
|
|
823
|
+
}
|
|
824
|
+
else if (caseFragment) {
|
|
825
|
+
const fragmentElement = document.getElementById(currState.fragment ?? '');
|
|
826
|
+
if (fragmentElement) {
|
|
827
|
+
fragmentElement.scrollIntoView({ behavior: config.fragment?.smooth ? 'smooth' : 'auto' });
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
else {
|
|
832
|
+
if (!(currState.data['disableScrollTopAsReturnRoute'] && prevState.data['disableScrollTop']) &&
|
|
833
|
+
!currState.data['disableScrollTop']) {
|
|
834
|
+
(config.scrollElement ?? document.documentElement).scrollTop = 0;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
selectQueryParam(key) {
|
|
840
|
+
return this._state$.pipe(map((state) => state.queryParams[key]));
|
|
326
841
|
}
|
|
842
|
+
selectPathParam(key) {
|
|
843
|
+
return this._state$.pipe(map((state) => state.pathParams[key]));
|
|
844
|
+
}
|
|
845
|
+
selectData(key) {
|
|
846
|
+
return this._state$.pipe(map((state) => state.data[key]));
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
RouterStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
850
|
+
RouterStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, providedIn: 'root' });
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RouterStateService, decorators: [{
|
|
852
|
+
type: Injectable,
|
|
853
|
+
args: [{
|
|
854
|
+
providedIn: 'root',
|
|
855
|
+
}]
|
|
856
|
+
}], ctorParameters: function () { return []; } });
|
|
857
|
+
|
|
858
|
+
class ViewportService {
|
|
327
859
|
get isXs$() {
|
|
328
860
|
return this._isXs$.asObservable();
|
|
329
861
|
}
|
|
@@ -363,6 +895,18 @@ class ViewportService {
|
|
|
363
895
|
get currentViewport() {
|
|
364
896
|
return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
|
|
365
897
|
}
|
|
898
|
+
constructor(_viewportConfig, _breakpointObserver) {
|
|
899
|
+
this._breakpointObserver = _breakpointObserver;
|
|
900
|
+
this._isXs$ = new BehaviorSubject(false);
|
|
901
|
+
this._isSm$ = new BehaviorSubject(false);
|
|
902
|
+
this._isMd$ = new BehaviorSubject(false);
|
|
903
|
+
this._isLg$ = new BehaviorSubject(false);
|
|
904
|
+
this._isXl$ = new BehaviorSubject(false);
|
|
905
|
+
this._is2Xl$ = new BehaviorSubject(false);
|
|
906
|
+
this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), shareReplay());
|
|
907
|
+
this._viewportConfig = _viewportConfig || DEFAULT_VIEWPORT_CONFIG;
|
|
908
|
+
this._observeDefaultBreakpoints();
|
|
909
|
+
}
|
|
366
910
|
observe(options) {
|
|
367
911
|
const mediaQuery = this._buildMediaQuery(options);
|
|
368
912
|
return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay());
|
|
@@ -441,8 +985,8 @@ class ViewportService {
|
|
|
441
985
|
return 'xs';
|
|
442
986
|
}
|
|
443
987
|
}
|
|
444
|
-
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
445
|
-
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.
|
|
988
|
+
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 });
|
|
989
|
+
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, providedIn: 'root' });
|
|
446
990
|
__decorate([
|
|
447
991
|
Memo(),
|
|
448
992
|
__metadata("design:type", Function),
|
|
@@ -459,7 +1003,7 @@ __decorate([
|
|
|
459
1003
|
__metadata("design:paramtypes", [Object]),
|
|
460
1004
|
__metadata("design:returntype", void 0)
|
|
461
1005
|
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1006
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ViewportService, decorators: [{
|
|
463
1007
|
type: Injectable,
|
|
464
1008
|
args: [{
|
|
465
1009
|
providedIn: 'root',
|
|
@@ -471,6 +1015,189 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
471
1015
|
type: Optional
|
|
472
1016
|
}] }, { type: i1.BreakpointObserver }]; }, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
|
|
473
1017
|
|
|
1018
|
+
const ANIMATABLE_TOKEN = new InjectionToken('ANIMATABLE_DIRECTIVE_TOKEN');
|
|
1019
|
+
class AnimatableDirective {
|
|
1020
|
+
constructor() {
|
|
1021
|
+
this._didEmitStart = false;
|
|
1022
|
+
this._parent = inject(ANIMATABLE_TOKEN, { optional: true, skipSelf: true });
|
|
1023
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
1024
|
+
this._elementRef = inject(ElementRef);
|
|
1025
|
+
this._animationStart$ = new Subject();
|
|
1026
|
+
this._animationEnd$ = new Subject();
|
|
1027
|
+
this.animationStart$ = this._animationStart$.asObservable().pipe(debounceTime(0));
|
|
1028
|
+
this.animationEnd$ = this._animationEnd$.asObservable().pipe(debounceTime(0));
|
|
1029
|
+
this._hostActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1030
|
+
this._totalActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1031
|
+
this.isAnimating$ = this._totalActiveAnimationCount$.pipe(map((count) => count > 0), debounceTime(0));
|
|
1032
|
+
}
|
|
1033
|
+
ngOnInit() {
|
|
1034
|
+
merge(fromEvent(this._elementRef.nativeElement, 'animationstart'), fromEvent(this._elementRef.nativeElement, 'transitionstart'))
|
|
1035
|
+
.pipe(tap(() => {
|
|
1036
|
+
const count = this._hostActiveAnimationCount$.value + 1;
|
|
1037
|
+
this._hostActiveAnimationCount$.next(count);
|
|
1038
|
+
this._totalActiveAnimationCount$.next(count);
|
|
1039
|
+
}), takeUntil(this._destroy$))
|
|
1040
|
+
.subscribe();
|
|
1041
|
+
merge(fromEvent(this._elementRef.nativeElement, 'animationend'), fromEvent(this._elementRef.nativeElement, 'animationcancel'), fromEvent(this._elementRef.nativeElement, 'transitionend'), fromEvent(this._elementRef.nativeElement, 'transitioncancel'))
|
|
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
|
+
this._totalActiveAnimationCount$
|
|
1049
|
+
.pipe(tap((count) => {
|
|
1050
|
+
if (count > 0 && !this._didEmitStart) {
|
|
1051
|
+
this._animationStart$.next();
|
|
1052
|
+
this._didEmitStart = true;
|
|
1053
|
+
}
|
|
1054
|
+
else if (count === 0) {
|
|
1055
|
+
this._animationEnd$.next();
|
|
1056
|
+
this._didEmitStart = false;
|
|
1057
|
+
}
|
|
1058
|
+
}), takeUntil(this._destroy$))
|
|
1059
|
+
.subscribe();
|
|
1060
|
+
if (this._parent) {
|
|
1061
|
+
this._parent._hostActiveAnimationCount$
|
|
1062
|
+
.pipe(takeUntil(this._destroy$), tap((count) => {
|
|
1063
|
+
this._totalActiveAnimationCount$.next(count + this._hostActiveAnimationCount$.value);
|
|
1064
|
+
}))
|
|
1065
|
+
.subscribe();
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
AnimatableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1070
|
+
AnimatableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatableDirective, isStandalone: true, selector: "[etAnimatable]", providers: [
|
|
1071
|
+
{
|
|
1072
|
+
provide: ANIMATABLE_TOKEN,
|
|
1073
|
+
useExisting: AnimatableDirective,
|
|
1074
|
+
},
|
|
1075
|
+
DestroyService,
|
|
1076
|
+
], exportAs: ["etAnimatable"], ngImport: i0 });
|
|
1077
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatableDirective, decorators: [{
|
|
1078
|
+
type: Directive,
|
|
1079
|
+
args: [{
|
|
1080
|
+
selector: '[etAnimatable]',
|
|
1081
|
+
exportAs: 'etAnimatable',
|
|
1082
|
+
standalone: true,
|
|
1083
|
+
providers: [
|
|
1084
|
+
{
|
|
1085
|
+
provide: ANIMATABLE_TOKEN,
|
|
1086
|
+
useExisting: AnimatableDirective,
|
|
1087
|
+
},
|
|
1088
|
+
DestroyService,
|
|
1089
|
+
],
|
|
1090
|
+
}]
|
|
1091
|
+
}] });
|
|
1092
|
+
|
|
1093
|
+
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
1094
|
+
const ANIMATION_CLASSES = {
|
|
1095
|
+
enterFrom: 'et-animation-enter-from',
|
|
1096
|
+
enterActive: 'et-animation-enter-active',
|
|
1097
|
+
enterTo: 'et-animation-enter-to',
|
|
1098
|
+
leaveFrom: 'et-animation-leave-from',
|
|
1099
|
+
leaveActive: 'et-animation-leave-active',
|
|
1100
|
+
leaveTo: 'et-animation-leave-to',
|
|
1101
|
+
};
|
|
1102
|
+
class AnimatedLifecycleDirective {
|
|
1103
|
+
constructor() {
|
|
1104
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
1105
|
+
this._elementRef = inject(ElementRef);
|
|
1106
|
+
this._animatable = inject(ANIMATABLE_TOKEN);
|
|
1107
|
+
this._classList = this._elementRef.nativeElement.classList;
|
|
1108
|
+
this._state$ = new BehaviorSubject('init');
|
|
1109
|
+
this.state$ = this._state$.asObservable();
|
|
1110
|
+
this._bindings = createReactiveBindings({
|
|
1111
|
+
attribute: 'class.et-force-invisible',
|
|
1112
|
+
observable: this._state$.pipe(map((state) => state === 'init')),
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
get state() {
|
|
1116
|
+
return this._state$.value;
|
|
1117
|
+
}
|
|
1118
|
+
enter(config) {
|
|
1119
|
+
if (this.state !== 'init' && this.state !== 'left' && isDevMode()) {
|
|
1120
|
+
throw new Error('Tried to enter but the element is not in the initial state.');
|
|
1121
|
+
}
|
|
1122
|
+
this._state$.next('entering');
|
|
1123
|
+
if (!config?.onlyTransition) {
|
|
1124
|
+
this._classList.add(ANIMATION_CLASSES.enterFrom);
|
|
1125
|
+
}
|
|
1126
|
+
forceReflow();
|
|
1127
|
+
this._classList.add(ANIMATION_CLASSES.enterActive);
|
|
1128
|
+
fromNextFrame()
|
|
1129
|
+
.pipe(tap(() => {
|
|
1130
|
+
if (!config?.onlyTransition) {
|
|
1131
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1132
|
+
this._classList.add(ANIMATION_CLASSES.enterTo);
|
|
1133
|
+
}
|
|
1134
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1135
|
+
this._state$.next('entered');
|
|
1136
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1137
|
+
if (!config?.onlyTransition) {
|
|
1138
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1139
|
+
}
|
|
1140
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1141
|
+
.subscribe();
|
|
1142
|
+
}
|
|
1143
|
+
leave(config) {
|
|
1144
|
+
if (this.state !== 'entered' && this.state !== 'entering' && isDevMode()) {
|
|
1145
|
+
throw new Error('Tried to leave while already leaving or left');
|
|
1146
|
+
}
|
|
1147
|
+
if (this._classList.contains(ANIMATION_CLASSES.enterFrom) ||
|
|
1148
|
+
this._classList.contains(ANIMATION_CLASSES.enterActive) ||
|
|
1149
|
+
this._classList.contains(ANIMATION_CLASSES.enterTo)) {
|
|
1150
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
1151
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
1152
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1153
|
+
}
|
|
1154
|
+
this._state$.next('leaving');
|
|
1155
|
+
if (!config?.onlyTransition) {
|
|
1156
|
+
this._classList.add(ANIMATION_CLASSES.leaveFrom);
|
|
1157
|
+
}
|
|
1158
|
+
forceReflow();
|
|
1159
|
+
this._classList.add(ANIMATION_CLASSES.leaveActive);
|
|
1160
|
+
fromNextFrame()
|
|
1161
|
+
.pipe(tap(() => {
|
|
1162
|
+
if (!config?.onlyTransition) {
|
|
1163
|
+
this._classList.remove(ANIMATION_CLASSES.leaveFrom);
|
|
1164
|
+
this._classList.add(ANIMATION_CLASSES.leaveTo);
|
|
1165
|
+
}
|
|
1166
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
1167
|
+
this._state$.next('left');
|
|
1168
|
+
this._classList.remove(ANIMATION_CLASSES.leaveActive);
|
|
1169
|
+
if (!config?.onlyTransition) {
|
|
1170
|
+
this._classList.remove(ANIMATION_CLASSES.leaveTo);
|
|
1171
|
+
}
|
|
1172
|
+
}), takeUntil(this._destroy$), take(1))
|
|
1173
|
+
.subscribe();
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
AnimatedLifecycleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1177
|
+
AnimatedLifecycleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: AnimatedLifecycleDirective, isStandalone: true, selector: "[etAnimatedLifecycle]", providers: [
|
|
1178
|
+
{
|
|
1179
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1180
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1181
|
+
},
|
|
1182
|
+
DestroyService,
|
|
1183
|
+
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 });
|
|
1184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
1185
|
+
type: Directive,
|
|
1186
|
+
args: [{
|
|
1187
|
+
selector: '[etAnimatedLifecycle]',
|
|
1188
|
+
exportAs: 'etAnimatedLifecycle',
|
|
1189
|
+
standalone: true,
|
|
1190
|
+
providers: [
|
|
1191
|
+
{
|
|
1192
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
1193
|
+
useExisting: AnimatedLifecycleDirective,
|
|
1194
|
+
},
|
|
1195
|
+
DestroyService,
|
|
1196
|
+
],
|
|
1197
|
+
hostDirectives: [AnimatableDirective],
|
|
1198
|
+
}]
|
|
1199
|
+
}] });
|
|
1200
|
+
|
|
474
1201
|
class ClickOutsideDirective {
|
|
475
1202
|
constructor() {
|
|
476
1203
|
this._elementRef = inject(ElementRef);
|
|
@@ -493,9 +1220,9 @@ class ClickOutsideDirective {
|
|
|
493
1220
|
this._subscription?.unsubscribe();
|
|
494
1221
|
}
|
|
495
1222
|
}
|
|
496
|
-
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
497
|
-
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1223
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1224
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
499
1226
|
type: Directive,
|
|
500
1227
|
args: [{
|
|
501
1228
|
selector: '[etClickOutside]',
|
|
@@ -505,26 +1232,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
505
1232
|
type: Output
|
|
506
1233
|
}] } });
|
|
507
1234
|
|
|
508
|
-
const provideViewportConfig = (viewportConfig) => {
|
|
509
|
-
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
const clamp = (value, min = 0, max = 100) => {
|
|
513
|
-
return Math.max(min, Math.min(max, value));
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
const elementCanScroll = (element) => {
|
|
517
|
-
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
518
|
-
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
519
|
-
};
|
|
520
|
-
|
|
521
1235
|
const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
|
|
522
1236
|
const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
|
|
523
1237
|
|
|
524
1238
|
class CursorDragScrollDirective {
|
|
525
1239
|
constructor() {
|
|
526
1240
|
this._subscriptions = [];
|
|
527
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1241
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
528
1242
|
this._elementRef = inject(ElementRef);
|
|
529
1243
|
this._contentObserverService = inject(ContentObserverService);
|
|
530
1244
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -646,9 +1360,9 @@ class CursorDragScrollDirective {
|
|
|
646
1360
|
}
|
|
647
1361
|
}
|
|
648
1362
|
}
|
|
649
|
-
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
650
|
-
CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
651
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1363
|
+
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1364
|
+
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 });
|
|
1365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
652
1366
|
type: Directive,
|
|
653
1367
|
args: [{
|
|
654
1368
|
selector: '[etCursorDragScroll]',
|
|
@@ -661,25 +1375,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
661
1375
|
args: ['etCursorDragScroll']
|
|
662
1376
|
}] } });
|
|
663
1377
|
|
|
664
|
-
class DestroyDirective {
|
|
665
|
-
constructor() {
|
|
666
|
-
this._destroy$ = new Subject();
|
|
667
|
-
this.destroy$ = this._destroy$.asObservable();
|
|
668
|
-
}
|
|
669
|
-
ngOnDestroy() {
|
|
670
|
-
this._destroy$.next(true);
|
|
671
|
-
this._destroy$.unsubscribe();
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
DestroyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: DestroyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
675
|
-
DestroyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0", type: DestroyDirective, isStandalone: true, ngImport: i0 });
|
|
676
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: DestroyDirective, decorators: [{
|
|
677
|
-
type: Directive,
|
|
678
|
-
args: [{
|
|
679
|
-
standalone: true,
|
|
680
|
-
}]
|
|
681
|
-
}] });
|
|
682
|
-
|
|
683
1378
|
class LetContext {
|
|
684
1379
|
constructor() {
|
|
685
1380
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -690,6 +1385,10 @@ class LetContext {
|
|
|
690
1385
|
}
|
|
691
1386
|
|
|
692
1387
|
class LetDirective {
|
|
1388
|
+
set etLet(value) {
|
|
1389
|
+
this._context.$implicit = this._context.etLet = value;
|
|
1390
|
+
this._updateView();
|
|
1391
|
+
}
|
|
693
1392
|
constructor(_viewContainer, templateRef) {
|
|
694
1393
|
this._viewContainer = _viewContainer;
|
|
695
1394
|
this._context = new LetContext();
|
|
@@ -697,10 +1396,6 @@ class LetDirective {
|
|
|
697
1396
|
this._viewRef = null;
|
|
698
1397
|
this._templateRef = templateRef;
|
|
699
1398
|
}
|
|
700
|
-
set etLet(value) {
|
|
701
|
-
this._context.$implicit = this._context.etLet = value;
|
|
702
|
-
this._updateView();
|
|
703
|
-
}
|
|
704
1399
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
705
1400
|
static ngTemplateContextGuard(dir, ctx) {
|
|
706
1401
|
return true;
|
|
@@ -714,9 +1409,9 @@ class LetDirective {
|
|
|
714
1409
|
}
|
|
715
1410
|
}
|
|
716
1411
|
}
|
|
717
|
-
LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
718
|
-
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
719
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1412
|
+
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 });
|
|
1413
|
+
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
|
|
1414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: LetDirective, decorators: [{
|
|
720
1415
|
type: Directive,
|
|
721
1416
|
args: [{
|
|
722
1417
|
selector: '[etLet]',
|
|
@@ -731,7 +1426,7 @@ class ObserveContentDirective {
|
|
|
731
1426
|
this._contentObserver = inject(ContentObserverService);
|
|
732
1427
|
this._elementRef = inject(ElementRef);
|
|
733
1428
|
this._ngZone = inject(NgZone);
|
|
734
|
-
this.
|
|
1429
|
+
this.valueChange = new EventEmitter();
|
|
735
1430
|
this._disabled = false;
|
|
736
1431
|
this._debounce = null;
|
|
737
1432
|
this._currentSubscription = null;
|
|
@@ -762,23 +1457,23 @@ class ObserveContentDirective {
|
|
|
762
1457
|
this._unsubscribe();
|
|
763
1458
|
const stream = this._contentObserver.observe(this._elementRef);
|
|
764
1459
|
this._ngZone.runOutsideAngular(() => {
|
|
765
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.
|
|
1460
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime$1(this.debounce)) : stream).subscribe(this.valueChange);
|
|
766
1461
|
});
|
|
767
1462
|
}
|
|
768
1463
|
_unsubscribe() {
|
|
769
1464
|
this._currentSubscription?.unsubscribe();
|
|
770
1465
|
}
|
|
771
1466
|
}
|
|
772
|
-
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
773
|
-
ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1467
|
+
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1468
|
+
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 });
|
|
1469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
775
1470
|
type: Directive,
|
|
776
1471
|
args: [{
|
|
777
1472
|
selector: '[etObserveContent]',
|
|
778
1473
|
exportAs: 'etObserveContent',
|
|
779
1474
|
standalone: true,
|
|
780
1475
|
}]
|
|
781
|
-
}], propDecorators: {
|
|
1476
|
+
}], propDecorators: { valueChange: [{
|
|
782
1477
|
type: Output,
|
|
783
1478
|
args: ['etObserveContent']
|
|
784
1479
|
}], disabled: [{
|
|
@@ -794,7 +1489,7 @@ class ObserveResizeDirective {
|
|
|
794
1489
|
this._resizeObserver = inject(ResizeObserverService);
|
|
795
1490
|
this._elementRef = inject(ElementRef);
|
|
796
1491
|
this._ngZone = inject(NgZone);
|
|
797
|
-
this.
|
|
1492
|
+
this.valueChange = new EventEmitter();
|
|
798
1493
|
this._disabled = false;
|
|
799
1494
|
this._debounce = null;
|
|
800
1495
|
this._currentSubscription = null;
|
|
@@ -825,23 +1520,23 @@ class ObserveResizeDirective {
|
|
|
825
1520
|
this._unsubscribe();
|
|
826
1521
|
const stream = this._resizeObserver.observe(this._elementRef);
|
|
827
1522
|
this._ngZone.runOutsideAngular(() => {
|
|
828
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.
|
|
1523
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.valueChange);
|
|
829
1524
|
});
|
|
830
1525
|
}
|
|
831
1526
|
_unsubscribe() {
|
|
832
1527
|
this._currentSubscription?.unsubscribe();
|
|
833
1528
|
}
|
|
834
1529
|
}
|
|
835
|
-
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
836
|
-
ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
837
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1530
|
+
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1531
|
+
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 });
|
|
1532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
838
1533
|
type: Directive,
|
|
839
1534
|
args: [{
|
|
840
1535
|
selector: '[etObserveResize]',
|
|
841
1536
|
exportAs: 'etObserveResize',
|
|
842
1537
|
standalone: true,
|
|
843
1538
|
}]
|
|
844
|
-
}], propDecorators: {
|
|
1539
|
+
}], propDecorators: { valueChange: [{
|
|
845
1540
|
type: Output,
|
|
846
1541
|
args: ['etObserveResize']
|
|
847
1542
|
}], disabled: [{
|
|
@@ -864,9 +1559,9 @@ class ScrollObserverFirstElementDirective {
|
|
|
864
1559
|
this._isFirstElement = coerceBooleanProperty(value);
|
|
865
1560
|
}
|
|
866
1561
|
}
|
|
867
|
-
ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
868
|
-
ScrollObserverFirstElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1562
|
+
ScrollObserverFirstElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1563
|
+
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 });
|
|
1564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
|
|
870
1565
|
type: Directive,
|
|
871
1566
|
args: [{
|
|
872
1567
|
selector: '[etScrollObserverFirstElement]',
|
|
@@ -883,9 +1578,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
883
1578
|
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
884
1579
|
class ScrollObserverIgnoreTargetDirective {
|
|
885
1580
|
}
|
|
886
|
-
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
887
|
-
ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
888
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1581
|
+
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1582
|
+
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 });
|
|
1583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
889
1584
|
type: Directive,
|
|
890
1585
|
args: [{
|
|
891
1586
|
selector: '[etScrollObserverIgnoreTarget]',
|
|
@@ -908,9 +1603,9 @@ class ScrollObserverLastElementDirective {
|
|
|
908
1603
|
this._isLastElement = coerceBooleanProperty(value);
|
|
909
1604
|
}
|
|
910
1605
|
}
|
|
911
|
-
ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
912
|
-
ScrollObserverLastElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
913
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1606
|
+
ScrollObserverLastElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1607
|
+
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 });
|
|
1608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
|
|
914
1609
|
type: Directive,
|
|
915
1610
|
args: [{
|
|
916
1611
|
selector: '[etScrollObserverLastElement]',
|
|
@@ -931,7 +1626,7 @@ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
|
|
|
931
1626
|
|
|
932
1627
|
class ObserveScrollStateDirective {
|
|
933
1628
|
constructor() {
|
|
934
|
-
this._destroy$ = inject(DestroyService).destroy$;
|
|
1629
|
+
this._destroy$ = inject(DestroyService, { host: true }).destroy$;
|
|
935
1630
|
this._elementRef = inject(ElementRef);
|
|
936
1631
|
this._contentObserverService = inject(ContentObserverService);
|
|
937
1632
|
this._resizeObserverService = inject(ResizeObserverService);
|
|
@@ -942,7 +1637,7 @@ class ObserveScrollStateDirective {
|
|
|
942
1637
|
this._rootMargin = 0;
|
|
943
1638
|
this._threshold = 1;
|
|
944
1639
|
this._intersectionObserver = null;
|
|
945
|
-
this.
|
|
1640
|
+
this.valueChange = new EventEmitter();
|
|
946
1641
|
}
|
|
947
1642
|
get _firstCurrentChild() {
|
|
948
1643
|
const explicitFirstElement = this._elementRef.nativeElement.querySelector(`.${SCROLL_OBSERVER_FIRST_ELEMENT_CLASS}`);
|
|
@@ -999,7 +1694,7 @@ class ObserveScrollStateDirective {
|
|
|
999
1694
|
!elementCanScroll(this._elementRef.nativeElement)) {
|
|
1000
1695
|
this._unobserveChild('first');
|
|
1001
1696
|
this._unobserveChild('last');
|
|
1002
|
-
this.
|
|
1697
|
+
this.valueChange.emit({
|
|
1003
1698
|
isAtStart: true,
|
|
1004
1699
|
isAtEnd: true,
|
|
1005
1700
|
canScroll: false,
|
|
@@ -1016,7 +1711,7 @@ class ObserveScrollStateDirective {
|
|
|
1016
1711
|
const { first, last } = this._observedChildren;
|
|
1017
1712
|
const isAtStart = entries.find((entry) => entry.target === first)?.isIntersecting ?? false;
|
|
1018
1713
|
const isAtEnd = entries.find((entry) => entry.target === last)?.isIntersecting ?? false;
|
|
1019
|
-
this.
|
|
1714
|
+
this.valueChange.emit({
|
|
1020
1715
|
isAtStart,
|
|
1021
1716
|
isAtEnd,
|
|
1022
1717
|
canScroll: !isAtStart || !isAtEnd,
|
|
@@ -1060,15 +1755,15 @@ class ObserveScrollStateDirective {
|
|
|
1060
1755
|
return element;
|
|
1061
1756
|
}
|
|
1062
1757
|
}
|
|
1063
|
-
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1064
|
-
ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1758
|
+
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1759
|
+
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: [
|
|
1065
1760
|
{
|
|
1066
1761
|
provide: OBSERVE_SCROLL_STATE,
|
|
1067
1762
|
useExisting: ObserveScrollStateDirective,
|
|
1068
1763
|
},
|
|
1069
1764
|
DestroyService,
|
|
1070
1765
|
], exportAs: ["etObserveScrollState"], ngImport: i0 });
|
|
1071
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
1072
1767
|
type: Directive,
|
|
1073
1768
|
args: [{
|
|
1074
1769
|
selector: '[etObserveScrollState]',
|
|
@@ -1086,34 +1781,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
1086
1781
|
type: Input
|
|
1087
1782
|
}], observerThreshold: [{
|
|
1088
1783
|
type: Input
|
|
1089
|
-
}],
|
|
1090
|
-
type: Output
|
|
1784
|
+
}], valueChange: [{
|
|
1785
|
+
type: Output,
|
|
1786
|
+
args: ['etObserveScrollState']
|
|
1091
1787
|
}] } });
|
|
1092
1788
|
|
|
1093
1789
|
class RepeatDirective {
|
|
1094
|
-
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1095
|
-
this._mainTemplateRef = _mainTemplateRef;
|
|
1096
|
-
this._viewContainerRef = _viewContainerRef;
|
|
1097
|
-
this._repeatCount = 2;
|
|
1098
|
-
}
|
|
1099
1790
|
get repeatCount() {
|
|
1100
1791
|
return this._repeatCount;
|
|
1101
1792
|
}
|
|
1102
1793
|
set repeatCount(value) {
|
|
1103
1794
|
this._repeatCount = coerceNumberProperty(value);
|
|
1104
|
-
}
|
|
1105
|
-
ngOnInit() {
|
|
1106
1795
|
this._render();
|
|
1107
1796
|
}
|
|
1797
|
+
constructor(_mainTemplateRef, _viewContainerRef) {
|
|
1798
|
+
this._mainTemplateRef = _mainTemplateRef;
|
|
1799
|
+
this._viewContainerRef = _viewContainerRef;
|
|
1800
|
+
this._repeatCount = 2;
|
|
1801
|
+
}
|
|
1108
1802
|
_render() {
|
|
1803
|
+
this._viewContainerRef.clear();
|
|
1109
1804
|
for (let i = 0; i < this.repeatCount; i++) {
|
|
1110
1805
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
|
|
1111
1806
|
}
|
|
1112
1807
|
}
|
|
1113
1808
|
}
|
|
1114
|
-
RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1115
|
-
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1809
|
+
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 });
|
|
1810
|
+
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
|
|
1811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
1117
1812
|
type: Directive,
|
|
1118
1813
|
args: [{
|
|
1119
1814
|
selector: '[etRepeat]',
|
|
@@ -1153,6 +1848,10 @@ class SeoDirective {
|
|
|
1153
1848
|
this._cleanUp();
|
|
1154
1849
|
this.parent?._activate();
|
|
1155
1850
|
}
|
|
1851
|
+
// TODO(TRB): This should get split up into multiple methods to make it more readable
|
|
1852
|
+
// - updateTitle
|
|
1853
|
+
// - updateMeta
|
|
1854
|
+
// - updateLink
|
|
1156
1855
|
updateConfig(config) {
|
|
1157
1856
|
this._config = mergeSeoConfig(config, this.parent?.config || {});
|
|
1158
1857
|
if (this._isDeactivated) {
|
|
@@ -1279,9 +1978,9 @@ class SeoDirective {
|
|
|
1279
1978
|
}
|
|
1280
1979
|
}
|
|
1281
1980
|
}
|
|
1282
|
-
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1283
|
-
SeoDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.
|
|
1284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
1981
|
+
SeoDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1982
|
+
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 });
|
|
1983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SeoDirective, decorators: [{
|
|
1285
1984
|
type: Directive,
|
|
1286
1985
|
args: [{
|
|
1287
1986
|
standalone: true,
|
|
@@ -1289,6 +1988,328 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
1289
1988
|
}]
|
|
1290
1989
|
}] });
|
|
1291
1990
|
|
|
1991
|
+
// TODO(TRB): Add correct type once provided by API
|
|
1992
|
+
const normalizeGameResultType = (type) => {
|
|
1993
|
+
if (!type) {
|
|
1994
|
+
return null;
|
|
1995
|
+
}
|
|
1996
|
+
switch (type) {
|
|
1997
|
+
case 'extra_time':
|
|
1998
|
+
return {
|
|
1999
|
+
i18n: 'game-result-type.extra-time',
|
|
2000
|
+
shortCode: 'AET',
|
|
2001
|
+
text: 'After Extra Time',
|
|
2002
|
+
};
|
|
2003
|
+
case 'penalty':
|
|
2004
|
+
return {
|
|
2005
|
+
i18n: 'game-result-type.penalty',
|
|
2006
|
+
shortCode: 'PSO',
|
|
2007
|
+
text: 'Penalty shootout',
|
|
2008
|
+
};
|
|
2009
|
+
case 'golden_goal':
|
|
2010
|
+
return {
|
|
2011
|
+
i18n: 'game-result-type.golden-goal',
|
|
2012
|
+
shortCode: 'GG',
|
|
2013
|
+
text: 'Golden Goal',
|
|
2014
|
+
};
|
|
2015
|
+
case 'default':
|
|
2016
|
+
default:
|
|
2017
|
+
return {
|
|
2018
|
+
i18n: 'game-result-type.full-time',
|
|
2019
|
+
shortCode: 'FT',
|
|
2020
|
+
text: 'Full Time',
|
|
2021
|
+
};
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
class NormalizeGameResultTypePipe {
|
|
2026
|
+
constructor() {
|
|
2027
|
+
this.transform = normalizeGameResultType;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
NormalizeGameResultTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2031
|
+
NormalizeGameResultTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" });
|
|
2032
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
|
|
2033
|
+
type: Pipe,
|
|
2034
|
+
args: [{ name: 'etNormalizeGameResultType', standalone: true }]
|
|
2035
|
+
}] });
|
|
2036
|
+
|
|
2037
|
+
const normalizeMatchState = (match) => {
|
|
2038
|
+
if (match?.isCompletedByReferee) {
|
|
2039
|
+
return "autoWin" /* MatchStateType.AUTO_WIN */;
|
|
2040
|
+
}
|
|
2041
|
+
else if (match?.status === 'preparing') {
|
|
2042
|
+
return "preMatch" /* MatchStateType.PRE_MATCH */;
|
|
2043
|
+
}
|
|
2044
|
+
else if (match?.status === 'started') {
|
|
2045
|
+
return "live" /* MatchStateType.LIVE */;
|
|
2046
|
+
}
|
|
2047
|
+
else if (match?.status === 'published' || match?.status === 'finished') {
|
|
2048
|
+
return "postMatch" /* MatchStateType.POST_MATCH */;
|
|
2049
|
+
}
|
|
2050
|
+
else if (match?.round.state !== 'preparing') {
|
|
2051
|
+
return "preparingRound" /* MatchStateType.PREPARING_ROUND */;
|
|
2052
|
+
}
|
|
2053
|
+
return null;
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
class NormalizeMatchStatePipe {
|
|
2057
|
+
constructor() {
|
|
2058
|
+
this.transform = normalizeMatchState;
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
NormalizeMatchStatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2062
|
+
NormalizeMatchStatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" });
|
|
2063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
|
|
2064
|
+
type: Pipe,
|
|
2065
|
+
args: [{ name: 'etNormalizeMatchState', standalone: true }]
|
|
2066
|
+
}] });
|
|
2067
|
+
|
|
2068
|
+
const normalizeMatchParticipants = (match) => {
|
|
2069
|
+
const matchState = normalizeMatchState(match);
|
|
2070
|
+
if (!match || !matchState) {
|
|
2071
|
+
return null;
|
|
2072
|
+
}
|
|
2073
|
+
return {
|
|
2074
|
+
home: normalizeMatchParticipant(match, 'home'),
|
|
2075
|
+
away: normalizeMatchParticipant(match, 'away'),
|
|
2076
|
+
};
|
|
2077
|
+
};
|
|
2078
|
+
const normalizeMatchParticipant = (match, side) => {
|
|
2079
|
+
const matchState = normalizeMatchState(match);
|
|
2080
|
+
if (!match || !matchState) {
|
|
2081
|
+
return null;
|
|
2082
|
+
}
|
|
2083
|
+
const participant = match[side];
|
|
2084
|
+
const participantType = match.home?.type ?? match.away?.type ?? 'unknown';
|
|
2085
|
+
if (!participant) {
|
|
2086
|
+
if (matchState === "postMatch" /* MatchStateType.POST_MATCH */ || matchState === "autoWin" /* MatchStateType.AUTO_WIN */) {
|
|
2087
|
+
return {
|
|
2088
|
+
participantType,
|
|
2089
|
+
type: 'none',
|
|
2090
|
+
i18n: 'match-participant.none',
|
|
2091
|
+
text: 'No opponent',
|
|
2092
|
+
data: participant,
|
|
2093
|
+
};
|
|
2094
|
+
}
|
|
2095
|
+
else {
|
|
2096
|
+
return {
|
|
2097
|
+
participantType,
|
|
2098
|
+
type: 'tbd',
|
|
2099
|
+
i18n: 'match-participant.tbd',
|
|
2100
|
+
text: 'TBD',
|
|
2101
|
+
data: participant,
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
return {
|
|
2107
|
+
participantType,
|
|
2108
|
+
type: 'participant',
|
|
2109
|
+
data: participant,
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2114
|
+
class NormalizeMatchParticipantsPipe {
|
|
2115
|
+
constructor() {
|
|
2116
|
+
this.transform = normalizeMatchParticipants;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
NormalizeMatchParticipantsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2120
|
+
NormalizeMatchParticipantsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" });
|
|
2121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
|
|
2122
|
+
type: Pipe,
|
|
2123
|
+
args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
|
|
2124
|
+
}] });
|
|
2125
|
+
|
|
2126
|
+
const EMPTY_SCORE = {
|
|
2127
|
+
home: { score: 'match-score.placeholder', isWinner: false },
|
|
2128
|
+
away: { score: 'match-score.placeholder', isWinner: false },
|
|
2129
|
+
isNumeric: false,
|
|
2130
|
+
subLine: null,
|
|
2131
|
+
};
|
|
2132
|
+
const normalizeMatchScore = (match) => {
|
|
2133
|
+
if (!match) {
|
|
2134
|
+
return null;
|
|
2135
|
+
}
|
|
2136
|
+
const matchState = normalizeMatchState(match);
|
|
2137
|
+
const subLine = getMatchScoreSubLine(match);
|
|
2138
|
+
if (!match.homeScore && !match.awayScore) {
|
|
2139
|
+
return { ...EMPTY_SCORE, subLine, isNumeric: false };
|
|
2140
|
+
}
|
|
2141
|
+
if (isKnockoutMatch(match)) {
|
|
2142
|
+
if (matchState === "preMatch" /* MatchStateType.PRE_MATCH */ || matchState === "live" /* MatchStateType.LIVE */) {
|
|
2143
|
+
return { ...EMPTY_SCORE, subLine, isNumeric: false };
|
|
2144
|
+
}
|
|
2145
|
+
return {
|
|
2146
|
+
home: {
|
|
2147
|
+
score: getKnockoutMatchScore(match.homeScore),
|
|
2148
|
+
isWinner: match.homeScore?.status === 'won',
|
|
2149
|
+
},
|
|
2150
|
+
away: {
|
|
2151
|
+
score: getKnockoutMatchScore(match.awayScore),
|
|
2152
|
+
isWinner: match.awayScore?.status === 'won',
|
|
2153
|
+
},
|
|
2154
|
+
subLine,
|
|
2155
|
+
isNumeric: false,
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
else if (isGroupMatch(match)) {
|
|
2159
|
+
if (match.games.length === 1) {
|
|
2160
|
+
// Return the score if only one game has been played
|
|
2161
|
+
return {
|
|
2162
|
+
...getGroupMatchScore(match),
|
|
2163
|
+
subLine,
|
|
2164
|
+
isNumeric: true,
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
else {
|
|
2168
|
+
return {
|
|
2169
|
+
...getGroupMatchPoints(match),
|
|
2170
|
+
subLine,
|
|
2171
|
+
isNumeric: true,
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
else {
|
|
2176
|
+
return {
|
|
2177
|
+
...getGroupMatchScore(match),
|
|
2178
|
+
subLine,
|
|
2179
|
+
isNumeric: true,
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
const isKnockoutMatch = (match) => {
|
|
2184
|
+
if (!match) {
|
|
2185
|
+
return false;
|
|
2186
|
+
}
|
|
2187
|
+
return (match.matchType === 'single_elimination' ||
|
|
2188
|
+
match.matchType === 'double_elimination' ||
|
|
2189
|
+
match.matchType === 'fifa_swiss');
|
|
2190
|
+
};
|
|
2191
|
+
const isGroupMatch = (match) => {
|
|
2192
|
+
if (!match) {
|
|
2193
|
+
return false;
|
|
2194
|
+
}
|
|
2195
|
+
return match.matchType === 'groups' || match.matchType === 'league';
|
|
2196
|
+
};
|
|
2197
|
+
const getKnockoutMatchScore = (score) => {
|
|
2198
|
+
if (score?.status === 'won') {
|
|
2199
|
+
return 'match-score.knockout.won';
|
|
2200
|
+
}
|
|
2201
|
+
else if (score?.status === 'lost') {
|
|
2202
|
+
return 'match-score.knockout.lost';
|
|
2203
|
+
}
|
|
2204
|
+
else if (score?.status === 'tie') {
|
|
2205
|
+
return 'match-score.knockout.tie';
|
|
2206
|
+
}
|
|
2207
|
+
return null;
|
|
2208
|
+
};
|
|
2209
|
+
const getMatchScoreSubLine = (match) => {
|
|
2210
|
+
if (isKnockoutMatch(match)) {
|
|
2211
|
+
return null;
|
|
2212
|
+
}
|
|
2213
|
+
else if (isGroupMatch(match)) {
|
|
2214
|
+
return 'match-score.groups.sub-line';
|
|
2215
|
+
}
|
|
2216
|
+
else {
|
|
2217
|
+
return null;
|
|
2218
|
+
}
|
|
2219
|
+
};
|
|
2220
|
+
const getGroupMatchScore = (match) => {
|
|
2221
|
+
if (!match) {
|
|
2222
|
+
return null;
|
|
2223
|
+
}
|
|
2224
|
+
return {
|
|
2225
|
+
home: {
|
|
2226
|
+
score: match.homeScore?.ownPoints || 0,
|
|
2227
|
+
isWinner: match.homeScore?.status === 'won',
|
|
2228
|
+
},
|
|
2229
|
+
away: {
|
|
2230
|
+
score: match.awayScore?.ownPoints || 0,
|
|
2231
|
+
isWinner: match.awayScore?.status === 'won',
|
|
2232
|
+
},
|
|
2233
|
+
};
|
|
2234
|
+
};
|
|
2235
|
+
const getGroupMatchPoints = (match) => {
|
|
2236
|
+
if (!match) {
|
|
2237
|
+
return null;
|
|
2238
|
+
}
|
|
2239
|
+
return {
|
|
2240
|
+
home: {
|
|
2241
|
+
score: match.homeScore?.score || 0,
|
|
2242
|
+
isWinner: match.homeScore?.status === 'won',
|
|
2243
|
+
},
|
|
2244
|
+
away: {
|
|
2245
|
+
score: match.awayScore?.score || 0,
|
|
2246
|
+
isWinner: match.awayScore?.status === 'won',
|
|
2247
|
+
},
|
|
2248
|
+
};
|
|
2249
|
+
};
|
|
2250
|
+
|
|
2251
|
+
class NormalizeMatchScorePipe {
|
|
2252
|
+
constructor() {
|
|
2253
|
+
this.transform = normalizeMatchScore;
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
NormalizeMatchScorePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2257
|
+
NormalizeMatchScorePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" });
|
|
2258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
|
|
2259
|
+
type: Pipe,
|
|
2260
|
+
args: [{ name: 'etNormalizeMatchScore', standalone: true }]
|
|
2261
|
+
}] });
|
|
2262
|
+
|
|
2263
|
+
const normalizeMatchType = (matchType) => {
|
|
2264
|
+
if (!matchType) {
|
|
2265
|
+
return null;
|
|
2266
|
+
}
|
|
2267
|
+
switch (matchType) {
|
|
2268
|
+
case 'double_elimination':
|
|
2269
|
+
return {
|
|
2270
|
+
i18n: 'match-type.double-elimination',
|
|
2271
|
+
text: 'Double Elimination',
|
|
2272
|
+
};
|
|
2273
|
+
case 'single_elimination':
|
|
2274
|
+
return {
|
|
2275
|
+
i18n: 'match-type.single-elimination',
|
|
2276
|
+
text: 'Single Elimination',
|
|
2277
|
+
};
|
|
2278
|
+
case 'fifa_swiss':
|
|
2279
|
+
return {
|
|
2280
|
+
i18n: 'match-type.fifa-swiss',
|
|
2281
|
+
text: 'FIFA Swiss',
|
|
2282
|
+
};
|
|
2283
|
+
case 'groups':
|
|
2284
|
+
return {
|
|
2285
|
+
i18n: 'match-type.groups',
|
|
2286
|
+
text: 'Groups',
|
|
2287
|
+
};
|
|
2288
|
+
case 'league':
|
|
2289
|
+
return {
|
|
2290
|
+
i18n: 'match-type.league',
|
|
2291
|
+
text: 'League',
|
|
2292
|
+
};
|
|
2293
|
+
case 'pools':
|
|
2294
|
+
return {
|
|
2295
|
+
i18n: 'match-type.pools',
|
|
2296
|
+
text: 'Pools',
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
};
|
|
2300
|
+
|
|
2301
|
+
class NormalizeMatchTypePipe {
|
|
2302
|
+
constructor() {
|
|
2303
|
+
this.transform = normalizeMatchType;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
NormalizeMatchTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2307
|
+
NormalizeMatchTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" });
|
|
2308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
|
|
2309
|
+
type: Pipe,
|
|
2310
|
+
args: [{ name: 'etNormalizeMatchType', standalone: true }]
|
|
2311
|
+
}] });
|
|
2312
|
+
|
|
1292
2313
|
const toArray = (value) => {
|
|
1293
2314
|
return Array.from({ length: value }, (_, i) => i);
|
|
1294
2315
|
};
|
|
@@ -1299,16 +2320,95 @@ class ToArrayPipe {
|
|
|
1299
2320
|
this.transform = toArray;
|
|
1300
2321
|
}
|
|
1301
2322
|
}
|
|
1302
|
-
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.
|
|
1303
|
-
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.
|
|
1304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.
|
|
2323
|
+
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2324
|
+
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
|
|
2325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
1305
2326
|
type: Pipe,
|
|
1306
2327
|
args: [{ name: 'toArray', standalone: true }]
|
|
1307
2328
|
}] });
|
|
1308
2329
|
|
|
2330
|
+
var _a;
|
|
2331
|
+
class TypedQueryList extends QueryList {
|
|
2332
|
+
constructor() {
|
|
2333
|
+
super(...arguments);
|
|
2334
|
+
this[_a] = () => {
|
|
2335
|
+
return super[Symbol.iterator]();
|
|
2336
|
+
};
|
|
2337
|
+
}
|
|
2338
|
+
get changes() {
|
|
2339
|
+
return super.changes;
|
|
2340
|
+
}
|
|
2341
|
+
toArray() {
|
|
2342
|
+
return super.toArray();
|
|
2343
|
+
}
|
|
2344
|
+
forEach(fn) {
|
|
2345
|
+
super.forEach(fn);
|
|
2346
|
+
}
|
|
2347
|
+
filter(fn) {
|
|
2348
|
+
return super.filter(fn);
|
|
2349
|
+
}
|
|
2350
|
+
map(fn) {
|
|
2351
|
+
return super.map(fn);
|
|
2352
|
+
}
|
|
2353
|
+
reduce(fn, initialValue) {
|
|
2354
|
+
return super.reduce(fn, initialValue);
|
|
2355
|
+
}
|
|
2356
|
+
some(fn) {
|
|
2357
|
+
return super.some(fn);
|
|
2358
|
+
}
|
|
2359
|
+
find(fn) {
|
|
2360
|
+
return super.find(fn);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
_a = Symbol.iterator;
|
|
2364
|
+
|
|
2365
|
+
const IS_ARRAY_NOT_EMPTY = 'isArrayNotEmpty';
|
|
2366
|
+
const IsArrayNotEmpty = (control) => {
|
|
2367
|
+
const value = control.value;
|
|
2368
|
+
if (!value) {
|
|
2369
|
+
return null;
|
|
2370
|
+
}
|
|
2371
|
+
return value.length > 0 ? null : { [IS_ARRAY_NOT_EMPTY]: true };
|
|
2372
|
+
};
|
|
2373
|
+
|
|
2374
|
+
const IS_EMAIL = 'isEmail';
|
|
2375
|
+
const IsEmail = (control) => {
|
|
2376
|
+
const value = control.value;
|
|
2377
|
+
if (!value) {
|
|
2378
|
+
return null;
|
|
2379
|
+
}
|
|
2380
|
+
const regex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
|
|
2381
|
+
return regex.test(value) ? null : { [IS_EMAIL]: true };
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2384
|
+
const MUST_MATCH = 'mustMatch';
|
|
2385
|
+
const MustMatch = (controlName, matchingControlName) => {
|
|
2386
|
+
return (formGroup) => {
|
|
2387
|
+
const control = formGroup.controls[controlName];
|
|
2388
|
+
const matchingControl = formGroup.controls[matchingControlName];
|
|
2389
|
+
// set error on matchingControl if validation fails
|
|
2390
|
+
if (matchingControl.errors && !matchingControl.errors[MUST_MATCH]) {
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
// set error on matchingControl if validation fails
|
|
2394
|
+
if (control.value !== matchingControl.value) {
|
|
2395
|
+
matchingControl.setErrors({ [MUST_MATCH]: true });
|
|
2396
|
+
}
|
|
2397
|
+
else {
|
|
2398
|
+
matchingControl.setErrors(null);
|
|
2399
|
+
}
|
|
2400
|
+
};
|
|
2401
|
+
};
|
|
2402
|
+
|
|
2403
|
+
const Validators = {
|
|
2404
|
+
MustMatch,
|
|
2405
|
+
IsEmail,
|
|
2406
|
+
IsArrayNotEmpty,
|
|
2407
|
+
};
|
|
2408
|
+
|
|
1309
2409
|
/**
|
|
1310
2410
|
* Generated bundle index. Do not edit.
|
|
1311
2411
|
*/
|
|
1312
2412
|
|
|
1313
|
-
export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG,
|
|
2413
|
+
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 };
|
|
1314
2414
|
//# sourceMappingURL=ethlete-core.mjs.map
|