@ethlete/core 0.2.0-next.9 → 1.1.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.
Files changed (87) hide show
  1. package/esm2020/lib/components/public-api.mjs +2 -0
  2. package/esm2020/lib/components/structured-data/public-api.mjs +2 -0
  3. package/esm2020/lib/components/structured-data/structured-data.component.mjs +37 -0
  4. package/esm2020/lib/directives/animatable/animatable.directive.mjs +113 -0
  5. package/esm2020/lib/directives/animatable/public-api.mjs +2 -0
  6. package/esm2020/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +115 -0
  7. package/esm2020/lib/directives/animated-lifecycle/public-api.mjs +2 -0
  8. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  9. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +5 -5
  10. package/esm2020/lib/directives/let/let.directive.mjs +8 -8
  11. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +7 -7
  12. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +7 -7
  13. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +11 -10
  14. package/esm2020/lib/directives/public-api.mjs +3 -2
  15. package/esm2020/lib/directives/repeat/repeat.directive.mjs +10 -11
  16. package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
  17. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
  18. package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
  19. package/esm2020/lib/directives/seo/seo.directive.mjs +3 -3
  20. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
  21. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
  22. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
  23. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
  24. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
  25. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  26. package/esm2020/lib/public-api.mjs +3 -1
  27. package/esm2020/lib/services/click-observer.service.mjs +6 -6
  28. package/esm2020/lib/services/content-observer.service.mjs +6 -6
  29. package/esm2020/lib/services/destroy.service.mjs +3 -3
  30. package/esm2020/lib/services/focus-visible.service.mjs +7 -7
  31. package/esm2020/lib/services/public-api.mjs +2 -1
  32. package/esm2020/lib/services/resize-observer.service.mjs +6 -6
  33. package/esm2020/lib/services/router-state.service.mjs +115 -0
  34. package/esm2020/lib/services/viewport.service.mjs +16 -16
  35. package/esm2020/lib/types/angular.types.mjs +36 -2
  36. package/esm2020/lib/utils/animation.utils.mjs +18 -0
  37. package/esm2020/lib/utils/clone.util.mjs +78 -0
  38. package/esm2020/lib/utils/cookie.util.mjs +48 -0
  39. package/esm2020/lib/utils/equal.util.mjs +118 -0
  40. package/esm2020/lib/utils/media-query-observable.util.mjs +18 -0
  41. package/esm2020/lib/utils/public-api.mjs +8 -2
  42. package/esm2020/lib/utils/reactive-binding.util.mjs +111 -0
  43. package/esm2020/lib/validators/is-array-not-empty.validator.mjs +9 -0
  44. package/esm2020/lib/validators/is-email.validator.mjs +10 -0
  45. package/esm2020/lib/validators/must-match.validator.mjs +19 -0
  46. package/esm2020/lib/validators/public-api.mjs +12 -0
  47. package/fesm2015/ethlete-core.mjs +963 -153
  48. package/fesm2015/ethlete-core.mjs.map +1 -1
  49. package/fesm2020/ethlete-core.mjs +961 -153
  50. package/fesm2020/ethlete-core.mjs.map +1 -1
  51. package/lib/components/public-api.d.ts +1 -0
  52. package/lib/components/structured-data/public-api.d.ts +1 -0
  53. package/lib/components/structured-data/structured-data.component.d.ts +11 -0
  54. package/lib/directives/animatable/animatable.directive.d.ts +22 -0
  55. package/lib/directives/animatable/public-api.d.ts +1 -0
  56. package/lib/directives/animated-lifecycle/animated-lifecycle.directive.d.ts +22 -0
  57. package/lib/directives/animated-lifecycle/public-api.d.ts +1 -0
  58. package/lib/directives/observe-content/observe-content.directive.d.ts +2 -2
  59. package/lib/directives/observe-resize/observe-resize.directive.d.ts +2 -2
  60. package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +2 -2
  61. package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +1 -1
  62. package/lib/directives/public-api.d.ts +2 -1
  63. package/lib/directives/repeat/repeat.directive.d.ts +2 -3
  64. package/lib/directives/seo/seo.directive.types.d.ts +1 -1
  65. package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +2 -2
  66. package/lib/public-api.d.ts +2 -0
  67. package/lib/services/public-api.d.ts +1 -0
  68. package/lib/services/router-state.service.d.ts +40 -0
  69. package/lib/services/viewport.types.d.ts +1 -1
  70. package/lib/types/angular.types.d.ts +14 -1
  71. package/lib/types/viewport.types.d.ts +2 -2
  72. package/lib/utils/animation.utils.d.ts +4 -0
  73. package/lib/utils/clone.util.d.ts +15 -0
  74. package/lib/utils/cookie.util.d.ts +5 -0
  75. package/lib/utils/equal.util.d.ts +27 -0
  76. package/lib/utils/media-query-observable.util.d.ts +5 -0
  77. package/lib/utils/public-api.d.ts +7 -1
  78. package/lib/utils/reactive-binding.util.d.ts +19 -0
  79. package/lib/validators/is-array-not-empty.validator.d.ts +3 -0
  80. package/lib/validators/is-email.validator.d.ts +3 -0
  81. package/lib/validators/must-match.validator.d.ts +3 -0
  82. package/lib/validators/public-api.d.ts +8 -0
  83. package/package.json +8 -6
  84. package/esm2020/lib/directives/destroy/destroy.directive.mjs +0 -22
  85. package/esm2020/lib/directives/destroy/public-api.mjs +0 -2
  86. package/lib/directives/destroy/destroy.directive.d.ts +0 -9
  87. package/lib/directives/destroy/public-api.d.ts +0 -1
@@ -0,0 +1 @@
1
+ export * from './structured-data/public-api';
@@ -0,0 +1 @@
1
+ export * from './structured-data.component';
@@ -0,0 +1,11 @@
1
+ import { SafeHtml } from '@angular/platform-browser';
2
+ import { JsonLD } from '@ethlete/types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class StructuredDataComponent {
5
+ private readonly _sanitizer;
6
+ set data(currentValue: JsonLD.WithContext<JsonLD.Thing> | JsonLD.Graph | null | undefined);
7
+ jsonLD?: SafeHtml;
8
+ getSafeHTML(value: JsonLD.WithContext<JsonLD.Thing> | JsonLD.Graph | null | undefined): SafeHtml;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<StructuredDataComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<StructuredDataComponent, "et-structured-data", never, { "data": "data"; }, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,22 @@
1
+ import { InjectionToken, OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export declare const ANIMATABLE_TOKEN: InjectionToken<AnimatableDirective>;
5
+ export declare class AnimatableDirective implements OnInit {
6
+ private _didEmitStart;
7
+ private readonly _parent;
8
+ private readonly _destroy$;
9
+ private readonly _elementRef;
10
+ private readonly _animationStart$;
11
+ private readonly _animationEnd$;
12
+ set animatedElement(value: string | HTMLElement | null | undefined);
13
+ private _animatedElement$;
14
+ readonly animationStart$: Observable<void>;
15
+ readonly animationEnd$: Observable<void>;
16
+ private readonly _hostActiveAnimationCount$;
17
+ private readonly _totalActiveAnimationCount$;
18
+ readonly isAnimating$: Observable<boolean>;
19
+ ngOnInit(): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AnimatableDirective, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatableDirective, "[etAnimatable]", ["etAnimatable"], { "animatedElement": "etAnimatable"; }, {}, never, never, true, never>;
22
+ }
@@ -0,0 +1 @@
1
+ export * from './animatable.directive';
@@ -0,0 +1,22 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "../animatable/animatable.directive";
4
+ export declare const ANIMATED_LIFECYCLE_TOKEN: InjectionToken<AnimatedLifecycleDirective>;
5
+ export declare class AnimatedLifecycleDirective {
6
+ private readonly _destroy$;
7
+ private readonly _elementRef;
8
+ private readonly _animatable;
9
+ private readonly _classList;
10
+ private _state$;
11
+ readonly state$: import("rxjs").Observable<"entering" | "entered" | "leaving" | "left" | "init">;
12
+ get state(): "entering" | "entered" | "leaving" | "left" | "init";
13
+ private readonly _bindings;
14
+ enter(config?: {
15
+ onlyTransition?: boolean;
16
+ }): void;
17
+ leave(config?: {
18
+ onlyTransition?: boolean;
19
+ }): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AnimatedLifecycleDirective, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedLifecycleDirective, "[etAnimatedLifecycle]", ["etAnimatedLifecycle"], {}, {}, never, never, true, [{ directive: typeof i1.AnimatableDirective; inputs: {}; outputs: {}; }]>;
22
+ }
@@ -0,0 +1 @@
1
+ export * from './animated-lifecycle.directive';
@@ -5,7 +5,7 @@ export declare class ObserveContentDirective implements AfterContentInit, OnDest
5
5
  private _contentObserver;
6
6
  private _elementRef;
7
7
  private _ngZone;
8
- readonly event: EventEmitter<MutationRecord[]>;
8
+ readonly valueChange: EventEmitter<MutationRecord[]>;
9
9
  get disabled(): boolean;
10
10
  set disabled(value: BooleanInput);
11
11
  private _disabled;
@@ -18,5 +18,5 @@ export declare class ObserveContentDirective implements AfterContentInit, OnDest
18
18
  private _subscribe;
19
19
  private _unsubscribe;
20
20
  static ɵfac: i0.ɵɵFactoryDeclaration<ObserveContentDirective, never>;
21
- static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveContentDirective, "[etObserveContent]", ["etObserveContent"], { "disabled": "etObserveContentDisabled"; "debounce": "etObserveContentDebounce"; }, { "event": "etObserveContent"; }, never, never, true, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveContentDirective, "[etObserveContent]", ["etObserveContent"], { "disabled": "etObserveContentDisabled"; "debounce": "etObserveContentDebounce"; }, { "valueChange": "etObserveContent"; }, never, never, true, never>;
22
22
  }
@@ -5,7 +5,7 @@ export declare class ObserveResizeDirective implements AfterContentInit, OnDestr
5
5
  private _resizeObserver;
6
6
  private _elementRef;
7
7
  private _ngZone;
8
- readonly event: EventEmitter<ResizeObserverEntry[]>;
8
+ readonly valueChange: EventEmitter<ResizeObserverEntry[]>;
9
9
  get disabled(): boolean;
10
10
  set disabled(value: BooleanInput);
11
11
  private _disabled;
@@ -18,5 +18,5 @@ export declare class ObserveResizeDirective implements AfterContentInit, OnDestr
18
18
  private _subscribe;
19
19
  private _unsubscribe;
20
20
  static ɵfac: i0.ɵɵFactoryDeclaration<ObserveResizeDirective, never>;
21
- static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveResizeDirective, "[etObserveResize]", ["etObserveResize"], { "disabled": "etObserveResizeDisabled"; "debounce": "etObserveResizeDebounce"; }, { "event": "etObserveResize"; }, never, never, true, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveResizeDirective, "[etObserveResize]", ["etObserveResize"], { "disabled": "etObserveResizeDisabled"; "debounce": "etObserveResizeDebounce"; }, { "valueChange": "etObserveResize"; }, never, never, true, never>;
22
22
  }
@@ -17,7 +17,7 @@ export declare class ObserveScrollStateDirective implements OnInit, OnDestroy {
17
17
  set observerThreshold(value: NumberInput);
18
18
  private _threshold;
19
19
  private _intersectionObserver;
20
- etObserveScrollState: EventEmitter<ScrollObserverScrollState>;
20
+ valueChange: EventEmitter<ScrollObserverScrollState>;
21
21
  ngOnInit(): void;
22
22
  ngOnDestroy(): void;
23
23
  private _checkChildren;
@@ -27,5 +27,5 @@ export declare class ObserveScrollStateDirective implements OnInit, OnDestroy {
27
27
  private _clearIntersectionObserver;
28
28
  private _getNonIgnoredChild;
29
29
  static ɵfac: i0.ɵɵFactoryDeclaration<ObserveScrollStateDirective, never>;
30
- static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveScrollStateDirective, "[etObserveScrollState]", ["etObserveScrollState"], { "observerRootMargin": "observerRootMargin"; "observerThreshold": "observerThreshold"; }, { "etObserveScrollState": "etObserveScrollState"; }, never, never, true, never>;
30
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ObserveScrollStateDirective, "[etObserveScrollState]", ["etObserveScrollState"], { "observerRootMargin": "observerRootMargin"; "observerThreshold": "observerThreshold"; }, { "valueChange": "etObserveScrollState"; }, never, never, true, never>;
31
31
  }
@@ -3,4 +3,4 @@ export interface ScrollObserverScrollState {
3
3
  isAtEnd: boolean;
4
4
  canScroll: boolean;
5
5
  }
6
- export declare type ObservedScrollableChild = 'first' | 'last';
6
+ export type ObservedScrollableChild = 'first' | 'last';
@@ -1,6 +1,7 @@
1
+ export * from './animatable/public-api';
2
+ export * from './animated-lifecycle/public-api';
1
3
  export * from './click-outside/public-api';
2
4
  export * from './cursor-drag-scroll/public-api';
3
- export * from './destroy/public-api';
4
5
  export * from './let/public-api';
5
6
  export * from './observe-content/public-api';
6
7
  export * from './observe-resize/public-api';
@@ -1,14 +1,13 @@
1
1
  import { NumberInput } from '@angular/cdk/coercion';
2
- import { OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { TemplateRef, ViewContainerRef } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
- export declare class RepeatDirective implements OnInit {
4
+ export declare class RepeatDirective {
5
5
  private _mainTemplateRef;
6
6
  private _viewContainerRef;
7
7
  get repeatCount(): number;
8
8
  set repeatCount(value: NumberInput);
9
9
  private _repeatCount;
10
10
  constructor(_mainTemplateRef: TemplateRef<unknown>, _viewContainerRef: ViewContainerRef);
11
- ngOnInit(): void;
12
11
  private _render;
13
12
  static ɵfac: i0.ɵɵFactoryDeclaration<RepeatDirective, never>;
14
13
  static ɵdir: i0.ɵɵDirectiveDeclaration<RepeatDirective, "[etRepeat]", never, { "repeatCount": "etRepeat"; }, {}, never, never, true, never>;
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- export declare type MaybeObservable<T> = T | Observable<T>;
2
+ export type MaybeObservable<T> = T | Observable<T>;
3
3
  export interface SeoConfig {
4
4
  title?: MaybeObservable<string>;
5
5
  description?: MaybeObservable<string>;
@@ -4,8 +4,8 @@ export interface NormalizedMatchParticipants {
4
4
  home: NormalizedMatchParticipant | null;
5
5
  away: NormalizedMatchParticipant | null;
6
6
  }
7
- declare type NormalizedParticipantType = 'team' | 'player' | 'unknown';
8
- export declare type NormalizedMatchParticipant = ({
7
+ type NormalizedParticipantType = 'team' | 'player' | 'unknown';
8
+ export type NormalizedMatchParticipant = ({
9
9
  type: 'tbd';
10
10
  participantType: NormalizedParticipantType;
11
11
  data: ParticipantViewUnion | null;
@@ -1,3 +1,4 @@
1
+ export * from './components/public-api';
1
2
  export * from './constants/public-api';
2
3
  export * from './decorators/public-api';
3
4
  export * from './directives/public-api';
@@ -5,3 +6,4 @@ export * from './pipes/public-api';
5
6
  export * from './services/public-api';
6
7
  export * from './types/public-api';
7
8
  export * from './utils/public-api';
9
+ export * from './validators/public-api';
@@ -3,5 +3,6 @@ export * from './content-observer.service';
3
3
  export * from './destroy.service';
4
4
  export * from './focus-visible.service';
5
5
  export * from './resize-observer.service';
6
+ export * from './router-state.service';
6
7
  export * from './viewport.service';
7
8
  export * from './viewport.types';
@@ -0,0 +1,40 @@
1
+ import { Data, Params } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export declare const routerDisableScrollTop: (config?: {
5
+ asReturnRoute?: boolean;
6
+ }) => {
7
+ disableScrollTop: boolean;
8
+ disableScrollTopAsReturnRoute?: undefined;
9
+ } | {
10
+ disableScrollTopAsReturnRoute: boolean;
11
+ disableScrollTop?: undefined;
12
+ };
13
+ export declare class RouterStateService {
14
+ private _isScrollTopOnNavigationEnabled;
15
+ private readonly _router;
16
+ private readonly _route$;
17
+ private readonly _state$;
18
+ get route$(): Observable<string>;
19
+ get state$(): Observable<{
20
+ data: Data;
21
+ pathParams: Params;
22
+ queryParams: Params;
23
+ title: string | null;
24
+ fragment: string | null;
25
+ }>;
26
+ constructor();
27
+ enableScrollEnhancements(config?: {
28
+ scrollElement?: HTMLElement;
29
+ queryParamTriggerList?: string[];
30
+ fragment?: {
31
+ enabled?: boolean;
32
+ smooth?: boolean;
33
+ };
34
+ }): void;
35
+ selectQueryParam<T = string | undefined>(key: string): Observable<T>;
36
+ selectPathParam<T = string | undefined>(key: string): Observable<T>;
37
+ selectData<T = unknown>(key: string): Observable<T>;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterStateService, never>;
39
+ static ɵprov: i0.ɵɵInjectableDeclaration<RouterStateService>;
40
+ }
@@ -1,5 +1,5 @@
1
1
  import { Breakpoint } from '../types';
2
- export declare type BuildMediaQueryOptions = {
2
+ export type BuildMediaQueryOptions = {
3
3
  min?: number | Breakpoint;
4
4
  max?: number | Breakpoint;
5
5
  };
@@ -1,3 +1,16 @@
1
- export declare type NgClassType = string | string[] | Set<string> | {
1
+ import { QueryList } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ export type NgClassType = string | string[] | Set<string> | {
2
4
  [klass: string]: any;
3
5
  } | null | undefined;
6
+ export declare class TypedQueryList<T> extends QueryList<T | undefined> {
7
+ [Symbol.iterator]: () => Iterator<T>;
8
+ get changes(): Observable<TypedQueryList<T>>;
9
+ toArray(): T[];
10
+ forEach(fn: (item: T, index: number, array: T[]) => void): void;
11
+ filter(fn: (item: T, index: number, array: T[]) => boolean): T[];
12
+ map<U>(fn: (item: T, index: number, array: T[]) => U): U[];
13
+ reduce<U>(fn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
14
+ some(fn: (value: T, index: number, array: T[]) => boolean): boolean;
15
+ find(fn: (value: T, index: number, array: T[]) => boolean): T | undefined;
16
+ }
@@ -1,4 +1,4 @@
1
- export declare type Vec2 = [number, number];
1
+ export type Vec2 = [number, number];
2
2
  export interface ViewportConfig {
3
3
  breakpoints: {
4
4
  xs: Vec2;
@@ -9,4 +9,4 @@ export interface ViewportConfig {
9
9
  '2xl': Vec2;
10
10
  };
11
11
  }
12
- export declare type Breakpoint = keyof ViewportConfig['breakpoints'];
12
+ export type Breakpoint = keyof ViewportConfig['breakpoints'];
@@ -0,0 +1,4 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare const nextFrame: (cb: () => void) => void;
3
+ export declare const fromNextFrame: () => Observable<void>;
4
+ export declare const forceReflow: (element?: HTMLElement) => number;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Stolen from klona to avoid adding a dependency
3
+ * https://github.com/lukeed/klona
4
+ *
5
+ * MIT License
6
+ *
7
+ * Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ */
15
+ export declare const clone: <T>(original: T) => T;
@@ -0,0 +1,5 @@
1
+ export declare const hasCookie: (name: string) => boolean;
2
+ export declare const getCookie: (name: string) => string | null | undefined;
3
+ export declare const setCookie: (name: string, data: string, expiresInDays?: number, domain?: string | null) => void;
4
+ export declare const deleteCookie: (name: string, path: string, domain?: string | null) => void;
5
+ export declare const getDomain: () => string | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Stolen from dequal to avoid adding a dependency
3
+ * https://github.com/lukeed/dequal
4
+ *
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ */
27
+ export declare const equal: (foo: any, bar: any) => boolean;
@@ -0,0 +1,5 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare const createMediaQueryObservable: (query: string) => Observable<{
3
+ matches: boolean;
4
+ query: string;
5
+ }>;
@@ -1,3 +1,9 @@
1
- export * from './viewport.util';
1
+ export * from './animation.utils';
2
2
  export * from './clamp.util';
3
+ export * from './clone.util';
4
+ export * from './cookie.util';
5
+ export * from './equal.util';
6
+ export * from './media-query-observable.util';
7
+ export * from './reactive-binding.util';
3
8
  export * from './scrollable.utils';
9
+ export * from './viewport.util';
@@ -0,0 +1,19 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ type AttributeValueBinding = {
4
+ render: boolean;
5
+ value: boolean | string | number;
6
+ };
7
+ type AttributeRenderBinding = boolean;
8
+ export type ReactiveAttributes = {
9
+ attribute: string | string[];
10
+ observable: Observable<AttributeValueBinding | AttributeRenderBinding>;
11
+ elementRef?: ElementRef<HTMLElement>;
12
+ };
13
+ export interface ReactiveBindingResult {
14
+ reset: () => void;
15
+ remove: (...attributes: string[]) => void;
16
+ push: (value: ReactiveAttributes) => void;
17
+ }
18
+ export declare const createReactiveBindings: (...values: ReactiveAttributes[]) => ReactiveBindingResult;
19
+ export {};
@@ -0,0 +1,3 @@
1
+ import { AbstractControl, ValidationErrors } from '@angular/forms';
2
+ export declare const IS_ARRAY_NOT_EMPTY = "isArrayNotEmpty";
3
+ export declare const IsArrayNotEmpty: (control: AbstractControl) => ValidationErrors | null;
@@ -0,0 +1,3 @@
1
+ import { AbstractControl, ValidationErrors } from '@angular/forms';
2
+ export declare const IS_EMAIL = "isEmail";
3
+ export declare const IsEmail: (control: AbstractControl) => ValidationErrors | null;
@@ -0,0 +1,3 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ export declare const MUST_MATCH = "mustMatch";
3
+ export declare const MustMatch: (controlName: string, matchingControlName: string) => (formGroup: FormGroup) => void;
@@ -0,0 +1,8 @@
1
+ export * from './is-array-not-empty.validator';
2
+ export * from './is-email.validator';
3
+ export * from './must-match.validator';
4
+ export declare const Validators: {
5
+ readonly MustMatch: (controlName: string, matchingControlName: string) => (formGroup: import("@angular/forms").FormGroup<any>) => void;
6
+ readonly IsEmail: (control: import("@angular/forms").AbstractControl<any, any>) => import("@angular/forms").ValidationErrors | null;
7
+ readonly IsArrayNotEmpty: (control: import("@angular/forms").AbstractControl<any, any>) => import("@angular/forms").ValidationErrors | null;
8
+ };
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "0.2.0-next.9",
3
+ "version": "1.1.0",
4
4
  "dependencies": {
5
- "tslib": "2.4.1"
5
+ "tslib": "2.5.0"
6
6
  },
7
7
  "peerDependencies": {
8
8
  "@angular/common": "^14.0.0 || ^15.0.0",
9
9
  "@angular/core": "^14.0.0 || ^15.0.0",
10
- "rxjs": "7.5.7",
11
- "@angular/cdk": "15.0.2",
12
- "@angular/platform-browser": "15.0.2",
13
- "@ethlete/types": "0.2.0-next.1"
10
+ "@angular/platform-browser": "15.1.4",
11
+ "@ethlete/types": "1.0.0",
12
+ "rxjs": "7.8.0",
13
+ "@angular/cdk": "15.1.4",
14
+ "@angular/router": "15.1.4",
15
+ "@angular/forms": "15.1.4"
14
16
  },
15
17
  "module": "fesm2015/ethlete-core.mjs",
16
18
  "es2020": "fesm2020/ethlete-core.mjs",
@@ -1,22 +0,0 @@
1
- import { Directive } from '@angular/core';
2
- import { Subject } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- export class DestroyDirective {
5
- constructor() {
6
- this._destroy$ = new Subject();
7
- this.destroy$ = this._destroy$.asObservable();
8
- }
9
- ngOnDestroy() {
10
- this._destroy$.next(true);
11
- this._destroy$.unsubscribe();
12
- }
13
- }
14
- DestroyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: DestroyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
15
- DestroyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.2", type: DestroyDirective, isStandalone: true, ngImport: i0 });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: DestroyDirective, decorators: [{
17
- type: Directive,
18
- args: [{
19
- standalone: true,
20
- }]
21
- }] });
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzdHJveS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3JjL2xpYi9kaXJlY3RpdmVzL2Rlc3Ryb3kvZGVzdHJveS5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBYSxNQUFNLGVBQWUsQ0FBQztBQUNyRCxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDOztBQUsvQixNQUFNLE9BQU8sZ0JBQWdCO0lBSDdCO1FBSW1CLGNBQVMsR0FBRyxJQUFJLE9BQU8sRUFBVyxDQUFDO1FBRTNDLGFBQVEsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLFlBQVksRUFBRSxDQUFDO0tBTW5EO0lBSkMsV0FBVztRQUNULElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzFCLElBQUksQ0FBQyxTQUFTLENBQUMsV0FBVyxFQUFFLENBQUM7SUFDL0IsQ0FBQzs7NkdBUlUsZ0JBQWdCO2lHQUFoQixnQkFBZ0I7MkZBQWhCLGdCQUFnQjtrQkFINUIsU0FBUzttQkFBQztvQkFDVCxVQUFVLEVBQUUsSUFBSTtpQkFDakIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEaXJlY3RpdmUsIE9uRGVzdHJveSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgU3ViamVjdCB9IGZyb20gJ3J4anMnO1xuXG5ARGlyZWN0aXZlKHtcbiAgc3RhbmRhbG9uZTogdHJ1ZSxcbn0pXG5leHBvcnQgY2xhc3MgRGVzdHJveURpcmVjdGl2ZSBpbXBsZW1lbnRzIE9uRGVzdHJveSB7XG4gIHByaXZhdGUgcmVhZG9ubHkgX2Rlc3Ryb3kkID0gbmV3IFN1YmplY3Q8Ym9vbGVhbj4oKTtcblxuICByZWFkb25seSBkZXN0cm95JCA9IHRoaXMuX2Rlc3Ryb3kkLmFzT2JzZXJ2YWJsZSgpO1xuXG4gIG5nT25EZXN0cm95KCk6IHZvaWQge1xuICAgIHRoaXMuX2Rlc3Ryb3kkLm5leHQodHJ1ZSk7XG4gICAgdGhpcy5fZGVzdHJveSQudW5zdWJzY3JpYmUoKTtcbiAgfVxufVxuIl19
@@ -1,2 +0,0 @@
1
- export * from './destroy.directive';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvbGliL2RpcmVjdGl2ZXMvZGVzdHJveS9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMscUJBQXFCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2Rlc3Ryb3kuZGlyZWN0aXZlJztcbiJdfQ==
@@ -1,9 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class DestroyDirective implements OnDestroy {
4
- private readonly _destroy$;
5
- readonly destroy$: import("rxjs").Observable<boolean>;
6
- ngOnDestroy(): void;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<DestroyDirective, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<DestroyDirective, never, never, {}, {}, never, never, true, never>;
9
- }
@@ -1 +0,0 @@
1
- export * from './destroy.directive';