@ethlete/core 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +28 -4
- package/esm2022/lib/directives/observe-resize/index.mjs +2 -0
- package/esm2022/lib/services/router-state.service.mjs +59 -2
- package/fesm2022/ethlete-core.mjs +317 -238
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/directives/animated-overlay/animated-overlay.directive.d.ts +8 -4
- package/lib/directives/observe-resize/index.d.ts +1 -0
- package/lib/services/router-state.service.d.ts +22 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, assertInInjectionContext, DestroyRef, ElementRef, isDevMode, Directive,
|
|
2
|
+
import { inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, InjectionToken, assertInInjectionContext, DestroyRef, ElementRef, isDevMode, Directive, Injectable, Inject, Optional, NgZone, EventEmitter, Output, Injector, ViewContainerRef, Pipe, QueryList } from '@angular/core';
|
|
3
3
|
import { DomSanitizer, Meta, Title } from '@angular/platform-browser';
|
|
4
4
|
import { Observable, combineLatest, Subject, startWith, map, takeUntil, distinctUntilChanged, BehaviorSubject, skip, take, tap, debounceTime, merge, fromEvent, filter, switchMap, pairwise, shareReplay } from 'rxjs';
|
|
5
5
|
import { coerceCssPixelValue, coerceElement, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
@@ -982,179 +982,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
982
982
|
}]
|
|
983
983
|
}] });
|
|
984
984
|
|
|
985
|
-
class AnimatedOverlayDirective {
|
|
986
|
-
constructor() {
|
|
987
|
-
this._destroy$ = createDestroy();
|
|
988
|
-
this._overlayService = inject(Overlay);
|
|
989
|
-
this._injector = inject(Injector);
|
|
990
|
-
this._viewContainerRef = inject(ViewContainerRef);
|
|
991
|
-
this._zone = inject(NgZone);
|
|
992
|
-
this._elementRef = inject(ElementRef);
|
|
993
|
-
this._portal = null;
|
|
994
|
-
this._overlayRef = null;
|
|
995
|
-
this._componentRef = null;
|
|
996
|
-
this._popper = null;
|
|
997
|
-
this._beforeOpened = null;
|
|
998
|
-
this._afterOpened = null;
|
|
999
|
-
this._beforeClosed = null;
|
|
1000
|
-
this._afterClosed = null;
|
|
1001
|
-
/**
|
|
1002
|
-
* The placement of the tooltip.
|
|
1003
|
-
* @default 'auto'
|
|
1004
|
-
*/
|
|
1005
|
-
this.placement = 'auto';
|
|
1006
|
-
/**
|
|
1007
|
-
* The offset of the tooltip.
|
|
1008
|
-
* @see https://popper.js.org/docs/v2/modifiers/offset/#offset-1
|
|
1009
|
-
*/
|
|
1010
|
-
this.offset = null;
|
|
1011
|
-
/**
|
|
1012
|
-
* The arrow padding.
|
|
1013
|
-
* @see https://popper.js.org/docs/v2/modifiers/arrow/#padding
|
|
1014
|
-
* @default 4
|
|
1015
|
-
*/
|
|
1016
|
-
this.arrowPadding = null;
|
|
1017
|
-
}
|
|
1018
|
-
get isMounted() {
|
|
1019
|
-
return !!this._componentRef;
|
|
1020
|
-
}
|
|
1021
|
-
get portal() {
|
|
1022
|
-
return this._portal;
|
|
1023
|
-
}
|
|
1024
|
-
get overlayRef() {
|
|
1025
|
-
return this._overlayRef;
|
|
1026
|
-
}
|
|
1027
|
-
get componentRef() {
|
|
1028
|
-
return this._componentRef;
|
|
1029
|
-
}
|
|
1030
|
-
get popper() {
|
|
1031
|
-
return this._popper;
|
|
1032
|
-
}
|
|
1033
|
-
mount(config) {
|
|
1034
|
-
const { component, providers, data } = config;
|
|
1035
|
-
this._beforeOpened?.next();
|
|
1036
|
-
const injector = Injector.create({
|
|
1037
|
-
parent: this._injector,
|
|
1038
|
-
providers: providers ?? [],
|
|
1039
|
-
});
|
|
1040
|
-
this._overlayRef = this._overlayService.create();
|
|
1041
|
-
this._portal = this._portal ?? new ComponentPortal(component, this._viewContainerRef, injector);
|
|
1042
|
-
this._componentRef = this._overlayRef.attach(this._portal);
|
|
1043
|
-
if (data) {
|
|
1044
|
-
Object.assign(this._componentRef.instance, data);
|
|
1045
|
-
}
|
|
1046
|
-
this._componentRef.instance._markForCheck?.();
|
|
1047
|
-
this._zone.runOutsideAngular(() => {
|
|
1048
|
-
if (!this._componentRef) {
|
|
1049
|
-
return;
|
|
1050
|
-
}
|
|
1051
|
-
this._popper = createPopper(this._elementRef.nativeElement, this._componentRef.location.nativeElement, {
|
|
1052
|
-
placement: this.placement,
|
|
1053
|
-
modifiers: [
|
|
1054
|
-
...(this.offset
|
|
1055
|
-
? [
|
|
1056
|
-
{
|
|
1057
|
-
name: 'offset',
|
|
1058
|
-
options: {
|
|
1059
|
-
offset: this.offset,
|
|
1060
|
-
},
|
|
1061
|
-
},
|
|
1062
|
-
]
|
|
1063
|
-
: []),
|
|
1064
|
-
...(this.arrowPadding
|
|
1065
|
-
? [
|
|
1066
|
-
{
|
|
1067
|
-
name: 'arrow',
|
|
1068
|
-
options: {
|
|
1069
|
-
padding: this.arrowPadding,
|
|
1070
|
-
},
|
|
1071
|
-
},
|
|
1072
|
-
]
|
|
1073
|
-
: []),
|
|
1074
|
-
],
|
|
1075
|
-
});
|
|
1076
|
-
// We need to wait for the tooltip content to be rendered
|
|
1077
|
-
nextFrame(() => {
|
|
1078
|
-
if (!this._componentRef) {
|
|
1079
|
-
return;
|
|
1080
|
-
}
|
|
1081
|
-
this._popper?.update();
|
|
1082
|
-
this._componentRef.instance._animatedLifecycle?.enter();
|
|
1083
|
-
this._componentRef.instance._animatedLifecycle?.state$
|
|
1084
|
-
.pipe(tap((s) => {
|
|
1085
|
-
if (s === 'entered') {
|
|
1086
|
-
this._afterOpened?.next();
|
|
1087
|
-
}
|
|
1088
|
-
}), take(1), takeUntil(this._destroy$))
|
|
1089
|
-
.subscribe();
|
|
1090
|
-
});
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
unmount() {
|
|
1094
|
-
if (!this._componentRef) {
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
this._beforeClosed?.next();
|
|
1098
|
-
this._componentRef.instance._animatedLifecycle?.leave();
|
|
1099
|
-
this._componentRef.instance._animatedLifecycle?.state$
|
|
1100
|
-
.pipe(filter((s) => s === 'left'), take(1))
|
|
1101
|
-
.subscribe(() => this._destroy());
|
|
1102
|
-
}
|
|
1103
|
-
beforeOpened() {
|
|
1104
|
-
if (!this._beforeOpened) {
|
|
1105
|
-
this._beforeOpened = new Subject();
|
|
1106
|
-
}
|
|
1107
|
-
return this._beforeOpened;
|
|
1108
|
-
}
|
|
1109
|
-
afterOpened() {
|
|
1110
|
-
if (!this._afterOpened) {
|
|
1111
|
-
this._afterOpened = new Subject();
|
|
1112
|
-
}
|
|
1113
|
-
return this._afterOpened;
|
|
1114
|
-
}
|
|
1115
|
-
beforeClosed() {
|
|
1116
|
-
if (!this._beforeClosed) {
|
|
1117
|
-
this._beforeClosed = new Subject();
|
|
1118
|
-
}
|
|
1119
|
-
return this._beforeClosed;
|
|
1120
|
-
}
|
|
1121
|
-
afterClosed() {
|
|
1122
|
-
if (!this._afterClosed) {
|
|
1123
|
-
this._afterClosed = new Subject();
|
|
1124
|
-
}
|
|
1125
|
-
return this._afterClosed;
|
|
1126
|
-
}
|
|
1127
|
-
_destroy() {
|
|
1128
|
-
this._zone.runOutsideAngular(() => {
|
|
1129
|
-
this._popper?.destroy();
|
|
1130
|
-
this._popper = null;
|
|
1131
|
-
});
|
|
1132
|
-
if (this._overlayRef) {
|
|
1133
|
-
this._overlayRef.dispose();
|
|
1134
|
-
this._overlayRef = null;
|
|
1135
|
-
}
|
|
1136
|
-
if (this._componentRef) {
|
|
1137
|
-
this._componentRef.destroy();
|
|
1138
|
-
this._componentRef = null;
|
|
1139
|
-
}
|
|
1140
|
-
this._afterClosed?.next();
|
|
1141
|
-
}
|
|
1142
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: AnimatedOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1143
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: AnimatedOverlayDirective, isStandalone: true, inputs: { placement: "placement", offset: "offset", arrowPadding: "arrowPadding" }, ngImport: i0 }); }
|
|
1144
|
-
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: AnimatedOverlayDirective, decorators: [{
|
|
1146
|
-
type: Directive,
|
|
1147
|
-
args: [{
|
|
1148
|
-
standalone: true,
|
|
1149
|
-
}]
|
|
1150
|
-
}], propDecorators: { placement: [{
|
|
1151
|
-
type: Input
|
|
1152
|
-
}], offset: [{
|
|
1153
|
-
type: Input
|
|
1154
|
-
}], arrowPadding: [{
|
|
1155
|
-
type: Input
|
|
1156
|
-
}] } });
|
|
1157
|
-
|
|
1158
985
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
1159
986
|
class ClickObserverFactory {
|
|
1160
987
|
create() {
|
|
@@ -1411,6 +1238,7 @@ const routerDisableScrollTop = (config = {}) => {
|
|
|
1411
1238
|
disableScrollTopAsReturnRoute: true,
|
|
1412
1239
|
};
|
|
1413
1240
|
};
|
|
1241
|
+
const ET_PROPERTY_REMOVED = Symbol('ET_PROPERTY_REMOVED');
|
|
1414
1242
|
class RouterStateService {
|
|
1415
1243
|
get route$() {
|
|
1416
1244
|
return this._route$.asObservable().pipe(distinctUntilChanged());
|
|
@@ -1418,6 +1246,48 @@ class RouterStateService {
|
|
|
1418
1246
|
get state$() {
|
|
1419
1247
|
return this._state$.asObservable();
|
|
1420
1248
|
}
|
|
1249
|
+
get state() {
|
|
1250
|
+
return this._state$.getValue();
|
|
1251
|
+
}
|
|
1252
|
+
get data$() {
|
|
1253
|
+
return this._state$.pipe(map((state) => state.data), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1254
|
+
}
|
|
1255
|
+
get data() {
|
|
1256
|
+
return this._state$.getValue().data;
|
|
1257
|
+
}
|
|
1258
|
+
get pathParams$() {
|
|
1259
|
+
return this._state$.pipe(map((state) => state.pathParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1260
|
+
}
|
|
1261
|
+
get pathParams() {
|
|
1262
|
+
return this._state$.getValue().pathParams;
|
|
1263
|
+
}
|
|
1264
|
+
get queryParams$() {
|
|
1265
|
+
return this._state$.pipe(map((state) => state.queryParams), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1266
|
+
}
|
|
1267
|
+
get queryParams() {
|
|
1268
|
+
return this._state$.getValue().queryParams;
|
|
1269
|
+
}
|
|
1270
|
+
get title$() {
|
|
1271
|
+
return this._state$.pipe(map((state) => state.title), distinctUntilChanged());
|
|
1272
|
+
}
|
|
1273
|
+
get title() {
|
|
1274
|
+
return this._state$.getValue().title;
|
|
1275
|
+
}
|
|
1276
|
+
get fragment$() {
|
|
1277
|
+
return this._state$.pipe(map((state) => state.fragment), distinctUntilChanged());
|
|
1278
|
+
}
|
|
1279
|
+
get fragment() {
|
|
1280
|
+
return this._state$.getValue().fragment;
|
|
1281
|
+
}
|
|
1282
|
+
get dataChanges$() {
|
|
1283
|
+
return this.data$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1284
|
+
}
|
|
1285
|
+
get queryParamChanges$() {
|
|
1286
|
+
return this.queryParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1287
|
+
}
|
|
1288
|
+
get pathParamChanges$() {
|
|
1289
|
+
return this.pathParams$.pipe(pairwise(), map((v) => this._findChanges(v)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1290
|
+
}
|
|
1421
1291
|
constructor() {
|
|
1422
1292
|
this._isScrollTopOnNavigationEnabled = false;
|
|
1423
1293
|
this._router = inject(Router);
|
|
@@ -1501,6 +1371,20 @@ class RouterStateService {
|
|
|
1501
1371
|
selectData(key) {
|
|
1502
1372
|
return this._state$.pipe(map((state) => state.data[key]), distinctUntilChanged((a, b) => equal(a, b)));
|
|
1503
1373
|
}
|
|
1374
|
+
_findChanges([previous, current,]) {
|
|
1375
|
+
const changes = {};
|
|
1376
|
+
const allKeys = new Set([
|
|
1377
|
+
...Object.keys(previous),
|
|
1378
|
+
...Object.keys(current),
|
|
1379
|
+
]);
|
|
1380
|
+
for (const key of allKeys) {
|
|
1381
|
+
if (!equal(previous[key], current[key])) {
|
|
1382
|
+
const val = current[key] === undefined ? ET_PROPERTY_REMOVED : current[key];
|
|
1383
|
+
changes[key] = val;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return changes;
|
|
1387
|
+
}
|
|
1504
1388
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: RouterStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1505
1389
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: RouterStateService, providedIn: 'root' }); }
|
|
1506
1390
|
}
|
|
@@ -1671,6 +1555,264 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
1671
1555
|
type: Optional
|
|
1672
1556
|
}] }, { type: i1.BreakpointObserver }]; }, propDecorators: { _getViewportSize: [], _buildMediaQuery: [] } });
|
|
1673
1557
|
|
|
1558
|
+
class ObserveResizeDirective {
|
|
1559
|
+
constructor() {
|
|
1560
|
+
this._resizeObserver = inject(ResizeObserverService);
|
|
1561
|
+
this._elementRef = inject(ElementRef);
|
|
1562
|
+
this._ngZone = inject(NgZone);
|
|
1563
|
+
this.valueChange = new EventEmitter();
|
|
1564
|
+
this._disabled = false;
|
|
1565
|
+
this._debounce = null;
|
|
1566
|
+
this._currentSubscription = null;
|
|
1567
|
+
}
|
|
1568
|
+
get disabled() {
|
|
1569
|
+
return this._disabled;
|
|
1570
|
+
}
|
|
1571
|
+
set disabled(value) {
|
|
1572
|
+
this._disabled = coerceBooleanProperty(value);
|
|
1573
|
+
this._disabled ? this._unsubscribe() : this._subscribe();
|
|
1574
|
+
}
|
|
1575
|
+
get debounce() {
|
|
1576
|
+
return this._debounce;
|
|
1577
|
+
}
|
|
1578
|
+
set debounce(value) {
|
|
1579
|
+
this._debounce = coerceNumberProperty(value);
|
|
1580
|
+
this._subscribe();
|
|
1581
|
+
}
|
|
1582
|
+
ngAfterContentInit() {
|
|
1583
|
+
if (!this._currentSubscription && !this.disabled) {
|
|
1584
|
+
this._subscribe();
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
ngOnDestroy() {
|
|
1588
|
+
this._unsubscribe();
|
|
1589
|
+
}
|
|
1590
|
+
_subscribe() {
|
|
1591
|
+
this._unsubscribe();
|
|
1592
|
+
const stream = this._resizeObserver.observe(this._elementRef);
|
|
1593
|
+
this._ngZone.runOutsideAngular(() => {
|
|
1594
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.valueChange);
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
_unsubscribe() {
|
|
1598
|
+
this._currentSubscription?.unsubscribe();
|
|
1599
|
+
}
|
|
1600
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1601
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { valueChange: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 }); }
|
|
1602
|
+
}
|
|
1603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
1604
|
+
type: Directive,
|
|
1605
|
+
args: [{
|
|
1606
|
+
selector: '[etObserveResize]',
|
|
1607
|
+
exportAs: 'etObserveResize',
|
|
1608
|
+
standalone: true,
|
|
1609
|
+
}]
|
|
1610
|
+
}], propDecorators: { valueChange: [{
|
|
1611
|
+
type: Output,
|
|
1612
|
+
args: ['etObserveResize']
|
|
1613
|
+
}], disabled: [{
|
|
1614
|
+
type: Input,
|
|
1615
|
+
args: ['etObserveResizeDisabled']
|
|
1616
|
+
}], debounce: [{
|
|
1617
|
+
type: Input,
|
|
1618
|
+
args: ['etObserveResizeDebounce']
|
|
1619
|
+
}] } });
|
|
1620
|
+
|
|
1621
|
+
class AnimatedOverlayDirective {
|
|
1622
|
+
constructor() {
|
|
1623
|
+
this._destroy$ = createDestroy();
|
|
1624
|
+
this._overlayService = inject(Overlay);
|
|
1625
|
+
this._injector = inject(Injector);
|
|
1626
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
1627
|
+
this._zone = inject(NgZone);
|
|
1628
|
+
this._elementRef = inject(ElementRef);
|
|
1629
|
+
this._observeResize = inject(ObserveResizeDirective);
|
|
1630
|
+
this._portal = null;
|
|
1631
|
+
this._overlayRef = null;
|
|
1632
|
+
this._componentRef = null;
|
|
1633
|
+
this._popper = null;
|
|
1634
|
+
this._beforeOpened = null;
|
|
1635
|
+
this._afterOpened = null;
|
|
1636
|
+
this._beforeClosed = null;
|
|
1637
|
+
this._afterClosed = null;
|
|
1638
|
+
/**
|
|
1639
|
+
* The placement of the tooltip.
|
|
1640
|
+
* @default 'auto'
|
|
1641
|
+
*/
|
|
1642
|
+
this.placement = 'auto';
|
|
1643
|
+
/**
|
|
1644
|
+
* The offset of the tooltip.
|
|
1645
|
+
* @see https://popper.js.org/docs/v2/modifiers/offset/#offset-1
|
|
1646
|
+
*/
|
|
1647
|
+
this.offset = null;
|
|
1648
|
+
/**
|
|
1649
|
+
* The arrow padding.
|
|
1650
|
+
* @see https://popper.js.org/docs/v2/modifiers/arrow/#padding
|
|
1651
|
+
* @default 4
|
|
1652
|
+
*/
|
|
1653
|
+
this.arrowPadding = null;
|
|
1654
|
+
}
|
|
1655
|
+
get isMounted() {
|
|
1656
|
+
return !!this._componentRef;
|
|
1657
|
+
}
|
|
1658
|
+
get portal() {
|
|
1659
|
+
return this._portal;
|
|
1660
|
+
}
|
|
1661
|
+
get overlayRef() {
|
|
1662
|
+
return this._overlayRef;
|
|
1663
|
+
}
|
|
1664
|
+
get componentRef() {
|
|
1665
|
+
return this._componentRef;
|
|
1666
|
+
}
|
|
1667
|
+
get popper() {
|
|
1668
|
+
return this._popper;
|
|
1669
|
+
}
|
|
1670
|
+
mount(config) {
|
|
1671
|
+
if (this.isMounted) {
|
|
1672
|
+
if (isDevMode()) {
|
|
1673
|
+
console.warn('AnimatedOverlayDirective: There is already a component mounted. Please call `unmount` before calling `mount` again.');
|
|
1674
|
+
}
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
const { component, providers, data, mirrorWidth } = config;
|
|
1678
|
+
this._beforeOpened?.next();
|
|
1679
|
+
const injector = Injector.create({
|
|
1680
|
+
parent: this._injector,
|
|
1681
|
+
providers: providers ?? [],
|
|
1682
|
+
});
|
|
1683
|
+
this._overlayRef = this._overlayService.create();
|
|
1684
|
+
this._portal = this._portal ?? new ComponentPortal(component, this._viewContainerRef, injector);
|
|
1685
|
+
this._componentRef = this._overlayRef.attach(this._portal);
|
|
1686
|
+
if (data) {
|
|
1687
|
+
Object.assign(this._componentRef.instance, data);
|
|
1688
|
+
}
|
|
1689
|
+
this._componentRef.instance._markForCheck?.();
|
|
1690
|
+
if (mirrorWidth) {
|
|
1691
|
+
this._overlayRef.updateSize({
|
|
1692
|
+
width: this._elementRef.nativeElement.offsetWidth,
|
|
1693
|
+
});
|
|
1694
|
+
this._observeResize.valueChange
|
|
1695
|
+
.pipe(tap(() => {
|
|
1696
|
+
this._overlayRef?.updateSize({
|
|
1697
|
+
width: this._elementRef.nativeElement.offsetWidth,
|
|
1698
|
+
});
|
|
1699
|
+
this._popper?.update();
|
|
1700
|
+
}), takeUntil(this._destroy$), takeUntil(this.afterClosed()))
|
|
1701
|
+
.subscribe();
|
|
1702
|
+
}
|
|
1703
|
+
this._zone.runOutsideAngular(() => {
|
|
1704
|
+
if (!this._componentRef) {
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
this._popper = createPopper(this._elementRef.nativeElement, this._componentRef.location.nativeElement, {
|
|
1708
|
+
placement: this.placement,
|
|
1709
|
+
modifiers: [
|
|
1710
|
+
...(this.offset
|
|
1711
|
+
? [
|
|
1712
|
+
{
|
|
1713
|
+
name: 'offset',
|
|
1714
|
+
options: {
|
|
1715
|
+
offset: this.offset,
|
|
1716
|
+
},
|
|
1717
|
+
},
|
|
1718
|
+
]
|
|
1719
|
+
: []),
|
|
1720
|
+
...(this.arrowPadding
|
|
1721
|
+
? [
|
|
1722
|
+
{
|
|
1723
|
+
name: 'arrow',
|
|
1724
|
+
options: {
|
|
1725
|
+
padding: this.arrowPadding,
|
|
1726
|
+
},
|
|
1727
|
+
},
|
|
1728
|
+
]
|
|
1729
|
+
: []),
|
|
1730
|
+
],
|
|
1731
|
+
});
|
|
1732
|
+
// We need to wait for the tooltip content to be rendered
|
|
1733
|
+
nextFrame(() => {
|
|
1734
|
+
if (!this._componentRef) {
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
this._popper?.update();
|
|
1738
|
+
this._componentRef.instance._animatedLifecycle?.enter();
|
|
1739
|
+
this._componentRef.instance._animatedLifecycle?.state$
|
|
1740
|
+
.pipe(tap((s) => {
|
|
1741
|
+
if (s === 'entered') {
|
|
1742
|
+
this._afterOpened?.next();
|
|
1743
|
+
}
|
|
1744
|
+
}), take(1), takeUntil(this._destroy$))
|
|
1745
|
+
.subscribe();
|
|
1746
|
+
});
|
|
1747
|
+
});
|
|
1748
|
+
return this._componentRef.instance;
|
|
1749
|
+
}
|
|
1750
|
+
unmount() {
|
|
1751
|
+
if (!this._componentRef) {
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
this._beforeClosed?.next();
|
|
1755
|
+
this._componentRef.instance._animatedLifecycle?.leave();
|
|
1756
|
+
this._componentRef.instance._animatedLifecycle?.state$
|
|
1757
|
+
.pipe(filter((s) => s === 'left'), take(1))
|
|
1758
|
+
.subscribe(() => this._destroy());
|
|
1759
|
+
}
|
|
1760
|
+
beforeOpened() {
|
|
1761
|
+
if (!this._beforeOpened) {
|
|
1762
|
+
this._beforeOpened = new Subject();
|
|
1763
|
+
}
|
|
1764
|
+
return this._beforeOpened;
|
|
1765
|
+
}
|
|
1766
|
+
afterOpened() {
|
|
1767
|
+
if (!this._afterOpened) {
|
|
1768
|
+
this._afterOpened = new Subject();
|
|
1769
|
+
}
|
|
1770
|
+
return this._afterOpened;
|
|
1771
|
+
}
|
|
1772
|
+
beforeClosed() {
|
|
1773
|
+
if (!this._beforeClosed) {
|
|
1774
|
+
this._beforeClosed = new Subject();
|
|
1775
|
+
}
|
|
1776
|
+
return this._beforeClosed;
|
|
1777
|
+
}
|
|
1778
|
+
afterClosed() {
|
|
1779
|
+
if (!this._afterClosed) {
|
|
1780
|
+
this._afterClosed = new Subject();
|
|
1781
|
+
}
|
|
1782
|
+
return this._afterClosed;
|
|
1783
|
+
}
|
|
1784
|
+
_destroy() {
|
|
1785
|
+
this._zone.runOutsideAngular(() => {
|
|
1786
|
+
this._popper?.destroy();
|
|
1787
|
+
this._popper = null;
|
|
1788
|
+
});
|
|
1789
|
+
if (this._overlayRef) {
|
|
1790
|
+
this._overlayRef.dispose();
|
|
1791
|
+
this._overlayRef = null;
|
|
1792
|
+
}
|
|
1793
|
+
if (this._componentRef) {
|
|
1794
|
+
this._componentRef.destroy();
|
|
1795
|
+
this._componentRef = null;
|
|
1796
|
+
}
|
|
1797
|
+
this._afterClosed?.next();
|
|
1798
|
+
}
|
|
1799
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: AnimatedOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1800
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: AnimatedOverlayDirective, isStandalone: true, inputs: { placement: "placement", offset: "offset", arrowPadding: "arrowPadding" }, hostDirectives: [{ directive: ObserveResizeDirective }], ngImport: i0 }); }
|
|
1801
|
+
}
|
|
1802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: AnimatedOverlayDirective, decorators: [{
|
|
1803
|
+
type: Directive,
|
|
1804
|
+
args: [{
|
|
1805
|
+
standalone: true,
|
|
1806
|
+
hostDirectives: [ObserveResizeDirective],
|
|
1807
|
+
}]
|
|
1808
|
+
}], propDecorators: { placement: [{
|
|
1809
|
+
type: Input
|
|
1810
|
+
}], offset: [{
|
|
1811
|
+
type: Input
|
|
1812
|
+
}], arrowPadding: [{
|
|
1813
|
+
type: Input
|
|
1814
|
+
}] } });
|
|
1815
|
+
|
|
1674
1816
|
class ClickOutsideDirective {
|
|
1675
1817
|
constructor() {
|
|
1676
1818
|
this._elementRef = inject(ElementRef);
|
|
@@ -2045,69 +2187,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
2045
2187
|
args: ['etObserveContentDebounce']
|
|
2046
2188
|
}] } });
|
|
2047
2189
|
|
|
2048
|
-
class ObserveResizeDirective {
|
|
2049
|
-
constructor() {
|
|
2050
|
-
this._resizeObserver = inject(ResizeObserverService);
|
|
2051
|
-
this._elementRef = inject(ElementRef);
|
|
2052
|
-
this._ngZone = inject(NgZone);
|
|
2053
|
-
this.valueChange = new EventEmitter();
|
|
2054
|
-
this._disabled = false;
|
|
2055
|
-
this._debounce = null;
|
|
2056
|
-
this._currentSubscription = null;
|
|
2057
|
-
}
|
|
2058
|
-
get disabled() {
|
|
2059
|
-
return this._disabled;
|
|
2060
|
-
}
|
|
2061
|
-
set disabled(value) {
|
|
2062
|
-
this._disabled = coerceBooleanProperty(value);
|
|
2063
|
-
this._disabled ? this._unsubscribe() : this._subscribe();
|
|
2064
|
-
}
|
|
2065
|
-
get debounce() {
|
|
2066
|
-
return this._debounce;
|
|
2067
|
-
}
|
|
2068
|
-
set debounce(value) {
|
|
2069
|
-
this._debounce = coerceNumberProperty(value);
|
|
2070
|
-
this._subscribe();
|
|
2071
|
-
}
|
|
2072
|
-
ngAfterContentInit() {
|
|
2073
|
-
if (!this._currentSubscription && !this.disabled) {
|
|
2074
|
-
this._subscribe();
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
ngOnDestroy() {
|
|
2078
|
-
this._unsubscribe();
|
|
2079
|
-
}
|
|
2080
|
-
_subscribe() {
|
|
2081
|
-
this._unsubscribe();
|
|
2082
|
-
const stream = this._resizeObserver.observe(this._elementRef);
|
|
2083
|
-
this._ngZone.runOutsideAngular(() => {
|
|
2084
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.valueChange);
|
|
2085
|
-
});
|
|
2086
|
-
}
|
|
2087
|
-
_unsubscribe() {
|
|
2088
|
-
this._currentSubscription?.unsubscribe();
|
|
2089
|
-
}
|
|
2090
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2091
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { valueChange: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 }); }
|
|
2092
|
-
}
|
|
2093
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
2094
|
-
type: Directive,
|
|
2095
|
-
args: [{
|
|
2096
|
-
selector: '[etObserveResize]',
|
|
2097
|
-
exportAs: 'etObserveResize',
|
|
2098
|
-
standalone: true,
|
|
2099
|
-
}]
|
|
2100
|
-
}], propDecorators: { valueChange: [{
|
|
2101
|
-
type: Output,
|
|
2102
|
-
args: ['etObserveResize']
|
|
2103
|
-
}], disabled: [{
|
|
2104
|
-
type: Input,
|
|
2105
|
-
args: ['etObserveResizeDisabled']
|
|
2106
|
-
}], debounce: [{
|
|
2107
|
-
type: Input,
|
|
2108
|
-
args: ['etObserveResizeDebounce']
|
|
2109
|
-
}] } });
|
|
2110
|
-
|
|
2111
2190
|
const SCROLL_OBSERVER_FIRST_ELEMENT_CLASS = 'et-scroll-observer-first-element';
|
|
2112
2191
|
class ScrollObserverFirstElementDirective {
|
|
2113
2192
|
constructor() {
|
|
@@ -2952,5 +3031,5 @@ const Validators = {
|
|
|
2952
3031
|
* Generated bundle index. Do not edit.
|
|
2953
3032
|
*/
|
|
2954
3033
|
|
|
2955
|
-
export { ANIMATABLE_TOKEN, ANIMATED_LIFECYCLE_TOKEN, AnimatableDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, BehaviorSubjectWithSubscriberCount, ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DELAYABLE_TOKEN, DelayableDirective, FocusVisibleService, IS_ACTIVE_ELEMENT, IS_ARRAY_NOT_EMPTY, IS_EMAIL, IsActiveElementDirective, IsArrayNotEmpty, IsEmail, LetContext, LetDirective, MUST_MATCH, Memo, MustMatch, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RouterStateService, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, SmartBlockScrollStrategy, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, Validators, ViewportService, clamp, clone, createDestroy, createFlipAnimation, createFlipAnimationGroup, createMediaQueryObservable, createReactiveBindings, deleteCookie, elementCanScroll, equal, forceReflow, fromNextFrame, getCookie, getDomain, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, hasCookie, isElementVisible, isGroupMatch, isKnockoutMatch, mergeSeoConfig, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, routerDisableScrollTop, scrollToElement, setCookie, toArray, toArrayTrackByFn };
|
|
3034
|
+
export { ANIMATABLE_TOKEN, ANIMATED_LIFECYCLE_TOKEN, AnimatableDirective, AnimatedLifecycleDirective, AnimatedOverlayDirective, BehaviorSubjectWithSubscriberCount, ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DELAYABLE_TOKEN, DelayableDirective, ET_PROPERTY_REMOVED, FocusVisibleService, IS_ACTIVE_ELEMENT, IS_ARRAY_NOT_EMPTY, IS_EMAIL, IsActiveElementDirective, IsArrayNotEmpty, IsEmail, LetContext, LetDirective, MUST_MATCH, Memo, MustMatch, MutationObserverFactory, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, RouterStateService, SCROLL_OBSERVER_FIRST_ELEMENT_CLASS, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, SCROLL_OBSERVER_LAST_ELEMENT_CLASS, SEO_DIRECTIVE_TOKEN, ScrollObserverFirstElementDirective, ScrollObserverIgnoreTargetDirective, ScrollObserverLastElementDirective, SeoDirective, SmartBlockScrollStrategy, StructuredDataComponent, ToArrayPipe, TypedQueryList, VIEWPORT_CONFIG, Validators, ViewportService, clamp, clone, createDestroy, createFlipAnimation, createFlipAnimationGroup, createMediaQueryObservable, createReactiveBindings, deleteCookie, elementCanScroll, equal, forceReflow, fromNextFrame, getCookie, getDomain, getGroupMatchPoints, getGroupMatchScore, getKnockoutMatchScore, getMatchScoreSubLine, hasCookie, isElementVisible, isGroupMatch, isKnockoutMatch, mergeSeoConfig, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, provideViewportConfig, routerDisableScrollTop, scrollToElement, setCookie, toArray, toArrayTrackByFn };
|
|
2956
3035
|
//# sourceMappingURL=ethlete-core.mjs.map
|