@ethlete/core 4.16.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -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 +10 -10
- package/esm2022/lib/utils/intersection-observer.utils.mjs +2 -2
- package/esm2022/lib/utils/signal.utils.mjs +112 -12
- package/fesm2022/ethlete-core.mjs +241 -141
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/lib/utils/signal.utils.d.ts +40 -0
- package/package.json +7 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EffectRef, ElementRef, Injector, QueryList, Signal, WritableSignal } from '@angular/core';
|
|
2
2
|
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { Breakpoint } from '../types';
|
|
4
5
|
type SignalElementBindingComplexType = HTMLElement | ElementRef<HTMLElement> | QueryList<ElementRef<HTMLElement> | HTMLElement> | Array<ElementRef<HTMLElement> | HTMLElement> | null | undefined;
|
|
5
6
|
type SignalElementBindingType = HTMLElement | ElementRef<HTMLElement> | Observable<SignalElementBindingComplexType> | Signal<SignalElementBindingComplexType> | QueryList<ElementRef<HTMLElement> | HTMLElement> | ElementSignal;
|
|
6
7
|
type ElementSignal = Signal<{
|
|
@@ -194,4 +195,43 @@ export declare const useCursorDragScroll: (el: SignalElementBindingType, options
|
|
|
194
195
|
y: number;
|
|
195
196
|
}>;
|
|
196
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* A computed that will only be reactive until the source signal contains a truthy value.
|
|
200
|
+
* All subsequent changes inside the computation will be ignored.
|
|
201
|
+
*/
|
|
202
|
+
export declare const computedTillTruthy: <T>(source: Signal<T>) => Signal<T | null>;
|
|
203
|
+
/**
|
|
204
|
+
* A computed that will only be reactive until the source signal contains a falsy value.
|
|
205
|
+
* All subsequent changes inside the computation will be ignored.
|
|
206
|
+
*/
|
|
207
|
+
export declare const computedTillFalsy: <T>(source: Signal<T>) => Signal<T | null>;
|
|
208
|
+
/** Inject a signal containing a boolean value indicating if the viewport is xs */
|
|
209
|
+
export declare const injectIsXs: () => Signal<boolean>;
|
|
210
|
+
/** Inject a signal containing a boolean value indicating if the viewport is sm */
|
|
211
|
+
export declare const injectIsSm: () => Signal<boolean>;
|
|
212
|
+
/** Inject a signal containing a boolean value indicating if the viewport is md */
|
|
213
|
+
export declare const injectIsMd: () => Signal<boolean>;
|
|
214
|
+
/** Inject a signal containing a boolean value indicating if the viewport is lg */
|
|
215
|
+
export declare const injectIsLg: () => Signal<boolean>;
|
|
216
|
+
/** Inject a signal containing a boolean value indicating if the viewport is xl */
|
|
217
|
+
export declare const injectIsXl: () => Signal<boolean>;
|
|
218
|
+
/** Inject a signal containing a boolean value indicating if the viewport is 2xl */
|
|
219
|
+
export declare const injectIs2Xl: () => Signal<boolean>;
|
|
220
|
+
/**
|
|
221
|
+
* Inject a boolean value indicating if the viewport is matching the provided options.
|
|
222
|
+
* This value is not reactive. If you want to react to changes, use the {@link injectObserveBreakpoint} function instead.
|
|
223
|
+
*/
|
|
224
|
+
export declare const injectBreakpointIsMatched: (options: {
|
|
225
|
+
min?: number | Breakpoint;
|
|
226
|
+
max?: number | Breakpoint;
|
|
227
|
+
}) => boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Inject a signal containing a boolean value indicating if the viewport is matching the provided options.
|
|
230
|
+
*/
|
|
231
|
+
export declare const injectObserveBreakpoint: (options: {
|
|
232
|
+
min?: number | Breakpoint;
|
|
233
|
+
max?: number | Breakpoint;
|
|
234
|
+
}) => Signal<boolean>;
|
|
235
|
+
/** Inject a signal containing the current breakpoint. */
|
|
236
|
+
export declare const injectCurrentBreakpoint: () => Signal<"xs" | "sm" | "md" | "lg" | "xl" | "2xl">;
|
|
197
237
|
export {};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/cdk": "17.3.
|
|
6
|
-
"@angular/common": "17.3.
|
|
7
|
-
"@angular/core": "17.3.
|
|
8
|
-
"@angular/forms": "17.3.
|
|
9
|
-
"@angular/platform-browser": "17.3.
|
|
10
|
-
"@angular/router": "17.3.
|
|
5
|
+
"@angular/cdk": "17.3.8",
|
|
6
|
+
"@angular/common": "17.3.8",
|
|
7
|
+
"@angular/core": "17.3.8",
|
|
8
|
+
"@angular/forms": "17.3.8",
|
|
9
|
+
"@angular/platform-browser": "17.3.8",
|
|
10
|
+
"@angular/router": "17.3.8",
|
|
11
11
|
"@ethlete/theming": "^2.3.1",
|
|
12
12
|
"@ethlete/types": "^1.6.2",
|
|
13
13
|
"@floating-ui/dom": "^1.5.3",
|