@ethlete/core 5.0.0-next.57 → 5.0.0-next.58
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 +11 -0
- package/fesm2022/ethlete-core.mjs +77 -322
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ethlete-core.d.ts +34 -191
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @ethlete/core
|
|
2
2
|
|
|
3
|
+
## 5.0.0-next.58
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `signalCountdown(deadline)`, a signal of the days, hours, minutes and seconds left until a deadline, recounted on the whole second.
|
|
8
|
+
- Overlays and `[etTooltip]` can anchor to an SVG element, and `[etTooltip]` takes an `anchor` input to point at an element other than its trigger; core exports `isElement` and `isHTMLOrSVGElement`.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Place `takeUntilDestroyed()` last in every pipe, so operators after it no longer run or stay subscribed after destroy.
|
|
13
|
+
|
|
3
14
|
## 5.0.0-next.57
|
|
4
15
|
|
|
5
16
|
### Major Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { assertInInjectionContext, inject, DestroyRef, ElementRef, TemplateRef, InjectionToken, QueryList, RendererFactory2, RendererStyleFlags2, isSignal, DOCUMENT, signal, linkedSignal, isDevMode, computed, afterNextRender, effect, untracked, ApplicationRef, runInInjectionContext, NgZone, Injector, booleanAttribute, numberAttribute, PLATFORM_ID, EnvironmentInjector, createComponent, ViewEncapsulation, Component, Directive, model, ViewContainerRef, input, provideEnvironmentInitializer, output, createEnvironmentInjector, Pipe, afterEveryRender } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toSignal, toObservable, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Subject, fromEvent, switchMap, startWith, of, defer, from, map, catchError, timer, takeUntil, pairwise, debounceTime, merge, distinctUntilChanged, EMPTY, tap, take, filter, BehaviorSubject, combineLatest, Observable, isObservable, firstValueFrom, defaultIfEmpty, concatMap, concat, finalize, exhaustMap, share, shareReplay } from 'rxjs';
|
|
4
|
+
import { Subject, fromEvent, switchMap, startWith, of, defer, from, map, catchError, timer, takeUntil, pairwise, debounceTime, merge, distinctUntilChanged, EMPTY, expand, skip, tap, take, filter, BehaviorSubject, combineLatest, Observable, isObservable, firstValueFrom, defaultIfEmpty, concatMap, concat, finalize, exhaustMap, share, shareReplay } from 'rxjs';
|
|
5
5
|
import { FormGroup, FormArray, FormControl } from '@angular/forms';
|
|
6
6
|
import { SIGNAL, signalSetFn } from '@angular/core/primitives/signals';
|
|
7
7
|
import { isPlatformBrowser, DOCUMENT as DOCUMENT$1 } from '@angular/common';
|
|
@@ -1779,6 +1779,59 @@ const controlValueSignalWithPrevious = (control, options) => {
|
|
|
1779
1779
|
return data.asReadonly();
|
|
1780
1780
|
};
|
|
1781
1781
|
|
|
1782
|
+
const SECOND_MS = 1000;
|
|
1783
|
+
const toTimestamp = (deadline) => {
|
|
1784
|
+
if (deadline === null || deadline === undefined || deadline === '')
|
|
1785
|
+
return null;
|
|
1786
|
+
const timestamp = new Date(deadline).getTime();
|
|
1787
|
+
return Number.isNaN(timestamp) ? null : timestamp;
|
|
1788
|
+
};
|
|
1789
|
+
const toCountdown = (remainingMs) => {
|
|
1790
|
+
const totalSeconds = Math.max(0, Math.ceil(remainingMs / SECOND_MS));
|
|
1791
|
+
return {
|
|
1792
|
+
totalSeconds,
|
|
1793
|
+
days: Math.floor(totalSeconds / 86_400),
|
|
1794
|
+
hours: Math.floor((totalSeconds % 86_400) / 3600),
|
|
1795
|
+
minutes: Math.floor((totalSeconds % 3600) / 60),
|
|
1796
|
+
seconds: totalSeconds % 60,
|
|
1797
|
+
hasPassed: totalSeconds === 0,
|
|
1798
|
+
};
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* The time left until `deadline`, recounted on every whole second and broken down into days, hours, minutes
|
|
1802
|
+
* and seconds. `null` while the deadline is missing or not a valid date. The timer stops once the deadline
|
|
1803
|
+
* has passed, and never runs on the server.
|
|
1804
|
+
*
|
|
1805
|
+
* Call in an injection context.
|
|
1806
|
+
*
|
|
1807
|
+
* ```ts
|
|
1808
|
+
* protected timeLeft = signalCountdown(computed(() => this.round()?.startsAt));
|
|
1809
|
+
* ```
|
|
1810
|
+
*/
|
|
1811
|
+
const signalCountdown = (deadline) => {
|
|
1812
|
+
const end = computed(() => toTimestamp(deadline()), /* @ts-ignore */
|
|
1813
|
+
...(ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []));
|
|
1814
|
+
const tick = signal(0, /* @ts-ignore */
|
|
1815
|
+
...(ngDevMode ? [{ debugName: "tick" }] : /* istanbul ignore next */ []));
|
|
1816
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
1817
|
+
toObservable(end)
|
|
1818
|
+
.pipe(switchMap((endsAt) => {
|
|
1819
|
+
if (endsAt === null)
|
|
1820
|
+
return EMPTY;
|
|
1821
|
+
return of(null).pipe(expand(() => {
|
|
1822
|
+
const remainingMs = endsAt - Date.now();
|
|
1823
|
+
return remainingMs <= 0 ? EMPTY : timer(remainingMs % SECOND_MS || SECOND_MS);
|
|
1824
|
+
}), skip(1));
|
|
1825
|
+
}), takeUntilDestroyed())
|
|
1826
|
+
.subscribe(() => tick.update((count) => count + 1));
|
|
1827
|
+
}
|
|
1828
|
+
return computed(() => {
|
|
1829
|
+
tick();
|
|
1830
|
+
const endsAt = end();
|
|
1831
|
+
return endsAt === null ? null : toCountdown(endsAt - Date.now());
|
|
1832
|
+
});
|
|
1833
|
+
};
|
|
1834
|
+
|
|
1782
1835
|
/**
|
|
1783
1836
|
* Gates a loading indicator on a loading flag, so work that finishes quickly never flashes one: the
|
|
1784
1837
|
* returned signal turns true only once `source` has been true for `delay` ms, and then stays true for
|
|
@@ -2771,10 +2824,10 @@ const useCursorDragScroll = (el, options) => {
|
|
|
2771
2824
|
if (!el)
|
|
2772
2825
|
return;
|
|
2773
2826
|
mouseMove
|
|
2774
|
-
.pipe(
|
|
2827
|
+
.pipe(takeUntil(dragEnd), tap((e) => updateDragging(e)), takeUntilDestroyed(destroyRef))
|
|
2775
2828
|
.subscribe();
|
|
2776
2829
|
dragEnd
|
|
2777
|
-
.pipe(take(1),
|
|
2830
|
+
.pipe(take(1), tap(() => updateDraggingEnd()), takeUntilDestroyed(destroyRef))
|
|
2778
2831
|
.subscribe();
|
|
2779
2832
|
initialDragPosition.set({ x: e.clientX, y: e.clientY });
|
|
2780
2833
|
initialScrollPosition.set({ x: el.scrollLeft, y: el.scrollTop });
|
|
@@ -7033,7 +7086,7 @@ class DragHandleDirective {
|
|
|
7033
7086
|
...(ngDevMode ? [{ debugName: "commitThreshold" }] : /* istanbul ignore next */ []));
|
|
7034
7087
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
7035
7088
|
this.gestureStart$ = new Subject();
|
|
7036
|
-
this.gesture$ = this.gestureStart$.pipe(exhaustMap((event) => dragGestureFrom(event, this.el.nativeElement, { commitThreshold: this.commitThreshold() })),
|
|
7089
|
+
this.gesture$ = this.gestureStart$.pipe(exhaustMap((event) => dragGestureFrom(event, this.el.nativeElement, { commitThreshold: this.commitThreshold() })), share(), takeUntilDestroyed());
|
|
7037
7090
|
this.dragTapped = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'tapped'), map(() => undefined)));
|
|
7038
7091
|
this.dragStarted = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'start'), map((e) => e.data)));
|
|
7039
7092
|
this.dragMoved = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'move'), map((e) => e.data)));
|
|
@@ -7315,6 +7368,16 @@ const isHTMLElement = (value) => {
|
|
|
7315
7368
|
const view = value?.ownerDocument?.defaultView;
|
|
7316
7369
|
return view ? value instanceof view.HTMLElement : value instanceof HTMLElement;
|
|
7317
7370
|
};
|
|
7371
|
+
const isElement = (value) => {
|
|
7372
|
+
const view = value?.ownerDocument?.defaultView;
|
|
7373
|
+
return view ? value instanceof view.Element : value instanceof Element;
|
|
7374
|
+
};
|
|
7375
|
+
const isHTMLOrSVGElement = (value) => {
|
|
7376
|
+
const view = value?.ownerDocument?.defaultView;
|
|
7377
|
+
return view
|
|
7378
|
+
? value instanceof view.HTMLElement || value instanceof view.SVGElement
|
|
7379
|
+
: value instanceof HTMLElement || value instanceof SVGElement;
|
|
7380
|
+
};
|
|
7318
7381
|
/**
|
|
7319
7382
|
* Whether the overlay rooted at `hostElement` is still the owner of DOM focus - focus is inside it, or
|
|
7320
7383
|
* nothing is focused. False once the user has moved focus somewhere else.
|
|
@@ -7750,7 +7813,7 @@ const createAnchoredPositionCleanup = (strategy, paneElement, overlayRef, render
|
|
|
7750
7813
|
// or `autoCloseIfReferenceHidden` asked for it: a trigger destroyed while its overlay is open (a
|
|
7751
7814
|
// menu item that removes the button it was opened from) would otherwise fly to the corner for the
|
|
7752
7815
|
// frames the overlay takes to animate out.
|
|
7753
|
-
if (
|
|
7816
|
+
if (isElement(strategy.referenceElement) && !strategy.referenceElement.isConnected) {
|
|
7754
7817
|
handleUnusableReference();
|
|
7755
7818
|
return;
|
|
7756
7819
|
}
|
|
@@ -8094,7 +8157,9 @@ const OVERLAY_RUNTIME_DEF = /* @__PURE__ */ defineRootProvider(() => {
|
|
|
8094
8157
|
const paneElement = renderer.createElement('div');
|
|
8095
8158
|
const backdropElement = signal(null, /* @ts-ignore */
|
|
8096
8159
|
...(ngDevMode ? [{ debugName: "backdropElement" }] : /* istanbul ignore next */ []));
|
|
8097
|
-
const previousFocusedElement =
|
|
8160
|
+
const previousFocusedElement = isHTMLOrSVGElement(targetDocument.activeElement)
|
|
8161
|
+
? targetDocument.activeElement
|
|
8162
|
+
: null;
|
|
8098
8163
|
const autoFocus = config.autoFocus ?? 'first-tabbable';
|
|
8099
8164
|
let currentHasBackdrop = config.hasBackdrop !== false;
|
|
8100
8165
|
let currentPositionStrategy = config.positionStrategy;
|
|
@@ -8168,7 +8233,7 @@ const OVERLAY_RUNTIME_DEF = /* @__PURE__ */ defineRootProvider(() => {
|
|
|
8168
8233
|
openEntriesState.update((entries) => [...entries, overlayRef]);
|
|
8169
8234
|
let positionCleanup = setupPositioning(activeConfig(), hostElement, paneElement, overlayRef, renderer);
|
|
8170
8235
|
cleanupFns.push(() => positionCleanup());
|
|
8171
|
-
const getOriginElement = () => currentPositionStrategy?.kind === 'anchored' &&
|
|
8236
|
+
const getOriginElement = () => currentPositionStrategy?.kind === 'anchored' && isElement(currentPositionStrategy.referenceElement)
|
|
8172
8237
|
? currentPositionStrategy.referenceElement
|
|
8173
8238
|
: null;
|
|
8174
8239
|
overlayRef.attachPositionUpdater((strategy) => {
|
|
@@ -8283,7 +8348,7 @@ const OVERLAY_RUNTIME_DEF = /* @__PURE__ */ defineRootProvider(() => {
|
|
|
8283
8348
|
return;
|
|
8284
8349
|
}
|
|
8285
8350
|
const target = event.target;
|
|
8286
|
-
if (!
|
|
8351
|
+
if (!isElement(target) || paneElement.contains(target)) {
|
|
8287
8352
|
return;
|
|
8288
8353
|
}
|
|
8289
8354
|
if (isOnHigherOverlayLayer(target, layer)) {
|
|
@@ -8297,7 +8362,7 @@ const OVERLAY_RUNTIME_DEF = /* @__PURE__ */ defineRootProvider(() => {
|
|
|
8297
8362
|
const originElement = getOriginElement();
|
|
8298
8363
|
if (originElement && originElement.contains(target)) {
|
|
8299
8364
|
const swallowReopenClick = (clickEvent) => {
|
|
8300
|
-
if (
|
|
8365
|
+
if (isElement(clickEvent.target) && originElement.contains(clickEvent.target)) {
|
|
8301
8366
|
clickEvent.stopImmediatePropagation();
|
|
8302
8367
|
clickEvent.preventDefault();
|
|
8303
8368
|
}
|
|
@@ -9006,316 +9071,6 @@ const toArray = (value) => {
|
|
|
9006
9071
|
};
|
|
9007
9072
|
const toArrayTrackByFn = (_, item) => item;
|
|
9008
9073
|
|
|
9009
|
-
const createPropHandlers = () => {
|
|
9010
|
-
const id = createComponentId('et-props');
|
|
9011
|
-
const elementRef = inject(ElementRef);
|
|
9012
|
-
const classes = signalHostClasses({});
|
|
9013
|
-
const attributes = signalHostAttributes({});
|
|
9014
|
-
const styles = signalHostStyles({});
|
|
9015
|
-
return {
|
|
9016
|
-
classes,
|
|
9017
|
-
attributes,
|
|
9018
|
-
styles,
|
|
9019
|
-
id,
|
|
9020
|
-
elementRef,
|
|
9021
|
-
};
|
|
9022
|
-
};
|
|
9023
|
-
|
|
9024
|
-
const createElementDictionary = () => {
|
|
9025
|
-
const dictionary = {
|
|
9026
|
-
ids: signal([]),
|
|
9027
|
-
elements: signal({}),
|
|
9028
|
-
};
|
|
9029
|
-
const firstElement = computed(() => {
|
|
9030
|
-
const id = dictionary.ids()[0];
|
|
9031
|
-
return id ? (dictionary.elements()[id] ?? null) : null;
|
|
9032
|
-
}, /* @ts-ignore */
|
|
9033
|
-
...(ngDevMode ? [{ debugName: "firstElement" }] : /* istanbul ignore next */ []));
|
|
9034
|
-
const firstId = computed(() => {
|
|
9035
|
-
const id = dictionary.ids()[0];
|
|
9036
|
-
return id ?? null;
|
|
9037
|
-
}, /* @ts-ignore */
|
|
9038
|
-
...(ngDevMode ? [{ debugName: "firstId" }] : /* istanbul ignore next */ []));
|
|
9039
|
-
const ids = computed(() => dictionary.ids(), /* @ts-ignore */
|
|
9040
|
-
...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
|
|
9041
|
-
const elements = computed(() => {
|
|
9042
|
-
const byId = dictionary.elements();
|
|
9043
|
-
return ids()
|
|
9044
|
-
.map((id) => byId[id])
|
|
9045
|
-
.filter((element) => !!element);
|
|
9046
|
-
}, /* @ts-ignore */
|
|
9047
|
-
...(ngDevMode ? [{ debugName: "elements" }] : /* istanbul ignore next */ []));
|
|
9048
|
-
const isEmpty = computed(() => dictionary.ids().length === 0, /* @ts-ignore */
|
|
9049
|
-
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
9050
|
-
const has = (id) => {
|
|
9051
|
-
return dictionary.ids().includes(id);
|
|
9052
|
-
};
|
|
9053
|
-
const push = (id, element) => {
|
|
9054
|
-
dictionary.ids.set([...dictionary.ids(), id]);
|
|
9055
|
-
dictionary.elements.set({ ...dictionary.elements(), [id]: element });
|
|
9056
|
-
};
|
|
9057
|
-
const remove = (id) => {
|
|
9058
|
-
dictionary.ids.set(dictionary.ids().filter((i) => i !== id));
|
|
9059
|
-
dictionary.elements.set(Object.fromEntries(Object.entries(dictionary.elements()).filter(([k]) => k !== id)));
|
|
9060
|
-
};
|
|
9061
|
-
const get = (id) => {
|
|
9062
|
-
return dictionary.elements()[id] ?? null;
|
|
9063
|
-
};
|
|
9064
|
-
return {
|
|
9065
|
-
ids,
|
|
9066
|
-
elements,
|
|
9067
|
-
has,
|
|
9068
|
-
get,
|
|
9069
|
-
push,
|
|
9070
|
-
remove,
|
|
9071
|
-
isEmpty,
|
|
9072
|
-
firstElement,
|
|
9073
|
-
firstId,
|
|
9074
|
-
};
|
|
9075
|
-
};
|
|
9076
|
-
|
|
9077
|
-
const teardownsByProps = /* @__PURE__ */ new WeakMap();
|
|
9078
|
-
const bindProps = (config) => {
|
|
9079
|
-
const props = config.props;
|
|
9080
|
-
const { attachEventListeners, classBindings, attributeBindings, styleBindings, staticAttributeBindings, staticClassBindings, staticStyleBindings, attached, single, name, bindId, attachedElements, } = props;
|
|
9081
|
-
const { attributes, classes, elementRef, id, styles } = config.handlers;
|
|
9082
|
-
const el = elementRef.nativeElement;
|
|
9083
|
-
if (attached()) {
|
|
9084
|
-
if (attachedElements.has(id)) {
|
|
9085
|
-
return;
|
|
9086
|
-
}
|
|
9087
|
-
else if (single) {
|
|
9088
|
-
const firstAttachedRefElement = attachedElements.first();
|
|
9089
|
-
if (isDevMode()) {
|
|
9090
|
-
console.error(`[${name}] These props can only be attached to a single element at a time.\n\n Already attached to \n`, firstAttachedRefElement, '\n Trying to attach to \n', el);
|
|
9091
|
-
}
|
|
9092
|
-
return;
|
|
9093
|
-
}
|
|
9094
|
-
}
|
|
9095
|
-
attachedElements.push(id, el);
|
|
9096
|
-
const teardowns = [];
|
|
9097
|
-
if (bindId) {
|
|
9098
|
-
el.id = id;
|
|
9099
|
-
}
|
|
9100
|
-
if (classBindings) {
|
|
9101
|
-
const tokens = Object.keys(classBindings);
|
|
9102
|
-
classes.pushMany(classBindings);
|
|
9103
|
-
teardowns.push(() => classes.removeMany(tokens));
|
|
9104
|
-
}
|
|
9105
|
-
if (attributeBindings) {
|
|
9106
|
-
const tokens = Object.keys(attributeBindings);
|
|
9107
|
-
attributes.pushMany(attributeBindings);
|
|
9108
|
-
teardowns.push(() => attributes.removeMany(tokens));
|
|
9109
|
-
}
|
|
9110
|
-
if (styleBindings) {
|
|
9111
|
-
const tokens = Object.keys(styleBindings);
|
|
9112
|
-
styles.pushMany(styleBindings);
|
|
9113
|
-
teardowns.push(() => styles.removeMany(tokens));
|
|
9114
|
-
}
|
|
9115
|
-
if (staticAttributeBindings) {
|
|
9116
|
-
const keys = Object.keys(staticAttributeBindings);
|
|
9117
|
-
for (const key of keys) {
|
|
9118
|
-
el.setAttribute(key, `${staticAttributeBindings[key]}`);
|
|
9119
|
-
}
|
|
9120
|
-
teardowns.push(() => keys.forEach((key) => el.removeAttribute(key)));
|
|
9121
|
-
}
|
|
9122
|
-
if (staticClassBindings) {
|
|
9123
|
-
el.classList.add(...staticClassBindings);
|
|
9124
|
-
teardowns.push(() => el.classList.remove(...staticClassBindings));
|
|
9125
|
-
}
|
|
9126
|
-
if (staticStyleBindings) {
|
|
9127
|
-
const keys = Object.keys(staticStyleBindings);
|
|
9128
|
-
for (const key of keys) {
|
|
9129
|
-
el.style.setProperty(key, `${staticStyleBindings[key]}`);
|
|
9130
|
-
}
|
|
9131
|
-
teardowns.push(() => keys.forEach((key) => el.style.removeProperty(key)));
|
|
9132
|
-
}
|
|
9133
|
-
if (attachEventListeners) {
|
|
9134
|
-
const on = ((type, listener, options) => {
|
|
9135
|
-
el.addEventListener(type, listener, options);
|
|
9136
|
-
teardowns.push(() => el.removeEventListener(type, listener, options));
|
|
9137
|
-
});
|
|
9138
|
-
attachEventListeners({ on, element: el });
|
|
9139
|
-
}
|
|
9140
|
-
let teardownsById = teardownsByProps.get(config.props);
|
|
9141
|
-
if (!teardownsById) {
|
|
9142
|
-
teardownsById = new Map();
|
|
9143
|
-
teardownsByProps.set(config.props, teardownsById);
|
|
9144
|
-
}
|
|
9145
|
-
teardownsById.set(id, () => teardowns.forEach((teardown) => teardown()));
|
|
9146
|
-
};
|
|
9147
|
-
const unbindProps = (config) => {
|
|
9148
|
-
const props = config.props;
|
|
9149
|
-
const { id } = config.handlers;
|
|
9150
|
-
const teardownsById = teardownsByProps.get(config.props);
|
|
9151
|
-
teardownsById?.get(id)?.();
|
|
9152
|
-
teardownsById?.delete(id);
|
|
9153
|
-
props.attachedElements.remove(id);
|
|
9154
|
-
};
|
|
9155
|
-
|
|
9156
|
-
const createProps = (props) => {
|
|
9157
|
-
const { bindId = false, single = true, classes: classBindings, attributes: attributeBindings, styles: styleBindings, staticAttributes: staticAttributeBindings = null, staticClasses: staticClassBindings = null, staticStyles: staticStyleBindings = null, listeners, name, } = props;
|
|
9158
|
-
const dictionary = createElementDictionary();
|
|
9159
|
-
const attached = computed(() => !dictionary.isEmpty(), /* @ts-ignore */
|
|
9160
|
-
...(ngDevMode ? [{ debugName: "attached" }] : /* istanbul ignore next */ []));
|
|
9161
|
-
const attachedElements = {
|
|
9162
|
-
first: dictionary.firstElement,
|
|
9163
|
-
firstId: dictionary.firstId,
|
|
9164
|
-
has: dictionary.has,
|
|
9165
|
-
push: dictionary.push,
|
|
9166
|
-
remove: dictionary.remove,
|
|
9167
|
-
get: dictionary.get,
|
|
9168
|
-
};
|
|
9169
|
-
const data = {
|
|
9170
|
-
name,
|
|
9171
|
-
single,
|
|
9172
|
-
bindId,
|
|
9173
|
-
attached,
|
|
9174
|
-
attachedElements,
|
|
9175
|
-
classBindings: classBindings ?? null,
|
|
9176
|
-
attributeBindings: attributeBindings ?? null,
|
|
9177
|
-
styleBindings: styleBindings ?? null,
|
|
9178
|
-
staticAttributeBindings,
|
|
9179
|
-
staticClassBindings,
|
|
9180
|
-
staticStyleBindings,
|
|
9181
|
-
attachEventListeners: listeners ?? null,
|
|
9182
|
-
};
|
|
9183
|
-
return data;
|
|
9184
|
-
};
|
|
9185
|
-
const createHostProps = (props) => {
|
|
9186
|
-
const data = createProps(props);
|
|
9187
|
-
const handlers = createPropHandlers();
|
|
9188
|
-
afterNextRender({
|
|
9189
|
-
write: () => {
|
|
9190
|
-
bindProps({
|
|
9191
|
-
handlers,
|
|
9192
|
-
props: data,
|
|
9193
|
-
});
|
|
9194
|
-
},
|
|
9195
|
-
});
|
|
9196
|
-
const destroyRef = inject(DestroyRef);
|
|
9197
|
-
destroyRef.onDestroy(() => {
|
|
9198
|
-
unbindProps({
|
|
9199
|
-
handlers,
|
|
9200
|
-
props: data,
|
|
9201
|
-
});
|
|
9202
|
-
});
|
|
9203
|
-
return { props: data, handlers };
|
|
9204
|
-
};
|
|
9205
|
-
|
|
9206
|
-
const createSetup = (config) => {
|
|
9207
|
-
let didCallSetup = false;
|
|
9208
|
-
afterNextRender(() => {
|
|
9209
|
-
if (!didCallSetup && isDevMode()) {
|
|
9210
|
-
console.error('The setup() function was not called. Please call it inside your constructor.', config.this);
|
|
9211
|
-
return;
|
|
9212
|
-
}
|
|
9213
|
-
});
|
|
9214
|
-
return (params) => {
|
|
9215
|
-
if (didCallSetup) {
|
|
9216
|
-
if (!isDevMode())
|
|
9217
|
-
return;
|
|
9218
|
-
console.error('The setup() function was already called. Please call it only once. \n\n', 'Instance containing the setup() call \n', config.this, '\n\n Setup was called with\n', params);
|
|
9219
|
-
return;
|
|
9220
|
-
}
|
|
9221
|
-
didCallSetup = true;
|
|
9222
|
-
config.setupFn(params);
|
|
9223
|
-
};
|
|
9224
|
-
};
|
|
9225
|
-
|
|
9226
|
-
const createDependencyStash = (stash) => {
|
|
9227
|
-
const injector = inject(Injector);
|
|
9228
|
-
const provideSignal = (data) => {
|
|
9229
|
-
runInInjectionContext(injector, () => {
|
|
9230
|
-
effect(() => {
|
|
9231
|
-
stash[data.for]?.set(data.signal());
|
|
9232
|
-
});
|
|
9233
|
-
});
|
|
9234
|
-
};
|
|
9235
|
-
const provideValue = (data) => {
|
|
9236
|
-
stash[data.for]?.set(data.value);
|
|
9237
|
-
};
|
|
9238
|
-
return {
|
|
9239
|
-
...stash,
|
|
9240
|
-
provideSignal,
|
|
9241
|
-
provideValue,
|
|
9242
|
-
};
|
|
9243
|
-
};
|
|
9244
|
-
|
|
9245
|
-
class PropsDirective {
|
|
9246
|
-
constructor() {
|
|
9247
|
-
this.destroyRef = inject(DestroyRef);
|
|
9248
|
-
this.props = input.required({ ...(ngDevMode ? { debugName: "props" } : /* istanbul ignore next */ {}), alias: 'etProps', transform: (d) => d });
|
|
9249
|
-
this.propHandlers = createPropHandlers();
|
|
9250
|
-
let boundProps = null;
|
|
9251
|
-
effect(() => {
|
|
9252
|
-
const props = this.props();
|
|
9253
|
-
untracked(() => {
|
|
9254
|
-
if (boundProps) {
|
|
9255
|
-
unbindProps({ handlers: this.propHandlers, props: boundProps });
|
|
9256
|
-
}
|
|
9257
|
-
bindProps({
|
|
9258
|
-
handlers: this.propHandlers,
|
|
9259
|
-
props,
|
|
9260
|
-
});
|
|
9261
|
-
boundProps = props;
|
|
9262
|
-
});
|
|
9263
|
-
});
|
|
9264
|
-
this.destroyRef.onDestroy(() => {
|
|
9265
|
-
if (boundProps)
|
|
9266
|
-
unbindProps({ handlers: this.propHandlers, props: boundProps });
|
|
9267
|
-
});
|
|
9268
|
-
}
|
|
9269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PropsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9270
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: PropsDirective, isStandalone: true, selector: "[etProps]", inputs: { props: { classPropertyName: "props", publicName: "etProps", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
9271
|
-
}
|
|
9272
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PropsDirective, decorators: [{
|
|
9273
|
-
type: Directive,
|
|
9274
|
-
args: [{
|
|
9275
|
-
selector: '[etProps]',
|
|
9276
|
-
}]
|
|
9277
|
-
}], ctorParameters: () => [], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "etProps", required: true }] }] } });
|
|
9278
|
-
|
|
9279
|
-
const templateComputed = (templateSignal) => computed(() => {
|
|
9280
|
-
const content = templateSignal();
|
|
9281
|
-
if (content === null)
|
|
9282
|
-
return null;
|
|
9283
|
-
if (typeof content === 'string') {
|
|
9284
|
-
return {
|
|
9285
|
-
type: 'string',
|
|
9286
|
-
value: content,
|
|
9287
|
-
};
|
|
9288
|
-
}
|
|
9289
|
-
if (content instanceof TemplateRef) {
|
|
9290
|
-
return {
|
|
9291
|
-
type: 'template',
|
|
9292
|
-
value: content,
|
|
9293
|
-
injector: null,
|
|
9294
|
-
};
|
|
9295
|
-
}
|
|
9296
|
-
if ('component' in content) {
|
|
9297
|
-
return {
|
|
9298
|
-
type: 'component',
|
|
9299
|
-
value: content.component,
|
|
9300
|
-
inputs: content.inputs,
|
|
9301
|
-
injector: content.injector ?? null,
|
|
9302
|
-
};
|
|
9303
|
-
}
|
|
9304
|
-
if ('template' in content) {
|
|
9305
|
-
return {
|
|
9306
|
-
type: 'template',
|
|
9307
|
-
value: content.template,
|
|
9308
|
-
context: content.context,
|
|
9309
|
-
injector: content.injector ?? null,
|
|
9310
|
-
};
|
|
9311
|
-
}
|
|
9312
|
-
return {
|
|
9313
|
-
type: 'component',
|
|
9314
|
-
value: content,
|
|
9315
|
-
injector: null,
|
|
9316
|
-
};
|
|
9317
|
-
});
|
|
9318
|
-
|
|
9319
9074
|
const EDGE_CURSORS = {
|
|
9320
9075
|
n: 'ns-resize',
|
|
9321
9076
|
s: 'ns-resize',
|
|
@@ -9349,7 +9104,7 @@ class ResizeHandlesComponent {
|
|
|
9349
9104
|
...(ngDevMode ? [{ debugName: "edges" }] : /* istanbul ignore next */ []));
|
|
9350
9105
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9351
9106
|
this.gestureStart$ = new Subject();
|
|
9352
|
-
this.gesture$ = this.gestureStart$.pipe(exhaustMap(({ event, edge }) => setupResizeObservable(event, edge, this.el.nativeElement.ownerDocument)),
|
|
9107
|
+
this.gesture$ = this.gestureStart$.pipe(exhaustMap(({ event, edge }) => setupResizeObservable(event, edge, this.el.nativeElement.ownerDocument)), share(), takeUntilDestroyed());
|
|
9353
9108
|
this.resizeStarted = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'start'), map((e) => e.edge)));
|
|
9354
9109
|
this.resizeMoved = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'move'), map((e) => e.data)));
|
|
9355
9110
|
this.resizeEnded = outputFromObservable(this.gesture$.pipe(filter((e) => e.type === 'end'), map(() => undefined)));
|
|
@@ -10306,11 +10061,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
10306
10061
|
|
|
10307
10062
|
// Generated from package.json by tools/scripts/generate-version.js - do not edit.
|
|
10308
10063
|
/** The version of `@ethlete/core` this build was cut from. */
|
|
10309
|
-
const CORE_VERSION = '5.0.0-next.
|
|
10064
|
+
const CORE_VERSION = '5.0.0-next.58';
|
|
10310
10065
|
|
|
10311
10066
|
/**
|
|
10312
10067
|
* Generated bundle index. Do not edit.
|
|
10313
10068
|
*/
|
|
10314
10069
|
|
|
10315
|
-
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, ANIMATION_DEBUG_STORAGE_KEY, AT_LEAST_ONE_REQUIRED, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AutoSurfaceDirective, BOUNDARY_ELEMENT_TOKEN, BREAKPOINT_INSTANCE_TOKEN, BREAKPOINT_ORDER, COLOR_PALETTE, COLOR_PROVIDER, CORE_VERSION, ClickOutsideDirective, ColorInteractiveContainerDirective, ColorInteractiveDirective, ColorInteractiveExcludeDirective, ColorInteractiveHasFocusDirective, DEFAULT_MULTI_INSTANCE_RELS, DEFAULT_MULTI_INSTANCE_TAGS, DEFAULT_OVERLAY_LAYER, DEFAULT_VIEWPORT_CONFIG, DISABLE_LOGGER_PARAM, DragHandleDirective, ET_DISABLE_SCROLL_TOP, ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE, ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE, ET_PROPERTY_REMOVED, ET_RESTORE_SCROLL, EasingTokensStylesComponent, EthleteValidators, FOCUSABLE_SELECTOR, FOCUS_VISIBLE_TRACKER_TOKEN, HtmlToMarkdownPipe, IS_ARRAY_NOT_EMPTY, IS_EMAIL, InferMimeTypePipe, InitialsPipe, IsArrayNotEmpty, IsEmail, jsonLd as JsonLD, KeyPressManager, MUST_MATCH, MarkdownToHtmlPipe, MatchStateType, MustMatch, NOTIFICATION_CLICK_MESSAGE_TYPE, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OVERLAY_LAYER_ATTRIBUTE,
|
|
10070
|
+
export { ANIMATABLE_TOKEN, ANIMATED_IF_TOKEN, ANIMATED_LIFECYCLE_TOKEN, ANIMATION_DEBUG_STORAGE_KEY, AT_LEAST_ONE_REQUIRED, AnimatableDirective, AnimatedIfDirective, AnimatedLifecycleDirective, AutoSurfaceDirective, BOUNDARY_ELEMENT_TOKEN, BREAKPOINT_INSTANCE_TOKEN, BREAKPOINT_ORDER, COLOR_PALETTE, COLOR_PROVIDER, CORE_VERSION, ClickOutsideDirective, ColorInteractiveContainerDirective, ColorInteractiveDirective, ColorInteractiveExcludeDirective, ColorInteractiveHasFocusDirective, DEFAULT_MULTI_INSTANCE_RELS, DEFAULT_MULTI_INSTANCE_TAGS, DEFAULT_OVERLAY_LAYER, DEFAULT_VIEWPORT_CONFIG, DISABLE_LOGGER_PARAM, DragHandleDirective, ET_DISABLE_SCROLL_TOP, ET_DISABLE_SCROLL_TOP_AS_RETURN_ROUTE, ET_DISABLE_SCROLL_TOP_ON_PATH_PARAM_CHANGE, ET_PROPERTY_REMOVED, ET_RESTORE_SCROLL, EasingTokensStylesComponent, EthleteValidators, FOCUSABLE_SELECTOR, FOCUS_VISIBLE_TRACKER_TOKEN, HtmlToMarkdownPipe, IS_ARRAY_NOT_EMPTY, IS_EMAIL, InferMimeTypePipe, InitialsPipe, IsArrayNotEmpty, IsEmail, jsonLd as JsonLD, KeyPressManager, MUST_MATCH, MarkdownToHtmlPipe, MatchStateType, MustMatch, NOTIFICATION_CLICK_MESSAGE_TYPE, NormalizeGameResultTypePipe, NormalizeMatchParticipantsPipe, NormalizeMatchScorePipe, NormalizeMatchStatePipe, NormalizeMatchTypePipe, OVERLAY_LAYER_ATTRIBUTE, ProvideColorDirective, ProvideSurfaceDirective, RUNTIME_ERROR_NO_DATA, RepeatDirective, ResizeHandlesComponent, RestoreScrollDirective, RuntimeError, SURFACE_COLOR, SURFACE_PROVIDER, SURFACE_TYPE, SWIPE_VELOCITY_WINDOW_MS, ScrollObserverDirective, ScrollObserverEndDirective, ScrollObserverStartDirective, SlugifyPipe, StructuredDataComponent, SurfaceInteractiveDirective, ToArrayPipe, TypedQueryList, UNSAVED_CHANGES_TITLE_MARKER, ValidateAtLeastOneRequired, anchoredOverlayPosition, animationDebugLog, applyAlternateBinding, applyAlternateLanguagesBindings, applyArticleBindings, applyAuthorBinding, applyCanonicalBinding, applyCenteredPosition, applyDescriptionBinding, applyFaviconOverlay, applyGlobalPosition, applyHeadBinding, applyHeadTitleBinding, applyHeadTitleMarker, applyHostListener, applyHostListeners, applyInitialFocus, applyKeywordsBinding, applyLinkBinding, applyMetaBinding, applyNextBinding, applyOgBinding, applyOpenGraphBindings, applyPrevBinding, applyResourceHintsBindings, applyRobotsBinding, applySocialMediaBindings, applyStructuredDataBinding, applyTwitterCardBindings, boolBreakpointTransform, boundingClientRectToElementRect, breakpointTransformBase, buildElementSignal, buildSignalEffects, canUseSessionMemory, clamp, clone, cloneFormGroup, computedTillFalsy, computedTillTruthy, controlValueSignal, controlValueSignalWithPrevious, copyToClipboard, createAnchoredPositionCleanup, createArrayPropertyBinding, createAutoSessionMemoryKey, createCanAnimateSignal, createComponentId, createCssColorThemeName, createCssSurfaceName, createDestroy, createDocumentElementSignal, createElementDimensions, createEmptyElementSignal, createFlipAnimation, createFlipAnimationGroup, createIsRenderedSignal, createLogger, createObjectUrlHandle, createOverlayRuntimeRef, createPropertyBinding, createRootThemeCss, createRoute, createRouterState, createRxHostListener, createSessionMemory, createSwatchCss, createSwipeTracker, createTailwindColorThemes, createTailwindCssVar, createTailwindRgbVar, createThemeStyle, createUnsavedChangesGuard, createUnsavedChangesTabLock, createUnsavedChangesTracker, createUserConsentProvider, deferredSignal, defineLabels, defineProvider, defineRootProvider, defineStaticProvider, defineStaticRootProvider, deleteCookie, dragGestureFrom, easeElastic, easeIn, easeInOut, easeLinear, easeOut, easeOutBack, easeOutBackStrong, elementCanScroll, enableAnchoredOverlayPositionExtras, equal, fetchDeployedBuildFingerprint, firstElementSignal, focusElement, forceReflow, formatRuntimeError, fromNextFrame, getCookie, getDomain, getElementScrollCoordinates, getFocusableElements, getFormGroupValue, getGroupMatchPoints, getGroupMatchScore, getHeadingElement, getKnockoutMatchScore, getMatchScoreSubLine, getObjectProperty, getScrollContainerTarget, getScrollItemTarget, getScrollSnapTarget, hasCookie, holdScrollRestoration, htmlToMarkdown, inferMimeType, initials, injectAngularRootElement, injectAnimatedBlockSize, injectAppUpdates, injectAppUpdatesConfig, injectBoundaryElement, injectBreakpointInput, injectBreakpointIsMatched, injectBreakpointObserver, injectCanHover, injectColorPalette, injectColorThemes, injectColorThemesPrefix, injectCurrentBreakpoint, injectDefaultColorTheme, injectDefaultSurfaceTheme, injectDeviceInputType, injectDisplayOrientation, injectErrorTheme, injectFaviconStore, injectFileDownload, injectFocusVisibleTracker, injectFragment, injectHasPrecisionInput, injectHasTouchInput, injectHostElement, injectIs2Xl, injectIsDocumentVisible, injectIsLandscape, injectIsLg, injectIsMd, injectIsPortrait, injectIsRouterInitialized, injectIsSm, injectIsXl, injectIsXs, injectLinkStore, injectLinkStoreConfig, injectLocale, injectMediaQueryIsMatched, injectMetaConfig, injectMetaStore, injectNotifications, injectObserveBreakpoint, injectObserveMediaQuery, injectOverlayRuntime, injectParentSurface, injectPathParam, injectPathParamChanges, injectPathParams, injectPrefersReducedMotion, injectQueryParam, injectQueryParamChanges, injectQueryParams, injectRenderer, injectRoute, injectRouteData, injectRouteDataItem, injectRouteTitle, injectRouterEvent, injectRouterNavigationState, injectRouterState, injectScrollbarDimensions, injectStructuredDataConfig, injectStructuredDataStore, injectStyleManager, injectSuccessTheme, injectSurfaceContextTracker, injectSurfaceThemes, injectSurfaceThemesPrefix, injectSurfaceType, injectTemplateRef, injectTitleConfig, injectTitleStore, injectUnsavedChangesCoordinator, injectUrl, injectViewportConfig, injectViewportDimensions, injectViewportSize, injectWarningTheme, isAnimationDebugEnabled, isArray, isElement, isElementSignal, isElementVisible, isFocusable, isGroupMatch, isHTMLElement, isHTMLOrSVGElement, isKnockoutMatch, isObject, isOnHigherOverlayLayer, isStaleBuildError, markdownToHtml, matchesReducedMotion, maybeSignalValue, memoizeSignal, mountEasingTokens, nextFrame, normalizeGameResultType, normalizeMatchParticipant, normalizeMatchParticipants, normalizeMatchScore, normalizeMatchState, normalizeMatchType, normalizeUnsavedChangesSource, numberBreakpointTransform, onOverlayViewportInsetsChange, overlayViewportInsets, overlayViewportInsetsFor, ownsActiveElement, previousSignalValue, provideAppUpdates, provideAppUpdatesConfig, provideAppUpdatesInstance, provideBoundaryElement, provideBreakpointInstance, provideBreakpointObserver, provideColorPalette, provideColorThemes, provideColorThemesWithTailwind4, provideFaviconStore, provideFocusVisibleTracker, provideLinkStore, provideLinkStoreConfig, provideLocale, provideMetaConfig, provideMetaStore, provideNotifications, provideOverlayRuntime, provideRenderer, provideStructuredDataConfig, provideStructuredDataStore, provideStyleManager, provideSurfaceContextTracker, provideSurfaceThemesWithTailwind4, provideTitleConfig, provideTitleStore, provideUnsavedChangesCoordinator, provideViewportConfig, randomId, readBuildFingerprint, readFromClipboard, registerAnchoredPositionMiddlewareExtras, registerAnchoredPositionSetup, reserveOverlayViewportSpace, resetPositioningStyles, resolveAppRootColorProvider, resolveOverlayLayer, resolveSurfaceByElevation, round, routerDisableScrollTop, routerRestoreScroll, scrollToElement, setBackdropStyles, setBaseElementStyles, setCookie, setInputSignal, setupFocusTrap, setupPositioning, setupScrollRestoration, signalAnimatedNumber, signalAttributes, signalClasses, signalCountdown, signalDeferredLoading, signalElementChildren, signalElementDimensions, signalElementIntersection, signalElementLastScrollDirection, signalElementMutations, signalElementScrollState, signalHostAttributes, signalHostClasses, signalHostElementDimensions, signalHostElementIntersection, signalHostElementLastScrollDirection, signalHostElementMutations, signalHostElementScrollState, signalHostStyles, signalIsRendered, signalStyles, slugify, suppressTextSelection, switchQueryListChanges, syncSignal, toArray, toArrayTrackByFn, toInjectFn, toProvideFn, toStringBinding, toToken, transformOrReturn, typedBreakpointTransform, useCursorDragScroll, writeScrollbarSizeToCssVariables, writeViewportSizeToCssVariables, ɵProvideColorThemes, ɵProvideColorThemesPrefix, ɵProvideSurfaceThemes, ɵProvideSurfaceThemesPrefix };
|
|
10316
10071
|
//# sourceMappingURL=ethlete-core.mjs.map
|