@ethlete/core 4.11.0 → 4.12.1
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 +22 -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 +3 -3
- 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 +1599 -1493
- package/fesm2022/ethlete-core.mjs.map +1 -1
- 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
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.6", ngImport: i0, type: StructuredDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.6", 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.6", 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,1542 +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.6", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1506
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", 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.6", 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.6", ngImport: i0, type: ClickObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1562
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ClickObserverService, providedIn: 'root' }); }
|
|
1563
|
+
}
|
|
1564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1575
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' }); }
|
|
1576
|
+
}
|
|
1577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: ContentObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1637
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ContentObserverService, providedIn: 'root' }); }
|
|
1638
|
+
}
|
|
1639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1666
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: FocusVisibleService, providedIn: 'root' }); }
|
|
1667
|
+
}
|
|
1668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: IntersectionObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1681
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: IntersectionObserverFactory, providedIn: 'root' }); }
|
|
1682
|
+
}
|
|
1683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: IntersectionObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1739
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: IntersectionObserverService, providedIn: 'root' }); }
|
|
1740
|
+
}
|
|
1741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1752
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' }); }
|
|
1753
|
+
}
|
|
1754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.6", ngImport: i0, type: ResizeObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1810
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ResizeObserverService, providedIn: 'root' }); }
|
|
1926
1811
|
}
|
|
1812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", 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.4", 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.stateChange = outputFromObservable(this._state$);
|
|
2093
|
-
this.skipNextEnter = model(false);
|
|
1834
|
+
get state$() {
|
|
1835
|
+
return this._state$.asObservable();
|
|
2094
1836
|
}
|
|
2095
1837
|
get state() {
|
|
2096
|
-
return this._state$.
|
|
1838
|
+
return this._state$.getValue();
|
|
2097
1839
|
}
|
|
2098
|
-
|
|
2099
|
-
this.
|
|
1840
|
+
get data$() {
|
|
1841
|
+
return this._state$.pipe(map((state) => state.data), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2100
1842
|
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
this.
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
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);
|
|
2126
1895
|
}
|
|
2127
|
-
})
|
|
2128
|
-
|
|
1896
|
+
}))
|
|
1897
|
+
.subscribe(this._route$);
|
|
1898
|
+
combineLatest([this._route$, this._afterInitialize$])
|
|
1899
|
+
.pipe(tap(([, afterInitialize]) => {
|
|
1900
|
+
if (!afterInitialize)
|
|
2129
1901
|
return;
|
|
2130
|
-
this.
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
this._classList.remove(ANIMATION_CLASSES.enterTo);
|
|
1902
|
+
let route = this._router.routerState.snapshot.root;
|
|
1903
|
+
while (route.firstChild) {
|
|
1904
|
+
route = route.firstChild;
|
|
2134
1905
|
}
|
|
2135
|
-
|
|
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
|
+
}))
|
|
2136
1915
|
.subscribe();
|
|
2137
1916
|
}
|
|
2138
|
-
|
|
2139
|
-
if (this.
|
|
2140
|
-
return;
|
|
2141
|
-
if (this.state === 'init') {
|
|
2142
|
-
this._state$.next('left');
|
|
1917
|
+
enableScrollEnhancements(config = {}) {
|
|
1918
|
+
if (this._isScrollTopOnNavigationEnabled) {
|
|
2143
1919
|
return;
|
|
2144
1920
|
}
|
|
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
|
-
|
|
2182
|
-
], exportAs: ["etAnimatedLifecycle"], hostDirectives: [{ directive: AnimatableDirective }], ngImport: i0 }); }
|
|
2183
|
-
}
|
|
2184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AnimatedLifecycleDirective, decorators: [{
|
|
2185
|
-
type: Directive,
|
|
2186
|
-
args: [{
|
|
2187
|
-
selector: '[etAnimatedLifecycle]',
|
|
2188
|
-
exportAs: 'etAnimatedLifecycle',
|
|
2189
|
-
standalone: true,
|
|
2190
|
-
providers: [
|
|
2191
|
-
{
|
|
2192
|
-
provide: ANIMATED_LIFECYCLE_TOKEN,
|
|
2193
|
-
useExisting: AnimatedLifecycleDirective,
|
|
2194
|
-
},
|
|
2195
|
-
],
|
|
2196
|
-
hostDirectives: [AnimatableDirective],
|
|
2197
|
-
}]
|
|
2198
|
-
}] });
|
|
2199
|
-
|
|
2200
|
-
const ANIMATED_IF_TOKEN = new InjectionToken('ANIMATED_IF_TOKEN');
|
|
2201
|
-
class AnimatedIfDirective {
|
|
2202
|
-
constructor() {
|
|
2203
|
-
this._destroy$ = createDestroy();
|
|
2204
|
-
this._ngIf = inject(NgIf);
|
|
2205
|
-
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
|
+
});
|
|
2206
1958
|
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
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
|
+
}
|
|
2211
1979
|
}
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
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
|
+
});
|
|
2219
1995
|
}
|
|
1996
|
+
if (currentFragment) {
|
|
1997
|
+
fragment = currentFragment.slice(1);
|
|
1998
|
+
}
|
|
1999
|
+
return {
|
|
2000
|
+
data,
|
|
2001
|
+
pathParams,
|
|
2002
|
+
queryParams,
|
|
2003
|
+
title,
|
|
2004
|
+
fragment,
|
|
2005
|
+
};
|
|
2220
2006
|
}
|
|
2221
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2222
|
-
static { this.ɵ
|
|
2223
|
-
{
|
|
2224
|
-
provide: ANIMATED_IF_TOKEN,
|
|
2225
|
-
useExisting: AnimatedIfDirective,
|
|
2226
|
-
},
|
|
2227
|
-
], hostDirectives: [{ directive: i1.NgIf }], ngImport: i0 }); }
|
|
2007
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2008
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: RouterStateService, providedIn: 'root' }); }
|
|
2228
2009
|
}
|
|
2229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
2230
|
-
type:
|
|
2010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: RouterStateService, decorators: [{
|
|
2011
|
+
type: Injectable,
|
|
2231
2012
|
args: [{
|
|
2232
|
-
|
|
2233
|
-
standalone: true,
|
|
2234
|
-
providers: [
|
|
2235
|
-
{
|
|
2236
|
-
provide: ANIMATED_IF_TOKEN,
|
|
2237
|
-
useExisting: AnimatedIfDirective,
|
|
2238
|
-
},
|
|
2239
|
-
],
|
|
2240
|
-
hostDirectives: [NgIf],
|
|
2013
|
+
providedIn: 'root',
|
|
2241
2014
|
}]
|
|
2242
|
-
}],
|
|
2243
|
-
type: Input,
|
|
2244
|
-
args: ['etAnimatedIf']
|
|
2245
|
-
}] } });
|
|
2015
|
+
}], ctorParameters: () => [] });
|
|
2246
2016
|
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
return fromEvent(document, 'click');
|
|
2017
|
+
class ViewportService {
|
|
2018
|
+
get isXs$() {
|
|
2019
|
+
return this._isXs$.asObservable();
|
|
2251
2020
|
}
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
}
|
|
2255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
2256
|
-
type: Injectable,
|
|
2257
|
-
args: [{ providedIn: 'root' }]
|
|
2258
|
-
}] });
|
|
2259
|
-
class ClickObserverService {
|
|
2260
|
-
constructor() {
|
|
2261
|
-
this._clickObserverFactory = inject(ClickObserverFactory);
|
|
2262
|
-
this._observedElements = new Map();
|
|
2021
|
+
get isXs() {
|
|
2022
|
+
return this._isXs$.value;
|
|
2263
2023
|
}
|
|
2264
|
-
|
|
2265
|
-
|
|
2024
|
+
get isSm$() {
|
|
2025
|
+
return this._isSm$.asObservable();
|
|
2266
2026
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
return new Observable((observer) => {
|
|
2270
|
-
const stream = this._observeElement(element);
|
|
2271
|
-
const subscription = stream.subscribe(observer);
|
|
2272
|
-
return () => {
|
|
2273
|
-
subscription.unsubscribe();
|
|
2274
|
-
this._unobserveElement(element);
|
|
2275
|
-
};
|
|
2276
|
-
});
|
|
2027
|
+
get isSm() {
|
|
2028
|
+
return this._isSm$.value;
|
|
2277
2029
|
}
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
const stream = new Subject();
|
|
2281
|
-
const observer = this._clickObserverFactory.create();
|
|
2282
|
-
const sub = observer.subscribe((event) => stream.next(event));
|
|
2283
|
-
this._observedElements.set(element, { observer: sub, stream, count: 1 });
|
|
2284
|
-
}
|
|
2285
|
-
else {
|
|
2286
|
-
this._observedElements.get(element).count++;
|
|
2287
|
-
}
|
|
2288
|
-
return this._observedElements.get(element).stream;
|
|
2030
|
+
get isMd$() {
|
|
2031
|
+
return this._isMd$.asObservable();
|
|
2289
2032
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
this._observedElements.get(element).count--;
|
|
2293
|
-
if (!this._observedElements.get(element).count) {
|
|
2294
|
-
this._cleanupObserver(element);
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2033
|
+
get isMd() {
|
|
2034
|
+
return this._isMd$.value;
|
|
2297
2035
|
}
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2301
|
-
if (observer) {
|
|
2302
|
-
observer.unsubscribe();
|
|
2303
|
-
}
|
|
2304
|
-
stream.complete();
|
|
2305
|
-
this._observedElements.delete(element);
|
|
2306
|
-
}
|
|
2036
|
+
get isLg$() {
|
|
2037
|
+
return this._isLg$.asObservable();
|
|
2307
2038
|
}
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
}
|
|
2311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
2312
|
-
type: Injectable,
|
|
2313
|
-
args: [{ providedIn: 'root' }]
|
|
2314
|
-
}] });
|
|
2315
|
-
|
|
2316
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2317
|
-
class MutationObserverFactory {
|
|
2318
|
-
create(callback) {
|
|
2319
|
-
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
2039
|
+
get isLg() {
|
|
2040
|
+
return this._isLg$.value;
|
|
2320
2041
|
}
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
}
|
|
2324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
2325
|
-
type: Injectable,
|
|
2326
|
-
args: [{ providedIn: 'root' }]
|
|
2327
|
-
}] });
|
|
2328
|
-
class ContentObserverService {
|
|
2329
|
-
constructor() {
|
|
2330
|
-
this._mutationObserverFactory = inject(MutationObserverFactory);
|
|
2331
|
-
this._observedElements = new Map();
|
|
2042
|
+
get isXl$() {
|
|
2043
|
+
return this._isXl$.asObservable();
|
|
2332
2044
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2045
|
+
get isXl() {
|
|
2046
|
+
return this._isXl$.value;
|
|
2335
2047
|
}
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
return new Observable((observer) => {
|
|
2339
|
-
const stream = this._observeElement(element);
|
|
2340
|
-
const subscription = stream.subscribe(observer);
|
|
2341
|
-
return () => {
|
|
2342
|
-
subscription.unsubscribe();
|
|
2343
|
-
this._unobserveElement(element);
|
|
2344
|
-
};
|
|
2345
|
-
});
|
|
2048
|
+
get is2Xl$() {
|
|
2049
|
+
return this._is2Xl$.asObservable();
|
|
2346
2050
|
}
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
const stream = new Subject();
|
|
2350
|
-
const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
|
|
2351
|
-
if (observer) {
|
|
2352
|
-
observer.observe(element, {
|
|
2353
|
-
characterData: true,
|
|
2354
|
-
childList: true,
|
|
2355
|
-
subtree: true,
|
|
2356
|
-
});
|
|
2357
|
-
}
|
|
2358
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
2359
|
-
}
|
|
2360
|
-
else {
|
|
2361
|
-
this._observedElements.get(element).count++;
|
|
2362
|
-
}
|
|
2363
|
-
return this._observedElements.get(element).stream;
|
|
2051
|
+
get is2Xl() {
|
|
2052
|
+
return this._is2Xl$.value;
|
|
2364
2053
|
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
this._observedElements.get(element).count--;
|
|
2368
|
-
if (!this._observedElements.get(element).count) {
|
|
2369
|
-
this._cleanupObserver(element);
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2054
|
+
get viewportSize$() {
|
|
2055
|
+
return this._viewportSize$.asObservable();
|
|
2372
2056
|
}
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2376
|
-
if (observer) {
|
|
2377
|
-
observer.disconnect();
|
|
2378
|
-
}
|
|
2379
|
-
stream.complete();
|
|
2380
|
-
this._observedElements.delete(element);
|
|
2381
|
-
}
|
|
2057
|
+
get viewportSize() {
|
|
2058
|
+
return this._viewportSize$.value;
|
|
2382
2059
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
}
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
class FocusVisibleService {
|
|
2392
|
-
get isFocusVisible() {
|
|
2393
|
-
return this._hadKeyboardEvent;
|
|
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]);
|
|
2394
2068
|
}
|
|
2395
2069
|
constructor() {
|
|
2396
|
-
this.
|
|
2397
|
-
this.
|
|
2398
|
-
this.
|
|
2399
|
-
this.
|
|
2400
|
-
this.
|
|
2401
|
-
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();
|
|
2402
2085
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
}
|
|
2407
|
-
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 }));
|
|
2408
2089
|
}
|
|
2409
|
-
|
|
2410
|
-
|
|
2090
|
+
isMatched(options) {
|
|
2091
|
+
const mediaQuery = this._buildMediaQuery(options);
|
|
2092
|
+
return this._breakpointObserver.isMatched(mediaQuery);
|
|
2411
2093
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
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();
|
|
2426
2152
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: IntersectionObserverFactory, decorators: [{
|
|
2431
|
-
type: Injectable,
|
|
2432
|
-
args: [{ providedIn: 'root' }]
|
|
2433
|
-
}] });
|
|
2434
|
-
class IntersectionObserverService {
|
|
2435
|
-
constructor() {
|
|
2436
|
-
this._intersectionObserverFactory = inject(IntersectionObserverFactory);
|
|
2437
|
-
this._observedElements = new Map();
|
|
2153
|
+
unmonitorViewport() {
|
|
2154
|
+
this._viewportMonitorStop$.next();
|
|
2155
|
+
this._isViewportMonitorEnabled = false;
|
|
2438
2156
|
}
|
|
2439
|
-
|
|
2440
|
-
|
|
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;
|
|
2441
2170
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
this._unobserveElement(element);
|
|
2450
|
-
};
|
|
2451
|
-
});
|
|
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$);
|
|
2452
2178
|
}
|
|
2453
|
-
|
|
2454
|
-
if (!
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
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)`);
|
|
2459
2190
|
}
|
|
2460
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
2461
2191
|
}
|
|
2462
|
-
|
|
2463
|
-
|
|
2192
|
+
if (options.min && options.max) {
|
|
2193
|
+
mediaQueryParts.push('and');
|
|
2464
2194
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
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)`);
|
|
2472
2201
|
}
|
|
2473
2202
|
}
|
|
2203
|
+
return mediaQueryParts.join(' ');
|
|
2474
2204
|
}
|
|
2475
|
-
|
|
2476
|
-
if (
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
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';
|
|
2483
2217
|
}
|
|
2218
|
+
else if (isXl) {
|
|
2219
|
+
return 'xl';
|
|
2220
|
+
}
|
|
2221
|
+
else if (is2Xl) {
|
|
2222
|
+
return '2xl';
|
|
2223
|
+
}
|
|
2224
|
+
return 'xs';
|
|
2484
2225
|
}
|
|
2485
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2486
|
-
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.6", ngImport: i0, type: ViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2227
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ViewportService, providedIn: 'root' }); }
|
|
2487
2228
|
}
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
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.6", ngImport: i0, type: ViewportService, decorators: [{
|
|
2502
2246
|
type: Injectable,
|
|
2503
|
-
args: [{
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
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;
|
|
2509
2256
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
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: [] });
|
|
2512
2268
|
}
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
return new Observable((observer) => {
|
|
2516
|
-
const stream = this._observeElement(element);
|
|
2517
|
-
const subscription = stream.subscribe(observer);
|
|
2518
|
-
return () => {
|
|
2519
|
-
subscription.unsubscribe();
|
|
2520
|
-
this._unobserveElement(element);
|
|
2521
|
-
};
|
|
2522
|
-
});
|
|
2269
|
+
if (isElementSignal(el)) {
|
|
2270
|
+
return el;
|
|
2523
2271
|
}
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
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)));
|
|
2532
2279
|
}
|
|
2533
2280
|
else {
|
|
2534
|
-
|
|
2281
|
+
const coercedEl = coerceElement(elOrRef);
|
|
2282
|
+
return of(coercedEl ? [coercedEl] : null);
|
|
2535
2283
|
}
|
|
2536
|
-
|
|
2284
|
+
});
|
|
2285
|
+
if (el instanceof Observable) {
|
|
2286
|
+
mElSignal = toSignal(el.pipe(switchElement()), { initialValue: null });
|
|
2537
2287
|
}
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
this._observedElements.get(element).count--;
|
|
2541
|
-
if (!this._observedElements.get(element).count) {
|
|
2542
|
-
this._cleanupObserver(element);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2288
|
+
else if (isSignal(el)) {
|
|
2289
|
+
mElSignal = toSignal(toObservable(el).pipe(switchElement()), { initialValue: null });
|
|
2545
2290
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
2549
|
-
if (observer) {
|
|
2550
|
-
observer.disconnect();
|
|
2551
|
-
}
|
|
2552
|
-
stream.complete();
|
|
2553
|
-
this._observedElements.delete(element);
|
|
2554
|
-
}
|
|
2291
|
+
else if (el instanceof QueryList) {
|
|
2292
|
+
mElSignal = toSignal(el.changes.pipe(startWith(el), map(() => el.toArray().map((r) => coerceElement(r)))), { initialValue: null });
|
|
2555
2293
|
}
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
const
|
|
2567
|
-
const
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
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
|
+
}
|
|
2571
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 };
|
|
2572
2342
|
};
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
return this._state$.getValue();
|
|
2586
|
-
}
|
|
2587
|
-
get data$() {
|
|
2588
|
-
return this._state$.pipe(map((state) => state.data), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2589
|
-
}
|
|
2590
|
-
get data() {
|
|
2591
|
-
return this._state$.getValue().data;
|
|
2592
|
-
}
|
|
2593
|
-
get pathParams$() {
|
|
2594
|
-
return this._state$.pipe(map((state) => state.pathParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2595
|
-
}
|
|
2596
|
-
get pathParams() {
|
|
2597
|
-
return this._state$.getValue().pathParams;
|
|
2598
|
-
}
|
|
2599
|
-
get queryParams$() {
|
|
2600
|
-
return this._state$.pipe(map((state) => state.queryParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
2601
|
-
}
|
|
2602
|
-
get queryParams() {
|
|
2603
|
-
return this._state$.getValue().queryParams;
|
|
2604
|
-
}
|
|
2605
|
-
get title$() {
|
|
2606
|
-
return this._state$.pipe(map((state) => state.title), distinctUntilChanged());
|
|
2607
|
-
}
|
|
2608
|
-
get title() {
|
|
2609
|
-
return this._state$.getValue().title;
|
|
2610
|
-
}
|
|
2611
|
-
get fragment$() {
|
|
2612
|
-
return this._state$.pipe(map((state) => state.fragment), distinctUntilChanged());
|
|
2613
|
-
}
|
|
2614
|
-
get fragment() {
|
|
2615
|
-
return this._state$.getValue().fragment;
|
|
2616
|
-
}
|
|
2617
|
-
get dataChanges$() {
|
|
2618
|
-
return this.data$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2619
|
-
}
|
|
2620
|
-
get queryParamChanges$() {
|
|
2621
|
-
return this.queryParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2622
|
-
}
|
|
2623
|
-
get pathParamChanges$() {
|
|
2624
|
-
return this.pathParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
2625
|
-
}
|
|
2626
|
-
constructor() {
|
|
2627
|
-
this._isScrollTopOnNavigationEnabled = false;
|
|
2628
|
-
this._router = inject(Router);
|
|
2629
|
-
this._route$ = new BehaviorSubject(window.location.pathname);
|
|
2630
|
-
this._state$ = new BehaviorSubject(this._getInitialState());
|
|
2631
|
-
this._afterInitialize$ = new BehaviorSubject(false);
|
|
2632
|
-
this.afterInitialize$ = this._afterInitialize$.pipe(filter((v) => v));
|
|
2633
|
-
this._router.events
|
|
2634
|
-
.pipe(filter((event) => event instanceof NavigationEnd), distinctUntilChanged((a, b) => a.url === b.url), map((event) => {
|
|
2635
|
-
const { url } = event;
|
|
2636
|
-
const urlWithoutQueryParams = url.split('?')[0] ?? '';
|
|
2637
|
-
const withoutFragment = urlWithoutQueryParams.split('#')[0] ?? '';
|
|
2638
|
-
return withoutFragment;
|
|
2639
|
-
}), tap(() => {
|
|
2640
|
-
if (!this._afterInitialize$.getValue()) {
|
|
2641
|
-
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);
|
|
2642
2355
|
}
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
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())
|
|
2648
2540
|
return;
|
|
2649
|
-
let
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
title: title ?? null,
|
|
2659
|
-
fragment,
|
|
2660
|
-
});
|
|
2661
|
-
}))
|
|
2662
|
-
.subscribe();
|
|
2663
|
-
}
|
|
2664
|
-
enableScrollEnhancements(config = {}) {
|
|
2665
|
-
if (this._isScrollTopOnNavigationEnabled) {
|
|
2666
|
-
return;
|
|
2667
|
-
}
|
|
2668
|
-
this._isScrollTopOnNavigationEnabled = true;
|
|
2669
|
-
combineLatest([this._state$.pipe(pairwise()), this._route$.pipe(pairwise())])
|
|
2670
|
-
.pipe(debounceTime(1))
|
|
2671
|
-
.subscribe(([[prevState, currState], [prevRoute, currRoute]]) => {
|
|
2672
|
-
const sameUrlNavigation = prevRoute === currRoute;
|
|
2673
|
-
const didFragmentChange = prevState.fragment !== currState.fragment;
|
|
2674
|
-
if (sameUrlNavigation) {
|
|
2675
|
-
const allQueryParams = [
|
|
2676
|
-
...new Set(Object.keys(prevState.queryParams).concat(Object.keys(currState.queryParams))),
|
|
2677
|
-
];
|
|
2678
|
-
const changedQueryParams = allQueryParams.filter((key) => currState.queryParams[key] !== prevState.queryParams[key]);
|
|
2679
|
-
if (!config.queryParamTriggerList?.length && !didFragmentChange) {
|
|
2680
|
-
return;
|
|
2681
|
-
}
|
|
2682
|
-
const caseQueryParams = changedQueryParams.some((key) => config.queryParamTriggerList?.includes(key));
|
|
2683
|
-
const caseFragment = didFragmentChange && config.fragment?.enabled;
|
|
2684
|
-
if (caseQueryParams) {
|
|
2685
|
-
(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
|
+
];
|
|
2686
2550
|
}
|
|
2687
|
-
else
|
|
2688
|
-
|
|
2689
|
-
if (fragmentElement) {
|
|
2690
|
-
fragmentElement.scrollIntoView({ behavior: config.fragment?.smooth ? 'smooth' : 'auto' });
|
|
2691
|
-
}
|
|
2551
|
+
else {
|
|
2552
|
+
currentValues = [...currentValues, entry];
|
|
2692
2553
|
}
|
|
2693
2554
|
}
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
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);
|
|
2703
2570
|
}
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
const
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
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);
|
|
2725
2595
|
}
|
|
2726
2596
|
}
|
|
2727
|
-
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);
|
|
2728
2637
|
}
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
const currentQueryParams = window.location.search;
|
|
2736
|
-
const currentFragment = window.location.hash;
|
|
2737
|
-
if (currentQueryParams) {
|
|
2738
|
-
const params = new URLSearchParams(currentQueryParams);
|
|
2739
|
-
params.forEach((value, key) => {
|
|
2740
|
-
queryParams[key] = value;
|
|
2741
|
-
});
|
|
2742
|
-
}
|
|
2743
|
-
if (currentFragment) {
|
|
2744
|
-
fragment = currentFragment.slice(1);
|
|
2745
|
-
}
|
|
2746
|
-
return {
|
|
2747
|
-
data,
|
|
2748
|
-
pathParams,
|
|
2749
|
-
queryParams,
|
|
2750
|
-
title,
|
|
2751
|
-
fragment,
|
|
2752
|
-
};
|
|
2638
|
+
return fn();
|
|
2639
|
+
};
|
|
2640
|
+
const transformOrReturn = (src, config) => {
|
|
2641
|
+
const transformer = config?.transform;
|
|
2642
|
+
if (transformer) {
|
|
2643
|
+
return computed(() => transformer(src()));
|
|
2753
2644
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
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
|
+
};
|
|
2763
2702
|
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
get isMd() {
|
|
2781
|
-
return this._isMd$.value;
|
|
2782
|
-
}
|
|
2783
|
-
get isLg$() {
|
|
2784
|
-
return this._isLg$.asObservable();
|
|
2785
|
-
}
|
|
2786
|
-
get isLg() {
|
|
2787
|
-
return this._isLg$.value;
|
|
2788
|
-
}
|
|
2789
|
-
get isXl$() {
|
|
2790
|
-
return this._isXl$.asObservable();
|
|
2791
|
-
}
|
|
2792
|
-
get isXl() {
|
|
2793
|
-
return this._isXl$.value;
|
|
2794
|
-
}
|
|
2795
|
-
get is2Xl$() {
|
|
2796
|
-
return this._is2Xl$.asObservable();
|
|
2797
|
-
}
|
|
2798
|
-
get is2Xl() {
|
|
2799
|
-
return this._is2Xl$.value;
|
|
2800
|
-
}
|
|
2801
|
-
get viewportSize$() {
|
|
2802
|
-
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;
|
|
2803
2719
|
}
|
|
2804
|
-
|
|
2805
|
-
|
|
2720
|
+
attach() {
|
|
2721
|
+
// noop
|
|
2806
2722
|
}
|
|
2807
|
-
|
|
2808
|
-
|
|
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
|
+
}
|
|
2809
2747
|
}
|
|
2810
|
-
|
|
2811
|
-
|
|
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
|
+
}
|
|
2812
2776
|
}
|
|
2813
|
-
|
|
2814
|
-
|
|
2777
|
+
_canBeEnabled() {
|
|
2778
|
+
const html = this._document.documentElement;
|
|
2779
|
+
if (html.classList.contains(BLOCK_CLASS) || this._isEnabled) {
|
|
2780
|
+
return false;
|
|
2781
|
+
}
|
|
2782
|
+
return true;
|
|
2815
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 {
|
|
2816
2814
|
constructor() {
|
|
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.
|
|
2831
|
-
this._observeDefaultBreakpoints();
|
|
2832
|
-
}
|
|
2833
|
-
observe(options) {
|
|
2834
|
-
const mediaQuery = this._buildMediaQuery(options);
|
|
2835
|
-
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));
|
|
2836
2829
|
}
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
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
|
+
}
|
|
2840
2853
|
}
|
|
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
|
-
|
|
2869
|
-
this._viewportSize$.next(null);
|
|
2870
|
-
}), 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$))
|
|
2871
2882
|
.subscribe();
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
if (!entry)
|
|
2884
|
-
return;
|
|
2885
|
-
const size = entry.contentRect.width;
|
|
2886
|
-
const obj = { width: 100 - size, height: 100 - size };
|
|
2887
|
-
if (equal(obj, this._scrollbarSize$.value))
|
|
2888
|
-
return;
|
|
2889
|
-
document.documentElement.style.setProperty('--et-sw', `${obj.width}px`);
|
|
2890
|
-
document.documentElement.style.setProperty('--et-sh', `${obj.height}px`);
|
|
2891
|
-
this._scrollbarSize$.next(obj);
|
|
2892
|
-
}), finalize(() => {
|
|
2893
|
-
document.body.removeChild(scrollbarRuler);
|
|
2894
|
-
document.documentElement.style.removeProperty('--et-vw');
|
|
2895
|
-
document.documentElement.style.removeProperty('--et-vh');
|
|
2896
|
-
this._scrollbarSize$.next(null);
|
|
2897
|
-
}), 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$))
|
|
2898
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
|
+
}
|
|
2899
2902
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: AnimatableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2904
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", 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.6", 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);
|
|
2903
2952
|
}
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
const size = this._viewportConfig.breakpoints[type][index];
|
|
2907
|
-
if (size === Infinity || size === 0) {
|
|
2908
|
-
return size;
|
|
2909
|
-
}
|
|
2910
|
-
if (option === 'min') {
|
|
2911
|
-
return size;
|
|
2912
|
-
}
|
|
2913
|
-
// Due to scaling, the actual size of the viewport may be a decimal number.
|
|
2914
|
-
// Eg. on Windows 11 with 150% scaling, the viewport size may be 1535.33px
|
|
2915
|
-
// and thus not matching any of the default breakpoints.
|
|
2916
|
-
return size + 0.9;
|
|
2953
|
+
get state() {
|
|
2954
|
+
return this._state$.value;
|
|
2917
2955
|
}
|
|
2918
|
-
|
|
2919
|
-
this.
|
|
2920
|
-
this.observe({ min: 'sm', max: 'sm' }).subscribe(this._isSm$);
|
|
2921
|
-
this.observe({ min: 'md', max: 'md' }).subscribe(this._isMd$);
|
|
2922
|
-
this.observe({ min: 'lg', max: 'lg' }).subscribe(this._isLg$);
|
|
2923
|
-
this.observe({ min: 'xl', max: 'xl' }).subscribe(this._isXl$);
|
|
2924
|
-
this.observe({ min: '2xl' }).subscribe(this._is2Xl$);
|
|
2956
|
+
ngAfterViewInit() {
|
|
2957
|
+
this._isConstructed = true;
|
|
2925
2958
|
}
|
|
2926
|
-
|
|
2927
|
-
if (
|
|
2928
|
-
|
|
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;
|
|
2929
2967
|
}
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
}
|
|
2935
|
-
else {
|
|
2936
|
-
mediaQueryParts.push(`(min-width: ${this.getBreakpointSize(options.min, 'min')}px)`);
|
|
2937
|
-
}
|
|
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);
|
|
2938
2972
|
}
|
|
2939
|
-
|
|
2940
|
-
|
|
2973
|
+
this._state$.next('entering');
|
|
2974
|
+
if (!config?.onlyTransition) {
|
|
2975
|
+
this._classList.add(ANIMATION_CLASSES.enterFrom);
|
|
2941
2976
|
}
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
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);
|
|
2945
2984
|
}
|
|
2946
|
-
|
|
2947
|
-
|
|
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);
|
|
2948
2992
|
}
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2993
|
+
}), takeUntil(this._destroy$), take(1))
|
|
2994
|
+
.subscribe();
|
|
2951
2995
|
}
|
|
2952
|
-
|
|
2953
|
-
if (
|
|
2954
|
-
return
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
return
|
|
2996
|
+
leave(config) {
|
|
2997
|
+
if (this.state === 'leaving')
|
|
2998
|
+
return;
|
|
2999
|
+
if (this.state === 'init') {
|
|
3000
|
+
this._state$.next('left');
|
|
3001
|
+
return;
|
|
2958
3002
|
}
|
|
2959
|
-
|
|
2960
|
-
|
|
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);
|
|
2961
3007
|
}
|
|
2962
|
-
|
|
2963
|
-
|
|
3008
|
+
this._state$.next('leaving');
|
|
3009
|
+
if (!config?.onlyTransition) {
|
|
3010
|
+
this._classList.add(ANIMATION_CLASSES.leaveFrom);
|
|
2964
3011
|
}
|
|
2965
|
-
|
|
2966
|
-
|
|
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.6", ngImport: i0, type: AnimatedLifecycleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3035
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.6", 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.6", 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();
|
|
2967
3069
|
}
|
|
2968
|
-
else
|
|
2969
|
-
|
|
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();
|
|
2970
3077
|
}
|
|
2971
|
-
return 'xs';
|
|
2972
3078
|
}
|
|
2973
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
2974
|
-
static { this.ɵ
|
|
3079
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: AnimatedIfDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3080
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", 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 }); }
|
|
2975
3086
|
}
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
__metadata("design:type", Function),
|
|
2979
|
-
__metadata("design:paramtypes", [String, String]),
|
|
2980
|
-
__metadata("design:returntype", void 0)
|
|
2981
|
-
], ViewportService.prototype, "getBreakpointSize", null);
|
|
2982
|
-
__decorate([
|
|
2983
|
-
Memo({
|
|
2984
|
-
resolver: (v) => {
|
|
2985
|
-
return `${v.min ?? ''}-${v.max ?? ''}`;
|
|
2986
|
-
},
|
|
2987
|
-
}),
|
|
2988
|
-
__metadata("design:type", Function),
|
|
2989
|
-
__metadata("design:paramtypes", [Object]),
|
|
2990
|
-
__metadata("design:returntype", void 0)
|
|
2991
|
-
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
2992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ViewportService, decorators: [{
|
|
2993
|
-
type: Injectable,
|
|
3087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: AnimatedIfDirective, decorators: [{
|
|
3088
|
+
type: Directive,
|
|
2994
3089
|
args: [{
|
|
2995
|
-
|
|
3090
|
+
selector: '[etAnimatedIf]',
|
|
3091
|
+
standalone: true,
|
|
3092
|
+
providers: [
|
|
3093
|
+
{
|
|
3094
|
+
provide: ANIMATED_IF_TOKEN,
|
|
3095
|
+
useExisting: AnimatedIfDirective,
|
|
3096
|
+
},
|
|
3097
|
+
],
|
|
3098
|
+
hostDirectives: [NgIf],
|
|
2996
3099
|
}]
|
|
2997
|
-
}],
|
|
3100
|
+
}], propDecorators: { shouldRender: [{
|
|
3101
|
+
type: Input,
|
|
3102
|
+
args: ['etAnimatedIf']
|
|
3103
|
+
}] } });
|
|
2998
3104
|
|
|
2999
3105
|
class ObserveResizeDirective {
|
|
3000
3106
|
constructor() {
|
|
@@ -3038,10 +3144,10 @@ class ObserveResizeDirective {
|
|
|
3038
3144
|
_unsubscribe() {
|
|
3039
3145
|
this._currentSubscription?.unsubscribe();
|
|
3040
3146
|
}
|
|
3041
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3042
|
-
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.6", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3148
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { valueChange: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 }); }
|
|
3043
3149
|
}
|
|
3044
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
3045
3151
|
type: Directive,
|
|
3046
3152
|
args: [{
|
|
3047
3153
|
selector: '[etObserveResize]',
|
|
@@ -3071,15 +3177,15 @@ class RootBoundaryDirective {
|
|
|
3071
3177
|
set boundaryElement(v) {
|
|
3072
3178
|
this._boundaryElement = v;
|
|
3073
3179
|
}
|
|
3074
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3075
|
-
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.6", ngImport: i0, type: RootBoundaryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3181
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: RootBoundaryDirective, isStandalone: true, selector: "[etRootBoundary]", providers: [
|
|
3076
3182
|
{
|
|
3077
3183
|
provide: ROOT_BOUNDARY_TOKEN,
|
|
3078
3184
|
useExisting: RootBoundaryDirective,
|
|
3079
3185
|
},
|
|
3080
3186
|
], ngImport: i0 }); }
|
|
3081
3187
|
}
|
|
3082
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: RootBoundaryDirective, decorators: [{
|
|
3083
3189
|
type: Directive,
|
|
3084
3190
|
args: [{
|
|
3085
3191
|
selector: '[etRootBoundary]',
|
|
@@ -3385,10 +3491,10 @@ class AnimatedOverlayDirective {
|
|
|
3385
3491
|
this._isUnmounting$.next(false);
|
|
3386
3492
|
this._afterClosed?.next();
|
|
3387
3493
|
}
|
|
3388
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3389
|
-
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.6", ngImport: i0, type: AnimatedOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3495
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", 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 }); }
|
|
3390
3496
|
}
|
|
3391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: AnimatedOverlayDirective, decorators: [{
|
|
3392
3498
|
type: Directive,
|
|
3393
3499
|
args: [{
|
|
3394
3500
|
standalone: true,
|
|
@@ -3438,10 +3544,10 @@ class ClickOutsideDirective {
|
|
|
3438
3544
|
ngOnDestroy() {
|
|
3439
3545
|
this._subscription?.unsubscribe();
|
|
3440
3546
|
}
|
|
3441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3442
|
-
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.6", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3548
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 }); }
|
|
3443
3549
|
}
|
|
3444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
3445
3551
|
type: Directive,
|
|
3446
3552
|
args: [{
|
|
3447
3553
|
selector: '[etClickOutside]',
|
|
@@ -3595,10 +3701,10 @@ class CursorDragScrollDirective {
|
|
|
3595
3701
|
this._elementRef.nativeElement.style.cursor = 'default';
|
|
3596
3702
|
}
|
|
3597
3703
|
}
|
|
3598
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3599
|
-
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.6", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3705
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", inputs: { enabled: ["etCursorDragScroll", "enabled"], allowedDirection: "allowedDirection" }, outputs: { cursorDragStart: "cursorDragStart", cursorDragMove: "cursorDragMove", cursorDragEnd: "cursorDragEnd" }, exportAs: ["etCursorDragScroll"], ngImport: i0 }); }
|
|
3600
3706
|
}
|
|
3601
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
3602
3708
|
type: Directive,
|
|
3603
3709
|
args: [{
|
|
3604
3710
|
selector: '[etCursorDragScroll]',
|
|
@@ -3631,15 +3737,15 @@ class DebugDirective {
|
|
|
3631
3737
|
set sDebug(value) {
|
|
3632
3738
|
this._debug.set(value);
|
|
3633
3739
|
}
|
|
3634
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3635
|
-
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.6", ngImport: i0, type: DebugDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3741
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", type: DebugDirective, isStandalone: true, selector: "[etDebug]", inputs: { sDebug: ["etDebug", "sDebug", booleanAttribute] }, providers: [
|
|
3636
3742
|
{
|
|
3637
3743
|
provide: DEBUG_TOKEN,
|
|
3638
3744
|
useExisting: DebugDirective,
|
|
3639
3745
|
},
|
|
3640
3746
|
], exportAs: ["etDebug"], ngImport: i0 }); }
|
|
3641
3747
|
}
|
|
3642
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DebugDirective, decorators: [{
|
|
3643
3749
|
type: Directive,
|
|
3644
3750
|
args: [{
|
|
3645
3751
|
selector: '[etDebug]',
|
|
@@ -3686,15 +3792,15 @@ class DelayableDirective {
|
|
|
3686
3792
|
}
|
|
3687
3793
|
this._isDelayed$.next(val);
|
|
3688
3794
|
}
|
|
3689
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3690
|
-
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.6", ngImport: i0, type: DelayableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3796
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: DelayableDirective, isStandalone: true, selector: "[etDelayable]", providers: [
|
|
3691
3797
|
{
|
|
3692
3798
|
provide: DELAYABLE_TOKEN,
|
|
3693
3799
|
useExisting: DelayableDirective,
|
|
3694
3800
|
},
|
|
3695
3801
|
], exportAs: ["etDelayable"], ngImport: i0 }); }
|
|
3696
3802
|
}
|
|
3697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DelayableDirective, decorators: [{
|
|
3698
3804
|
type: Directive,
|
|
3699
3805
|
args: [{
|
|
3700
3806
|
selector: '[etDelayable]',
|
|
@@ -3715,15 +3821,15 @@ class IsActiveElementDirective {
|
|
|
3715
3821
|
this.elementRef = inject(ElementRef);
|
|
3716
3822
|
this.isActiveElement = false;
|
|
3717
3823
|
}
|
|
3718
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3719
|
-
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.6", ngImport: i0, type: IsActiveElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3825
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", type: IsActiveElementDirective, isStandalone: true, selector: "[etIsActiveElement]", inputs: { isActiveElement: ["etIsActiveElement", "isActiveElement", booleanAttribute] }, providers: [
|
|
3720
3826
|
{
|
|
3721
3827
|
provide: IS_ACTIVE_ELEMENT,
|
|
3722
3828
|
useExisting: IsActiveElementDirective,
|
|
3723
3829
|
},
|
|
3724
3830
|
], ngImport: i0 }); }
|
|
3725
3831
|
}
|
|
3726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: IsActiveElementDirective, decorators: [{
|
|
3727
3833
|
type: Directive,
|
|
3728
3834
|
args: [{
|
|
3729
3835
|
selector: '[etIsActiveElement]',
|
|
@@ -3746,15 +3852,15 @@ class IsElementDirective {
|
|
|
3746
3852
|
this.elementRef = inject(ElementRef);
|
|
3747
3853
|
this.isElement = false;
|
|
3748
3854
|
}
|
|
3749
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3750
|
-
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.6", ngImport: i0, type: IsElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3856
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", type: IsElementDirective, isStandalone: true, selector: "[etIsElement]", inputs: { isElement: ["etIsElement", "isElement", booleanAttribute] }, providers: [
|
|
3751
3857
|
{
|
|
3752
3858
|
provide: IS_ELEMENT,
|
|
3753
3859
|
useExisting: IsElementDirective,
|
|
3754
3860
|
},
|
|
3755
3861
|
], ngImport: i0 }); }
|
|
3756
3862
|
}
|
|
3757
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: IsElementDirective, decorators: [{
|
|
3758
3864
|
type: Directive,
|
|
3759
3865
|
args: [{
|
|
3760
3866
|
selector: '[etIsElement]',
|
|
@@ -3803,10 +3909,10 @@ class LetDirective {
|
|
|
3803
3909
|
}
|
|
3804
3910
|
}
|
|
3805
3911
|
}
|
|
3806
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3807
|
-
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.6", ngImport: i0, type: LetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3913
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 }); }
|
|
3808
3914
|
}
|
|
3809
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: LetDirective, decorators: [{
|
|
3810
3916
|
type: Directive,
|
|
3811
3917
|
args: [{
|
|
3812
3918
|
selector: '[etLet]',
|
|
@@ -3858,10 +3964,10 @@ class ObserveContentDirective {
|
|
|
3858
3964
|
_unsubscribe() {
|
|
3859
3965
|
this._currentSubscription?.unsubscribe();
|
|
3860
3966
|
}
|
|
3861
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3862
|
-
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.6", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3968
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { valueChange: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 }); }
|
|
3863
3969
|
}
|
|
3864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3970
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
3865
3971
|
type: Directive,
|
|
3866
3972
|
args: [{
|
|
3867
3973
|
selector: '[etObserveContent]',
|
|
@@ -3886,10 +3992,10 @@ class ScrollObserverFirstElementDirective {
|
|
|
3886
3992
|
constructor() {
|
|
3887
3993
|
this.isFirstElement = false;
|
|
3888
3994
|
}
|
|
3889
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3890
|
-
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.6", ngImport: i0, type: ScrollObserverFirstElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3996
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", type: ScrollObserverFirstElementDirective, isStandalone: true, selector: "[etScrollObserverFirstElement]", inputs: { isFirstElement: ["etScrollObserverFirstElement", "isFirstElement", booleanAttribute] }, host: { properties: { "class.et-scroll-observer-first-element": "this.isFirstElement" } }, ngImport: i0 }); }
|
|
3891
3997
|
}
|
|
3892
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
3998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ScrollObserverFirstElementDirective, decorators: [{
|
|
3893
3999
|
type: Directive,
|
|
3894
4000
|
args: [{
|
|
3895
4001
|
selector: '[etScrollObserverFirstElement]',
|
|
@@ -3905,10 +4011,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
3905
4011
|
|
|
3906
4012
|
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
3907
4013
|
class ScrollObserverIgnoreTargetDirective {
|
|
3908
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3909
|
-
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.6", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4015
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 }); }
|
|
3910
4016
|
}
|
|
3911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
3912
4018
|
type: Directive,
|
|
3913
4019
|
args: [{
|
|
3914
4020
|
selector: '[etScrollObserverIgnoreTarget]',
|
|
@@ -3924,10 +4030,10 @@ class ScrollObserverLastElementDirective {
|
|
|
3924
4030
|
constructor() {
|
|
3925
4031
|
this.isLastElement = false;
|
|
3926
4032
|
}
|
|
3927
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
3928
|
-
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.6", ngImport: i0, type: ScrollObserverLastElementDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4034
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", 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 }); }
|
|
3929
4035
|
}
|
|
3930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ScrollObserverLastElementDirective, decorators: [{
|
|
3931
4037
|
type: Directive,
|
|
3932
4038
|
args: [{
|
|
3933
4039
|
selector: '[etScrollObserverLastElement]',
|
|
@@ -4084,15 +4190,15 @@ class ObserveScrollStateDirective {
|
|
|
4084
4190
|
}
|
|
4085
4191
|
return element;
|
|
4086
4192
|
}
|
|
4087
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4088
|
-
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.6", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4194
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.6", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { rootMargin: ["rootMargin", "rootMargin", numberAttribute], observerThreshold: "observerThreshold" }, outputs: { valueChange: "etObserveScrollState" }, providers: [
|
|
4089
4195
|
{
|
|
4090
4196
|
provide: OBSERVE_SCROLL_STATE,
|
|
4091
4197
|
useExisting: ObserveScrollStateDirective,
|
|
4092
4198
|
},
|
|
4093
4199
|
], exportAs: ["etObserveScrollState"], ngImport: i0 }); }
|
|
4094
4200
|
}
|
|
4095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
4096
4202
|
type: Directive,
|
|
4097
4203
|
args: [{
|
|
4098
4204
|
selector: '[etObserveScrollState]',
|
|
@@ -4162,15 +4268,15 @@ class ObserveVisibilityDirective {
|
|
|
4162
4268
|
}))
|
|
4163
4269
|
.subscribe();
|
|
4164
4270
|
}
|
|
4165
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4166
|
-
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.6", ngImport: i0, type: ObserveVisibilityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4272
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: ObserveVisibilityDirective, isStandalone: true, selector: "[etObserveVisibility]", outputs: { etObserveVisibility: "etObserveVisibility" }, host: { classAttribute: "et-observe-visibility" }, providers: [
|
|
4167
4273
|
{
|
|
4168
4274
|
provide: OBSERVE_VISIBILITY_TOKEN,
|
|
4169
4275
|
useExisting: ObserveVisibilityDirective,
|
|
4170
4276
|
},
|
|
4171
4277
|
], ngImport: i0 }); }
|
|
4172
4278
|
}
|
|
4173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ObserveVisibilityDirective, decorators: [{
|
|
4174
4280
|
type: Directive,
|
|
4175
4281
|
args: [{
|
|
4176
4282
|
selector: '[etObserveVisibility]',
|
|
@@ -4208,10 +4314,10 @@ class RepeatDirective {
|
|
|
4208
4314
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef);
|
|
4209
4315
|
}
|
|
4210
4316
|
}
|
|
4211
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4212
|
-
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.6", 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.6", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 }); }
|
|
4213
4319
|
}
|
|
4214
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
4215
4321
|
type: Directive,
|
|
4216
4322
|
args: [{
|
|
4217
4323
|
selector: '[etRepeat]',
|
|
@@ -4380,10 +4486,10 @@ class SeoDirective {
|
|
|
4380
4486
|
}
|
|
4381
4487
|
}
|
|
4382
4488
|
}
|
|
4383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4384
|
-
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.6", ngImport: i0, type: SeoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4490
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: SeoDirective, isStandalone: true, providers: [{ provide: SEO_DIRECTIVE_TOKEN, useExisting: SeoDirective }], ngImport: i0 }); }
|
|
4385
4491
|
}
|
|
4386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: SeoDirective, decorators: [{
|
|
4387
4493
|
type: Directive,
|
|
4388
4494
|
args: [{
|
|
4389
4495
|
standalone: true,
|
|
@@ -4559,10 +4665,10 @@ class InferMimeTypePipe {
|
|
|
4559
4665
|
constructor() {
|
|
4560
4666
|
this.transform = inferMimeType;
|
|
4561
4667
|
}
|
|
4562
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4563
|
-
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.6", ngImport: i0, type: InferMimeTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4669
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: InferMimeTypePipe, isStandalone: true, name: "inferMimeType" }); }
|
|
4564
4670
|
}
|
|
4565
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: InferMimeTypePipe, decorators: [{
|
|
4566
4672
|
type: Pipe,
|
|
4567
4673
|
args: [{
|
|
4568
4674
|
name: 'inferMimeType',
|
|
@@ -4608,10 +4714,10 @@ class NormalizeGameResultTypePipe {
|
|
|
4608
4714
|
constructor() {
|
|
4609
4715
|
this.transform = normalizeGameResultType;
|
|
4610
4716
|
}
|
|
4611
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4612
|
-
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.6", ngImport: i0, type: NormalizeGameResultTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4718
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: NormalizeGameResultTypePipe, isStandalone: true, name: "etNormalizeGameResultType" }); }
|
|
4613
4719
|
}
|
|
4614
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: NormalizeGameResultTypePipe, decorators: [{
|
|
4615
4721
|
type: Pipe,
|
|
4616
4722
|
args: [{ name: 'etNormalizeGameResultType', standalone: true }]
|
|
4617
4723
|
}] });
|
|
@@ -4639,10 +4745,10 @@ class NormalizeMatchStatePipe {
|
|
|
4639
4745
|
constructor() {
|
|
4640
4746
|
this.transform = normalizeMatchState;
|
|
4641
4747
|
}
|
|
4642
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4643
|
-
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.6", ngImport: i0, type: NormalizeMatchStatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4749
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchStatePipe, isStandalone: true, name: "etNormalizeMatchState" }); }
|
|
4644
4750
|
}
|
|
4645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchStatePipe, decorators: [{
|
|
4646
4752
|
type: Pipe,
|
|
4647
4753
|
args: [{ name: 'etNormalizeMatchState', standalone: true }]
|
|
4648
4754
|
}] });
|
|
@@ -4697,10 +4803,10 @@ class NormalizeMatchParticipantsPipe {
|
|
|
4697
4803
|
constructor() {
|
|
4698
4804
|
this.transform = normalizeMatchParticipants;
|
|
4699
4805
|
}
|
|
4700
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4701
|
-
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.6", ngImport: i0, type: NormalizeMatchParticipantsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4807
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchParticipantsPipe, isStandalone: true, name: "etNormalizeMatchParticipants" }); }
|
|
4702
4808
|
}
|
|
4703
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchParticipantsPipe, decorators: [{
|
|
4704
4810
|
type: Pipe,
|
|
4705
4811
|
args: [{ name: 'etNormalizeMatchParticipants', standalone: true }]
|
|
4706
4812
|
}] });
|
|
@@ -4834,10 +4940,10 @@ class NormalizeMatchScorePipe {
|
|
|
4834
4940
|
constructor() {
|
|
4835
4941
|
this.transform = normalizeMatchScore;
|
|
4836
4942
|
}
|
|
4837
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4838
|
-
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.6", ngImport: i0, type: NormalizeMatchScorePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4944
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchScorePipe, isStandalone: true, name: "etNormalizeMatchScore" }); }
|
|
4839
4945
|
}
|
|
4840
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchScorePipe, decorators: [{
|
|
4841
4947
|
type: Pipe,
|
|
4842
4948
|
args: [{ name: 'etNormalizeMatchScore', standalone: true }]
|
|
4843
4949
|
}] });
|
|
@@ -4884,10 +4990,10 @@ class NormalizeMatchTypePipe {
|
|
|
4884
4990
|
constructor() {
|
|
4885
4991
|
this.transform = normalizeMatchType;
|
|
4886
4992
|
}
|
|
4887
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4888
|
-
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.6", ngImport: i0, type: NormalizeMatchTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
4994
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchTypePipe, isStandalone: true, name: "etNormalizeMatchType" }); }
|
|
4889
4995
|
}
|
|
4890
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
4996
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: NormalizeMatchTypePipe, decorators: [{
|
|
4891
4997
|
type: Pipe,
|
|
4892
4998
|
args: [{ name: 'etNormalizeMatchType', standalone: true }]
|
|
4893
4999
|
}] });
|
|
@@ -4901,10 +5007,10 @@ class ToArrayPipe {
|
|
|
4901
5007
|
constructor() {
|
|
4902
5008
|
this.transform = toArray;
|
|
4903
5009
|
}
|
|
4904
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
4905
|
-
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.6", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
5011
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" }); }
|
|
4906
5012
|
}
|
|
4907
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
5013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
4908
5014
|
type: Pipe,
|
|
4909
5015
|
args: [{ name: 'toArray', standalone: true }]
|
|
4910
5016
|
}] });
|
|
@@ -5122,10 +5228,10 @@ class PropsDirective {
|
|
|
5122
5228
|
});
|
|
5123
5229
|
});
|
|
5124
5230
|
}
|
|
5125
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
5126
|
-
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.6", ngImport: i0, type: PropsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5232
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.6", type: PropsDirective, isStandalone: true, selector: "[etProps]", inputs: { props: { classPropertyName: "props", publicName: "etProps", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
5127
5233
|
}
|
|
5128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
5234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PropsDirective, decorators: [{
|
|
5129
5235
|
type: Directive,
|
|
5130
5236
|
args: [{
|
|
5131
5237
|
selector: '[etProps]',
|
|
@@ -5258,5 +5364,5 @@ const Validators = {
|
|
|
5258
5364
|
* Generated bundle index. Do not edit.
|
|
5259
5365
|
*/
|
|
5260
5366
|
|
|
5261
|
-
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 };
|
|
5262
5368
|
//# sourceMappingURL=ethlete-core.mjs.map
|