@ethlete/core 0.2.0-next.4 → 0.2.0-next.6

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 (48) hide show
  1. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  2. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.mjs +3 -0
  3. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +123 -0
  4. package/esm2020/lib/directives/cursor-drag-scroll/public-api.mjs +2 -0
  5. package/esm2020/lib/directives/let/let.directive.mjs +3 -3
  6. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +3 -3
  7. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
  8. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.constants.mjs +3 -0
  9. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +156 -0
  10. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.types.mjs +2 -0
  11. package/esm2020/lib/directives/observe-scroll-state/public-api.mjs +3 -0
  12. package/esm2020/lib/directives/public-api.mjs +4 -1
  13. package/esm2020/lib/directives/repeat/repeat.directive.mjs +3 -3
  14. package/esm2020/lib/directives/scroll-observer-ignore-target/index.mjs +2 -0
  15. package/esm2020/lib/directives/scroll-observer-ignore-target/public-api.mjs +2 -0
  16. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +18 -0
  17. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  18. package/esm2020/lib/services/click-observer.service.mjs +6 -6
  19. package/esm2020/lib/services/content-observer.service.mjs +6 -6
  20. package/esm2020/lib/services/destroy.service.mjs +24 -0
  21. package/esm2020/lib/services/focus-visible.service.mjs +3 -3
  22. package/esm2020/lib/services/public-api.mjs +2 -1
  23. package/esm2020/lib/services/resize-observer.service.mjs +6 -6
  24. package/esm2020/lib/services/viewport.service.mjs +3 -3
  25. package/esm2020/lib/utils/index.mjs +2 -0
  26. package/esm2020/lib/utils/public-api.mjs +2 -1
  27. package/esm2020/lib/utils/scrollable.utils.mjs +5 -0
  28. package/fesm2015/ethlete-core.mjs +371 -52
  29. package/fesm2015/ethlete-core.mjs.map +1 -1
  30. package/fesm2020/ethlete-core.mjs +364 -52
  31. package/fesm2020/ethlete-core.mjs.map +1 -1
  32. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.d.ts +2 -0
  33. package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.d.ts +21 -0
  34. package/lib/directives/cursor-drag-scroll/public-api.d.ts +1 -0
  35. package/lib/directives/observe-scroll-state/observe-scroll-state.constants.d.ts +3 -0
  36. package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +31 -0
  37. package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +6 -0
  38. package/lib/directives/observe-scroll-state/public-api.d.ts +3 -0
  39. package/lib/directives/public-api.d.ts +3 -0
  40. package/lib/directives/scroll-observer-ignore-target/index.d.ts +1 -0
  41. package/lib/directives/scroll-observer-ignore-target/public-api.d.ts +1 -0
  42. package/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.d.ts +6 -0
  43. package/lib/services/destroy.service.d.ts +9 -0
  44. package/lib/services/public-api.d.ts +1 -0
  45. package/lib/utils/index.d.ts +1 -0
  46. package/lib/utils/public-api.d.ts +1 -0
  47. package/lib/utils/scrollable.utils.d.ts +1 -0
  48. package/package.json +4 -3
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Directive, Input, Injectable, Inject, Optional, inject, ElementRef, NgZone, EventEmitter, Output, Pipe } from '@angular/core';
3
3
  import { coerceNumberProperty, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';
4
- import { BehaviorSubject, combineLatest, map, shareReplay, Observable, Subject, fromEvent, debounceTime } from 'rxjs';
4
+ import { BehaviorSubject, combineLatest, map, shareReplay, Observable, Subject, fromEvent, debounceTime, tap, takeUntil, take } from 'rxjs';
5
5
  import { __decorate, __metadata } from 'tslib';
6
6
  import * as i1 from '@angular/cdk/layout';
7
7
  import { DOCUMENT } from '@angular/common';
@@ -82,9 +82,9 @@ class LetDirective {
82
82
  }
83
83
  }
84
84
  }
85
- LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
86
- LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: LetDirective, decorators: [{
85
+ LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
86
+ LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: LetDirective, decorators: [{
88
88
  type: Directive,
89
89
  args: [{
90
90
  selector: '[etLet]',
@@ -115,9 +115,9 @@ class RepeatDirective {
115
115
  }
116
116
  }
117
117
  }
118
- RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
119
- RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: RepeatDirective, decorators: [{
118
+ RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
119
+ RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: RepeatDirective, decorators: [{
121
121
  type: Directive,
122
122
  args: [{
123
123
  selector: '[etRepeat]',
@@ -258,8 +258,8 @@ class ViewportService {
258
258
  return 'xs';
259
259
  }
260
260
  }
261
- ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
262
- ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, providedIn: 'root' });
261
+ ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
262
+ ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ViewportService, providedIn: 'root' });
263
263
  __decorate([
264
264
  Memo(),
265
265
  __metadata("design:type", Function),
@@ -276,7 +276,7 @@ __decorate([
276
276
  __metadata("design:paramtypes", [Object]),
277
277
  __metadata("design:returntype", void 0)
278
278
  ], ViewportService.prototype, "_buildMediaQuery", null);
279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ViewportService, decorators: [{
279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ViewportService, decorators: [{
280
280
  type: Injectable,
281
281
  args: [{
282
282
  providedIn: 'root',
@@ -310,9 +310,9 @@ class FocusVisibleService {
310
310
  this._hadKeyboardEvent = false;
311
311
  }
312
312
  }
313
- FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
314
- FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
315
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FocusVisibleService, decorators: [{
313
+ FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
314
+ FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: FocusVisibleService, decorators: [{
316
316
  type: Injectable,
317
317
  args: [{
318
318
  providedIn: 'root',
@@ -325,9 +325,9 @@ class ResizeObserverFactory {
325
325
  return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
326
326
  }
327
327
  }
328
- ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
329
- ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverFactory, decorators: [{
328
+ ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
329
+ ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverFactory, decorators: [{
331
331
  type: Injectable,
332
332
  args: [{ providedIn: 'root' }]
333
333
  }] });
@@ -383,9 +383,9 @@ class ResizeObserverService {
383
383
  }
384
384
  }
385
385
  }
386
- ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
387
- ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ResizeObserverService, decorators: [{
386
+ ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
387
+ ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ResizeObserverService, decorators: [{
389
389
  type: Injectable,
390
390
  args: [{ providedIn: 'root' }]
391
391
  }], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
@@ -396,9 +396,9 @@ class MutationObserverFactory {
396
396
  return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
397
397
  }
398
398
  }
399
- MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
400
- MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MutationObserverFactory, decorators: [{
399
+ MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
400
+ MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: MutationObserverFactory, decorators: [{
402
402
  type: Injectable,
403
403
  args: [{ providedIn: 'root' }]
404
404
  }] });
@@ -458,9 +458,9 @@ class ContentObserverService {
458
458
  }
459
459
  }
460
460
  }
461
- ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
462
- ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
463
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ContentObserverService, decorators: [{
461
+ ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
462
+ ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ContentObserverService, decorators: [{
464
464
  type: Injectable,
465
465
  args: [{ providedIn: 'root' }]
466
466
  }], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
@@ -471,9 +471,9 @@ class ClickObserverFactory {
471
471
  return fromEvent(document, 'click');
472
472
  }
473
473
  }
474
- ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
475
- ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverFactory, decorators: [{
474
+ ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
475
+ ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverFactory, decorators: [{
477
477
  type: Injectable,
478
478
  args: [{ providedIn: 'root' }]
479
479
  }] });
@@ -527,13 +527,34 @@ class ClickObserverService {
527
527
  }
528
528
  }
529
529
  }
530
- ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
531
- ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickObserverService, decorators: [{
530
+ ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
531
+ ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickObserverService, decorators: [{
533
533
  type: Injectable,
534
534
  args: [{ providedIn: 'root' }]
535
535
  }], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
536
536
 
537
+ class DestroyService {
538
+ constructor() {
539
+ this._destroy$ = new Subject();
540
+ }
541
+ get destroy$() {
542
+ return this._destroy$.asObservable();
543
+ }
544
+ ngOnDestroy() {
545
+ this._destroy$.next(true);
546
+ this._destroy$.unsubscribe();
547
+ }
548
+ }
549
+ DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
550
+ DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DestroyService, providedIn: 'any' });
551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: DestroyService, decorators: [{
552
+ type: Injectable,
553
+ args: [{
554
+ providedIn: 'any',
555
+ }]
556
+ }] });
557
+
537
558
  class ObserveResizeDirective {
538
559
  constructor() {
539
560
  this._resizeObserver = inject(ResizeObserverService);
@@ -577,9 +598,9 @@ class ObserveResizeDirective {
577
598
  this._currentSubscription?.unsubscribe();
578
599
  }
579
600
  }
580
- ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
581
- ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
582
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveResizeDirective, decorators: [{
601
+ ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
602
+ ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveResizeDirective, decorators: [{
583
604
  type: Directive,
584
605
  args: [{
585
606
  selector: '[etObserveResize]',
@@ -640,9 +661,9 @@ class ObserveContentDirective {
640
661
  this._currentSubscription?.unsubscribe();
641
662
  }
642
663
  }
643
- ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
644
- ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
645
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ObserveContentDirective, decorators: [{
664
+ ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
665
+ ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveContentDirective, decorators: [{
646
667
  type: Directive,
647
668
  args: [{
648
669
  selector: '[etObserveContent]',
@@ -682,9 +703,9 @@ class ClickOutsideDirective {
682
703
  this._subscription?.unsubscribe();
683
704
  }
684
705
  }
685
- ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
686
- ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
687
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ClickOutsideDirective, decorators: [{
706
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
707
+ ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ClickOutsideDirective, decorators: [{
688
709
  type: Directive,
689
710
  args: [{
690
711
  selector: '[etClickOutside]',
@@ -694,6 +715,305 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
694
715
  type: Output
695
716
  }] } });
696
717
 
718
+ const provideViewportConfig = (viewportConfig) => {
719
+ return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
720
+ };
721
+
722
+ const clamp = (value, min = 0, max = 100) => {
723
+ return Math.max(min, Math.min(max, value));
724
+ };
725
+
726
+ const elementCanScroll = (element) => {
727
+ const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
728
+ return scrollHeight > clientHeight || scrollWidth > clientWidth;
729
+ };
730
+
731
+ const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
732
+ class ScrollObserverIgnoreTargetDirective {
733
+ }
734
+ ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
735
+ ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
737
+ type: Directive,
738
+ args: [{
739
+ selector: '[etScrollObserverIgnoreTarget]',
740
+ standalone: true,
741
+ host: {
742
+ class: SCROLL_OBSERVER_IGNORE_TARGET_CLASS,
743
+ },
744
+ }]
745
+ }] });
746
+
747
+ const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
748
+
749
+ class ObserveScrollStateDirective {
750
+ constructor() {
751
+ this._destroy$ = inject(DestroyService).destroy$;
752
+ this._elementRef = inject(ElementRef);
753
+ this._contentObserverService = inject(ContentObserverService);
754
+ this._resizeObserverService = inject(ResizeObserverService);
755
+ this._observedChildren = {
756
+ first: this._firstCurrentChild,
757
+ last: this._lastCurrentChild,
758
+ };
759
+ this._rootMargin = 0;
760
+ this._threshold = 1;
761
+ this._intersectionObserver = null;
762
+ this.etObserveScrollState = new EventEmitter();
763
+ }
764
+ get _firstCurrentChild() {
765
+ const element = this._elementRef.nativeElement.children[0];
766
+ return this._getNonIgnoredChild(element, 'next');
767
+ }
768
+ get _lastCurrentChild() {
769
+ const element = this._elementRef.nativeElement.children[this._elementRef.nativeElement.children.length - 1];
770
+ return this._getNonIgnoredChild(element, 'previous');
771
+ }
772
+ get observerRootMargin() {
773
+ return this._rootMargin;
774
+ }
775
+ set observerRootMargin(value) {
776
+ this._rootMargin = coerceNumberProperty(value);
777
+ }
778
+ get observerThreshold() {
779
+ return this._threshold;
780
+ }
781
+ set observerThreshold(value) {
782
+ this._threshold = coerceNumberProperty(value);
783
+ }
784
+ ngOnInit() {
785
+ this._contentObserverService
786
+ .observe(this._elementRef.nativeElement)
787
+ .pipe(tap(() => this._checkChildren()), takeUntil(this._destroy$))
788
+ .subscribe();
789
+ this._resizeObserverService
790
+ .observe(this._elementRef.nativeElement)
791
+ .pipe(debounceTime(25), tap(() => {
792
+ if (!this._intersectionObserver && elementCanScroll(this._elementRef.nativeElement)) {
793
+ this._checkChildren();
794
+ }
795
+ }), takeUntil(this._destroy$))
796
+ .subscribe();
797
+ this._checkChildren();
798
+ }
799
+ ngOnDestroy() {
800
+ this._clearIntersectionObserver();
801
+ }
802
+ _checkChildren() {
803
+ this._clearIntersectionObserver();
804
+ if (this._firstCurrentChild === this._lastCurrentChild ||
805
+ !this._firstCurrentChild ||
806
+ !this._lastCurrentChild ||
807
+ !elementCanScroll(this._elementRef.nativeElement)) {
808
+ this._unobserveChild('first');
809
+ this._unobserveChild('last');
810
+ this.etObserveScrollState.emit({
811
+ isAtStart: true,
812
+ isAtEnd: true,
813
+ canScroll: false,
814
+ });
815
+ }
816
+ else {
817
+ this._intersectionObserver = this._initiateIntersectionObserver();
818
+ this._observeChild('first', this._firstCurrentChild);
819
+ this._observeChild('last', this._lastCurrentChild);
820
+ }
821
+ }
822
+ _initiateIntersectionObserver() {
823
+ const observer = new IntersectionObserver((entries) => {
824
+ const { first, last } = this._observedChildren;
825
+ const isAtStart = entries.find((entry) => entry.target === first)?.isIntersecting ?? false;
826
+ const isAtEnd = entries.find((entry) => entry.target === last)?.isIntersecting ?? false;
827
+ this.etObserveScrollState.emit({
828
+ isAtStart,
829
+ isAtEnd,
830
+ canScroll: !isAtStart || !isAtEnd,
831
+ });
832
+ }, {
833
+ root: this._elementRef.nativeElement,
834
+ rootMargin: `${this._rootMargin}px`,
835
+ threshold: this._threshold,
836
+ });
837
+ return observer;
838
+ }
839
+ _observeChild(child, element) {
840
+ this._intersectionObserver?.observe(element);
841
+ this._observedChildren[child] = element;
842
+ }
843
+ _unobserveChild(child) {
844
+ const observedChild = this._observedChildren[child];
845
+ if (!observedChild) {
846
+ return;
847
+ }
848
+ this._intersectionObserver?.unobserve(observedChild);
849
+ this._observedChildren[child] = null;
850
+ }
851
+ _clearIntersectionObserver() {
852
+ this._intersectionObserver?.disconnect();
853
+ this._intersectionObserver = null;
854
+ }
855
+ _getNonIgnoredChild(element, direction) {
856
+ if (!element) {
857
+ return null;
858
+ }
859
+ if (element?.classList.contains(SCROLL_OBSERVER_IGNORE_TARGET_CLASS)) {
860
+ const nextElement = element[`${direction}ElementSibling`];
861
+ if (!nextElement) {
862
+ return null;
863
+ }
864
+ return this._getNonIgnoredChild(nextElement, direction);
865
+ }
866
+ return element;
867
+ }
868
+ }
869
+ ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
870
+ ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { etObserveScrollState: "etObserveScrollState" }, providers: [
871
+ {
872
+ provide: OBSERVE_SCROLL_STATE,
873
+ useExisting: ObserveScrollStateDirective,
874
+ },
875
+ ], exportAs: ["etObserveScrollState"], ngImport: i0 });
876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
877
+ type: Directive,
878
+ args: [{
879
+ selector: '[etObserveScrollState]',
880
+ exportAs: 'etObserveScrollState',
881
+ standalone: true,
882
+ providers: [
883
+ {
884
+ provide: OBSERVE_SCROLL_STATE,
885
+ useExisting: ObserveScrollStateDirective,
886
+ },
887
+ ],
888
+ }]
889
+ }], propDecorators: { observerRootMargin: [{
890
+ type: Input
891
+ }], observerThreshold: [{
892
+ type: Input
893
+ }], etObserveScrollState: [{
894
+ type: Output
895
+ }] } });
896
+
897
+ const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
898
+ const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
899
+
900
+ class CursorDragScrollDirective {
901
+ constructor() {
902
+ this._destroy$ = inject(DestroyService).destroy$;
903
+ this._elementRef = inject(ElementRef);
904
+ this._contentObserverService = inject(ContentObserverService);
905
+ this._resizeObserverService = inject(ResizeObserverService);
906
+ this._bufferUntilScroll = 5;
907
+ this._mouseUp$ = new Subject();
908
+ this._isScrolling = false;
909
+ this._canScroll = false;
910
+ this._currentScrollState = {
911
+ top: 0,
912
+ left: 0,
913
+ x: 0,
914
+ y: 0,
915
+ };
916
+ }
917
+ ngAfterViewInit() {
918
+ combineLatest([
919
+ this._contentObserverService.observe(this._elementRef.nativeElement),
920
+ this._resizeObserverService.observe(this._elementRef.nativeElement),
921
+ ])
922
+ .pipe(tap(() => this._updateCanScrollState()), takeUntil(this._destroy$))
923
+ .subscribe();
924
+ fromEvent(this._elementRef.nativeElement, 'mousedown')
925
+ .pipe(tap((e) => this._onMouseDown(e)), takeUntil(this._destroy$))
926
+ .subscribe();
927
+ this._updateCanScrollState();
928
+ }
929
+ _onMouseDown(e) {
930
+ if (!this._elementRef?.nativeElement || !this._canScroll) {
931
+ return;
932
+ }
933
+ const element = this._elementRef.nativeElement;
934
+ element.classList.add(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
935
+ this._elementRef.nativeElement.style.scrollSnapType = 'none';
936
+ this._elementRef.nativeElement.style.scrollBehavior = 'unset';
937
+ this._currentScrollState = {
938
+ left: this._elementRef.nativeElement.scrollLeft,
939
+ top: this._elementRef.nativeElement.scrollTop,
940
+ x: e.clientX,
941
+ y: e.clientY,
942
+ };
943
+ fromEvent(document, 'mousemove')
944
+ .pipe(tap((e) => this._mouseMoveHandler(e)), takeUntil(this._mouseUp$), takeUntil(this._destroy$))
945
+ .subscribe();
946
+ fromEvent(document, 'mouseup')
947
+ .pipe(tap(() => this._mouseUpHandler()), take(1), takeUntil(this._destroy$))
948
+ .subscribe();
949
+ }
950
+ _mouseMoveHandler(e) {
951
+ e.preventDefault();
952
+ if (!this._elementRef?.nativeElement) {
953
+ return;
954
+ }
955
+ const dx = e.clientX - this._currentScrollState.x;
956
+ const dy = e.clientY - this._currentScrollState.y;
957
+ if (Math.abs(dx) > this._bufferUntilScroll || Math.abs(dy) > this._bufferUntilScroll) {
958
+ const element = this._elementRef.nativeElement;
959
+ if (!this._isScrolling) {
960
+ this._isScrolling = true;
961
+ element.style.cursor = 'grabbing';
962
+ element.classList.add(CURSOR_DRAG_SCROLLING_CLASS);
963
+ element.scroll({
964
+ top: this._currentScrollState.top - dy,
965
+ left: this._currentScrollState.left - dx,
966
+ behavior: 'smooth',
967
+ });
968
+ }
969
+ else {
970
+ element.scrollTop = this._currentScrollState.top - dy;
971
+ element.scrollLeft = this._currentScrollState.left - dx;
972
+ }
973
+ }
974
+ }
975
+ _mouseUpHandler() {
976
+ this._mouseUp$.next(true);
977
+ this._isScrolling = false;
978
+ if (!this._elementRef?.nativeElement) {
979
+ return;
980
+ }
981
+ this._elementRef.nativeElement.style.scrollSnapType = '';
982
+ this._elementRef.nativeElement.style.scrollBehavior = '';
983
+ this._elementRef.nativeElement.style.cursor = 'grab';
984
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_CLASS);
985
+ this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
986
+ }
987
+ _updateCanScrollState() {
988
+ this._canScroll = elementCanScroll(this._elementRef.nativeElement);
989
+ if (this._canScroll) {
990
+ this._elementRef.nativeElement.style.cursor = 'grab';
991
+ }
992
+ else {
993
+ this._elementRef.nativeElement.style.cursor = 'default';
994
+ }
995
+ }
996
+ _checkCanScroll() {
997
+ if (this._elementRef.nativeElement.scrollWidth > this._elementRef.nativeElement.clientWidth) {
998
+ return true;
999
+ }
1000
+ if (this._elementRef.nativeElement.scrollHeight > this._elementRef.nativeElement.clientHeight) {
1001
+ return true;
1002
+ }
1003
+ return false;
1004
+ }
1005
+ }
1006
+ CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1007
+ CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.9", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", exportAs: ["etCursorDragScroll"], ngImport: i0 });
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
1009
+ type: Directive,
1010
+ args: [{
1011
+ selector: '[etCursorDragScroll]',
1012
+ exportAs: 'etCursorDragScroll',
1013
+ standalone: true,
1014
+ }]
1015
+ }] });
1016
+
697
1017
  const toArray = (value) => {
698
1018
  return Array.from({ length: value }, (_, i) => i);
699
1019
  };
@@ -704,24 +1024,16 @@ class ToArrayPipe {
704
1024
  this.transform = toArray;
705
1025
  }
706
1026
  }
707
- ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
708
- ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
709
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: ToArrayPipe, decorators: [{
1027
+ ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1028
+ ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.9", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
1029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: ToArrayPipe, decorators: [{
710
1030
  type: Pipe,
711
1031
  args: [{ name: 'toArray', standalone: true }]
712
1032
  }] });
713
1033
 
714
- const provideViewportConfig = (viewportConfig) => {
715
- return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
716
- };
717
-
718
- const clamp = (value, min = 0, max = 100) => {
719
- return Math.max(min, Math.min(max, value));
720
- };
721
-
722
1034
  /**
723
1035
  * Generated bundle index. Do not edit.
724
1036
  */
725
1037
 
726
- export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, DEFAULT_VIEWPORT_CONFIG, FocusVisibleService, LetContext, LetDirective, Memo, MutationObserverFactory, ObserveContentDirective, ObserveResizeDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, provideViewportConfig, toArray, toArrayTrackByFn };
1038
+ export { ClickObserverFactory, ClickObserverService, ClickOutsideDirective, ContentObserverService, CursorDragScrollDirective, DEFAULT_VIEWPORT_CONFIG, DestroyService, FocusVisibleService, LetContext, LetDirective, Memo, MutationObserverFactory, OBSERVE_SCROLL_STATE, ObserveContentDirective, ObserveResizeDirective, ObserveScrollStateDirective, RepeatDirective, ResizeObserverFactory, ResizeObserverService, SCROLL_OBSERVER_IGNORE_TARGET_CLASS, ScrollObserverIgnoreTargetDirective, ToArrayPipe, VIEWPORT_CONFIG, ViewportService, clamp, elementCanScroll, provideViewportConfig, toArray, toArrayTrackByFn };
727
1039
  //# sourceMappingURL=ethlete-core.mjs.map