@ethlete/core 1.10.1 → 2.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 (28) hide show
  1. package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -5
  2. package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +4 -7
  3. package/esm2022/lib/directives/animated-lifecycle/index.mjs +2 -0
  4. package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +181 -0
  5. package/esm2022/lib/directives/animated-overlay/public-api.mjs +2 -0
  6. package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +7 -8
  7. package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +41 -0
  8. package/esm2022/lib/directives/is-active-element/public-api.mjs +2 -0
  9. package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +4 -6
  10. package/esm2022/lib/directives/public-api.mjs +3 -1
  11. package/esm2022/lib/services/public-api.mjs +1 -2
  12. package/esm2022/lib/utils/destroy.utils.mjs +13 -0
  13. package/esm2022/lib/utils/public-api.mjs +2 -1
  14. package/esm2022/lib/utils/reactive-binding.util.mjs +5 -4
  15. package/fesm2022/ethlete-core.mjs +1267 -1069
  16. package/fesm2022/ethlete-core.mjs.map +1 -1
  17. package/lib/directives/animated-lifecycle/index.d.ts +1 -0
  18. package/lib/directives/animated-overlay/animated-overlay.directive.d.ts +62 -0
  19. package/lib/directives/animated-overlay/public-api.d.ts +1 -0
  20. package/lib/directives/is-active-element/is-active-element.directive.d.ts +12 -0
  21. package/lib/directives/is-active-element/public-api.d.ts +1 -0
  22. package/lib/directives/public-api.d.ts +2 -0
  23. package/lib/services/public-api.d.ts +0 -1
  24. package/lib/utils/destroy.utils.d.ts +1 -0
  25. package/lib/utils/public-api.d.ts +1 -0
  26. package/package.json +2 -1
  27. package/esm2022/lib/services/destroy.service.mjs +0 -24
  28. package/lib/services/destroy.service.d.ts +0 -12
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,62 @@
1
+ import { OverlayRef } from '@angular/cdk/overlay';
2
+ import { ComponentPortal, ComponentType } from '@angular/cdk/portal';
3
+ import { ComponentRef, StaticProvider } from '@angular/core';
4
+ import { Instance as PopperInstance, Placement as PopperPlacement } from '@popperjs/core';
5
+ import { Options as ArrowOptions } from '@popperjs/core/lib/modifiers/arrow';
6
+ import { Options as OffsetOptions } from '@popperjs/core/lib/modifiers/offset';
7
+ import { Subject } from 'rxjs';
8
+ import { AnimatedLifecycleDirective } from '../animated-lifecycle';
9
+ import * as i0 from "@angular/core";
10
+ export declare class AnimatedOverlayDirective<T extends {
11
+ _animatedLifecycle?: AnimatedLifecycleDirective;
12
+ _markForCheck?: () => void;
13
+ }> {
14
+ private readonly _destroy$;
15
+ private readonly _overlayService;
16
+ private readonly _injector;
17
+ private readonly _viewContainerRef;
18
+ private readonly _zone;
19
+ private readonly _elementRef;
20
+ private _portal;
21
+ private _overlayRef;
22
+ private _componentRef;
23
+ private _popper;
24
+ private _beforeOpened;
25
+ private _afterOpened;
26
+ private _beforeClosed;
27
+ private _afterClosed;
28
+ /**
29
+ * The placement of the tooltip.
30
+ * @default 'auto'
31
+ */
32
+ placement: PopperPlacement;
33
+ /**
34
+ * The offset of the tooltip.
35
+ * @see https://popper.js.org/docs/v2/modifiers/offset/#offset-1
36
+ */
37
+ offset: OffsetOptions['offset'] | Readonly<OffsetOptions['offset']> | null;
38
+ /**
39
+ * The arrow padding.
40
+ * @see https://popper.js.org/docs/v2/modifiers/arrow/#padding
41
+ * @default 4
42
+ */
43
+ arrowPadding: ArrowOptions['padding'] | null;
44
+ get isMounted(): boolean;
45
+ get portal(): ComponentPortal<T> | null;
46
+ get overlayRef(): OverlayRef | null;
47
+ get componentRef(): ComponentRef<T> | null;
48
+ get popper(): PopperInstance | null;
49
+ mount(config: {
50
+ component: ComponentType<T>;
51
+ providers?: StaticProvider[];
52
+ data?: Partial<T>;
53
+ }): void;
54
+ unmount(): void;
55
+ beforeOpened(): Subject<void>;
56
+ afterOpened(): Subject<void>;
57
+ beforeClosed(): Subject<void>;
58
+ afterClosed(): Subject<void>;
59
+ _destroy(): void;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<AnimatedOverlayDirective<any>, never>;
61
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AnimatedOverlayDirective<any>, never, never, { "placement": { "alias": "placement"; "required": false; }; "offset": { "alias": "offset"; "required": false; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; }; }, {}, never, never, true, never>;
62
+ }
@@ -0,0 +1 @@
1
+ export * from './animated-overlay.directive';
@@ -0,0 +1,12 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { ElementRef, InjectionToken } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare const IS_ACTIVE_ELEMENT: InjectionToken<IsActiveElementDirective>;
5
+ export declare class IsActiveElementDirective {
6
+ readonly elementRef: ElementRef<HTMLElement>;
7
+ get isActiveElement(): boolean;
8
+ set isActiveElement(value: BooleanInput);
9
+ private _isActiveElement;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<IsActiveElementDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<IsActiveElementDirective, "[etIsActiveElement]", never, { "isActiveElement": { "alias": "etIsActiveElement"; "required": false; }; }, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1 @@
1
+ export * from './is-active-element.directive';
@@ -1,8 +1,10 @@
1
1
  export * from './animatable/public-api';
2
2
  export * from './animated-lifecycle/public-api';
3
+ export * from './animated-overlay/public-api';
3
4
  export * from './click-outside/public-api';
4
5
  export * from './cursor-drag-scroll/public-api';
5
6
  export * from './delayable/public-api';
7
+ export * from './is-active-element/public-api';
6
8
  export * from './let/public-api';
7
9
  export * from './observe-content/public-api';
8
10
  export * from './observe-resize/public-api';
@@ -1,6 +1,5 @@
1
1
  export * from './click-observer.service';
2
2
  export * from './content-observer.service';
3
- export * from './destroy.service';
4
3
  export * from './focus-visible.service';
5
4
  export * from './resize-observer.service';
6
5
  export * from './router-state.service';
@@ -0,0 +1 @@
1
+ export declare const createDestroy: () => import("rxjs").Observable<boolean>;
@@ -2,6 +2,7 @@ export * from './animation.utils';
2
2
  export * from './clamp.util';
3
3
  export * from './clone.util';
4
4
  export * from './cookie.util';
5
+ export * from './destroy.utils';
5
6
  export * from './equal.util';
6
7
  export * from './media-query-observable.util';
7
8
  export * from './reactive-binding.util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "1.10.1",
3
+ "version": "2.1.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.5.0"
6
6
  },
@@ -11,6 +11,7 @@
11
11
  "@ethlete/types": "1.1.1",
12
12
  "rxjs": "7.8.1",
13
13
  "@angular/cdk": "16.0.0",
14
+ "@popperjs/core": "2.11.7",
14
15
  "@angular/router": "16.0.0",
15
16
  "@angular/forms": "16.0.0"
16
17
  },
@@ -1,24 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Subject } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * @deprecated Will be replaced with the upcoming Angular 16 `DestroyRef` feature.
6
- */
7
- // TODO: Replace with Angular 16 `DestroyRef` feature when available.
8
- class DestroyService {
9
- constructor() {
10
- this._destroy$ = new Subject();
11
- this.destroy$ = this._destroy$.asObservable();
12
- }
13
- ngOnDestroy() {
14
- this._destroy$.next(true);
15
- this._destroy$.unsubscribe();
16
- }
17
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
18
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: DestroyService }); }
19
- }
20
- export { DestroyService };
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type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G4vLyBUT0RPOiBSZXBsYWNlIHdpdGggQW5ndWxhciAxNiBgRGVzdHJveVJlZmAgZmVhdHVyZSB3aGVuIGF2YWlsYWJsZS5cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBEZXN0cm95U2VydmljZSBpbXBsZW1lbnRzIE9uRGVzdHJveSB7XG4gIHByaXZhdGUgcmVhZG9ubHkgX2Rlc3Ryb3kkID0gbmV3IFN1YmplY3Q8Ym9vbGVhbj4oKTtcblxuICByZWFkb25seSBkZXN0cm95JCA9IHRoaXMuX2Rlc3Ryb3kkLmFzT2JzZXJ2YWJsZSgpO1xuXG4gIG5nT25EZXN0cm95KCk6IHZvaWQge1xuICAgIHRoaXMuX2Rlc3Ryb3kkLm5leHQodHJ1ZSk7XG4gICAgdGhpcy5fZGVzdHJveSQudW5zdWJzY3JpYmUoKTtcbiAgfVxufVxuIl19
@@ -1,12 +0,0 @@
1
- import { OnDestroy } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * @deprecated Will be replaced with the upcoming Angular 16 `DestroyRef` feature.
5
- */
6
- export declare class DestroyService implements OnDestroy {
7
- private readonly _destroy$;
8
- readonly destroy$: import("rxjs").Observable<boolean>;
9
- ngOnDestroy(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<DestroyService, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<DestroyService>;
12
- }