@ethlete/core 4.10.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
- package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
- package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +6 -5
- package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +3 -3
- package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
- package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
- package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
- package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
- package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
- package/esm2022/lib/directives/let/let.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
- package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
- package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
- package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
- package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
- package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
- package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
- package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
- package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
- package/esm2022/lib/props/props.directive.mjs +3 -3
- package/esm2022/lib/services/click-observer.service.mjs +6 -6
- package/esm2022/lib/services/content-observer.service.mjs +6 -6
- package/esm2022/lib/services/focus-visible.service.mjs +3 -3
- package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
- package/esm2022/lib/services/resize-observer.service.mjs +6 -6
- package/esm2022/lib/services/router-state.service.mjs +3 -3
- package/esm2022/lib/services/viewport.service.mjs +3 -3
- package/esm2022/lib/utils/intersection-observer.utils.mjs +50 -12
- package/esm2022/lib/utils/signal.utils.mjs +70 -1
- package/fesm2022/ethlete-core.mjs +1601 -1494
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +3 -3
- package/lib/utils/intersection-observer.utils.d.ts +36 -10
- package/lib/utils/signal.utils.d.ts +31 -1
- package/package.json +7 -7
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, assertInInjectionContext, DestroyRef, ElementRef, TemplateRef, isSignal, signal, QueryList, Injector, runInInjectionContext, effect, afterNextRender, NgZone, isDevMode, computed, untracked, Directive, model,
|
|
2
|
+
import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, assertInInjectionContext, DestroyRef, ElementRef, TemplateRef, Injectable, isSignal, signal, QueryList, Injector, runInInjectionContext, effect, afterNextRender, NgZone, isDevMode, computed, untracked, Directive, model, EventEmitter, booleanAttribute, numberAttribute, Output, ViewContainerRef, Pipe, AfterRenderPhase, input } from '@angular/core';
|
|
3
3
|
import { DomSanitizer, Meta, Title } from '@angular/platform-browser';
|
|
4
|
-
import { Subject, BehaviorSubject, takeUntil, switchMap, of, tap, map, startWith, Observable, combineLatest, timer, distinctUntilChanged, shareReplay, filter, take, pairwise, debounceTime, merge, skip,
|
|
4
|
+
import { Subject, BehaviorSubject, takeUntil, switchMap, of, tap, map, startWith, Observable, combineLatest, timer, distinctUntilChanged, shareReplay, filter, take, fromEvent, pairwise, debounceTime, finalize, merge, skip, takeWhile } from 'rxjs';
|
|
5
5
|
import { END, HOME, PAGE_DOWN, PAGE_UP, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
|
|
6
6
|
import { FormGroup, FormArray, FormControl } from '@angular/forms';
|
|
7
|
-
import { toSignal, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { toSignal, takeUntilDestroyed, toObservable, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
8
8
|
import { coerceElement, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
9
|
-
import { supportsScrollBehavior } from '@angular/cdk/platform';
|
|
10
9
|
import * as i1 from '@angular/common';
|
|
11
|
-
import {
|
|
12
|
-
import { Overlay } from '@angular/cdk/overlay';
|
|
13
|
-
import { ComponentPortal } from '@angular/cdk/portal';
|
|
14
|
-
import { autoUpdate, computePosition, offset, flip, size, shift, limitShift, arrow, hide } from '@floating-ui/dom';
|
|
10
|
+
import { DOCUMENT, NgIf } from '@angular/common';
|
|
15
11
|
import { Router, NavigationEnd } from '@angular/router';
|
|
16
12
|
import { __decorate, __metadata } from 'tslib';
|
|
17
13
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
14
|
+
import { supportsScrollBehavior } from '@angular/cdk/platform';
|
|
15
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
16
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
17
|
+
import { autoUpdate, computePosition, offset, flip, size, shift, limitShift, arrow, hide } from '@floating-ui/dom';
|
|
18
18
|
import { debounceTime as debounceTime$1 } from 'rxjs/operators';
|
|
19
19
|
|
|
20
20
|
class StructuredDataComponent {
|
|
@@ -29,10 +29,10 @@ class StructuredDataComponent {
|
|
|
29
29
|
const html = `<script type="application/ld+json">${json}</script>`;
|
|
30
30
|
return this._sanitizer.bypassSecurityTrustHtml(html);
|
|
31
31
|
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
33
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", 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 }); }
|
|
34
34
|
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: StructuredDataComponent, decorators: [{
|
|
36
36
|
type: Component,
|
|
37
37
|
args: [{
|
|
38
38
|
selector: 'et-structured-data',
|
|
@@ -636,9 +636,11 @@ const getFormGroupValue = (formGroup) => {
|
|
|
636
636
|
const injectHostElement = () => inject(ElementRef).nativeElement;
|
|
637
637
|
const injectTemplateRef = () => inject(TemplateRef);
|
|
638
638
|
|
|
639
|
-
|
|
639
|
+
// TODO: This needs to be redone, it's a mess...
|
|
640
|
+
const getIntersectionInfo = (intersections) => {
|
|
641
|
+
const reverseIntersections = [...intersections].reverse();
|
|
640
642
|
const firstIntersecting = intersections.find((i) => i.intersectionRatio > 0);
|
|
641
|
-
const lastIntersecting =
|
|
643
|
+
const lastIntersecting = reverseIntersections.find((i) => i.intersectionRatio > 0);
|
|
642
644
|
const firstIntersectingIndex = intersections.findIndex((i) => i === firstIntersecting);
|
|
643
645
|
const lastIntersectingIndex = intersections.findIndex((i) => i === lastIntersecting);
|
|
644
646
|
if (!firstIntersecting || !lastIntersecting)
|
|
@@ -647,18 +649,54 @@ const getFirstAndLastPartialIntersection = (intersections) => {
|
|
|
647
649
|
const greaterIntersectingIndex = firstIntersecting.intersectionRatio > lastIntersecting.intersectionRatio
|
|
648
650
|
? firstIntersectingIndex
|
|
649
651
|
: lastIntersectingIndex;
|
|
652
|
+
const hasFullIntersection = intersections.some((i) => i.intersectionRatio === 1);
|
|
653
|
+
const hasMultipleFullIntersections = intersections.filter((i) => i.intersectionRatio === 1).length > 1;
|
|
654
|
+
const firstFullIntersectionIndex = intersections.findIndex((i) => i.intersectionRatio === 1);
|
|
655
|
+
const firstFullIntersection = intersections.find((i) => i.intersectionRatio === 1);
|
|
656
|
+
const lastFullIntersectionIndex = reverseIntersections.findIndex((i) => i.intersectionRatio === 1);
|
|
657
|
+
const lastFullIntersection = reverseIntersections.find((i) => i.intersectionRatio === 1);
|
|
658
|
+
const firstNonIntersectingIndex = intersections.findIndex((i) => i.intersectionRatio === 0);
|
|
659
|
+
const firstNonIntersection = intersections.find((i) => i.intersectionRatio === 0);
|
|
660
|
+
const lastNonIntersection = reverseIntersections.find((i) => i.intersectionRatio === 0);
|
|
661
|
+
const lastNonIntersectingIndex = intersections.findIndex((i) => i === lastNonIntersection);
|
|
650
662
|
return {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
663
|
+
partial: {
|
|
664
|
+
hasAny: !!firstIntersecting || !!lastIntersecting,
|
|
665
|
+
hasMultiple: !!firstIntersecting || (!!lastIntersecting && firstIntersecting !== lastIntersecting),
|
|
666
|
+
first: {
|
|
667
|
+
intersection: firstIntersecting,
|
|
668
|
+
index: firstIntersectingIndex,
|
|
669
|
+
},
|
|
670
|
+
last: {
|
|
671
|
+
intersection: lastIntersecting,
|
|
672
|
+
index: lastIntersectingIndex,
|
|
673
|
+
},
|
|
674
|
+
biggest: {
|
|
675
|
+
intersection: greaterIntersecting,
|
|
676
|
+
index: greaterIntersectingIndex,
|
|
677
|
+
},
|
|
654
678
|
},
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
679
|
+
full: {
|
|
680
|
+
hasAny: hasFullIntersection,
|
|
681
|
+
hasMultiple: hasMultipleFullIntersections,
|
|
682
|
+
first: {
|
|
683
|
+
index: firstFullIntersectionIndex,
|
|
684
|
+
intersection: firstFullIntersection,
|
|
685
|
+
},
|
|
686
|
+
last: {
|
|
687
|
+
index: lastFullIntersectionIndex,
|
|
688
|
+
intersection: lastFullIntersection,
|
|
689
|
+
},
|
|
658
690
|
},
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
691
|
+
none: {
|
|
692
|
+
first: {
|
|
693
|
+
index: firstNonIntersectingIndex,
|
|
694
|
+
intersection: firstNonIntersection,
|
|
695
|
+
},
|
|
696
|
+
last: {
|
|
697
|
+
index: lastNonIntersectingIndex,
|
|
698
|
+
intersection: lastNonIntersection,
|
|
699
|
+
},
|
|
662
700
|
},
|
|
663
701
|
};
|
|
664
702
|
};
|
|
@@ -1459,1541 +1497,1610 @@ class SelectionModel {
|
|
|
1459
1497
|
}
|
|
1460
1498
|
}
|
|
1461
1499
|
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
return
|
|
1500
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1501
|
+
class ClickObserverFactory {
|
|
1502
|
+
create() {
|
|
1503
|
+
return fromEvent(document, 'click');
|
|
1466
1504
|
}
|
|
1467
|
-
|
|
1505
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1506
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' }); }
|
|
1468
1507
|
}
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
return signal({ currentElement: null, previousElement: null, currentElements: [], previousElements: [] });
|
|
1508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
1509
|
+
type: Injectable,
|
|
1510
|
+
args: [{ providedIn: 'root' }]
|
|
1511
|
+
}] });
|
|
1512
|
+
class ClickObserverService {
|
|
1513
|
+
constructor() {
|
|
1514
|
+
this._clickObserverFactory = inject(ClickObserverFactory);
|
|
1515
|
+
this._observedElements = new Map();
|
|
1478
1516
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1517
|
+
ngOnDestroy() {
|
|
1518
|
+
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
1481
1519
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1520
|
+
observe(elementOrRef) {
|
|
1521
|
+
const element = coerceElement(elementOrRef);
|
|
1522
|
+
return new Observable((observer) => {
|
|
1523
|
+
const stream = this._observeElement(element);
|
|
1524
|
+
const subscription = stream.subscribe(observer);
|
|
1525
|
+
return () => {
|
|
1526
|
+
subscription.unsubscribe();
|
|
1527
|
+
this._unobserveElement(element);
|
|
1528
|
+
};
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
_observeElement(element) {
|
|
1532
|
+
if (!this._observedElements.has(element)) {
|
|
1533
|
+
const stream = new Subject();
|
|
1534
|
+
const observer = this._clickObserverFactory.create();
|
|
1535
|
+
const sub = observer.subscribe((event) => stream.next(event));
|
|
1536
|
+
this._observedElements.set(element, { observer: sub, stream, count: 1 });
|
|
1489
1537
|
}
|
|
1490
1538
|
else {
|
|
1491
|
-
|
|
1492
|
-
return of(coercedEl ? [coercedEl] : null);
|
|
1539
|
+
this._observedElements.get(element).count++;
|
|
1493
1540
|
}
|
|
1494
|
-
|
|
1495
|
-
if (el instanceof Observable) {
|
|
1496
|
-
mElSignal = toSignal(el.pipe(switchElement()), { initialValue: null });
|
|
1541
|
+
return this._observedElements.get(element).stream;
|
|
1497
1542
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1543
|
+
_unobserveElement(element) {
|
|
1544
|
+
if (this._observedElements.has(element)) {
|
|
1545
|
+
this._observedElements.get(element).count--;
|
|
1546
|
+
if (!this._observedElements.get(element).count) {
|
|
1547
|
+
this._cleanupObserver(element);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1500
1550
|
}
|
|
1501
|
-
|
|
1502
|
-
|
|
1551
|
+
_cleanupObserver(element) {
|
|
1552
|
+
if (this._observedElements.has(element)) {
|
|
1553
|
+
const { observer, stream } = this._observedElements.get(element);
|
|
1554
|
+
if (observer) {
|
|
1555
|
+
observer.unsubscribe();
|
|
1556
|
+
}
|
|
1557
|
+
stream.complete();
|
|
1558
|
+
this._observedElements.delete(element);
|
|
1559
|
+
}
|
|
1503
1560
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1562
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverService, providedIn: 'root' }); }
|
|
1563
|
+
}
|
|
1564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
1565
|
+
type: Injectable,
|
|
1566
|
+
args: [{ providedIn: 'root' }]
|
|
1567
|
+
}] });
|
|
1568
|
+
|
|
1569
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1570
|
+
class MutationObserverFactory {
|
|
1571
|
+
create(callback) {
|
|
1572
|
+
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
1506
1573
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
};
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1574
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1575
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' }); }
|
|
1576
|
+
}
|
|
1577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
1578
|
+
type: Injectable,
|
|
1579
|
+
args: [{ providedIn: 'root' }]
|
|
1580
|
+
}] });
|
|
1581
|
+
class ContentObserverService {
|
|
1582
|
+
constructor() {
|
|
1583
|
+
this._mutationObserverFactory = inject(MutationObserverFactory);
|
|
1584
|
+
this._observedElements = new Map();
|
|
1585
|
+
}
|
|
1586
|
+
ngOnDestroy() {
|
|
1587
|
+
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
1588
|
+
}
|
|
1589
|
+
observe(elementOrRef) {
|
|
1590
|
+
const element = coerceElement(elementOrRef);
|
|
1591
|
+
return new Observable((observer) => {
|
|
1592
|
+
const stream = this._observeElement(element);
|
|
1593
|
+
const subscription = stream.subscribe(observer);
|
|
1594
|
+
return () => {
|
|
1595
|
+
subscription.unsubscribe();
|
|
1596
|
+
this._unobserveElement(element);
|
|
1597
|
+
};
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
_observeElement(element) {
|
|
1601
|
+
if (!this._observedElements.has(element)) {
|
|
1602
|
+
const stream = new Subject();
|
|
1603
|
+
const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
|
|
1604
|
+
if (observer) {
|
|
1605
|
+
observer.observe(element, {
|
|
1606
|
+
characterData: true,
|
|
1607
|
+
childList: true,
|
|
1608
|
+
subtree: true,
|
|
1528
1609
|
});
|
|
1529
|
-
|
|
1530
|
-
});
|
|
1531
|
-
}
|
|
1532
|
-
};
|
|
1533
|
-
const pushMany = (map) => {
|
|
1534
|
-
for (const [tokenString, signal] of Object.entries(map)) {
|
|
1535
|
-
push(tokenString, signal);
|
|
1536
|
-
}
|
|
1537
|
-
};
|
|
1538
|
-
const remove = (...tokens) => {
|
|
1539
|
-
for (const tokenString of tokens) {
|
|
1540
|
-
effectRefMap[tokenString]?.destroy();
|
|
1541
|
-
cleanupFn({ key: tokenString, value: map[tokenString]?.() });
|
|
1542
|
-
delete effectRefMap[tokenString];
|
|
1610
|
+
}
|
|
1611
|
+
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
1543
1612
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
for (const token of tokens) {
|
|
1547
|
-
remove(token);
|
|
1613
|
+
else {
|
|
1614
|
+
this._observedElements.get(element).count++;
|
|
1548
1615
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
return isRendered.asReadonly();
|
|
1557
|
-
};
|
|
1558
|
-
const signalClasses = (el, classMap) => {
|
|
1559
|
-
const elements = buildElementSignal(el);
|
|
1560
|
-
return buildSignalEffects({
|
|
1561
|
-
map: classMap,
|
|
1562
|
-
eachItemFn: ({ key, value }) => {
|
|
1563
|
-
if (value) {
|
|
1564
|
-
elements().currentElement?.classList.add(key);
|
|
1565
|
-
}
|
|
1566
|
-
else {
|
|
1567
|
-
elements().currentElement?.classList.remove(key);
|
|
1568
|
-
}
|
|
1569
|
-
},
|
|
1570
|
-
cleanupFn: ({ key }) => elements().currentElement?.classList.remove(key),
|
|
1571
|
-
});
|
|
1572
|
-
};
|
|
1573
|
-
const signalHostClasses = (classMap) => signalClasses(inject(ElementRef), classMap);
|
|
1574
|
-
const ALWAYS_TRUE_ATTRIBUTE_KEYS = ['disabled', 'readonly', 'required', 'checked', 'selected', 'hidden', 'inert'];
|
|
1575
|
-
const signalAttributes = (el, attributeMap) => {
|
|
1576
|
-
const elements = buildElementSignal(el);
|
|
1577
|
-
return buildSignalEffects({
|
|
1578
|
-
map: attributeMap,
|
|
1579
|
-
eachItemFn: ({ key, value }) => {
|
|
1580
|
-
const valueString = `${value}`;
|
|
1581
|
-
if (ALWAYS_TRUE_ATTRIBUTE_KEYS.includes(key)) {
|
|
1582
|
-
if (value) {
|
|
1583
|
-
elements().currentElement?.setAttribute(key, '');
|
|
1584
|
-
}
|
|
1585
|
-
else {
|
|
1586
|
-
elements().currentElement?.removeAttribute(key);
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
else {
|
|
1590
|
-
if (value === null || value === undefined) {
|
|
1591
|
-
elements().currentElement?.removeAttribute(key);
|
|
1592
|
-
}
|
|
1593
|
-
else {
|
|
1594
|
-
elements().currentElement?.setAttribute(key, valueString);
|
|
1595
|
-
}
|
|
1616
|
+
return this._observedElements.get(element).stream;
|
|
1617
|
+
}
|
|
1618
|
+
_unobserveElement(element) {
|
|
1619
|
+
if (this._observedElements.has(element)) {
|
|
1620
|
+
this._observedElements.get(element).count--;
|
|
1621
|
+
if (!this._observedElements.get(element).count) {
|
|
1622
|
+
this._cleanupObserver(element);
|
|
1596
1623
|
}
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
return buildSignalEffects({
|
|
1605
|
-
map: styleMap,
|
|
1606
|
-
eachItemFn: ({ key, value }) => {
|
|
1607
|
-
if (value === null || value === undefined) {
|
|
1608
|
-
elements().currentElement?.style.removeProperty(key);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
_cleanupObserver(element) {
|
|
1627
|
+
if (this._observedElements.has(element)) {
|
|
1628
|
+
const { observer, stream } = this._observedElements.get(element);
|
|
1629
|
+
if (observer) {
|
|
1630
|
+
observer.disconnect();
|
|
1609
1631
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
elements().currentElement?.style.setProperty(key, valueString);
|
|
1613
|
-
}
|
|
1614
|
-
},
|
|
1615
|
-
cleanupFn: ({ key }) => elements().currentElement?.style.removeProperty(key),
|
|
1616
|
-
});
|
|
1617
|
-
};
|
|
1618
|
-
const signalHostStyles = (styleMap) => signalStyles(inject(ElementRef), styleMap);
|
|
1619
|
-
const signalElementDimensions = (el) => {
|
|
1620
|
-
const destroyRef = inject(DestroyRef);
|
|
1621
|
-
const elements = buildElementSignal(el);
|
|
1622
|
-
const zone = inject(NgZone);
|
|
1623
|
-
const isRendered = signalIsRendered();
|
|
1624
|
-
const initialValue = () => ({
|
|
1625
|
-
rect: elements().currentElement?.getBoundingClientRect() ?? null,
|
|
1626
|
-
borderBoxSize: null,
|
|
1627
|
-
contentBoxSize: null,
|
|
1628
|
-
devicePixelContentBoxSize: null,
|
|
1629
|
-
});
|
|
1630
|
-
const elementDimensionsSignal = signal(initialValue());
|
|
1631
|
-
const observer = new ResizeObserver((e) => {
|
|
1632
|
-
if (!isRendered())
|
|
1633
|
-
return;
|
|
1634
|
-
const entry = e[0];
|
|
1635
|
-
if (entry) {
|
|
1636
|
-
const devicePixelContentBoxSize = entry.devicePixelContentBoxSize?.[0] ?? null;
|
|
1637
|
-
const borderBoxSize = entry.borderBoxSize?.[0] ?? null;
|
|
1638
|
-
const contentBoxSize = entry.contentBoxSize?.[0] ?? null;
|
|
1639
|
-
zone.run(() => elementDimensionsSignal.set({
|
|
1640
|
-
rect: entry.contentRect,
|
|
1641
|
-
borderBoxSize: borderBoxSize
|
|
1642
|
-
? { inlineSize: borderBoxSize.inlineSize, blockSize: borderBoxSize.blockSize }
|
|
1643
|
-
: null,
|
|
1644
|
-
contentBoxSize: contentBoxSize
|
|
1645
|
-
? { inlineSize: contentBoxSize.inlineSize, blockSize: contentBoxSize.blockSize }
|
|
1646
|
-
: null,
|
|
1647
|
-
devicePixelContentBoxSize: devicePixelContentBoxSize
|
|
1648
|
-
? { inlineSize: devicePixelContentBoxSize.inlineSize, blockSize: devicePixelContentBoxSize.blockSize }
|
|
1649
|
-
: null,
|
|
1650
|
-
}));
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1653
|
-
effect(() => {
|
|
1654
|
-
const els = elements();
|
|
1655
|
-
elementDimensionsSignal.set(initialValue());
|
|
1656
|
-
if (els.previousElement) {
|
|
1657
|
-
observer.disconnect();
|
|
1658
|
-
}
|
|
1659
|
-
if (els.currentElement) {
|
|
1660
|
-
const computedDisplay = getComputedStyle(els.currentElement).display;
|
|
1661
|
-
const currentElIsAngularComponent = els.currentElement?.tagName.toLowerCase().includes('-');
|
|
1662
|
-
if (computedDisplay === 'inline' && isDevMode() && currentElIsAngularComponent) {
|
|
1663
|
-
console.error(`Element <${els.currentElement?.tagName.toLowerCase()}> is an Angular component and has a display of 'inline'. Inline elements cannot be observed for dimensions. Please change it to 'block' or something else.`);
|
|
1664
|
-
}
|
|
1665
|
-
observer.observe(els.currentElement);
|
|
1632
|
+
stream.complete();
|
|
1633
|
+
this._observedElements.delete(element);
|
|
1666
1634
|
}
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1635
|
+
}
|
|
1636
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ContentObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1637
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ContentObserverService, providedIn: 'root' }); }
|
|
1638
|
+
}
|
|
1639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ContentObserverService, decorators: [{
|
|
1640
|
+
type: Injectable,
|
|
1641
|
+
args: [{ providedIn: 'root' }]
|
|
1642
|
+
}] });
|
|
1643
|
+
|
|
1644
|
+
class FocusVisibleService {
|
|
1645
|
+
get isFocusVisible() {
|
|
1646
|
+
return this._hadKeyboardEvent;
|
|
1647
|
+
}
|
|
1648
|
+
constructor() {
|
|
1649
|
+
this._document = inject(DOCUMENT);
|
|
1650
|
+
this._hadKeyboardEvent = false;
|
|
1651
|
+
this._document.addEventListener('keydown', this.onKeyDown.bind(this), true);
|
|
1652
|
+
this._document.addEventListener('mousedown', this.onPointerDown.bind(this), true);
|
|
1653
|
+
this._document.addEventListener('pointerdown', this.onPointerDown.bind(this), true);
|
|
1654
|
+
this._document.addEventListener('touchstart', this.onPointerDown.bind(this), true);
|
|
1655
|
+
}
|
|
1656
|
+
onKeyDown(e) {
|
|
1657
|
+
if (e.metaKey || e.altKey || e.ctrlKey) {
|
|
1680
1658
|
return;
|
|
1681
|
-
const entry = e[0];
|
|
1682
|
-
if (entry) {
|
|
1683
|
-
zone.run(() => elementMutationsSignal.set(entry));
|
|
1684
1659
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1660
|
+
this._hadKeyboardEvent = true;
|
|
1661
|
+
}
|
|
1662
|
+
onPointerDown() {
|
|
1663
|
+
this._hadKeyboardEvent = false;
|
|
1664
|
+
}
|
|
1665
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1666
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: FocusVisibleService, providedIn: 'root' }); }
|
|
1667
|
+
}
|
|
1668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: FocusVisibleService, decorators: [{
|
|
1669
|
+
type: Injectable,
|
|
1670
|
+
args: [{
|
|
1671
|
+
providedIn: 'root',
|
|
1672
|
+
}]
|
|
1673
|
+
}], ctorParameters: () => [] });
|
|
1674
|
+
|
|
1675
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1676
|
+
class IntersectionObserverFactory {
|
|
1677
|
+
create(callback) {
|
|
1678
|
+
return typeof IntersectionObserver === 'undefined' ? null : new IntersectionObserver(callback);
|
|
1679
|
+
}
|
|
1680
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1681
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverFactory, providedIn: 'root' }); }
|
|
1682
|
+
}
|
|
1683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverFactory, decorators: [{
|
|
1684
|
+
type: Injectable,
|
|
1685
|
+
args: [{ providedIn: 'root' }]
|
|
1686
|
+
}] });
|
|
1687
|
+
class IntersectionObserverService {
|
|
1688
|
+
constructor() {
|
|
1689
|
+
this._intersectionObserverFactory = inject(IntersectionObserverFactory);
|
|
1690
|
+
this._observedElements = new Map();
|
|
1691
|
+
}
|
|
1692
|
+
ngOnDestroy() {
|
|
1693
|
+
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
1694
|
+
}
|
|
1695
|
+
observe(elementOrRef) {
|
|
1696
|
+
const element = coerceElement(elementOrRef);
|
|
1697
|
+
return new Observable((observer) => {
|
|
1698
|
+
const stream = this._observeElement(element);
|
|
1699
|
+
const subscription = stream.subscribe(observer);
|
|
1700
|
+
return () => {
|
|
1701
|
+
subscription.unsubscribe();
|
|
1702
|
+
this._unobserveElement(element);
|
|
1703
|
+
};
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
_observeElement(element) {
|
|
1707
|
+
if (!this._observedElements.has(element)) {
|
|
1708
|
+
const stream = new Subject();
|
|
1709
|
+
const observer = this._intersectionObserverFactory.create((mutations) => stream.next(mutations));
|
|
1710
|
+
if (observer) {
|
|
1711
|
+
observer.observe(element);
|
|
1712
|
+
}
|
|
1713
|
+
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
1691
1714
|
}
|
|
1692
|
-
|
|
1693
|
-
|
|
1715
|
+
else {
|
|
1716
|
+
this._observedElements.get(element).count++;
|
|
1694
1717
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
const elementDimensions = signalElementDimensions(elements);
|
|
1703
|
-
const elementMutations = signalElementMutations(elements, { childList: true, subtree: true });
|
|
1704
|
-
const isRendered = signalIsRendered();
|
|
1705
|
-
return computed(() => {
|
|
1706
|
-
const element = elements().currentElement;
|
|
1707
|
-
const dimensions = elementDimensions();
|
|
1708
|
-
const notScrollable = () => ({
|
|
1709
|
-
canScroll: false,
|
|
1710
|
-
canScrollHorizontally: false,
|
|
1711
|
-
canScrollVertically: false,
|
|
1712
|
-
scrollWidth: element?.scrollWidth ?? null,
|
|
1713
|
-
scrollHeight: element?.scrollHeight ?? null,
|
|
1714
|
-
elementDimensions: dimensions,
|
|
1715
|
-
});
|
|
1716
|
-
// We are not interested what the mutation is, just that there is one.
|
|
1717
|
-
// Changes to the DOM can affect the scroll state of the element.
|
|
1718
|
-
elementMutations();
|
|
1719
|
-
if (!element || !dimensions.rect || !isRendered())
|
|
1720
|
-
return notScrollable();
|
|
1721
|
-
const { scrollWidth, scrollHeight } = element;
|
|
1722
|
-
const { width, height } = dimensions.rect;
|
|
1723
|
-
const canScrollHorizontally = scrollWidth > width;
|
|
1724
|
-
const canScrollVertically = scrollHeight > height;
|
|
1725
|
-
return {
|
|
1726
|
-
canScroll: canScrollHorizontally || canScrollVertically,
|
|
1727
|
-
canScrollHorizontally,
|
|
1728
|
-
canScrollVertically,
|
|
1729
|
-
scrollWidth,
|
|
1730
|
-
scrollHeight,
|
|
1731
|
-
elementDimensions: dimensions,
|
|
1732
|
-
};
|
|
1733
|
-
});
|
|
1734
|
-
};
|
|
1735
|
-
const signalHostElementScrollState = () => signalElementScrollState(inject(ElementRef));
|
|
1736
|
-
const signalElementIntersection = (el, options) => {
|
|
1737
|
-
const destroyRef = inject(DestroyRef);
|
|
1738
|
-
const elements = buildElementSignal(el);
|
|
1739
|
-
const root = options?.root ? buildElementSignal(options?.root) : documentElementSignal();
|
|
1740
|
-
const zone = inject(NgZone);
|
|
1741
|
-
const isRendered = signalIsRendered();
|
|
1742
|
-
const isEnabled = options?.enabled ?? signal(true);
|
|
1743
|
-
const elementIntersectionSignal = signal([]);
|
|
1744
|
-
const observer = signal(null);
|
|
1745
|
-
effect(() => {
|
|
1746
|
-
const rootEl = root().currentElement;
|
|
1747
|
-
untracked(() => observer()?.disconnect());
|
|
1748
|
-
const newObserver = new IntersectionObserver((entries) => {
|
|
1749
|
-
if (!isRendered())
|
|
1750
|
-
return;
|
|
1751
|
-
let currentValues = untracked(() => [...elementIntersectionSignal()]);
|
|
1752
|
-
for (const entry of entries) {
|
|
1753
|
-
const existingEntryIndex = currentValues.findIndex((v) => v.target === entry.target);
|
|
1754
|
-
if (existingEntryIndex !== -1) {
|
|
1755
|
-
currentValues = [
|
|
1756
|
-
...currentValues.slice(0, existingEntryIndex),
|
|
1757
|
-
entry,
|
|
1758
|
-
...currentValues.slice(existingEntryIndex + 1),
|
|
1759
|
-
];
|
|
1760
|
-
}
|
|
1761
|
-
else {
|
|
1762
|
-
currentValues = [...currentValues, entry];
|
|
1763
|
-
}
|
|
1718
|
+
return this._observedElements.get(element).stream;
|
|
1719
|
+
}
|
|
1720
|
+
_unobserveElement(element) {
|
|
1721
|
+
if (this._observedElements.has(element)) {
|
|
1722
|
+
this._observedElements.get(element).count--;
|
|
1723
|
+
if (!this._observedElements.get(element).count) {
|
|
1724
|
+
this._cleanupObserver(element);
|
|
1764
1725
|
}
|
|
1765
|
-
zone.run(() => elementIntersectionSignal.set(currentValues));
|
|
1766
|
-
}, { ...options, root: rootEl });
|
|
1767
|
-
observer.set(newObserver);
|
|
1768
|
-
}, { allowSignalWrites: true });
|
|
1769
|
-
effect(() => {
|
|
1770
|
-
const els = elements();
|
|
1771
|
-
const obs = observer();
|
|
1772
|
-
const enabled = isEnabled();
|
|
1773
|
-
elementIntersectionSignal.set([]);
|
|
1774
|
-
if (els.previousElements.length) {
|
|
1775
|
-
obs?.disconnect();
|
|
1776
1726
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1727
|
+
}
|
|
1728
|
+
_cleanupObserver(element) {
|
|
1729
|
+
if (this._observedElements.has(element)) {
|
|
1730
|
+
const { observer, stream } = this._observedElements.get(element);
|
|
1731
|
+
if (observer) {
|
|
1732
|
+
observer.disconnect();
|
|
1780
1733
|
}
|
|
1734
|
+
stream.complete();
|
|
1735
|
+
this._observedElements.delete(element);
|
|
1781
1736
|
}
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
const elementMutations = signalElementMutations(elements, { childList: true, subtree: true, attributes: true });
|
|
1791
|
-
return computed(() => {
|
|
1792
|
-
if (!isRendered())
|
|
1793
|
-
return [];
|
|
1794
|
-
const els = elements();
|
|
1795
|
-
// We are not interested what the mutation is, just that there is one.
|
|
1796
|
-
// Changes to the DOM may affect the children of the element.
|
|
1797
|
-
elementMutations();
|
|
1798
|
-
if (!els.currentElement)
|
|
1799
|
-
return [];
|
|
1800
|
-
const children = [];
|
|
1801
|
-
for (let index = 0; index < els.currentElement.children.length; index++) {
|
|
1802
|
-
const element = els.currentElement.children[index];
|
|
1803
|
-
if (element instanceof HTMLElement) {
|
|
1804
|
-
children.push(element);
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
return children;
|
|
1808
|
-
});
|
|
1809
|
-
};
|
|
1810
|
-
const previousSignalValue = (signal) => {
|
|
1811
|
-
const obs = toObservable(signal).pipe(pairwise(), map(([prev]) => prev));
|
|
1812
|
-
return toSignal(obs);
|
|
1813
|
-
};
|
|
1814
|
-
const syncSignal = (from, to) => {
|
|
1815
|
-
effect(() => {
|
|
1816
|
-
const formVal = from();
|
|
1817
|
-
untracked(() => {
|
|
1818
|
-
to.set(formVal);
|
|
1819
|
-
});
|
|
1820
|
-
});
|
|
1821
|
-
};
|
|
1822
|
-
const controlValueSignal = (control, options) => {
|
|
1823
|
-
const vcsObs = options?.debounceTime
|
|
1824
|
-
? control.valueChanges.pipe(debounceTime(options?.debounceTime ?? 300))
|
|
1825
|
-
: control.valueChanges;
|
|
1826
|
-
const obs = options?.debounceFirst
|
|
1827
|
-
? merge(of(control.value), vcsObs)
|
|
1828
|
-
: vcsObs.pipe(startWith(control.getRawValue()));
|
|
1829
|
-
return toSignal(obs.pipe(distinctUntilChanged((a, b) => equal(a, b))), {
|
|
1830
|
-
requireSync: true,
|
|
1831
|
-
});
|
|
1832
|
-
};
|
|
1833
|
-
/**
|
|
1834
|
-
* The first item in the pair is the previous value and the second item is the current value.
|
|
1835
|
-
*/
|
|
1836
|
-
const controlValueSignalWithPrevious = (control, options) => {
|
|
1837
|
-
const obs = toObservable(controlValueSignal(control, options)).pipe(pairwise(), startWith([null, control.getRawValue()]));
|
|
1838
|
-
return toSignal(obs, { requireSync: true });
|
|
1839
|
-
};
|
|
1840
|
-
/**
|
|
1841
|
-
* @deprecated Use `controlValueSignal` instead with `debounceTime` set to `300` and `debounceFirst` set to `true`.
|
|
1842
|
-
*/
|
|
1843
|
-
const debouncedControlValueSignal = (control, options) => controlValueSignal(control, options ?? { debounceTime: 300, debounceFirst: true });
|
|
1737
|
+
}
|
|
1738
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1739
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverService, providedIn: 'root' }); }
|
|
1740
|
+
}
|
|
1741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IntersectionObserverService, decorators: [{
|
|
1742
|
+
type: Injectable,
|
|
1743
|
+
args: [{ providedIn: 'root' }]
|
|
1744
|
+
}] });
|
|
1844
1745
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
class SmartBlockScrollStrategy {
|
|
1850
|
-
constructor(_viewportRuler, _routerState, document) {
|
|
1851
|
-
this._viewportRuler = _viewportRuler;
|
|
1852
|
-
this._routerState = _routerState;
|
|
1853
|
-
this._id = _uniqueIdCounter++;
|
|
1854
|
-
this._previousHTMLStyles = { top: '', left: '' };
|
|
1855
|
-
this._previousScrollPosition = { top: 0, left: 0 };
|
|
1856
|
-
this._isEnabled = false;
|
|
1857
|
-
this._urlSubscription = null;
|
|
1858
|
-
this._resizeSubscription = null;
|
|
1859
|
-
this._didNavigate = false;
|
|
1860
|
-
this._document = document;
|
|
1746
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1747
|
+
class ResizeObserverFactory {
|
|
1748
|
+
create(callback) {
|
|
1749
|
+
return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
|
|
1861
1750
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1752
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' }); }
|
|
1753
|
+
}
|
|
1754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverFactory, decorators: [{
|
|
1755
|
+
type: Injectable,
|
|
1756
|
+
args: [{ providedIn: 'root' }]
|
|
1757
|
+
}] });
|
|
1758
|
+
class ResizeObserverService {
|
|
1759
|
+
constructor() {
|
|
1760
|
+
this._mutationObserverFactory = inject(ResizeObserverFactory);
|
|
1761
|
+
this._observedElements = new Map();
|
|
1864
1762
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
const root = this._document.documentElement;
|
|
1868
|
-
root.classList.add(OVERSCROLL_CLASS);
|
|
1869
|
-
this._resizeSubscription = createResizeObservable({ elements: root })
|
|
1870
|
-
.pipe(startWith(null), tap(() => {
|
|
1871
|
-
if (this._isEnabled || !elementCanScroll(root) || !this._canBeEnabled())
|
|
1872
|
-
return;
|
|
1873
|
-
this._isEnabled = true;
|
|
1874
|
-
this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
|
|
1875
|
-
this._didNavigate = false;
|
|
1876
|
-
this._previousHTMLStyles.left = root.style.left || '';
|
|
1877
|
-
this._previousHTMLStyles.top = root.style.top || '';
|
|
1878
|
-
root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);
|
|
1879
|
-
root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);
|
|
1880
|
-
root.classList.add(BLOCK_CLASS);
|
|
1881
|
-
this._urlSubscription = this._routerState.route$
|
|
1882
|
-
.pipe(skip(1), take(1), tap(() => {
|
|
1883
|
-
this._didNavigate = true;
|
|
1884
|
-
}))
|
|
1885
|
-
.subscribe();
|
|
1886
|
-
}))
|
|
1887
|
-
.subscribe();
|
|
1888
|
-
}
|
|
1763
|
+
ngOnDestroy() {
|
|
1764
|
+
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
1889
1765
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
if (scrollBehaviorSupported) {
|
|
1908
|
-
htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
|
|
1909
|
-
}
|
|
1910
|
-
if (!this._didNavigate) {
|
|
1911
|
-
window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
|
|
1766
|
+
observe(elementOrRef) {
|
|
1767
|
+
const element = coerceElement(elementOrRef);
|
|
1768
|
+
return new Observable((observer) => {
|
|
1769
|
+
const stream = this._observeElement(element);
|
|
1770
|
+
const subscription = stream.subscribe(observer);
|
|
1771
|
+
return () => {
|
|
1772
|
+
subscription.unsubscribe();
|
|
1773
|
+
this._unobserveElement(element);
|
|
1774
|
+
};
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
_observeElement(element) {
|
|
1778
|
+
if (!this._observedElements.has(element)) {
|
|
1779
|
+
const stream = new Subject();
|
|
1780
|
+
const observer = this._mutationObserverFactory.create((resizes) => stream.next(resizes));
|
|
1781
|
+
if (observer) {
|
|
1782
|
+
observer.observe(element);
|
|
1912
1783
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1784
|
+
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
1785
|
+
}
|
|
1786
|
+
else {
|
|
1787
|
+
this._observedElements.get(element).count++;
|
|
1788
|
+
}
|
|
1789
|
+
return this._observedElements.get(element).stream;
|
|
1790
|
+
}
|
|
1791
|
+
_unobserveElement(element) {
|
|
1792
|
+
if (this._observedElements.has(element)) {
|
|
1793
|
+
this._observedElements.get(element).count--;
|
|
1794
|
+
if (!this._observedElements.get(element).count) {
|
|
1795
|
+
this._cleanupObserver(element);
|
|
1916
1796
|
}
|
|
1917
1797
|
}
|
|
1918
1798
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1799
|
+
_cleanupObserver(element) {
|
|
1800
|
+
if (this._observedElements.has(element)) {
|
|
1801
|
+
const { observer, stream } = this._observedElements.get(element);
|
|
1802
|
+
if (observer) {
|
|
1803
|
+
observer.disconnect();
|
|
1804
|
+
}
|
|
1805
|
+
stream.complete();
|
|
1806
|
+
this._observedElements.delete(element);
|
|
1923
1807
|
}
|
|
1924
|
-
return true;
|
|
1925
1808
|
}
|
|
1809
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1810
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverService, providedIn: 'root' }); }
|
|
1926
1811
|
}
|
|
1812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ResizeObserverService, decorators: [{
|
|
1813
|
+
type: Injectable,
|
|
1814
|
+
args: [{ providedIn: 'root' }]
|
|
1815
|
+
}] });
|
|
1927
1816
|
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
};
|
|
1937
|
-
const isObjectArray = (value) => {
|
|
1938
|
-
if (!Array.isArray(value))
|
|
1939
|
-
return false;
|
|
1940
|
-
const first = value[0];
|
|
1941
|
-
const last = value[value.length - 1];
|
|
1942
|
-
if (!first || !last)
|
|
1943
|
-
return false;
|
|
1944
|
-
return typeof first === 'object' && typeof last === 'object' && !Array.isArray(first) && !Array.isArray(last);
|
|
1945
|
-
};
|
|
1946
|
-
const isEmptyArray = (value) => {
|
|
1947
|
-
return Array.isArray(value) && value.length === 0;
|
|
1948
|
-
};
|
|
1949
|
-
|
|
1950
|
-
const provideViewportConfig = (viewportConfig) => {
|
|
1951
|
-
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
1817
|
+
const ET_DISABLE_SCROLL_TOP = Symbol('ET_DISABLE_SCROLL_TOP');
|
|
1818
|
+
const ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE = Symbol('ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE');
|
|
1819
|
+
const ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE = Symbol('ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE');
|
|
1820
|
+
const routerDisableScrollTop = (config = {}) => {
|
|
1821
|
+
return {
|
|
1822
|
+
...(!config.asReturnRoute ? { [ET_DISABLE_SCROLL_TOP]: true } : { [ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE]: true }),
|
|
1823
|
+
...(config.onPathParamChange ? { [ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE]: true } : {}),
|
|
1824
|
+
};
|
|
1952
1825
|
};
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
this._didEmitStart = false;
|
|
1958
|
-
this._parent = inject(ANIMATABLE_TOKEN, { optional: true, skipSelf: true });
|
|
1959
|
-
this._destroy$ = createDestroy();
|
|
1960
|
-
this._elementRef = inject(ElementRef);
|
|
1961
|
-
this._animationStart$ = new Subject();
|
|
1962
|
-
this._animationEnd$ = new Subject();
|
|
1963
|
-
this._animationCancelled$ = new Subject();
|
|
1964
|
-
this._animatedElement$ = new BehaviorSubject(this._elementRef.nativeElement);
|
|
1965
|
-
this.animationStart$ = this._animationStart$.asObservable().pipe(debounceTime(0));
|
|
1966
|
-
this.animationEnd$ = this._animationEnd$.asObservable().pipe(debounceTime(0));
|
|
1967
|
-
this.animationCancelled$ = this._animationCancelled$.asObservable().pipe(debounceTime(0));
|
|
1968
|
-
this._hostActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1969
|
-
this._totalActiveAnimationCount$ = new BehaviorSubject(0);
|
|
1970
|
-
this.isAnimating$ = this._totalActiveAnimationCount$.pipe(map((count) => count > 0), debounceTime(0));
|
|
1826
|
+
const ET_PROPERTY_REMOVED = Symbol('ET_PROPERTY_REMOVED');
|
|
1827
|
+
class RouterStateService {
|
|
1828
|
+
get route$() {
|
|
1829
|
+
return this._route$.asObservable().pipe(distinctUntilChanged());
|
|
1971
1830
|
}
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
if (value === null || value === undefined || value === '') {
|
|
1975
|
-
newElement = this._elementRef.nativeElement;
|
|
1976
|
-
}
|
|
1977
|
-
else if (typeof value === 'string') {
|
|
1978
|
-
const el = document.querySelector(value);
|
|
1979
|
-
if (el) {
|
|
1980
|
-
newElement = el;
|
|
1981
|
-
}
|
|
1982
|
-
else {
|
|
1983
|
-
if (isDevMode()) {
|
|
1984
|
-
console.warn(`Element with selector ${value} not found. Animatable directive will use host element.`);
|
|
1985
|
-
}
|
|
1986
|
-
newElement = this._elementRef.nativeElement;
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
else {
|
|
1990
|
-
newElement = value;
|
|
1991
|
-
}
|
|
1992
|
-
if (this._animatedElement$.value !== newElement) {
|
|
1993
|
-
this._animatedElement$.next(newElement);
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
ngOnInit() {
|
|
1997
|
-
this._animatedElement$
|
|
1998
|
-
.pipe(tap((el) => {
|
|
1999
|
-
this._totalActiveAnimationCount$.next(this._totalActiveAnimationCount$.value - this._hostActiveAnimationCount$.value);
|
|
2000
|
-
this._hostActiveAnimationCount$.next(0);
|
|
2001
|
-
merge(fromEvent(el, 'animationstart'), fromEvent(el, 'transitionstart'))
|
|
2002
|
-
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2003
|
-
tap(() => {
|
|
2004
|
-
const count = this._hostActiveAnimationCount$.value + 1;
|
|
2005
|
-
this._hostActiveAnimationCount$.next(count);
|
|
2006
|
-
this._totalActiveAnimationCount$.next(count);
|
|
2007
|
-
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2008
|
-
.subscribe();
|
|
2009
|
-
merge(fromEvent(el, 'animationend'), fromEvent(el, 'animationcancel'), fromEvent(el, 'transitionend'), fromEvent(el, 'transitioncancel'))
|
|
2010
|
-
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2011
|
-
tap(() => {
|
|
2012
|
-
const count = this._hostActiveAnimationCount$.value - 1;
|
|
2013
|
-
this._hostActiveAnimationCount$.next(count);
|
|
2014
|
-
this._totalActiveAnimationCount$.next(count);
|
|
2015
|
-
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2016
|
-
.subscribe();
|
|
2017
|
-
merge(fromEvent(el, 'animationcancel'), fromEvent(el, 'transitioncancel'))
|
|
2018
|
-
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2019
|
-
tap(() => {
|
|
2020
|
-
this._animationCancelled$.next();
|
|
2021
|
-
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2022
|
-
.subscribe();
|
|
2023
|
-
}), takeUntil(this._destroy$))
|
|
2024
|
-
.subscribe();
|
|
2025
|
-
this._totalActiveAnimationCount$
|
|
2026
|
-
.pipe(tap((count) => {
|
|
2027
|
-
if (count > 0 && !this._didEmitStart) {
|
|
2028
|
-
this._animationStart$.next();
|
|
2029
|
-
this._didEmitStart = true;
|
|
2030
|
-
}
|
|
2031
|
-
else if (count === 0) {
|
|
2032
|
-
this._animationEnd$.next();
|
|
2033
|
-
this._didEmitStart = false;
|
|
2034
|
-
}
|
|
2035
|
-
}), takeUntil(this._destroy$))
|
|
2036
|
-
.subscribe();
|
|
2037
|
-
if (this._parent) {
|
|
2038
|
-
this._parent._hostActiveAnimationCount$
|
|
2039
|
-
.pipe(takeUntil(this._destroy$), tap((count) => {
|
|
2040
|
-
this._totalActiveAnimationCount$.next(count + this._hostActiveAnimationCount$.value);
|
|
2041
|
-
}))
|
|
2042
|
-
.subscribe();
|
|
2043
|
-
}
|
|
1831
|
+
get route() {
|
|
1832
|
+
return this._route$.getValue();
|
|
2044
1833
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
{
|
|
2048
|
-
provide: ANIMATABLE_TOKEN,
|
|
2049
|
-
useExisting: AnimatableDirective,
|
|
2050
|
-
},
|
|
2051
|
-
], exportAs: ["etAnimatable"], ngImport: i0 }); }
|
|
2052
|
-
}
|
|
2053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AnimatableDirective, decorators: [{
|
|
2054
|
-
type: Directive,
|
|
2055
|
-
args: [{
|
|
2056
|
-
selector: '[etAnimatable]',
|
|
2057
|
-
exportAs: 'etAnimatable',
|
|
2058
|
-
standalone: true,
|
|
2059
|
-
providers: [
|
|
2060
|
-
{
|
|
2061
|
-
provide: ANIMATABLE_TOKEN,
|
|
2062
|
-
useExisting: AnimatableDirective,
|
|
2063
|
-
},
|
|
2064
|
-
],
|
|
2065
|
-
}]
|
|
2066
|
-
}], propDecorators: { animatedElement: [{
|
|
2067
|
-
type: Input,
|
|
2068
|
-
args: ['etAnimatable']
|
|
2069
|
-
}] } });
|
|
2070
|
-
|
|
2071
|
-
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
2072
|
-
const ANIMATION_CLASSES = {
|
|
2073
|
-
enterFrom: 'et-animation-enter-from',
|
|
2074
|
-
enterActive: 'et-animation-enter-active',
|
|
2075
|
-
enterTo: 'et-animation-enter-to',
|
|
2076
|
-
leaveFrom: 'et-animation-leave-from',
|
|
2077
|
-
leaveActive: 'et-animation-leave-active',
|
|
2078
|
-
leaveTo: 'et-animation-leave-to',
|
|
2079
|
-
};
|
|
2080
|
-
class AnimatedLifecycleDirective {
|
|
2081
|
-
constructor() {
|
|
2082
|
-
this._destroy$ = createDestroy();
|
|
2083
|
-
this._elementRef = inject(ElementRef);
|
|
2084
|
-
this._animatable = inject(ANIMATABLE_TOKEN);
|
|
2085
|
-
this._classList = this._elementRef.nativeElement.classList;
|
|
2086
|
-
this._isConstructed = false;
|
|
2087
|
-
this._state$ = new BehaviorSubject('init');
|
|
2088
|
-
this.state$ = this._state$.asObservable();
|
|
2089
|
-
this.hostClassBindings = signalHostClasses({
|
|
2090
|
-
'et-force-invisible': toSignal(this._state$.pipe(map((state) => state === 'init'))),
|
|
2091
|
-
});
|
|
2092
|
-
this.skipNextEnter = model(false);
|
|
1834
|
+
get state$() {
|
|
1835
|
+
return this._state$.asObservable();
|
|
2093
1836
|
}
|
|
2094
1837
|
get state() {
|
|
2095
|
-
return this._state$.
|
|
1838
|
+
return this._state$.getValue();
|
|
2096
1839
|
}
|
|
2097
|
-
|
|
2098
|
-
this.
|
|
1840
|
+
get data$() {
|
|
1841
|
+
return this._state$.pipe(map((state) => state.data), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2099
1842
|
}
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
this.
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
1843
|
+
get data() {
|
|
1844
|
+
return this._state$.getValue().data;
|
|
1845
|
+
}
|
|
1846
|
+
get pathParams$() {
|
|
1847
|
+
return this._state$.pipe(map((state) => state.pathParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1848
|
+
}
|
|
1849
|
+
get pathParams() {
|
|
1850
|
+
return this._state$.getValue().pathParams;
|
|
1851
|
+
}
|
|
1852
|
+
get queryParams$() {
|
|
1853
|
+
return this._state$.pipe(map((state) => state.queryParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1854
|
+
}
|
|
1855
|
+
get queryParams() {
|
|
1856
|
+
return this._state$.getValue().queryParams;
|
|
1857
|
+
}
|
|
1858
|
+
get title$() {
|
|
1859
|
+
return this._state$.pipe(map((state) => state.title), distinctUntilChanged());
|
|
1860
|
+
}
|
|
1861
|
+
get title() {
|
|
1862
|
+
return this._state$.getValue().title;
|
|
1863
|
+
}
|
|
1864
|
+
get fragment$() {
|
|
1865
|
+
return this._state$.pipe(map((state) => state.fragment), distinctUntilChanged());
|
|
1866
|
+
}
|
|
1867
|
+
get fragment() {
|
|
1868
|
+
return this._state$.getValue().fragment;
|
|
1869
|
+
}
|
|
1870
|
+
get dataChanges$() {
|
|
1871
|
+
return this.data$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1872
|
+
}
|
|
1873
|
+
get queryParamChanges$() {
|
|
1874
|
+
return this.queryParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1875
|
+
}
|
|
1876
|
+
get pathParamChanges$() {
|
|
1877
|
+
return this.pathParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1878
|
+
}
|
|
1879
|
+
constructor() {
|
|
1880
|
+
this._isScrollTopOnNavigationEnabled = false;
|
|
1881
|
+
this._router = inject(Router);
|
|
1882
|
+
this._route$ = new BehaviorSubject(window.location.pathname);
|
|
1883
|
+
this._state$ = new BehaviorSubject(this._getInitialState());
|
|
1884
|
+
this._afterInitialize$ = new BehaviorSubject(false);
|
|
1885
|
+
this.afterInitialize$ = this._afterInitialize$.pipe(filter((v) => v));
|
|
1886
|
+
this._router.events
|
|
1887
|
+
.pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => {
|
|
1888
|
+
const { url } = event;
|
|
1889
|
+
const urlWithoutQueryParams = url.split('?')[0] ?? '';
|
|
1890
|
+
const withoutFragment = urlWithoutQueryParams.split('#')[0] ?? '';
|
|
1891
|
+
return withoutFragment;
|
|
1892
|
+
}), tap(() => {
|
|
1893
|
+
if (!this._afterInitialize$.getValue()) {
|
|
1894
|
+
this._afterInitialize$.next(true);
|
|
2125
1895
|
}
|
|
2126
|
-
})
|
|
2127
|
-
|
|
1896
|
+
}))
|
|
1897
|
+
.subscribe(this._route$);
|
|
1898
|
+
combineLatest([this._route$, this._afterInitialize$])
|
|
1899
|
+
.pipe(tap(([, afterInitialize]) => {
|
|
1900
|
+
if (!afterInitialize)
|
|
2128
1901
|
return;
|
|
2129
|
-
this.
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1902
|
+
let route = this._router.routerState.snapshot.root;
|
|
1903
|
+
while (route.firstChild) {
|
|
1904
|
+
route = route.firstChild;
|
|
2133
1905
|
}
|
|
2134
|
-
|
|
1906
|
+
const { data, params, queryParams, title, fragment } = route;
|
|
1907
|
+
this._state$.next({
|
|
1908
|
+
data,
|
|
1909
|
+
pathParams: params,
|
|
1910
|
+
queryParams,
|
|
1911
|
+
title: title ?? null,
|
|
1912
|
+
fragment,
|
|
1913
|
+
});
|
|
1914
|
+
}))
|
|
2135
1915
|
.subscribe();
|
|
2136
1916
|
}
|
|
2137
|
-
|
|
2138
|
-
if (this.
|
|
2139
|
-
return;
|
|
2140
|
-
if (this.state === 'init') {
|
|
2141
|
-
this._state$.next('left');
|
|
1917
|
+
enableScrollEnhancements(config = {}) {
|
|
1918
|
+
if (this._isScrollTopOnNavigationEnabled) {
|
|
2142
1919
|
return;
|
|
2143
1920
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 }); }
|
|
2182
|
-
}
|
|
2183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
2184
|
-
type: Directive,
|
|
2185
|
-
args: [{
|
|
2186
|
-
selector: '[etAnimatedLifecycle]',
|
|
2187
|
-
exportAs: 'etAnimatedLifecycle',
|
|
2188
|
-
standalone: true,
|
|
2189
|
-
providers: [
|
|
2190
|
-
{
|
|
2191
|
-
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
2192
|
-
useExisting: AnimatedLifecycleDirective,
|
|
2193
|
-
},
|
|
2194
|
-
],
|
|
2195
|
-
hostDirectives: [AnimatableDirective],
|
|
2196
|
-
}]
|
|
2197
|
-
}] });
|
|
2198
|
-
|
|
2199
|
-
const ANIMATED_IF_TOKEN = new InjectionToken('ANIMATED_IF_TOKEN');
|
|
2200
|
-
class AnimatedIfDirective {
|
|
2201
|
-
constructor() {
|
|
2202
|
-
this._destroy$ = createDestroy();
|
|
2203
|
-
this._ngIf = inject(NgIf);
|
|
2204
|
-
this._animatedLifecycle = inject(ANIMATED_LIFECYCLE_TOKEN);
|
|
1921
|
+
this._isScrollTopOnNavigationEnabled = true;
|
|
1922
|
+
combineLatest([this._state$.pipe(pairwise()), this._route$.pipe(pairwise())])
|
|
1923
|
+
.pipe(debounceTime(1))
|
|
1924
|
+
.subscribe(([[prevState, currState], [prevRoute, currRoute]]) => {
|
|
1925
|
+
const sameUrlNavigation = prevRoute === currRoute;
|
|
1926
|
+
const didFragmentChange = prevState.fragment !== currState.fragment;
|
|
1927
|
+
if (sameUrlNavigation) {
|
|
1928
|
+
const allQueryParams = [
|
|
1929
|
+
...new Set(Object.keys(prevState.queryParams).concat(Object.keys(currState.queryParams))),
|
|
1930
|
+
];
|
|
1931
|
+
const changedQueryParams = allQueryParams.filter((key) => currState.queryParams[key] !== prevState.queryParams[key]);
|
|
1932
|
+
if (!config.queryParamTriggerList?.length && !didFragmentChange) {
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
const caseQueryParams = changedQueryParams.some((key) => config.queryParamTriggerList?.includes(key));
|
|
1936
|
+
const caseFragment = didFragmentChange && config.fragment?.enabled;
|
|
1937
|
+
if (caseQueryParams) {
|
|
1938
|
+
(config.scrollElement ?? document.documentElement).scrollTop = 0;
|
|
1939
|
+
}
|
|
1940
|
+
else if (caseFragment) {
|
|
1941
|
+
const fragmentElement = document.getElementById(currState.fragment ?? '');
|
|
1942
|
+
if (fragmentElement) {
|
|
1943
|
+
fragmentElement.scrollIntoView({ behavior: config.fragment?.smooth ? 'smooth' : 'auto' });
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
const viaReturnRoute = currState.data[ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE] && prevState.data[ET_DISABLE_SCROLL_TOP];
|
|
1949
|
+
const explicitly = currState.data[ET_DISABLE_SCROLL_TOP];
|
|
1950
|
+
const pathParamsChange = currState.data[ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE];
|
|
1951
|
+
if (viaReturnRoute || explicitly || pathParamsChange) {
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1954
|
+
const el = config.scrollElement ?? document.documentElement;
|
|
1955
|
+
el.scrollTop = 0;
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
2205
1958
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
1959
|
+
selectQueryParam(key) {
|
|
1960
|
+
return this._state$.pipe(map((state) => state.queryParams[key]), distinctUntilChanged());
|
|
1961
|
+
}
|
|
1962
|
+
selectPathParam(key) {
|
|
1963
|
+
return this._state$.pipe(map((state) => state.pathParams[key]), distinctUntilChanged());
|
|
1964
|
+
}
|
|
1965
|
+
selectData(key) {
|
|
1966
|
+
return this._state$.pipe(map((state) => state.data[key]), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1967
|
+
}
|
|
1968
|
+
_findChanges([previous, current,]) {
|
|
1969
|
+
const changes = {};
|
|
1970
|
+
const allKeys = new Set([
|
|
1971
|
+
...Object.keys(previous),
|
|
1972
|
+
...Object.keys(current),
|
|
1973
|
+
]);
|
|
1974
|
+
for (const key of allKeys) {
|
|
1975
|
+
if (!equal(previous[key], current[key])) {
|
|
1976
|
+
const val = current[key] === undefined ? ET_PROPERTY_REMOVED : current[key];
|
|
1977
|
+
changes[key] = val;
|
|
1978
|
+
}
|
|
2210
1979
|
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
1980
|
+
return changes;
|
|
1981
|
+
}
|
|
1982
|
+
_getInitialState() {
|
|
1983
|
+
const data = {};
|
|
1984
|
+
const pathParams = {};
|
|
1985
|
+
const queryParams = {};
|
|
1986
|
+
const title = null;
|
|
1987
|
+
let fragment = null;
|
|
1988
|
+
const currentQueryParams = window.location.search;
|
|
1989
|
+
const currentFragment = window.location.hash;
|
|
1990
|
+
if (currentQueryParams) {
|
|
1991
|
+
const params = new URLSearchParams(currentQueryParams);
|
|
1992
|
+
params.forEach((value, key) => {
|
|
1993
|
+
queryParams[key] = value;
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
if (currentFragment) {
|
|
1997
|
+
fragment = currentFragment.slice(1);
|
|
2218
1998
|
}
|
|
1999
|
+
return {
|
|
2000
|
+
data,
|
|
2001
|
+
pathParams,
|
|
2002
|
+
queryParams,
|
|
2003
|
+
title,
|
|
2004
|
+
fragment,
|
|
2005
|
+
};
|
|
2219
2006
|
}
|
|
2220
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2221
|
-
static { this.ɵ
|
|
2222
|
-
{
|
|
2223
|
-
provide: ANIMATED_IF_TOKEN,
|
|
2224
|
-
useExisting: AnimatedIfDirective,
|
|
2225
|
-
},
|
|
2226
|
-
], hostDirectives: [{ directive: i1.NgIf }], ngImport: i0 }); }
|
|
2007
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2008
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RouterStateService, providedIn: 'root' }); }
|
|
2227
2009
|
}
|
|
2228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
2229
|
-
type:
|
|
2010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RouterStateService, decorators: [{
|
|
2011
|
+
type: Injectable,
|
|
2230
2012
|
args: [{
|
|
2231
|
-
|
|
2232
|
-
standalone: true,
|
|
2233
|
-
providers: [
|
|
2234
|
-
{
|
|
2235
|
-
provide: ANIMATED_IF_TOKEN,
|
|
2236
|
-
useExisting: AnimatedIfDirective,
|
|
2237
|
-
},
|
|
2238
|
-
],
|
|
2239
|
-
hostDirectives: [NgIf],
|
|
2013
|
+
providedIn: 'root',
|
|
2240
2014
|
}]
|
|
2241
|
-
}],
|
|
2242
|
-
type: Input,
|
|
2243
|
-
args: ['etAnimatedIf']
|
|
2244
|
-
}] } });
|
|
2015
|
+
}], ctorParameters: () => [] });
|
|
2245
2016
|
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
return fromEvent(document, 'click');
|
|
2250
|
-
}
|
|
2251
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2252
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' }); }
|
|
2253
|
-
}
|
|
2254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
2255
|
-
type: Injectable,
|
|
2256
|
-
args: [{ providedIn: 'root' }]
|
|
2257
|
-
}] });
|
|
2258
|
-
class ClickObserverService {
|
|
2259
|
-
constructor() {
|
|
2260
|
-
this._clickObserverFactory = inject(ClickObserverFactory);
|
|
2261
|
-
this._observedElements = new Map();
|
|
2017
|
+
class ViewportService {
|
|
2018
|
+
get isXs$() {
|
|
2019
|
+
return this._isXs$.asObservable();
|
|
2262
2020
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
2021
|
+
get isXs() {
|
|
2022
|
+
return this._isXs$.value;
|
|
2265
2023
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
return new Observable((observer) => {
|
|
2269
|
-
const stream = this._observeElement(element);
|
|
2270
|
-
const subscription = stream.subscribe(observer);
|
|
2271
|
-
return () => {
|
|
2272
|
-
subscription.unsubscribe();
|
|
2273
|
-
this._unobserveElement(element);
|
|
2274
|
-
};
|
|
2275
|
-
});
|
|
2024
|
+
get isSm$() {
|
|
2025
|
+
return this._isSm$.asObservable();
|
|
2276
2026
|
}
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
const stream = new Subject();
|
|
2280
|
-
const observer = this._clickObserverFactory.create();
|
|
2281
|
-
const sub = observer.subscribe((event) => stream.next(event));
|
|
2282
|
-
this._observedElements.set(element, { observer: sub, stream, count: 1 });
|
|
2283
|
-
}
|
|
2284
|
-
else {
|
|
2285
|
-
this._observedElements.get(element).count++;
|
|
2286
|
-
}
|
|
2287
|
-
return this._observedElements.get(element).stream;
|
|
2027
|
+
get isSm() {
|
|
2028
|
+
return this._isSm$.value;
|
|
2288
2029
|
}
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
this._observedElements.get(element).count--;
|
|
2292
|
-
if (!this._observedElements.get(element).count) {
|
|
2293
|
-
this._cleanupObserver(element);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2030
|
+
get isMd$() {
|
|
2031
|
+
return this._isMd$.asObservable();
|
|
2296
2032
|
}
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2300
|
-
if (observer) {
|
|
2301
|
-
observer.unsubscribe();
|
|
2302
|
-
}
|
|
2303
|
-
stream.complete();
|
|
2304
|
-
this._observedElements.delete(element);
|
|
2305
|
-
}
|
|
2033
|
+
get isMd() {
|
|
2034
|
+
return this._isMd$.value;
|
|
2306
2035
|
}
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}
|
|
2310
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
2311
|
-
type: Injectable,
|
|
2312
|
-
args: [{ providedIn: 'root' }]
|
|
2313
|
-
}] });
|
|
2314
|
-
|
|
2315
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2316
|
-
class MutationObserverFactory {
|
|
2317
|
-
create(callback) {
|
|
2318
|
-
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
2036
|
+
get isLg$() {
|
|
2037
|
+
return this._isLg$.asObservable();
|
|
2319
2038
|
}
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
}
|
|
2323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
2324
|
-
type: Injectable,
|
|
2325
|
-
args: [{ providedIn: 'root' }]
|
|
2326
|
-
}] });
|
|
2327
|
-
class ContentObserverService {
|
|
2328
|
-
constructor() {
|
|
2329
|
-
this._mutationObserverFactory = inject(MutationObserverFactory);
|
|
2330
|
-
this._observedElements = new Map();
|
|
2039
|
+
get isLg() {
|
|
2040
|
+
return this._isLg$.value;
|
|
2331
2041
|
}
|
|
2332
|
-
|
|
2333
|
-
|
|
2042
|
+
get isXl$() {
|
|
2043
|
+
return this._isXl$.asObservable();
|
|
2334
2044
|
}
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
return new Observable((observer) => {
|
|
2338
|
-
const stream = this._observeElement(element);
|
|
2339
|
-
const subscription = stream.subscribe(observer);
|
|
2340
|
-
return () => {
|
|
2341
|
-
subscription.unsubscribe();
|
|
2342
|
-
this._unobserveElement(element);
|
|
2343
|
-
};
|
|
2344
|
-
});
|
|
2045
|
+
get isXl() {
|
|
2046
|
+
return this._isXl$.value;
|
|
2345
2047
|
}
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
const stream = new Subject();
|
|
2349
|
-
const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
|
|
2350
|
-
if (observer) {
|
|
2351
|
-
observer.observe(element, {
|
|
2352
|
-
characterData: true,
|
|
2353
|
-
childList: true,
|
|
2354
|
-
subtree: true,
|
|
2355
|
-
});
|
|
2356
|
-
}
|
|
2357
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
2358
|
-
}
|
|
2359
|
-
else {
|
|
2360
|
-
this._observedElements.get(element).count++;
|
|
2361
|
-
}
|
|
2362
|
-
return this._observedElements.get(element).stream;
|
|
2048
|
+
get is2Xl$() {
|
|
2049
|
+
return this._is2Xl$.asObservable();
|
|
2363
2050
|
}
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
this._observedElements.get(element).count--;
|
|
2367
|
-
if (!this._observedElements.get(element).count) {
|
|
2368
|
-
this._cleanupObserver(element);
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2051
|
+
get is2Xl() {
|
|
2052
|
+
return this._is2Xl$.value;
|
|
2371
2053
|
}
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2375
|
-
if (observer) {
|
|
2376
|
-
observer.disconnect();
|
|
2377
|
-
}
|
|
2378
|
-
stream.complete();
|
|
2379
|
-
this._observedElements.delete(element);
|
|
2380
|
-
}
|
|
2054
|
+
get viewportSize$() {
|
|
2055
|
+
return this._viewportSize$.asObservable();
|
|
2381
2056
|
}
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
get
|
|
2392
|
-
return this.
|
|
2057
|
+
get viewportSize() {
|
|
2058
|
+
return this._viewportSize$.value;
|
|
2059
|
+
}
|
|
2060
|
+
get scrollbarSize$() {
|
|
2061
|
+
return this._scrollbarSize$.asObservable();
|
|
2062
|
+
}
|
|
2063
|
+
get scrollbarSize() {
|
|
2064
|
+
return this._scrollbarSize$.value;
|
|
2065
|
+
}
|
|
2066
|
+
get currentViewport() {
|
|
2067
|
+
return this.getCurrentViewport([this.isXs, this.isSm, this.isMd, this.isLg, this.isXl, this.is2Xl]);
|
|
2393
2068
|
}
|
|
2394
2069
|
constructor() {
|
|
2395
|
-
this.
|
|
2396
|
-
this.
|
|
2397
|
-
this.
|
|
2398
|
-
this.
|
|
2399
|
-
this.
|
|
2400
|
-
this.
|
|
2070
|
+
this._resizeObserverService = inject(ResizeObserverService);
|
|
2071
|
+
this._viewportConfig = inject(VIEWPORT_CONFIG, { optional: true }) || DEFAULT_VIEWPORT_CONFIG;
|
|
2072
|
+
this._breakpointObserver = inject(BreakpointObserver);
|
|
2073
|
+
this._viewportMonitorStop$ = new Subject();
|
|
2074
|
+
this._isViewportMonitorEnabled = false;
|
|
2075
|
+
this._isXs$ = new BehaviorSubject(false);
|
|
2076
|
+
this._isSm$ = new BehaviorSubject(false);
|
|
2077
|
+
this._isMd$ = new BehaviorSubject(false);
|
|
2078
|
+
this._isLg$ = new BehaviorSubject(false);
|
|
2079
|
+
this._isXl$ = new BehaviorSubject(false);
|
|
2080
|
+
this._is2Xl$ = new BehaviorSubject(false);
|
|
2081
|
+
this._viewportSize$ = new BehaviorSubject(null);
|
|
2082
|
+
this._scrollbarSize$ = new BehaviorSubject(null);
|
|
2083
|
+
this.currentViewport$ = combineLatest([this.isXs$, this.isSm$, this.isMd$, this.isLg$, this.isXl$, this.is2Xl$]).pipe(map((val) => this.getCurrentViewport(val)), debounceTime(0), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2084
|
+
this._observeDefaultBreakpoints();
|
|
2401
2085
|
}
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
}
|
|
2406
|
-
this._hadKeyboardEvent = true;
|
|
2086
|
+
observe(options) {
|
|
2087
|
+
const mediaQuery = this._buildMediaQuery(options);
|
|
2088
|
+
return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2407
2089
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2090
|
+
isMatched(options) {
|
|
2091
|
+
const mediaQuery = this._buildMediaQuery(options);
|
|
2092
|
+
return this._breakpointObserver.isMatched(mediaQuery);
|
|
2410
2093
|
}
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2094
|
+
/**
|
|
2095
|
+
* Applies size CSS variables to the documentElement in pixels.
|
|
2096
|
+
* - `--et-vw`: viewport width excluding scrollbar width
|
|
2097
|
+
* - `--et-vh`: viewport height excluding scrollbar height
|
|
2098
|
+
* - `--et-sw`: scrollbar width
|
|
2099
|
+
* - `--et-sh`: scrollbar height
|
|
2100
|
+
*/
|
|
2101
|
+
monitorViewport() {
|
|
2102
|
+
if (this._isViewportMonitorEnabled)
|
|
2103
|
+
return;
|
|
2104
|
+
this._isViewportMonitorEnabled = true;
|
|
2105
|
+
this._resizeObserverService
|
|
2106
|
+
.observe(document.documentElement)
|
|
2107
|
+
.pipe(tap((e) => {
|
|
2108
|
+
const entry = e[0];
|
|
2109
|
+
if (!entry)
|
|
2110
|
+
return;
|
|
2111
|
+
const width = entry.contentRect.width;
|
|
2112
|
+
const height = entry.contentRect.height;
|
|
2113
|
+
const obj = { width, height };
|
|
2114
|
+
if (equal(obj, this._viewportSize$.value))
|
|
2115
|
+
return;
|
|
2116
|
+
document.documentElement.style.setProperty('--et-vw', `${obj.width}px`);
|
|
2117
|
+
document.documentElement.style.setProperty('--et-vh', `${obj.height}px`);
|
|
2118
|
+
this._viewportSize$.next(obj);
|
|
2119
|
+
}), finalize(() => {
|
|
2120
|
+
document.documentElement.style.removeProperty('--et-vw');
|
|
2121
|
+
document.documentElement.style.removeProperty('--et-vh');
|
|
2122
|
+
this._viewportSize$.next(null);
|
|
2123
|
+
}), takeUntil(this._viewportMonitorStop$))
|
|
2124
|
+
.subscribe();
|
|
2125
|
+
const scrollbarRuler = document.createElement('div');
|
|
2126
|
+
scrollbarRuler.style.width = '100px';
|
|
2127
|
+
scrollbarRuler.style.height = '100px';
|
|
2128
|
+
scrollbarRuler.style.overflow = 'scroll';
|
|
2129
|
+
scrollbarRuler.style.position = 'absolute';
|
|
2130
|
+
scrollbarRuler.style.top = '-9999px';
|
|
2131
|
+
document.body.appendChild(scrollbarRuler);
|
|
2132
|
+
this._resizeObserverService
|
|
2133
|
+
.observe(scrollbarRuler)
|
|
2134
|
+
.pipe(tap((e) => {
|
|
2135
|
+
const entry = e[0];
|
|
2136
|
+
if (!entry)
|
|
2137
|
+
return;
|
|
2138
|
+
const size = entry.contentRect.width;
|
|
2139
|
+
const obj = { width: 100 - size, height: 100 - size };
|
|
2140
|
+
if (equal(obj, this._scrollbarSize$.value))
|
|
2141
|
+
return;
|
|
2142
|
+
document.documentElement.style.setProperty('--et-sw', `${obj.width}px`);
|
|
2143
|
+
document.documentElement.style.setProperty('--et-sh', `${obj.height}px`);
|
|
2144
|
+
this._scrollbarSize$.next(obj);
|
|
2145
|
+
}), finalize(() => {
|
|
2146
|
+
document.body.removeChild(scrollbarRuler);
|
|
2147
|
+
document.documentElement.style.removeProperty('--et-vw');
|
|
2148
|
+
document.documentElement.style.removeProperty('--et-vh');
|
|
2149
|
+
this._scrollbarSize$.next(null);
|
|
2150
|
+
}), takeUntil(this._viewportMonitorStop$))
|
|
2151
|
+
.subscribe();
|
|
2425
2152
|
}
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: IntersectionObserverFactory, decorators: [{
|
|
2430
|
-
type: Injectable,
|
|
2431
|
-
args: [{ providedIn: 'root' }]
|
|
2432
|
-
}] });
|
|
2433
|
-
class IntersectionObserverService {
|
|
2434
|
-
constructor() {
|
|
2435
|
-
this._intersectionObserverFactory = inject(IntersectionObserverFactory);
|
|
2436
|
-
this._observedElements = new Map();
|
|
2153
|
+
unmonitorViewport() {
|
|
2154
|
+
this._viewportMonitorStop$.next();
|
|
2155
|
+
this._isViewportMonitorEnabled = false;
|
|
2437
2156
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2157
|
+
getBreakpointSize(type, option) {
|
|
2158
|
+
const index = option === 'min' ? 0 : 1;
|
|
2159
|
+
const size = this._viewportConfig.breakpoints[type][index];
|
|
2160
|
+
if (size === Infinity || size === 0) {
|
|
2161
|
+
return size;
|
|
2162
|
+
}
|
|
2163
|
+
if (option === 'min') {
|
|
2164
|
+
return size;
|
|
2165
|
+
}
|
|
2166
|
+
// Due to scaling, the actual size of the viewport may be a decimal number.
|
|
2167
|
+
// Eg. on Windows 11 with 150% scaling, the viewport size may be 1535.33px
|
|
2168
|
+
// and thus not matching any of the default breakpoints.
|
|
2169
|
+
return size + 0.9;
|
|
2440
2170
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
this._unobserveElement(element);
|
|
2449
|
-
};
|
|
2450
|
-
});
|
|
2171
|
+
_observeDefaultBreakpoints() {
|
|
2172
|
+
this.observe({ max: 'xs' }).subscribe(this._isXs$);
|
|
2173
|
+
this.observe({ min: 'sm', max: 'sm' }).subscribe(this._isSm$);
|
|
2174
|
+
this.observe({ min: 'md', max: 'md' }).subscribe(this._isMd$);
|
|
2175
|
+
this.observe({ min: 'lg', max: 'lg' }).subscribe(this._isLg$);
|
|
2176
|
+
this.observe({ min: 'xl', max: 'xl' }).subscribe(this._isXl$);
|
|
2177
|
+
this.observe({ min: '2xl' }).subscribe(this._is2Xl$);
|
|
2451
2178
|
}
|
|
2452
|
-
|
|
2453
|
-
if (!
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2179
|
+
_buildMediaQuery(options) {
|
|
2180
|
+
if (!options.min && !options.max) {
|
|
2181
|
+
throw new Error('At least one of min or max must be defined');
|
|
2182
|
+
}
|
|
2183
|
+
const mediaQueryParts = [];
|
|
2184
|
+
if (options.min) {
|
|
2185
|
+
if (typeof options.min === 'number') {
|
|
2186
|
+
mediaQueryParts.push(`(min-width: ${options.min}px)`);
|
|
2187
|
+
}
|
|
2188
|
+
else {
|
|
2189
|
+
mediaQueryParts.push(`(min-width: ${this.getBreakpointSize(options.min, 'min')}px)`);
|
|
2458
2190
|
}
|
|
2459
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
2460
2191
|
}
|
|
2461
|
-
|
|
2462
|
-
|
|
2192
|
+
if (options.min && options.max) {
|
|
2193
|
+
mediaQueryParts.push('and');
|
|
2463
2194
|
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
this._cleanupObserver(element);
|
|
2195
|
+
if (options.max) {
|
|
2196
|
+
if (typeof options.max === 'number') {
|
|
2197
|
+
mediaQueryParts.push(`(max-width: ${options.max}px)`);
|
|
2198
|
+
}
|
|
2199
|
+
else {
|
|
2200
|
+
mediaQueryParts.push(`(max-width: ${this.getBreakpointSize(options.max, 'max')}px)`);
|
|
2471
2201
|
}
|
|
2472
2202
|
}
|
|
2203
|
+
return mediaQueryParts.join(' ');
|
|
2473
2204
|
}
|
|
2474
|
-
|
|
2475
|
-
if (
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2205
|
+
getCurrentViewport([isXs, isSm, isMd, isLg, isXl, is2Xl]) {
|
|
2206
|
+
if (isXs) {
|
|
2207
|
+
return 'xs';
|
|
2208
|
+
}
|
|
2209
|
+
else if (isSm) {
|
|
2210
|
+
return 'sm';
|
|
2211
|
+
}
|
|
2212
|
+
else if (isMd) {
|
|
2213
|
+
return 'md';
|
|
2214
|
+
}
|
|
2215
|
+
else if (isLg) {
|
|
2216
|
+
return 'lg';
|
|
2217
|
+
}
|
|
2218
|
+
else if (isXl) {
|
|
2219
|
+
return 'xl';
|
|
2482
2220
|
}
|
|
2221
|
+
else if (is2Xl) {
|
|
2222
|
+
return '2xl';
|
|
2223
|
+
}
|
|
2224
|
+
return 'xs';
|
|
2483
2225
|
}
|
|
2484
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2485
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.
|
|
2226
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2227
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ViewportService, providedIn: 'root' }); }
|
|
2486
2228
|
}
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2229
|
+
__decorate([
|
|
2230
|
+
Memo(),
|
|
2231
|
+
__metadata("design:type", Function),
|
|
2232
|
+
__metadata("design:paramtypes", [String, String]),
|
|
2233
|
+
__metadata("design:returntype", void 0)
|
|
2234
|
+
], ViewportService.prototype, "getBreakpointSize", null);
|
|
2235
|
+
__decorate([
|
|
2236
|
+
Memo({
|
|
2237
|
+
resolver: (v) => {
|
|
2238
|
+
return `${v.min ?? ''}-${v.max ?? ''}`;
|
|
2239
|
+
},
|
|
2240
|
+
}),
|
|
2241
|
+
__metadata("design:type", Function),
|
|
2242
|
+
__metadata("design:paramtypes", [Object]),
|
|
2243
|
+
__metadata("design:returntype", void 0)
|
|
2244
|
+
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
2245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ViewportService, decorators: [{
|
|
2501
2246
|
type: Injectable,
|
|
2502
|
-
args: [{
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2247
|
+
args: [{
|
|
2248
|
+
providedIn: 'root',
|
|
2249
|
+
}]
|
|
2250
|
+
}], ctorParameters: () => [], propDecorators: { getBreakpointSize: [], _buildMediaQuery: [] } });
|
|
2251
|
+
|
|
2252
|
+
function isElementSignal(el) {
|
|
2253
|
+
if (isSignal(el)) {
|
|
2254
|
+
const val = el();
|
|
2255
|
+
return typeof val === 'object' && val !== null && 'currentElement' in val && 'previousElement' in val;
|
|
2508
2256
|
}
|
|
2509
|
-
|
|
2510
|
-
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
const documentElementSignal = () => signal({
|
|
2260
|
+
currentElement: document.documentElement,
|
|
2261
|
+
previousElement: null,
|
|
2262
|
+
currentElements: [document.documentElement],
|
|
2263
|
+
previousElements: [],
|
|
2264
|
+
});
|
|
2265
|
+
const buildElementSignal = (el) => {
|
|
2266
|
+
if (el === null || el === undefined) {
|
|
2267
|
+
return signal({ currentElement: null, previousElement: null, currentElements: [], previousElements: [] });
|
|
2511
2268
|
}
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
return new Observable((observer) => {
|
|
2515
|
-
const stream = this._observeElement(element);
|
|
2516
|
-
const subscription = stream.subscribe(observer);
|
|
2517
|
-
return () => {
|
|
2518
|
-
subscription.unsubscribe();
|
|
2519
|
-
this._unobserveElement(element);
|
|
2520
|
-
};
|
|
2521
|
-
});
|
|
2269
|
+
if (isElementSignal(el)) {
|
|
2270
|
+
return el;
|
|
2522
2271
|
}
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
2272
|
+
let mElSignal = null;
|
|
2273
|
+
const switchElement = () => switchMap((elOrRef) => {
|
|
2274
|
+
if (elOrRef instanceof QueryList) {
|
|
2275
|
+
return elOrRef.changes.pipe(startWith(elOrRef), map(() => elOrRef.toArray().map((r) => coerceElement(r))));
|
|
2276
|
+
}
|
|
2277
|
+
else if (Array.isArray(elOrRef)) {
|
|
2278
|
+
return of(elOrRef.map((r) => coerceElement(r)));
|
|
2531
2279
|
}
|
|
2532
2280
|
else {
|
|
2533
|
-
|
|
2281
|
+
const coercedEl = coerceElement(elOrRef);
|
|
2282
|
+
return of(coercedEl ? [coercedEl] : null);
|
|
2534
2283
|
}
|
|
2535
|
-
|
|
2284
|
+
});
|
|
2285
|
+
if (el instanceof Observable) {
|
|
2286
|
+
mElSignal = toSignal(el.pipe(switchElement()), { initialValue: null });
|
|
2536
2287
|
}
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
this._observedElements.get(element).count--;
|
|
2540
|
-
if (!this._observedElements.get(element).count) {
|
|
2541
|
-
this._cleanupObserver(element);
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2288
|
+
else if (isSignal(el)) {
|
|
2289
|
+
mElSignal = toSignal(toObservable(el).pipe(switchElement()), { initialValue: null });
|
|
2544
2290
|
}
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2548
|
-
if (observer) {
|
|
2549
|
-
observer.disconnect();
|
|
2550
|
-
}
|
|
2551
|
-
stream.complete();
|
|
2552
|
-
this._observedElements.delete(element);
|
|
2553
|
-
}
|
|
2291
|
+
else if (el instanceof QueryList) {
|
|
2292
|
+
mElSignal = toSignal(el.changes.pipe(startWith(el), map(() => el.toArray().map((r) => coerceElement(r)))), { initialValue: null });
|
|
2554
2293
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
const
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2294
|
+
else {
|
|
2295
|
+
mElSignal = signal([coerceElement(el)]);
|
|
2296
|
+
}
|
|
2297
|
+
return toSignal(toObservable(mElSignal).pipe(startWith(null), pairwise(), map(([previousElements, currentElements]) => ({
|
|
2298
|
+
previousElements: previousElements ?? [],
|
|
2299
|
+
currentElements: currentElements ?? [],
|
|
2300
|
+
currentElement: currentElements?.[0] ?? null,
|
|
2301
|
+
previousElement: previousElements?.[0] ?? null,
|
|
2302
|
+
}))), { initialValue: { currentElement: null, previousElement: null, previousElements: [], currentElements: [] } });
|
|
2303
|
+
};
|
|
2304
|
+
const buildSignalEffects = (config) => {
|
|
2305
|
+
const injector = inject(Injector);
|
|
2306
|
+
const { map, eachItemFn, cleanupFn } = config;
|
|
2307
|
+
const effectRefMap = {};
|
|
2308
|
+
const has = (token) => token in effectRefMap;
|
|
2309
|
+
const push = (tokenString, signal) => {
|
|
2310
|
+
if (has(tokenString))
|
|
2311
|
+
return;
|
|
2312
|
+
const tokenArray = tokenString.split(' ').filter((token) => !!token);
|
|
2313
|
+
for (const token of tokenArray) {
|
|
2314
|
+
runInInjectionContext(injector, () => {
|
|
2315
|
+
const ref = effect(() => {
|
|
2316
|
+
const value = signal();
|
|
2317
|
+
eachItemFn({ key: token, value });
|
|
2318
|
+
});
|
|
2319
|
+
effectRefMap[token] = ref;
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
const pushMany = (map) => {
|
|
2324
|
+
for (const [tokenString, signal] of Object.entries(map)) {
|
|
2325
|
+
push(tokenString, signal);
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
const remove = (...tokens) => {
|
|
2329
|
+
for (const tokenString of tokens) {
|
|
2330
|
+
effectRefMap[tokenString]?.destroy();
|
|
2331
|
+
cleanupFn({ key: tokenString, value: map[tokenString]?.() });
|
|
2332
|
+
delete effectRefMap[tokenString];
|
|
2333
|
+
}
|
|
2570
2334
|
};
|
|
2335
|
+
const removeMany = (tokens) => {
|
|
2336
|
+
for (const token of tokens) {
|
|
2337
|
+
remove(token);
|
|
2338
|
+
}
|
|
2339
|
+
};
|
|
2340
|
+
pushMany(map);
|
|
2341
|
+
return { remove, removeMany, has, push, pushMany };
|
|
2571
2342
|
};
|
|
2572
|
-
const
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
return this._state$.getValue();
|
|
2585
|
-
}
|
|
2586
|
-
get data$() {
|
|
2587
|
-
return this._state$.pipe(map((state) => state.data), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2588
|
-
}
|
|
2589
|
-
get data() {
|
|
2590
|
-
return this._state$.getValue().data;
|
|
2591
|
-
}
|
|
2592
|
-
get pathParams$() {
|
|
2593
|
-
return this._state$.pipe(map((state) => state.pathParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2594
|
-
}
|
|
2595
|
-
get pathParams() {
|
|
2596
|
-
return this._state$.getValue().pathParams;
|
|
2597
|
-
}
|
|
2598
|
-
get queryParams$() {
|
|
2599
|
-
return this._state$.pipe(map((state) => state.queryParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2600
|
-
}
|
|
2601
|
-
get queryParams() {
|
|
2602
|
-
return this._state$.getValue().queryParams;
|
|
2603
|
-
}
|
|
2604
|
-
get title$() {
|
|
2605
|
-
return this._state$.pipe(map((state) => state.title), distinctUntilChanged());
|
|
2606
|
-
}
|
|
2607
|
-
get title() {
|
|
2608
|
-
return this._state$.getValue().title;
|
|
2609
|
-
}
|
|
2610
|
-
get fragment$() {
|
|
2611
|
-
return this._state$.pipe(map((state) => state.fragment), distinctUntilChanged());
|
|
2612
|
-
}
|
|
2613
|
-
get fragment() {
|
|
2614
|
-
return this._state$.getValue().fragment;
|
|
2615
|
-
}
|
|
2616
|
-
get dataChanges$() {
|
|
2617
|
-
return this.data$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2618
|
-
}
|
|
2619
|
-
get queryParamChanges$() {
|
|
2620
|
-
return this.queryParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2621
|
-
}
|
|
2622
|
-
get pathParamChanges$() {
|
|
2623
|
-
return this.pathParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2624
|
-
}
|
|
2625
|
-
constructor() {
|
|
2626
|
-
this._isScrollTopOnNavigationEnabled = false;
|
|
2627
|
-
this._router = inject(Router);
|
|
2628
|
-
this._route$ = new BehaviorSubject(window.location.pathname);
|
|
2629
|
-
this._state$ = new BehaviorSubject(this._getInitialState());
|
|
2630
|
-
this._afterInitialize$ = new BehaviorSubject(false);
|
|
2631
|
-
this.afterInitialize$ = this._afterInitialize$.pipe(filter((v) => v));
|
|
2632
|
-
this._router.events
|
|
2633
|
-
.pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => {
|
|
2634
|
-
const { url } = event;
|
|
2635
|
-
const urlWithoutQueryParams = url.split('?')[0] ?? '';
|
|
2636
|
-
const withoutFragment = urlWithoutQueryParams.split('#')[0] ?? '';
|
|
2637
|
-
return withoutFragment;
|
|
2638
|
-
}), tap(() => {
|
|
2639
|
-
if (!this._afterInitialize$.getValue()) {
|
|
2640
|
-
this._afterInitialize$.next(true);
|
|
2343
|
+
const signalIsRendered = () => {
|
|
2344
|
+
const isRendered = signal(false);
|
|
2345
|
+
afterNextRender(() => isRendered.set(true));
|
|
2346
|
+
return isRendered.asReadonly();
|
|
2347
|
+
};
|
|
2348
|
+
const signalClasses = (el, classMap) => {
|
|
2349
|
+
const elements = buildElementSignal(el);
|
|
2350
|
+
return buildSignalEffects({
|
|
2351
|
+
map: classMap,
|
|
2352
|
+
eachItemFn: ({ key, value }) => {
|
|
2353
|
+
if (value) {
|
|
2354
|
+
elements().currentElement?.classList.add(key);
|
|
2641
2355
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2356
|
+
else {
|
|
2357
|
+
elements().currentElement?.classList.remove(key);
|
|
2358
|
+
}
|
|
2359
|
+
},
|
|
2360
|
+
cleanupFn: ({ key }) => elements().currentElement?.classList.remove(key),
|
|
2361
|
+
});
|
|
2362
|
+
};
|
|
2363
|
+
const signalHostClasses = (classMap) => signalClasses(inject(ElementRef), classMap);
|
|
2364
|
+
const ALWAYS_TRUE_ATTRIBUTE_KEYS = ['disabled', 'readonly', 'required', 'checked', 'selected', 'hidden', 'inert'];
|
|
2365
|
+
const signalAttributes = (el, attributeMap) => {
|
|
2366
|
+
const elements = buildElementSignal(el);
|
|
2367
|
+
return buildSignalEffects({
|
|
2368
|
+
map: attributeMap,
|
|
2369
|
+
eachItemFn: ({ key, value }) => {
|
|
2370
|
+
const valueString = `${value}`;
|
|
2371
|
+
if (ALWAYS_TRUE_ATTRIBUTE_KEYS.includes(key)) {
|
|
2372
|
+
if (value) {
|
|
2373
|
+
elements().currentElement?.setAttribute(key, '');
|
|
2374
|
+
}
|
|
2375
|
+
else {
|
|
2376
|
+
elements().currentElement?.removeAttribute(key);
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
else {
|
|
2380
|
+
if (value === null || value === undefined) {
|
|
2381
|
+
elements().currentElement?.removeAttribute(key);
|
|
2382
|
+
}
|
|
2383
|
+
else {
|
|
2384
|
+
elements().currentElement?.setAttribute(key, valueString);
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2388
|
+
cleanupFn: ({ key }) => elements().currentElement?.removeAttribute(key),
|
|
2389
|
+
});
|
|
2390
|
+
};
|
|
2391
|
+
const signalHostAttributes = (attributeMap) => signalAttributes(inject(ElementRef), attributeMap);
|
|
2392
|
+
const signalStyles = (el, styleMap) => {
|
|
2393
|
+
const elements = buildElementSignal(el);
|
|
2394
|
+
return buildSignalEffects({
|
|
2395
|
+
map: styleMap,
|
|
2396
|
+
eachItemFn: ({ key, value }) => {
|
|
2397
|
+
if (value === null || value === undefined) {
|
|
2398
|
+
elements().currentElement?.style.removeProperty(key);
|
|
2399
|
+
}
|
|
2400
|
+
else {
|
|
2401
|
+
const valueString = `${value}`;
|
|
2402
|
+
elements().currentElement?.style.setProperty(key, valueString);
|
|
2403
|
+
}
|
|
2404
|
+
},
|
|
2405
|
+
cleanupFn: ({ key }) => elements().currentElement?.style.removeProperty(key),
|
|
2406
|
+
});
|
|
2407
|
+
};
|
|
2408
|
+
const signalHostStyles = (styleMap) => signalStyles(inject(ElementRef), styleMap);
|
|
2409
|
+
const signalElementDimensions = (el) => {
|
|
2410
|
+
const destroyRef = inject(DestroyRef);
|
|
2411
|
+
const elements = buildElementSignal(el);
|
|
2412
|
+
const zone = inject(NgZone);
|
|
2413
|
+
const isRendered = signalIsRendered();
|
|
2414
|
+
const initialValue = () => ({
|
|
2415
|
+
rect: elements().currentElement?.getBoundingClientRect() ?? null,
|
|
2416
|
+
borderBoxSize: null,
|
|
2417
|
+
contentBoxSize: null,
|
|
2418
|
+
devicePixelContentBoxSize: null,
|
|
2419
|
+
});
|
|
2420
|
+
const elementDimensionsSignal = signal(initialValue());
|
|
2421
|
+
const observer = new ResizeObserver((e) => {
|
|
2422
|
+
if (!isRendered())
|
|
2423
|
+
return;
|
|
2424
|
+
const entry = e[0];
|
|
2425
|
+
if (entry) {
|
|
2426
|
+
const devicePixelContentBoxSize = entry.devicePixelContentBoxSize?.[0] ?? null;
|
|
2427
|
+
const borderBoxSize = entry.borderBoxSize?.[0] ?? null;
|
|
2428
|
+
const contentBoxSize = entry.contentBoxSize?.[0] ?? null;
|
|
2429
|
+
zone.run(() => elementDimensionsSignal.set({
|
|
2430
|
+
rect: entry.contentRect,
|
|
2431
|
+
borderBoxSize: borderBoxSize
|
|
2432
|
+
? { inlineSize: borderBoxSize.inlineSize, blockSize: borderBoxSize.blockSize }
|
|
2433
|
+
: null,
|
|
2434
|
+
contentBoxSize: contentBoxSize
|
|
2435
|
+
? { inlineSize: contentBoxSize.inlineSize, blockSize: contentBoxSize.blockSize }
|
|
2436
|
+
: null,
|
|
2437
|
+
devicePixelContentBoxSize: devicePixelContentBoxSize
|
|
2438
|
+
? { inlineSize: devicePixelContentBoxSize.inlineSize, blockSize: devicePixelContentBoxSize.blockSize }
|
|
2439
|
+
: null,
|
|
2440
|
+
}));
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2443
|
+
effect(() => {
|
|
2444
|
+
const els = elements();
|
|
2445
|
+
elementDimensionsSignal.set(initialValue());
|
|
2446
|
+
if (els.previousElement) {
|
|
2447
|
+
observer.disconnect();
|
|
2448
|
+
}
|
|
2449
|
+
if (els.currentElement) {
|
|
2450
|
+
const computedDisplay = getComputedStyle(els.currentElement).display;
|
|
2451
|
+
const currentElIsAngularComponent = els.currentElement?.tagName.toLowerCase().includes('-');
|
|
2452
|
+
if (computedDisplay === 'inline' && isDevMode() && currentElIsAngularComponent) {
|
|
2453
|
+
console.error(`Element <${els.currentElement?.tagName.toLowerCase()}> is an Angular component and has a display of 'inline'. Inline elements cannot be observed for dimensions. Please change it to 'block' or something else.`);
|
|
2454
|
+
}
|
|
2455
|
+
observer.observe(els.currentElement);
|
|
2456
|
+
}
|
|
2457
|
+
}, { allowSignalWrites: true });
|
|
2458
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
2459
|
+
return elementDimensionsSignal.asReadonly();
|
|
2460
|
+
};
|
|
2461
|
+
const signalHostElementDimensions = () => signalElementDimensions(inject(ElementRef));
|
|
2462
|
+
const signalElementMutations = (el, options) => {
|
|
2463
|
+
const destroyRef = inject(DestroyRef);
|
|
2464
|
+
const elements = buildElementSignal(el);
|
|
2465
|
+
const zone = inject(NgZone);
|
|
2466
|
+
const isRendered = signalIsRendered();
|
|
2467
|
+
const elementMutationsSignal = signal(null);
|
|
2468
|
+
const observer = new MutationObserver((e) => {
|
|
2469
|
+
if (!isRendered())
|
|
2470
|
+
return;
|
|
2471
|
+
const entry = e[0];
|
|
2472
|
+
if (entry) {
|
|
2473
|
+
zone.run(() => elementMutationsSignal.set(entry));
|
|
2474
|
+
}
|
|
2475
|
+
});
|
|
2476
|
+
effect(() => {
|
|
2477
|
+
const els = elements();
|
|
2478
|
+
elementMutationsSignal.set(null);
|
|
2479
|
+
if (els.previousElement) {
|
|
2480
|
+
observer.disconnect();
|
|
2481
|
+
}
|
|
2482
|
+
if (els.currentElement) {
|
|
2483
|
+
observer.observe(els.currentElement, options);
|
|
2484
|
+
}
|
|
2485
|
+
}, { allowSignalWrites: true });
|
|
2486
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
2487
|
+
return elementMutationsSignal.asReadonly();
|
|
2488
|
+
};
|
|
2489
|
+
const signalHostElementMutations = (options) => signalElementMutations(inject(ElementRef), options);
|
|
2490
|
+
const signalElementScrollState = (el) => {
|
|
2491
|
+
const elements = buildElementSignal(el);
|
|
2492
|
+
const elementDimensions = signalElementDimensions(elements);
|
|
2493
|
+
const elementMutations = signalElementMutations(elements, { childList: true, subtree: true });
|
|
2494
|
+
const isRendered = signalIsRendered();
|
|
2495
|
+
return computed(() => {
|
|
2496
|
+
const element = elements().currentElement;
|
|
2497
|
+
const dimensions = elementDimensions();
|
|
2498
|
+
const notScrollable = () => ({
|
|
2499
|
+
canScroll: false,
|
|
2500
|
+
canScrollHorizontally: false,
|
|
2501
|
+
canScrollVertically: false,
|
|
2502
|
+
scrollWidth: element?.scrollWidth ?? null,
|
|
2503
|
+
scrollHeight: element?.scrollHeight ?? null,
|
|
2504
|
+
elementDimensions: dimensions,
|
|
2505
|
+
});
|
|
2506
|
+
// We are not interested what the mutation is, just that there is one.
|
|
2507
|
+
// Changes to the DOM can affect the scroll state of the element.
|
|
2508
|
+
elementMutations();
|
|
2509
|
+
if (!element || !dimensions.rect || !isRendered())
|
|
2510
|
+
return notScrollable();
|
|
2511
|
+
const { scrollWidth, scrollHeight } = element;
|
|
2512
|
+
const { width, height } = dimensions.rect;
|
|
2513
|
+
const canScrollHorizontally = scrollWidth > width;
|
|
2514
|
+
const canScrollVertically = scrollHeight > height;
|
|
2515
|
+
return {
|
|
2516
|
+
canScroll: canScrollHorizontally || canScrollVertically,
|
|
2517
|
+
canScrollHorizontally,
|
|
2518
|
+
canScrollVertically,
|
|
2519
|
+
scrollWidth,
|
|
2520
|
+
scrollHeight,
|
|
2521
|
+
elementDimensions: dimensions,
|
|
2522
|
+
};
|
|
2523
|
+
});
|
|
2524
|
+
};
|
|
2525
|
+
const signalHostElementScrollState = () => signalElementScrollState(inject(ElementRef));
|
|
2526
|
+
const signalElementIntersection = (el, options) => {
|
|
2527
|
+
const destroyRef = inject(DestroyRef);
|
|
2528
|
+
const elements = buildElementSignal(el);
|
|
2529
|
+
const root = options?.root ? buildElementSignal(options?.root) : documentElementSignal();
|
|
2530
|
+
const zone = inject(NgZone);
|
|
2531
|
+
const isRendered = signalIsRendered();
|
|
2532
|
+
const isEnabled = options?.enabled ?? signal(true);
|
|
2533
|
+
const elementIntersectionSignal = signal([]);
|
|
2534
|
+
const observer = signal(null);
|
|
2535
|
+
effect(() => {
|
|
2536
|
+
const rootEl = root().currentElement;
|
|
2537
|
+
untracked(() => observer()?.disconnect());
|
|
2538
|
+
const newObserver = new IntersectionObserver((entries) => {
|
|
2539
|
+
if (!isRendered())
|
|
2647
2540
|
return;
|
|
2648
|
-
let
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
title: title ?? null,
|
|
2658
|
-
fragment,
|
|
2659
|
-
});
|
|
2660
|
-
}))
|
|
2661
|
-
.subscribe();
|
|
2662
|
-
}
|
|
2663
|
-
enableScrollEnhancements(config = {}) {
|
|
2664
|
-
if (this._isScrollTopOnNavigationEnabled) {
|
|
2665
|
-
return;
|
|
2666
|
-
}
|
|
2667
|
-
this._isScrollTopOnNavigationEnabled = true;
|
|
2668
|
-
combineLatest([this._state$.pipe(pairwise()), this._route$.pipe(pairwise())])
|
|
2669
|
-
.pipe(debounceTime(1))
|
|
2670
|
-
.subscribe(([[prevState, currState], [prevRoute, currRoute]]) => {
|
|
2671
|
-
const sameUrlNavigation = prevRoute === currRoute;
|
|
2672
|
-
const didFragmentChange = prevState.fragment !== currState.fragment;
|
|
2673
|
-
if (sameUrlNavigation) {
|
|
2674
|
-
const allQueryParams = [
|
|
2675
|
-
...new Set(Object.keys(prevState.queryParams).concat(Object.keys(currState.queryParams))),
|
|
2676
|
-
];
|
|
2677
|
-
const changedQueryParams = allQueryParams.filter((key) => currState.queryParams[key] !== prevState.queryParams[key]);
|
|
2678
|
-
if (!config.queryParamTriggerList?.length && !didFragmentChange) {
|
|
2679
|
-
return;
|
|
2680
|
-
}
|
|
2681
|
-
const caseQueryParams = changedQueryParams.some((key) => config.queryParamTriggerList?.includes(key));
|
|
2682
|
-
const caseFragment = didFragmentChange && config.fragment?.enabled;
|
|
2683
|
-
if (caseQueryParams) {
|
|
2684
|
-
(config.scrollElement ?? document.documentElement).scrollTop = 0;
|
|
2541
|
+
let currentValues = untracked(() => [...elementIntersectionSignal()]);
|
|
2542
|
+
for (const entry of entries) {
|
|
2543
|
+
const existingEntryIndex = currentValues.findIndex((v) => v.target === entry.target);
|
|
2544
|
+
if (existingEntryIndex !== -1) {
|
|
2545
|
+
currentValues = [
|
|
2546
|
+
...currentValues.slice(0, existingEntryIndex),
|
|
2547
|
+
entry,
|
|
2548
|
+
...currentValues.slice(existingEntryIndex + 1),
|
|
2549
|
+
];
|
|
2685
2550
|
}
|
|
2686
|
-
else
|
|
2687
|
-
|
|
2688
|
-
if (fragmentElement) {
|
|
2689
|
-
fragmentElement.scrollIntoView({ behavior: config.fragment?.smooth ? 'smooth' : 'auto' });
|
|
2690
|
-
}
|
|
2551
|
+
else {
|
|
2552
|
+
currentValues = [...currentValues, entry];
|
|
2691
2553
|
}
|
|
2692
2554
|
}
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2555
|
+
zone.run(() => elementIntersectionSignal.set(currentValues));
|
|
2556
|
+
}, { ...options, root: rootEl });
|
|
2557
|
+
observer.set(newObserver);
|
|
2558
|
+
}, { allowSignalWrites: true });
|
|
2559
|
+
effect(() => {
|
|
2560
|
+
const els = elements();
|
|
2561
|
+
const obs = observer();
|
|
2562
|
+
const enabled = isEnabled();
|
|
2563
|
+
elementIntersectionSignal.set([]);
|
|
2564
|
+
if (els.previousElements.length) {
|
|
2565
|
+
obs?.disconnect();
|
|
2566
|
+
}
|
|
2567
|
+
if (els.currentElements.length && !!enabled) {
|
|
2568
|
+
for (const el of els.currentElements) {
|
|
2569
|
+
obs?.observe(el);
|
|
2702
2570
|
}
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
const
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2571
|
+
}
|
|
2572
|
+
}, { allowSignalWrites: true });
|
|
2573
|
+
destroyRef.onDestroy(() => observer()?.disconnect());
|
|
2574
|
+
return elementIntersectionSignal;
|
|
2575
|
+
};
|
|
2576
|
+
const signalHostElementIntersection = (options) => signalElementIntersection(inject(ElementRef), options);
|
|
2577
|
+
const signalElementChildren = (el) => {
|
|
2578
|
+
const elements = buildElementSignal(el);
|
|
2579
|
+
const isRendered = signalIsRendered();
|
|
2580
|
+
const elementMutations = signalElementMutations(elements, { childList: true, subtree: true, attributes: true });
|
|
2581
|
+
return computed(() => {
|
|
2582
|
+
if (!isRendered())
|
|
2583
|
+
return [];
|
|
2584
|
+
const els = elements();
|
|
2585
|
+
// We are not interested what the mutation is, just that there is one.
|
|
2586
|
+
// Changes to the DOM may affect the children of the element.
|
|
2587
|
+
elementMutations();
|
|
2588
|
+
if (!els.currentElement)
|
|
2589
|
+
return [];
|
|
2590
|
+
const children = [];
|
|
2591
|
+
for (let index = 0; index < els.currentElement.children.length; index++) {
|
|
2592
|
+
const element = els.currentElement.children[index];
|
|
2593
|
+
if (element instanceof HTMLElement) {
|
|
2594
|
+
children.push(element);
|
|
2724
2595
|
}
|
|
2725
2596
|
}
|
|
2726
|
-
return
|
|
2597
|
+
return children;
|
|
2598
|
+
});
|
|
2599
|
+
};
|
|
2600
|
+
const previousSignalValue = (signal) => {
|
|
2601
|
+
const obs = toObservable(signal).pipe(pairwise(), map(([prev]) => prev));
|
|
2602
|
+
return toSignal(obs);
|
|
2603
|
+
};
|
|
2604
|
+
const syncSignal = (from, to) => {
|
|
2605
|
+
effect(() => {
|
|
2606
|
+
const formVal = from();
|
|
2607
|
+
untracked(() => {
|
|
2608
|
+
to.set(formVal);
|
|
2609
|
+
});
|
|
2610
|
+
});
|
|
2611
|
+
};
|
|
2612
|
+
const controlValueSignal = (control, options) => {
|
|
2613
|
+
const vcsObs = options?.debounceTime
|
|
2614
|
+
? control.valueChanges.pipe(debounceTime(options?.debounceTime ?? 300))
|
|
2615
|
+
: control.valueChanges;
|
|
2616
|
+
const obs = options?.debounceFirst
|
|
2617
|
+
? merge(of(control.value), vcsObs)
|
|
2618
|
+
: vcsObs.pipe(startWith(control.getRawValue()));
|
|
2619
|
+
return toSignal(obs.pipe(distinctUntilChanged((a, b) => equal(a, b))), {
|
|
2620
|
+
requireSync: true,
|
|
2621
|
+
});
|
|
2622
|
+
};
|
|
2623
|
+
/**
|
|
2624
|
+
* The first item in the pair is the previous value and the second item is the current value.
|
|
2625
|
+
*/
|
|
2626
|
+
const controlValueSignalWithPrevious = (control, options) => {
|
|
2627
|
+
const obs = toObservable(controlValueSignal(control, options)).pipe(pairwise(), startWith([null, control.getRawValue()]));
|
|
2628
|
+
return toSignal(obs, { requireSync: true });
|
|
2629
|
+
};
|
|
2630
|
+
/**
|
|
2631
|
+
* @deprecated Use `controlValueSignal` instead with `debounceTime` set to `300` and `debounceFirst` set to `true`.
|
|
2632
|
+
*/
|
|
2633
|
+
const debouncedControlValueSignal = (control, options) => controlValueSignal(control, options ?? { debounceTime: 300, debounceFirst: true });
|
|
2634
|
+
const injectOrRunInContext = (fn, config) => {
|
|
2635
|
+
if (config?.injector) {
|
|
2636
|
+
return runInInjectionContext(config.injector, fn);
|
|
2727
2637
|
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
const currentQueryParams = window.location.search;
|
|
2735
|
-
const currentFragment = window.location.hash;
|
|
2736
|
-
if (currentQueryParams) {
|
|
2737
|
-
const params = new URLSearchParams(currentQueryParams);
|
|
2738
|
-
params.forEach((value, key) => {
|
|
2739
|
-
queryParams[key] = value;
|
|
2740
|
-
});
|
|
2741
|
-
}
|
|
2742
|
-
if (currentFragment) {
|
|
2743
|
-
fragment = currentFragment.slice(1);
|
|
2744
|
-
}
|
|
2745
|
-
return {
|
|
2746
|
-
data,
|
|
2747
|
-
pathParams,
|
|
2748
|
-
queryParams,
|
|
2749
|
-
title,
|
|
2750
|
-
fragment,
|
|
2751
|
-
};
|
|
2638
|
+
return fn();
|
|
2639
|
+
};
|
|
2640
|
+
const transformOrReturn = (src, config) => {
|
|
2641
|
+
const transformer = config?.transform;
|
|
2642
|
+
if (transformer) {
|
|
2643
|
+
return computed(() => transformer(src()));
|
|
2752
2644
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2645
|
+
return src;
|
|
2646
|
+
};
|
|
2647
|
+
/** Inject a signal containing the current route fragment (the part after the # inside the url if present) */
|
|
2648
|
+
const injectFragment = (config) => {
|
|
2649
|
+
return injectOrRunInContext(() => {
|
|
2650
|
+
const routerStateService = inject(RouterStateService);
|
|
2651
|
+
const src = toSignal(routerStateService.fragment$, { initialValue: routerStateService.fragment });
|
|
2652
|
+
return transformOrReturn(src, config);
|
|
2653
|
+
}, config);
|
|
2654
|
+
};
|
|
2655
|
+
/** Inject all currently available query parameters as a signal */
|
|
2656
|
+
const injectQueryParams = (config) => {
|
|
2657
|
+
return injectOrRunInContext(() => {
|
|
2658
|
+
const routerStateService = inject(RouterStateService);
|
|
2659
|
+
return toSignal(routerStateService.queryParams$, { initialValue: routerStateService.queryParams });
|
|
2660
|
+
}, config);
|
|
2661
|
+
};
|
|
2662
|
+
/** Inject all currently available route data as a signal */
|
|
2663
|
+
const injectRouteData = (config) => {
|
|
2664
|
+
return injectOrRunInContext(() => {
|
|
2665
|
+
const routerStateService = inject(RouterStateService);
|
|
2666
|
+
return toSignal(routerStateService.data$, { initialValue: routerStateService.data });
|
|
2667
|
+
}, config);
|
|
2668
|
+
};
|
|
2669
|
+
/** Inject the current route title as a signal */
|
|
2670
|
+
const injectRouteTitle = (config) => {
|
|
2671
|
+
return injectOrRunInContext(() => {
|
|
2672
|
+
const routerStateService = inject(RouterStateService);
|
|
2673
|
+
const src = toSignal(routerStateService.title$, { initialValue: routerStateService.title });
|
|
2674
|
+
return transformOrReturn(src, config);
|
|
2675
|
+
}, config);
|
|
2676
|
+
};
|
|
2677
|
+
/** Inject all currently available path parameters as a signal */
|
|
2678
|
+
const injectPathParams = (config) => {
|
|
2679
|
+
return injectOrRunInContext(() => {
|
|
2680
|
+
const routerStateService = inject(RouterStateService);
|
|
2681
|
+
return toSignal(routerStateService.pathParams$, { initialValue: routerStateService.pathParams });
|
|
2682
|
+
}, config);
|
|
2683
|
+
};
|
|
2684
|
+
/** Inject a specific query parameter as a signal */
|
|
2685
|
+
const injectQueryParam = (key, config) => {
|
|
2686
|
+
const queryParams = injectQueryParams(config);
|
|
2687
|
+
const src = computed(() => queryParams()[key] ?? null);
|
|
2688
|
+
return transformOrReturn(src, config);
|
|
2689
|
+
};
|
|
2690
|
+
/** Inject a specific route data item as a signal */
|
|
2691
|
+
const injectRouteDataItem = (key, config) => {
|
|
2692
|
+
const data = injectRouteData(config);
|
|
2693
|
+
const src = computed(() => data()[key] ?? null);
|
|
2694
|
+
return transformOrReturn(src, config);
|
|
2695
|
+
};
|
|
2696
|
+
/** Inject a specific path parameter as a signal */
|
|
2697
|
+
const injectPathParam = (key, config) => {
|
|
2698
|
+
const pathParams = injectPathParams(config);
|
|
2699
|
+
const src = computed(() => pathParams()[key] ?? null);
|
|
2700
|
+
return transformOrReturn(src, config);
|
|
2701
|
+
};
|
|
2762
2702
|
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
get isMd() {
|
|
2780
|
-
return this._isMd$.value;
|
|
2781
|
-
}
|
|
2782
|
-
get isLg$() {
|
|
2783
|
-
return this._isLg$.asObservable();
|
|
2784
|
-
}
|
|
2785
|
-
get isLg() {
|
|
2786
|
-
return this._isLg$.value;
|
|
2787
|
-
}
|
|
2788
|
-
get isXl$() {
|
|
2789
|
-
return this._isXl$.asObservable();
|
|
2790
|
-
}
|
|
2791
|
-
get isXl() {
|
|
2792
|
-
return this._isXl$.value;
|
|
2793
|
-
}
|
|
2794
|
-
get is2Xl$() {
|
|
2795
|
-
return this._is2Xl$.asObservable();
|
|
2796
|
-
}
|
|
2797
|
-
get is2Xl() {
|
|
2798
|
-
return this._is2Xl$.value;
|
|
2799
|
-
}
|
|
2800
|
-
get viewportSize$() {
|
|
2801
|
-
return this._viewportSize$.asObservable();
|
|
2703
|
+
const scrollBehaviorSupported = supportsScrollBehavior();
|
|
2704
|
+
let _uniqueIdCounter = 0;
|
|
2705
|
+
const BLOCK_CLASS = 'cdk-global-scrollblock';
|
|
2706
|
+
const OVERSCROLL_CLASS = 'et-global-no-overscroll';
|
|
2707
|
+
class SmartBlockScrollStrategy {
|
|
2708
|
+
constructor(_viewportRuler, _routerState, document) {
|
|
2709
|
+
this._viewportRuler = _viewportRuler;
|
|
2710
|
+
this._routerState = _routerState;
|
|
2711
|
+
this._id = _uniqueIdCounter++;
|
|
2712
|
+
this._previousHTMLStyles = { top: '', left: '' };
|
|
2713
|
+
this._previousScrollPosition = { top: 0, left: 0 };
|
|
2714
|
+
this._isEnabled = false;
|
|
2715
|
+
this._urlSubscription = null;
|
|
2716
|
+
this._resizeSubscription = null;
|
|
2717
|
+
this._didNavigate = false;
|
|
2718
|
+
this._document = document;
|
|
2802
2719
|
}
|
|
2803
|
-
|
|
2804
|
-
|
|
2720
|
+
attach() {
|
|
2721
|
+
// noop
|
|
2805
2722
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
2723
|
+
enable() {
|
|
2724
|
+
if (this._canBeEnabled()) {
|
|
2725
|
+
const root = this._document.documentElement;
|
|
2726
|
+
root.classList.add(OVERSCROLL_CLASS);
|
|
2727
|
+
this._resizeSubscription = createResizeObservable({ elements: root })
|
|
2728
|
+
.pipe(startWith(null), tap(() => {
|
|
2729
|
+
if (this._isEnabled || !elementCanScroll(root) || !this._canBeEnabled())
|
|
2730
|
+
return;
|
|
2731
|
+
this._isEnabled = true;
|
|
2732
|
+
this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
|
|
2733
|
+
this._didNavigate = false;
|
|
2734
|
+
this._previousHTMLStyles.left = root.style.left || '';
|
|
2735
|
+
this._previousHTMLStyles.top = root.style.top || '';
|
|
2736
|
+
root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);
|
|
2737
|
+
root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);
|
|
2738
|
+
root.classList.add(BLOCK_CLASS);
|
|
2739
|
+
this._urlSubscription = this._routerState.route$
|
|
2740
|
+
.pipe(skip(1), take(1), tap(() => {
|
|
2741
|
+
this._didNavigate = true;
|
|
2742
|
+
}))
|
|
2743
|
+
.subscribe();
|
|
2744
|
+
}))
|
|
2745
|
+
.subscribe();
|
|
2746
|
+
}
|
|
2808
2747
|
}
|
|
2809
|
-
|
|
2810
|
-
|
|
2748
|
+
disable() {
|
|
2749
|
+
this._urlSubscription?.unsubscribe();
|
|
2750
|
+
this._resizeSubscription?.unsubscribe();
|
|
2751
|
+
const html = this._document.documentElement;
|
|
2752
|
+
if (this._canBeEnabled()) {
|
|
2753
|
+
html.classList.remove(OVERSCROLL_CLASS);
|
|
2754
|
+
}
|
|
2755
|
+
if (this._isEnabled) {
|
|
2756
|
+
const body = this._document.body;
|
|
2757
|
+
const htmlStyle = html.style;
|
|
2758
|
+
const bodyStyle = body.style;
|
|
2759
|
+
const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
|
|
2760
|
+
const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';
|
|
2761
|
+
this._isEnabled = false;
|
|
2762
|
+
htmlStyle.left = this._previousHTMLStyles.left;
|
|
2763
|
+
htmlStyle.top = this._previousHTMLStyles.top;
|
|
2764
|
+
html.classList.remove(BLOCK_CLASS);
|
|
2765
|
+
if (scrollBehaviorSupported) {
|
|
2766
|
+
htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
|
|
2767
|
+
}
|
|
2768
|
+
if (!this._didNavigate) {
|
|
2769
|
+
window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
|
|
2770
|
+
}
|
|
2771
|
+
if (scrollBehaviorSupported) {
|
|
2772
|
+
htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
|
|
2773
|
+
bodyStyle.scrollBehavior = previousBodyScrollBehavior;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2811
2776
|
}
|
|
2812
|
-
|
|
2813
|
-
|
|
2777
|
+
_canBeEnabled() {
|
|
2778
|
+
const html = this._document.documentElement;
|
|
2779
|
+
if (html.classList.contains(BLOCK_CLASS) || this._isEnabled) {
|
|
2780
|
+
return false;
|
|
2781
|
+
}
|
|
2782
|
+
return true;
|
|
2814
2783
|
}
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
const isPrimitiveArray = (value) => {
|
|
2787
|
+
if (!Array.isArray(value))
|
|
2788
|
+
return false;
|
|
2789
|
+
const first = value[0];
|
|
2790
|
+
const last = value[value.length - 1];
|
|
2791
|
+
if (!first || !last)
|
|
2792
|
+
return false;
|
|
2793
|
+
return typeof first !== 'object' && typeof last !== 'object';
|
|
2794
|
+
};
|
|
2795
|
+
const isObjectArray = (value) => {
|
|
2796
|
+
if (!Array.isArray(value))
|
|
2797
|
+
return false;
|
|
2798
|
+
const first = value[0];
|
|
2799
|
+
const last = value[value.length - 1];
|
|
2800
|
+
if (!first || !last)
|
|
2801
|
+
return false;
|
|
2802
|
+
return typeof first === 'object' && typeof last === 'object' && !Array.isArray(first) && !Array.isArray(last);
|
|
2803
|
+
};
|
|
2804
|
+
const isEmptyArray = (value) => {
|
|
2805
|
+
return Array.isArray(value) && value.length === 0;
|
|
2806
|
+
};
|
|
2807
|
+
|
|
2808
|
+
const provideViewportConfig = (viewportConfig) => {
|
|
2809
|
+
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
2810
|
+
};
|
|
2811
|
+
|
|
2812
|
+
const ANIMATABLE_TOKEN = new InjectionToken('ANIMATABLE_DIRECTIVE_TOKEN');
|
|
2813
|
+
class AnimatableDirective {
|
|
2815
2814
|
constructor() {
|
|
2816
|
-
this.
|
|
2817
|
-
this.
|
|
2818
|
-
this.
|
|
2819
|
-
this.
|
|
2820
|
-
this.
|
|
2821
|
-
this.
|
|
2822
|
-
this.
|
|
2823
|
-
this.
|
|
2824
|
-
this.
|
|
2825
|
-
this.
|
|
2826
|
-
this.
|
|
2827
|
-
this.
|
|
2828
|
-
this.
|
|
2829
|
-
this.
|
|
2830
|
-
this._observeDefaultBreakpoints();
|
|
2831
|
-
}
|
|
2832
|
-
observe(options) {
|
|
2833
|
-
const mediaQuery = this._buildMediaQuery(options);
|
|
2834
|
-
return this._breakpointObserver.observe(mediaQuery).pipe(map((x) => x.matches), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2815
|
+
this._didEmitStart = false;
|
|
2816
|
+
this._parent = inject(ANIMATABLE_TOKEN, { optional: true, skipSelf: true });
|
|
2817
|
+
this._destroy$ = createDestroy();
|
|
2818
|
+
this._elementRef = inject(ElementRef);
|
|
2819
|
+
this._animationStart$ = new Subject();
|
|
2820
|
+
this._animationEnd$ = new Subject();
|
|
2821
|
+
this._animationCancelled$ = new Subject();
|
|
2822
|
+
this._animatedElement$ = new BehaviorSubject(this._elementRef.nativeElement);
|
|
2823
|
+
this.animationStart$ = this._animationStart$.asObservable().pipe(debounceTime(0));
|
|
2824
|
+
this.animationEnd$ = this._animationEnd$.asObservable().pipe(debounceTime(0));
|
|
2825
|
+
this.animationCancelled$ = this._animationCancelled$.asObservable().pipe(debounceTime(0));
|
|
2826
|
+
this._hostActiveAnimationCount$ = new BehaviorSubject(0);
|
|
2827
|
+
this._totalActiveAnimationCount$ = new BehaviorSubject(0);
|
|
2828
|
+
this.isAnimating$ = this._totalActiveAnimationCount$.pipe(map((count) => count > 0), debounceTime(0));
|
|
2835
2829
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2830
|
+
set animatedElement(value) {
|
|
2831
|
+
let newElement = null;
|
|
2832
|
+
if (value === null || value === undefined || value === '') {
|
|
2833
|
+
newElement = this._elementRef.nativeElement;
|
|
2834
|
+
}
|
|
2835
|
+
else if (typeof value === 'string') {
|
|
2836
|
+
const el = document.querySelector(value);
|
|
2837
|
+
if (el) {
|
|
2838
|
+
newElement = el;
|
|
2839
|
+
}
|
|
2840
|
+
else {
|
|
2841
|
+
if (isDevMode()) {
|
|
2842
|
+
console.warn(`Element with selector ${value} not found. Animatable directive will use host element.`);
|
|
2843
|
+
}
|
|
2844
|
+
newElement = this._elementRef.nativeElement;
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
else {
|
|
2848
|
+
newElement = value;
|
|
2849
|
+
}
|
|
2850
|
+
if (this._animatedElement$.value !== newElement) {
|
|
2851
|
+
this._animatedElement$.next(newElement);
|
|
2852
|
+
}
|
|
2839
2853
|
}
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
this._viewportSize$.next(null);
|
|
2869
|
-
}), takeUntil(this._viewportMonitorStop$))
|
|
2854
|
+
ngOnInit() {
|
|
2855
|
+
this._animatedElement$
|
|
2856
|
+
.pipe(tap((el) => {
|
|
2857
|
+
this._totalActiveAnimationCount$.next(this._totalActiveAnimationCount$.value - this._hostActiveAnimationCount$.value);
|
|
2858
|
+
this._hostActiveAnimationCount$.next(0);
|
|
2859
|
+
merge(fromEvent(el, 'animationstart'), fromEvent(el, 'transitionstart'))
|
|
2860
|
+
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2861
|
+
tap(() => {
|
|
2862
|
+
const count = this._hostActiveAnimationCount$.value + 1;
|
|
2863
|
+
this._hostActiveAnimationCount$.next(count);
|
|
2864
|
+
this._totalActiveAnimationCount$.next(count);
|
|
2865
|
+
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2866
|
+
.subscribe();
|
|
2867
|
+
merge(fromEvent(el, 'animationend'), fromEvent(el, 'animationcancel'), fromEvent(el, 'transitionend'), fromEvent(el, 'transitioncancel'))
|
|
2868
|
+
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2869
|
+
tap(() => {
|
|
2870
|
+
const count = this._hostActiveAnimationCount$.value - 1;
|
|
2871
|
+
this._hostActiveAnimationCount$.next(count);
|
|
2872
|
+
this._totalActiveAnimationCount$.next(count);
|
|
2873
|
+
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2874
|
+
.subscribe();
|
|
2875
|
+
merge(fromEvent(el, 'animationcancel'), fromEvent(el, 'transitioncancel'))
|
|
2876
|
+
.pipe(filter((e) => e.target === el), // skip events from children
|
|
2877
|
+
tap(() => {
|
|
2878
|
+
this._animationCancelled$.next();
|
|
2879
|
+
}), takeUntil(this._destroy$), takeUntil(this._animatedElement$.pipe(skip(1))))
|
|
2880
|
+
.subscribe();
|
|
2881
|
+
}), takeUntil(this._destroy$))
|
|
2870
2882
|
.subscribe();
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
if (!entry)
|
|
2883
|
-
return;
|
|
2884
|
-
const size = entry.contentRect.width;
|
|
2885
|
-
const obj = { width: 100 - size, height: 100 - size };
|
|
2886
|
-
if (equal(obj, this._scrollbarSize$.value))
|
|
2887
|
-
return;
|
|
2888
|
-
document.documentElement.style.setProperty('--et-sw', `${obj.width}px`);
|
|
2889
|
-
document.documentElement.style.setProperty('--et-sh', `${obj.height}px`);
|
|
2890
|
-
this._scrollbarSize$.next(obj);
|
|
2891
|
-
}), finalize(() => {
|
|
2892
|
-
document.body.removeChild(scrollbarRuler);
|
|
2893
|
-
document.documentElement.style.removeProperty('--et-vw');
|
|
2894
|
-
document.documentElement.style.removeProperty('--et-vh');
|
|
2895
|
-
this._scrollbarSize$.next(null);
|
|
2896
|
-
}), takeUntil(this._viewportMonitorStop$))
|
|
2883
|
+
this._totalActiveAnimationCount$
|
|
2884
|
+
.pipe(tap((count) => {
|
|
2885
|
+
if (count > 0 && !this._didEmitStart) {
|
|
2886
|
+
this._animationStart$.next();
|
|
2887
|
+
this._didEmitStart = true;
|
|
2888
|
+
}
|
|
2889
|
+
else if (count === 0) {
|
|
2890
|
+
this._animationEnd$.next();
|
|
2891
|
+
this._didEmitStart = false;
|
|
2892
|
+
}
|
|
2893
|
+
}), takeUntil(this._destroy$))
|
|
2897
2894
|
.subscribe();
|
|
2895
|
+
if (this._parent) {
|
|
2896
|
+
this._parent._hostActiveAnimationCount$
|
|
2897
|
+
.pipe(takeUntil(this._destroy$), tap((count) => {
|
|
2898
|
+
this._totalActiveAnimationCount$.next(count + this._hostActiveAnimationCount$.value);
|
|
2899
|
+
}))
|
|
2900
|
+
.subscribe();
|
|
2901
|
+
}
|
|
2898
2902
|
}
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2903
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2904
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: AnimatableDirective, isStandalone: true, selector: "[etAnimatable]", inputs: { animatedElement: ["etAnimatable", "animatedElement"] }, providers: [
|
|
2905
|
+
{
|
|
2906
|
+
provide: ANIMATABLE_TOKEN,
|
|
2907
|
+
useExisting: AnimatableDirective,
|
|
2908
|
+
},
|
|
2909
|
+
], exportAs: ["etAnimatable"], ngImport: i0 }); }
|
|
2910
|
+
}
|
|
2911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatableDirective, decorators: [{
|
|
2912
|
+
type: Directive,
|
|
2913
|
+
args: [{
|
|
2914
|
+
selector: '[etAnimatable]',
|
|
2915
|
+
exportAs: 'etAnimatable',
|
|
2916
|
+
standalone: true,
|
|
2917
|
+
providers: [
|
|
2918
|
+
{
|
|
2919
|
+
provide: ANIMATABLE_TOKEN,
|
|
2920
|
+
useExisting: AnimatableDirective,
|
|
2921
|
+
},
|
|
2922
|
+
],
|
|
2923
|
+
}]
|
|
2924
|
+
}], propDecorators: { animatedElement: [{
|
|
2925
|
+
type: Input,
|
|
2926
|
+
args: ['etAnimatable']
|
|
2927
|
+
}] } });
|
|
2928
|
+
|
|
2929
|
+
const ANIMATED_LIFECYCLE_TOKEN = new InjectionToken('ANIMATED_LIFECYCLE_DIRECTIVE_TOKEN');
|
|
2930
|
+
const ANIMATION_CLASSES = {
|
|
2931
|
+
enterFrom: 'et-animation-enter-from',
|
|
2932
|
+
enterActive: 'et-animation-enter-active',
|
|
2933
|
+
enterTo: 'et-animation-enter-to',
|
|
2934
|
+
leaveFrom: 'et-animation-leave-from',
|
|
2935
|
+
leaveActive: 'et-animation-leave-active',
|
|
2936
|
+
leaveTo: 'et-animation-leave-to',
|
|
2937
|
+
};
|
|
2938
|
+
class AnimatedLifecycleDirective {
|
|
2939
|
+
constructor() {
|
|
2940
|
+
this._destroy$ = createDestroy();
|
|
2941
|
+
this._elementRef = inject(ElementRef);
|
|
2942
|
+
this._animatable = inject(ANIMATABLE_TOKEN);
|
|
2943
|
+
this._classList = this._elementRef.nativeElement.classList;
|
|
2944
|
+
this._isConstructed = false;
|
|
2945
|
+
this._state$ = new BehaviorSubject('init');
|
|
2946
|
+
this.state$ = this._state$.asObservable();
|
|
2947
|
+
this.hostClassBindings = signalHostClasses({
|
|
2948
|
+
'et-force-invisible': toSignal(this._state$.pipe(map((state) => state === 'init'))),
|
|
2949
|
+
});
|
|
2950
|
+
this.stateChange = outputFromObservable(this._state$);
|
|
2951
|
+
this.skipNextEnter = model(false);
|
|
2902
2952
|
}
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
const size = this._viewportConfig.breakpoints[type][index];
|
|
2906
|
-
if (size === Infinity || size === 0) {
|
|
2907
|
-
return size;
|
|
2908
|
-
}
|
|
2909
|
-
if (option === 'min') {
|
|
2910
|
-
return size;
|
|
2911
|
-
}
|
|
2912
|
-
// Due to scaling, the actual size of the viewport may be a decimal number.
|
|
2913
|
-
// Eg. on Windows 11 with 150% scaling, the viewport size may be 1535.33px
|
|
2914
|
-
// and thus not matching any of the default breakpoints.
|
|
2915
|
-
return size + 0.9;
|
|
2953
|
+
get state() {
|
|
2954
|
+
return this._state$.value;
|
|
2916
2955
|
}
|
|
2917
|
-
|
|
2918
|
-
this.
|
|
2919
|
-
this.observe({ min: 'sm', max: 'sm' }).subscribe(this._isSm$);
|
|
2920
|
-
this.observe({ min: 'md', max: 'md' }).subscribe(this._isMd$);
|
|
2921
|
-
this.observe({ min: 'lg', max: 'lg' }).subscribe(this._isLg$);
|
|
2922
|
-
this.observe({ min: 'xl', max: 'xl' }).subscribe(this._isXl$);
|
|
2923
|
-
this.observe({ min: '2xl' }).subscribe(this._is2Xl$);
|
|
2956
|
+
ngAfterViewInit() {
|
|
2957
|
+
this._isConstructed = true;
|
|
2924
2958
|
}
|
|
2925
|
-
|
|
2926
|
-
if (
|
|
2927
|
-
|
|
2959
|
+
enter(config) {
|
|
2960
|
+
if (this.state === 'entering')
|
|
2961
|
+
return;
|
|
2962
|
+
if ((this.state === 'init' && !this._isConstructed) || this.skipNextEnter()) {
|
|
2963
|
+
// Force the state to entered so that the element is not animated when it is first rendered.
|
|
2964
|
+
this._forceState('entered');
|
|
2965
|
+
this.skipNextEnter.set(false);
|
|
2966
|
+
return;
|
|
2928
2967
|
}
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
}
|
|
2934
|
-
else {
|
|
2935
|
-
mediaQueryParts.push(`(min-width: ${this.getBreakpointSize(options.min, 'min')}px)`);
|
|
2936
|
-
}
|
|
2968
|
+
if (this.state === 'leaving') {
|
|
2969
|
+
this._classList.remove(ANIMATION_CLASSES.leaveFrom);
|
|
2970
|
+
this._classList.remove(ANIMATION_CLASSES.leaveActive);
|
|
2971
|
+
this._classList.remove(ANIMATION_CLASSES.leaveTo);
|
|
2937
2972
|
}
|
|
2938
|
-
|
|
2939
|
-
|
|
2973
|
+
this._state$.next('entering');
|
|
2974
|
+
if (!config?.onlyTransition) {
|
|
2975
|
+
this._classList.add(ANIMATION_CLASSES.enterFrom);
|
|
2940
2976
|
}
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2977
|
+
forceReflow();
|
|
2978
|
+
this._classList.add(ANIMATION_CLASSES.enterActive);
|
|
2979
|
+
fromNextFrame()
|
|
2980
|
+
.pipe(tap(() => {
|
|
2981
|
+
if (!config?.onlyTransition && this.state === 'entering') {
|
|
2982
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
2983
|
+
this._classList.add(ANIMATION_CLASSES.enterTo);
|
|
2944
2984
|
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2985
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
2986
|
+
if (this.state !== 'entering')
|
|
2987
|
+
return;
|
|
2988
|
+
this._state$.next('entered');
|
|
2989
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
2990
|
+
if (!config?.onlyTransition) {
|
|
2991
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
2947
2992
|
}
|
|
2948
|
-
}
|
|
2949
|
-
|
|
2993
|
+
}), takeUntil(this._destroy$), take(1))
|
|
2994
|
+
.subscribe();
|
|
2950
2995
|
}
|
|
2951
|
-
|
|
2952
|
-
if (
|
|
2953
|
-
return
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
return
|
|
2996
|
+
leave(config) {
|
|
2997
|
+
if (this.state === 'leaving')
|
|
2998
|
+
return;
|
|
2999
|
+
if (this.state === 'init') {
|
|
3000
|
+
this._state$.next('left');
|
|
3001
|
+
return;
|
|
2957
3002
|
}
|
|
2958
|
-
|
|
2959
|
-
|
|
3003
|
+
if (this.state === 'entering') {
|
|
3004
|
+
this._classList.remove(ANIMATION_CLASSES.enterFrom);
|
|
3005
|
+
this._classList.remove(ANIMATION_CLASSES.enterActive);
|
|
3006
|
+
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
2960
3007
|
}
|
|
2961
|
-
|
|
2962
|
-
|
|
3008
|
+
this._state$.next('leaving');
|
|
3009
|
+
if (!config?.onlyTransition) {
|
|
3010
|
+
this._classList.add(ANIMATION_CLASSES.leaveFrom);
|
|
2963
3011
|
}
|
|
2964
|
-
|
|
2965
|
-
|
|
3012
|
+
forceReflow();
|
|
3013
|
+
this._classList.add(ANIMATION_CLASSES.leaveActive);
|
|
3014
|
+
fromNextFrame()
|
|
3015
|
+
.pipe(tap(() => {
|
|
3016
|
+
if (!config?.onlyTransition && this.state === 'leaving') {
|
|
3017
|
+
this._classList.remove(ANIMATION_CLASSES.leaveFrom);
|
|
3018
|
+
this._classList.add(ANIMATION_CLASSES.leaveTo);
|
|
3019
|
+
}
|
|
3020
|
+
}), switchMap(() => this._animatable.animationEnd$), tap(() => {
|
|
3021
|
+
if (this.state !== 'leaving')
|
|
3022
|
+
return;
|
|
3023
|
+
this._state$.next('left');
|
|
3024
|
+
this._classList.remove(ANIMATION_CLASSES.leaveActive);
|
|
3025
|
+
if (!config?.onlyTransition) {
|
|
3026
|
+
this._classList.remove(ANIMATION_CLASSES.leaveTo);
|
|
3027
|
+
}
|
|
3028
|
+
}), takeUntil(this._destroy$), take(1))
|
|
3029
|
+
.subscribe();
|
|
3030
|
+
}
|
|
3031
|
+
_forceState(state) {
|
|
3032
|
+
this._state$.next(state);
|
|
3033
|
+
}
|
|
3034
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedLifecycleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3035
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.5", type: AnimatedLifecycleDirective, isStandalone: true, selector: "[etAnimatedLifecycle]", inputs: { skipNextEnter: { classPropertyName: "skipNextEnter", publicName: "skipNextEnter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange", skipNextEnter: "skipNextEnterChange" }, providers: [
|
|
3036
|
+
{
|
|
3037
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
3038
|
+
useExisting: AnimatedLifecycleDirective,
|
|
3039
|
+
},
|
|
3040
|
+
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 }); }
|
|
3041
|
+
}
|
|
3042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
3043
|
+
type: Directive,
|
|
3044
|
+
args: [{
|
|
3045
|
+
selector: '[etAnimatedLifecycle]',
|
|
3046
|
+
exportAs: 'etAnimatedLifecycle',
|
|
3047
|
+
standalone: true,
|
|
3048
|
+
providers: [
|
|
3049
|
+
{
|
|
3050
|
+
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
3051
|
+
useExisting: AnimatedLifecycleDirective,
|
|
3052
|
+
},
|
|
3053
|
+
],
|
|
3054
|
+
hostDirectives: [AnimatableDirective],
|
|
3055
|
+
}]
|
|
3056
|
+
}] });
|
|
3057
|
+
|
|
3058
|
+
const ANIMATED_IF_TOKEN = new InjectionToken('ANIMATED_IF_TOKEN');
|
|
3059
|
+
class AnimatedIfDirective {
|
|
3060
|
+
constructor() {
|
|
3061
|
+
this._destroy$ = createDestroy();
|
|
3062
|
+
this._ngIf = inject(NgIf);
|
|
3063
|
+
this._animatedLifecycle = inject(ANIMATED_LIFECYCLE_TOKEN);
|
|
3064
|
+
}
|
|
3065
|
+
set shouldRender(value) {
|
|
3066
|
+
if (value) {
|
|
3067
|
+
this._ngIf.ngIf = value;
|
|
3068
|
+
this._animatedLifecycle.enter();
|
|
2966
3069
|
}
|
|
2967
|
-
else
|
|
2968
|
-
|
|
3070
|
+
else {
|
|
3071
|
+
this._animatedLifecycle.leave();
|
|
3072
|
+
this._animatedLifecycle.state$
|
|
3073
|
+
.pipe(takeUntil(this._destroy$), takeWhile((state) => state !== 'left', true), filter((state) => state === 'left'), tap(() => {
|
|
3074
|
+
this._ngIf.ngIf = value;
|
|
3075
|
+
}))
|
|
3076
|
+
.subscribe();
|
|
2969
3077
|
}
|
|
2970
|
-
return 'xs';
|
|
2971
3078
|
}
|
|
2972
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2973
|
-
static { this.ɵ
|
|
3079
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedIfDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3080
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: AnimatedIfDirective, isStandalone: true, selector: "[etAnimatedIf]", inputs: { shouldRender: ["etAnimatedIf", "shouldRender"] }, providers: [
|
|
3081
|
+
{
|
|
3082
|
+
provide: ANIMATED_IF_TOKEN,
|
|
3083
|
+
useExisting: AnimatedIfDirective,
|
|
3084
|
+
},
|
|
3085
|
+
], hostDirectives: [{ directive: i1.NgIf }], ngImport: i0 }); }
|
|
2974
3086
|
}
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
__metadata("design:type", Function),
|
|
2978
|
-
__metadata("design:paramtypes", [String, String]),
|
|
2979
|
-
__metadata("design:returntype", void 0)
|
|
2980
|
-
], ViewportService.prototype, "getBreakpointSize", null);
|
|
2981
|
-
__decorate([
|
|
2982
|
-
Memo({
|
|
2983
|
-
resolver: (v) => {
|
|
2984
|
-
return `${v.min ?? ''}-${v.max ?? ''}`;
|
|
2985
|
-
},
|
|
2986
|
-
}),
|
|
2987
|
-
__metadata("design:type", Function),
|
|
2988
|
-
__metadata("design:paramtypes", [Object]),
|
|
2989
|
-
__metadata("design:returntype", void 0)
|
|
2990
|
-
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
2991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ViewportService, decorators: [{
|
|
2992
|
-
type: Injectable,
|
|
3087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedIfDirective, decorators: [{
|
|
3088
|
+
type: Directive,
|
|
2993
3089
|
args: [{
|
|
2994
|
-
|
|
3090
|
+
selector: '[etAnimatedIf]',
|
|
3091
|
+
standalone: true,
|
|
3092
|
+
providers: [
|
|
3093
|
+
{
|
|
3094
|
+
provide: ANIMATED_IF_TOKEN,
|
|
3095
|
+
useExisting: AnimatedIfDirective,
|
|
3096
|
+
},
|
|
3097
|
+
],
|
|
3098
|
+
hostDirectives: [NgIf],
|
|
2995
3099
|
}]
|
|
2996
|
-
}],
|
|
3100
|
+
}], propDecorators: { shouldRender: [{
|
|
3101
|
+
type: Input,
|
|
3102
|
+
args: ['etAnimatedIf']
|
|
3103
|
+
}] } });
|
|
2997
3104
|
|
|
2998
3105
|
class ObserveResizeDirective {
|
|
2999
3106
|
constructor() {
|
|
@@ -3037,10 +3144,10 @@ class ObserveResizeDirective {
|
|
|
3037
3144
|
_unsubscribe() {
|
|
3038
3145
|
this._currentSubscription?.unsubscribe();
|
|
3039
3146
|
}
|
|
3040
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3041
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3147
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3148
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { valueChange: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 }); }
|
|
3042
3149
|
}
|
|
3043
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
3044
3151
|
type: Directive,
|
|
3045
3152
|
args: [{
|
|
3046
3153
|
selector: '[etObserveResize]',
|
|
@@ -3070,15 +3177,15 @@ class RootBoundaryDirective {
|
|
|
3070
3177
|
set boundaryElement(v) {
|
|
3071
3178
|
this._boundaryElement = v;
|
|
3072
3179
|
}
|
|
3073
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3074
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3180
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RootBoundaryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3181
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: RootBoundaryDirective, isStandalone: true, selector: "[etRootBoundary]", providers: [
|
|
3075
3182
|
{
|
|
3076
3183
|
provide: ROOT_BOUNDARY_TOKEN,
|
|
3077
3184
|
useExisting: RootBoundaryDirective,
|
|
3078
3185
|
},
|
|
3079
3186
|
], ngImport: i0 }); }
|
|
3080
3187
|
}
|
|
3081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RootBoundaryDirective, decorators: [{
|
|
3082
3189
|
type: Directive,
|
|
3083
3190
|
args: [{
|
|
3084
3191
|
selector: '[etRootBoundary]',
|
|
@@ -3384,10 +3491,10 @@ class AnimatedOverlayDirective {
|
|
|
3384
3491
|
this._isUnmounting$.next(false);
|
|
3385
3492
|
this._afterClosed?.next();
|
|
3386
3493
|
}
|
|
3387
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3388
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3494
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3495
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: AnimatedOverlayDirective, isStandalone: true, inputs: { placement: "placement", fallbackPlacements: "fallbackPlacements", offset: "offset", arrowPadding: "arrowPadding", viewportPadding: "viewportPadding", autoResize: "autoResize", shift: "shift", autoHide: "autoHide", autoCloseIfReferenceHidden: "autoCloseIfReferenceHidden" }, host: { classAttribute: "et-animated-overlay" }, hostDirectives: [{ directive: ObserveResizeDirective }], ngImport: i0 }); }
|
|
3389
3496
|
}
|
|
3390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: AnimatedOverlayDirective, decorators: [{
|
|
3391
3498
|
type: Directive,
|
|
3392
3499
|
args: [{
|
|
3393
3500
|
standalone: true,
|
|
@@ -3437,10 +3544,10 @@ class ClickOutsideDirective {
|
|
|
3437
3544
|
ngOnDestroy() {
|
|
3438
3545
|
this._subscription?.unsubscribe();
|
|
3439
3546
|
}
|
|
3440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3441
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3547
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3548
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 }); }
|
|
3442
3549
|
}
|
|
3443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
3444
3551
|
type: Directive,
|
|
3445
3552
|
args: [{
|
|
3446
3553
|
selector: '[etClickOutside]',
|
|
@@ -3594,10 +3701,10 @@ class CursorDragScrollDirective {
|
|
|
3594
3701
|
this._elementRef.nativeElement.style.cursor = 'default';
|
|
3595
3702
|
}
|
|
3596
3703
|
}
|
|
3597
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3598
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3704
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3705
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"], allowedDirection: "allowedDirection" }, outputs: { cursorDragStart: "cursorDragStart", cursorDragMove: "cursorDragMove", cursorDragEnd: "cursorDragEnd" }, exportAs: ["etCursorDragScroll"], ngImport: i0 }); }
|
|
3599
3706
|
}
|
|
3600
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
3601
3708
|
type: Directive,
|
|
3602
3709
|
args: [{
|
|
3603
3710
|
selector: '[etCursorDragScroll]',
|
|
@@ -3630,15 +3737,15 @@ class DebugDirective {
|
|
|
3630
3737
|
set sDebug(value) {
|
|
3631
3738
|
this._debug.set(value);
|
|
3632
3739
|
}
|
|
3633
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3634
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
3740
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: DebugDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3741
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: DebugDirective, isStandalone: true, selector: "[etDebug]", inputs: { sDebug: ["etDebug", "sDebug", booleanAttribute] }, providers: [
|
|
3635
3742
|
{
|
|
3636
3743
|
provide: DEBUG_TOKEN,
|
|
3637
3744
|
useExisting: DebugDirective,
|
|
3638
3745
|
},
|
|
3639
3746
|
], exportAs: ["etDebug"], ngImport: i0 }); }
|
|
3640
3747
|
}
|
|
3641
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: DebugDirective, decorators: [{
|
|
3642
3749
|
type: Directive,
|
|
3643
3750
|
args: [{
|
|
3644
3751
|
selector: '[etDebug]',
|
|
@@ -3685,15 +3792,15 @@ class DelayableDirective {
|
|
|
3685
3792
|
}
|
|
3686
3793
|
this._isDelayed$.next(val);
|
|
3687
3794
|
}
|
|
3688
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3689
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3795
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: DelayableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3796
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: DelayableDirective, isStandalone: true, selector: "[etDelayable]", providers: [
|
|
3690
3797
|
{
|
|
3691
3798
|
provide: DELAYABLE_TOKEN,
|
|
3692
3799
|
useExisting: DelayableDirective,
|
|
3693
3800
|
},
|
|
3694
3801
|
], exportAs: ["etDelayable"], ngImport: i0 }); }
|
|
3695
3802
|
}
|
|
3696
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: DelayableDirective, decorators: [{
|
|
3697
3804
|
type: Directive,
|
|
3698
3805
|
args: [{
|
|
3699
3806
|
selector: '[etDelayable]',
|
|
@@ -3714,15 +3821,15 @@ class IsActiveElementDirective {
|
|
|
3714
3821
|
this.elementRef = inject(ElementRef);
|
|
3715
3822
|
this.isActiveElement = false;
|
|
3716
3823
|
}
|
|
3717
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3718
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
3824
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IsActiveElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3825
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: IsActiveElementDirective, isStandalone: true, selector: "[etIsActiveElement]", inputs: { isActiveElement: ["etIsActiveElement", "isActiveElement", booleanAttribute] }, providers: [
|
|
3719
3826
|
{
|
|
3720
3827
|
provide: IS_ACTIVE_ELEMENT,
|
|
3721
3828
|
useExisting: IsActiveElementDirective,
|
|
3722
3829
|
},
|
|
3723
3830
|
], ngImport: i0 }); }
|
|
3724
3831
|
}
|
|
3725
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IsActiveElementDirective, decorators: [{
|
|
3726
3833
|
type: Directive,
|
|
3727
3834
|
args: [{
|
|
3728
3835
|
selector: '[etIsActiveElement]',
|
|
@@ -3745,15 +3852,15 @@ class IsElementDirective {
|
|
|
3745
3852
|
this.elementRef = inject(ElementRef);
|
|
3746
3853
|
this.isElement = false;
|
|
3747
3854
|
}
|
|
3748
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3749
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
3855
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IsElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3856
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: IsElementDirective, isStandalone: true, selector: "[etIsElement]", inputs: { isElement: ["etIsElement", "isElement", booleanAttribute] }, providers: [
|
|
3750
3857
|
{
|
|
3751
3858
|
provide: IS_ELEMENT,
|
|
3752
3859
|
useExisting: IsElementDirective,
|
|
3753
3860
|
},
|
|
3754
3861
|
], ngImport: i0 }); }
|
|
3755
3862
|
}
|
|
3756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: IsElementDirective, decorators: [{
|
|
3757
3864
|
type: Directive,
|
|
3758
3865
|
args: [{
|
|
3759
3866
|
selector: '[etIsElement]',
|
|
@@ -3802,10 +3909,10 @@ class LetDirective {
|
|
|
3802
3909
|
}
|
|
3803
3910
|
}
|
|
3804
3911
|
}
|
|
3805
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3806
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3912
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: LetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3913
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 }); }
|
|
3807
3914
|
}
|
|
3808
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: LetDirective, decorators: [{
|
|
3809
3916
|
type: Directive,
|
|
3810
3917
|
args: [{
|
|
3811
3918
|
selector: '[etLet]',
|
|
@@ -3857,10 +3964,10 @@ class ObserveContentDirective {
|
|
|
3857
3964
|
_unsubscribe() {
|
|
3858
3965
|
this._currentSubscription?.unsubscribe();
|
|
3859
3966
|
}
|
|
3860
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3861
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
3967
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3968
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { valueChange: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 }); }
|
|
3862
3969
|
}
|
|
3863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3970
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
3864
3971
|
type: Directive,
|
|
3865
3972
|
args: [{
|
|
3866
3973
|
selector: '[etObserveContent]',
|
|
@@ -3885,10 +3992,10 @@ class ScrollObserverFirstElementDirective {
|
|
|
3885
3992
|
constructor() {
|
|
3886
3993
|
this.isFirstElement = false;
|
|
3887
3994
|
}
|
|
3888
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3889
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
3995
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3996
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement", booleanAttribute] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 }); }
|
|
3890
3997
|
}
|
|
3891
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
|
|
3892
3999
|
type: Directive,
|
|
3893
4000
|
args: [{
|
|
3894
4001
|
selector: '[etScrollObserverFirstElement]',
|
|
@@ -3904,10 +4011,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImpor
|
|
|
3904
4011
|
|
|
3905
4012
|
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
3906
4013
|
class ScrollObserverIgnoreTargetDirective {
|
|
3907
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3908
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
4014
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4015
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 }); }
|
|
3909
4016
|
}
|
|
3910
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
3911
4018
|
type: Directive,
|
|
3912
4019
|
args: [{
|
|
3913
4020
|
selector: '[etScrollObserverIgnoreTarget]',
|
|
@@ -3923,10 +4030,10 @@ class ScrollObserverLastElementDirective {
|
|
|
3923
4030
|
constructor() {
|
|
3924
4031
|
this.isLastElement = false;
|
|
3925
4032
|
}
|
|
3926
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3927
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
4033
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4034
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: ScrollObserverLastElementDirective, isStandalone: true, selector: "[etScrollObserverLastElement]", inputs: { isLastElement: ["etScrollObserverLastElement", "isLastElement", booleanAttribute] }, host: { properties: { "class.et-scroll-observer-last-element": "this.isLastElement" }, classAttribute: "et-scroll-observer-last-element" }, ngImport: i0 }); }
|
|
3928
4035
|
}
|
|
3929
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
|
|
3930
4037
|
type: Directive,
|
|
3931
4038
|
args: [{
|
|
3932
4039
|
selector: '[etScrollObserverLastElement]',
|
|
@@ -4083,15 +4190,15 @@ class ObserveScrollStateDirective {
|
|
|
4083
4190
|
}
|
|
4084
4191
|
return element;
|
|
4085
4192
|
}
|
|
4086
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4087
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.
|
|
4193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4194
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.5", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { rootMargin: ["rootMargin", "rootMargin", numberAttribute], observerThreshold: "observerThreshold" }, outputs: { valueChange: "etObserveScrollState" }, providers: [
|
|
4088
4195
|
{
|
|
4089
4196
|
provide: OBSERVE_SCROLL_STATE,
|
|
4090
4197
|
useExisting: ObserveScrollStateDirective,
|
|
4091
4198
|
},
|
|
4092
4199
|
], exportAs: ["etObserveScrollState"], ngImport: i0 }); }
|
|
4093
4200
|
}
|
|
4094
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
4095
4202
|
type: Directive,
|
|
4096
4203
|
args: [{
|
|
4097
4204
|
selector: '[etObserveScrollState]',
|
|
@@ -4161,15 +4268,15 @@ class ObserveVisibilityDirective {
|
|
|
4161
4268
|
}))
|
|
4162
4269
|
.subscribe();
|
|
4163
4270
|
}
|
|
4164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4165
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
4271
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveVisibilityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4272
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ObserveVisibilityDirective, isStandalone: true, selector: "[etObserveVisibility]", outputs: { etObserveVisibility: "etObserveVisibility" }, host: { classAttribute: "et-observe-visibility" }, providers: [
|
|
4166
4273
|
{
|
|
4167
4274
|
provide: OBSERVE_VISIBILITY_TOKEN,
|
|
4168
4275
|
useExisting: ObserveVisibilityDirective,
|
|
4169
4276
|
},
|
|
4170
4277
|
], ngImport: i0 }); }
|
|
4171
4278
|
}
|
|
4172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ObserveVisibilityDirective, decorators: [{
|
|
4173
4280
|
type: Directive,
|
|
4174
4281
|
args: [{
|
|
4175
4282
|
selector: '[etObserveVisibility]',
|
|
@@ -4207,10 +4314,10 @@ class RepeatDirective {
|
|
|
4207
4314
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
|
|
4208
4315
|
}
|
|
4209
4316
|
}
|
|
4210
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4211
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
4317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4318
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 }); }
|
|
4212
4319
|
}
|
|
4213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
4214
4321
|
type: Directive,
|
|
4215
4322
|
args: [{
|
|
4216
4323
|
selector: '[etRepeat]',
|
|
@@ -4379,10 +4486,10 @@ class SeoDirective {
|
|
|
4379
4486
|
}
|
|
4380
4487
|
}
|
|
4381
4488
|
}
|
|
4382
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4383
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
4489
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4490
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 }); }
|
|
4384
4491
|
}
|
|
4385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SeoDirective, decorators: [{
|
|
4386
4493
|
type: Directive,
|
|
4387
4494
|
args: [{
|
|
4388
4495
|
standalone: true,
|
|
@@ -4558,10 +4665,10 @@ class InferMimeTypePipe {
|
|
|
4558
4665
|
constructor() {
|
|
4559
4666
|
this.transform = inferMimeType;
|
|
4560
4667
|
}
|
|
4561
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4562
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: InferMimeTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4669
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: InferMimeTypePipe, isStandalone: true, name: "inferMimeType" }); }
|
|
4563
4670
|
}
|
|
4564
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: InferMimeTypePipe, decorators: [{
|
|
4565
4672
|
type: Pipe,
|
|
4566
4673
|
args: [{
|
|
4567
4674
|
name: 'inferMimeType',
|
|
@@ -4607,10 +4714,10 @@ class NormalizeGameResultTypePipe {
|
|
|
4607
4714
|
constructor() {
|
|
4608
4715
|
this.transform = normalizeGameResultType;
|
|
4609
4716
|
}
|
|
4610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4611
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4717
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4718
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" }); }
|
|
4612
4719
|
}
|
|
4613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
|
|
4614
4721
|
type: Pipe,
|
|
4615
4722
|
args: [{ name: 'etNormalizeGameResultType', standalone: true }]
|
|
4616
4723
|
}] });
|
|
@@ -4638,10 +4745,10 @@ class NormalizeMatchStatePipe {
|
|
|
4638
4745
|
constructor() {
|
|
4639
4746
|
this.transform = normalizeMatchState;
|
|
4640
4747
|
}
|
|
4641
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4642
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4748
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4749
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" }); }
|
|
4643
4750
|
}
|
|
4644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
|
|
4645
4752
|
type: Pipe,
|
|
4646
4753
|
args: [{ name: 'etNormalizeMatchState', standalone: true }]
|
|
4647
4754
|
}] });
|
|
@@ -4696,10 +4803,10 @@ class NormalizeMatchParticipantsPipe {
|
|
|
4696
4803
|
constructor() {
|
|
4697
4804
|
this.transform = normalizeMatchParticipants;
|
|
4698
4805
|
}
|
|
4699
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4700
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4806
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4807
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" }); }
|
|
4701
4808
|
}
|
|
4702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
|
|
4703
4810
|
type: Pipe,
|
|
4704
4811
|
args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
|
|
4705
4812
|
}] });
|
|
@@ -4833,10 +4940,10 @@ class NormalizeMatchScorePipe {
|
|
|
4833
4940
|
constructor() {
|
|
4834
4941
|
this.transform = normalizeMatchScore;
|
|
4835
4942
|
}
|
|
4836
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4837
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4943
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4944
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" }); }
|
|
4838
4945
|
}
|
|
4839
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
|
|
4840
4947
|
type: Pipe,
|
|
4841
4948
|
args: [{ name: 'etNormalizeMatchScore', standalone: true }]
|
|
4842
4949
|
}] });
|
|
@@ -4883,10 +4990,10 @@ class NormalizeMatchTypePipe {
|
|
|
4883
4990
|
constructor() {
|
|
4884
4991
|
this.transform = normalizeMatchType;
|
|
4885
4992
|
}
|
|
4886
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4887
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
4993
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4994
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" }); }
|
|
4888
4995
|
}
|
|
4889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
|
|
4890
4997
|
type: Pipe,
|
|
4891
4998
|
args: [{ name: 'etNormalizeMatchType', standalone: true }]
|
|
4892
4999
|
}] });
|
|
@@ -4900,10 +5007,10 @@ class ToArrayPipe {
|
|
|
4900
5007
|
constructor() {
|
|
4901
5008
|
this.transform = toArray;
|
|
4902
5009
|
}
|
|
4903
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4904
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
5010
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
5011
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" }); }
|
|
4905
5012
|
}
|
|
4906
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
5013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
4907
5014
|
type: Pipe,
|
|
4908
5015
|
args: [{ name: 'toArray', standalone: true }]
|
|
4909
5016
|
}] });
|
|
@@ -5121,10 +5228,10 @@ class PropsDirective {
|
|
|
5121
5228
|
});
|
|
5122
5229
|
});
|
|
5123
5230
|
}
|
|
5124
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
5125
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.
|
|
5231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: PropsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5232
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.5", type: PropsDirective, isStandalone: true, selector: "[etProps]", inputs: { props: { classPropertyName: "props", publicName: "etProps", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
5126
5233
|
}
|
|
5127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
5234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: PropsDirective, decorators: [{
|
|
5128
5235
|
type: Directive,
|
|
5129
5236
|
args: [{
|
|
5130
5237
|
selector: '[etProps]',
|
|
@@ -5257,5 +5364,5 @@ const Validators = {
|
|
|
5257
5364
|
* Generated bundle index. Do not edit.
|
|
5258
5365
|
*/
|
|
5259
5366
|
|
|
5260
|
-
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, AT_LEAST_ONE_REQUIRED, ActiveSelectionModel, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, CURSOR_DRAG_SCROLLING_CLASS, CURSOR_DRAG_SCROLLING_PREPARED_CLASS, ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEBUG_TOKEN, DEFAULT_VIEWPORT_CONFIG, DELAYABLE_TOKEN, DebugDirective, DelayableDirective, ET_PROPERTY_REMOVED, FocusVisibleService, IS_ACTIVE_ELEMENT, IS_ARRAY_NOT_EMPTY, IS_ELEMENT, IS_EMAIL, InferMimeTypePipe, IntersectionObserverFactory, IntersectionObserverService, IsActiveElementDirective, IsArrayNotEmpty, IsElementDirective, IsEmail, KeyPressManager, LetContext, LetDirective, MUST_MATCH, Memo, MustMatch, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, OBSERVE_VISIBILITY_TOKEN, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, ObserveVisibilityDirective, PropsDirective, ROOT_BOUNDARY_TOKEN, RUNTIME_ERROR_NO_DATA, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RootBoundaryDirective, RouterStateService, RuntimeError, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SCROLL_OBSERVER_OBSERVING_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_OBSERVING_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SelectionModel, SeoDirective, SmartBlockScrollStrategy, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, ValidateAtLeastOneRequired, Validators, ViewportService, bindProps, buildSignalEffects, clamp, clone, cloneFormGroup, controlValueSignal, controlValueSignalWithPrevious, createComponentId, createDependencyStash, createDestroy, createElementDictionary, createFlipAnimation, createFlipAnimationGroup, createHostProps, createMediaQueryObservable, createMutationObservable, createPropHandlers, createProps, createReactiveBindings, createResizeObservable, createSetup, debouncedControlValueSignal, deleteCookie, elementCanScroll, equal, forceReflow, formatRuntimeError, fromNextFrame, getCookie, getDomain, getElementVisibleStates,
|
|
5367
|
+
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, AT_LEAST_ONE_REQUIRED, ActiveSelectionModel, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, CURSOR_DRAG_SCROLLING_CLASS, CURSOR_DRAG_SCROLLING_PREPARED_CLASS, ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEBUG_TOKEN, DEFAULT_VIEWPORT_CONFIG, DELAYABLE_TOKEN, DebugDirective, DelayableDirective, ET_PROPERTY_REMOVED, FocusVisibleService, IS_ACTIVE_ELEMENT, IS_ARRAY_NOT_EMPTY, IS_ELEMENT, IS_EMAIL, InferMimeTypePipe, IntersectionObserverFactory, IntersectionObserverService, IsActiveElementDirective, IsArrayNotEmpty, IsElementDirective, IsEmail, KeyPressManager, LetContext, LetDirective, MUST_MATCH, Memo, MustMatch, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, OBSERVE_VISIBILITY_TOKEN, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, ObserveVisibilityDirective, PropsDirective, ROOT_BOUNDARY_TOKEN, RUNTIME_ERROR_NO_DATA, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RootBoundaryDirective, RouterStateService, RuntimeError, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SCROLL_OBSERVER_OBSERVING_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_OBSERVING_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SelectionModel, SeoDirective, SmartBlockScrollStrategy, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, ValidateAtLeastOneRequired, Validators, ViewportService, bindProps, buildSignalEffects, clamp, clone, cloneFormGroup, controlValueSignal, controlValueSignalWithPrevious, createComponentId, createDependencyStash, createDestroy, createElementDictionary, createFlipAnimation, createFlipAnimationGroup, createHostProps, createMediaQueryObservable, createMutationObservable, createPropHandlers, createProps, createReactiveBindings, createResizeObservable, createSetup, debouncedControlValueSignal, deleteCookie, elementCanScroll, equal, forceReflow, formatRuntimeError, fromNextFrame, getCookie, getDomain, getElementVisibleStates, getFormGroupValue, getGroupMatchPoints, getGroupMatchScore, getIntersectionInfo, getKnockoutMatchScore, getMatchScoreSubLine, getObjectProperty, hasCookie, inferMimeType, injectFragment, injectHostElement, injectOrRunInContext, injectPathParam, injectPathParams, injectQueryParam, injectQueryParams, injectRouteData, injectRouteDataItem, injectRouteTitle, injectTemplateRef, isArray, isElementVisible, isEmptyArray, isGroupMatch, isKnockoutMatch, isObject, isObjectArray, isPrimitiveArray, mergeSeoConfig, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, previousSignalValue, provideViewportConfig, round, routerDisableScrollTop, scrollToElement, setCookie, signalAttributes, signalClasses, signalElementChildren, signalElementDimensions, signalElementIntersection, signalElementMutations, signalElementScrollState, signalHostAttributes, signalHostClasses, signalHostElementDimensions, signalHostElementIntersection, signalHostElementMutations, signalHostElementScrollState, signalHostStyles, signalIsRendered, signalStyles, signalVisibilityChangeClasses, switchQueryListChanges, syncSignal, templateComputed, toArray, toArrayTrackByFn, transformOrReturn, unbindProps };
|
|
5261
5368
|
//# sourceMappingURL=ethlete-core.mjs.map
|