@ethlete/core 0.2.0-next.4 → 0.2.0-next.5
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/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
- package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.mjs +3 -0
- package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +123 -0
- package/esm2020/lib/directives/cursor-drag-scroll/public-api.mjs +2 -0
- package/esm2020/lib/directives/let/let.directive.mjs +3 -3
- package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +3 -3
- package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
- package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.constants.mjs +3 -0
- package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +156 -0
- package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.types.mjs +2 -0
- package/esm2020/lib/directives/observe-scroll-state/public-api.mjs +3 -0
- package/esm2020/lib/directives/public-api.mjs +4 -1
- package/esm2020/lib/directives/repeat/repeat.directive.mjs +3 -3
- package/esm2020/lib/directives/scroll-observer-ignore-target/index.mjs +2 -0
- package/esm2020/lib/directives/scroll-observer-ignore-target/public-api.mjs +2 -0
- package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +18 -0
- package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
- package/esm2020/lib/services/click-observer.service.mjs +6 -6
- package/esm2020/lib/services/content-observer.service.mjs +6 -6
- package/esm2020/lib/services/destroy.service.mjs +24 -0
- package/esm2020/lib/services/focus-visible.service.mjs +3 -3
- package/esm2020/lib/services/public-api.mjs +2 -1
- package/esm2020/lib/services/resize-observer.service.mjs +6 -6
- package/esm2020/lib/services/viewport.service.mjs +3 -3
- package/esm2020/lib/utils/index.mjs +2 -0
- package/esm2020/lib/utils/public-api.mjs +2 -1
- package/esm2020/lib/utils/scrollable.utils.mjs +5 -0
- package/fesm2015/ethlete-core.mjs +371 -52
- package/fesm2015/ethlete-core.mjs.map +1 -1
- package/fesm2020/ethlete-core.mjs +364 -52
- package/fesm2020/ethlete-core.mjs.map +1 -1
- package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.constants.d.ts +2 -0
- package/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.d.ts +21 -0
- package/lib/directives/cursor-drag-scroll/public-api.d.ts +1 -0
- package/lib/directives/observe-scroll-state/observe-scroll-state.constants.d.ts +3 -0
- package/lib/directives/observe-scroll-state/observe-scroll-state.directive.d.ts +31 -0
- package/lib/directives/observe-scroll-state/observe-scroll-state.types.d.ts +6 -0
- package/lib/directives/observe-scroll-state/public-api.d.ts +3 -0
- package/lib/directives/public-api.d.ts +3 -0
- package/lib/directives/scroll-observer-ignore-target/index.d.ts +1 -0
- package/lib/directives/scroll-observer-ignore-target/public-api.d.ts +1 -0
- package/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.d.ts +6 -0
- package/lib/services/destroy.service.d.ts +9 -0
- package/lib/services/public-api.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/public-api.d.ts +1 -0
- package/lib/utils/scrollable.utils.d.ts +1 -0
- package/package.json +2 -2
|
@@ -8,9 +8,9 @@ export class ResizeObserverFactory {
|
|
|
8
8
|
return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
12
|
-
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
11
|
+
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12
|
+
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, decorators: [{
|
|
14
14
|
type: Injectable,
|
|
15
15
|
args: [{ providedIn: 'root' }]
|
|
16
16
|
}] });
|
|
@@ -66,9 +66,9 @@ export class ResizeObserverService {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
70
|
-
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
69
|
+
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
+
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, decorators: [{
|
|
72
72
|
type: Injectable,
|
|
73
73
|
args: [{ providedIn: 'root' }]
|
|
74
74
|
}], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
|
|
@@ -136,8 +136,8 @@ export class ViewportService {
|
|
|
136
136
|
return 'xs';
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
140
|
-
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
139
|
+
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
140
|
+
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, providedIn: 'root' });
|
|
141
141
|
__decorate([
|
|
142
142
|
Memo(),
|
|
143
143
|
__metadata("design:type", Function),
|
|
@@ -154,7 +154,7 @@ __decorate([
|
|
|
154
154
|
__metadata("design:paramtypes", [Object]),
|
|
155
155
|
__metadata("design:returntype", void 0)
|
|
156
156
|
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, decorators: [{
|
|
158
158
|
type: Injectable,
|
|
159
159
|
args: [{
|
|
160
160
|
providedIn: 'root',
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from './public-api';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3JjL2xpYi91dGlscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './viewport.util';
|
|
2
2
|
export * from './clamp.util';
|
|
3
|
-
|
|
3
|
+
export * from './scrollable.utils';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvbGliL3V0aWxzL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLG9CQUFvQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi92aWV3cG9ydC51dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vY2xhbXAudXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL3Njcm9sbGFibGUudXRpbHMnO1xuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const elementCanScroll = (element) => {
|
|
2
|
+
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
3
|
+
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Nyb2xsYWJsZS51dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvbGliL3V0aWxzL3Njcm9sbGFibGUudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsQ0FBQyxPQUFvQixFQUFFLEVBQUU7SUFDdkQsTUFBTSxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsV0FBVyxFQUFFLFdBQVcsRUFBRSxHQUFHLE9BQU8sQ0FBQztJQUV6RSxPQUFPLFlBQVksR0FBRyxZQUFZLElBQUksV0FBVyxHQUFHLFdBQVcsQ0FBQztBQUNsRSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZWxlbWVudENhblNjcm9sbCA9IChlbGVtZW50OiBIVE1MRWxlbWVudCkgPT4ge1xuICBjb25zdCB7IHNjcm9sbEhlaWdodCwgY2xpZW50SGVpZ2h0LCBzY3JvbGxXaWR0aCwgY2xpZW50V2lkdGggfSA9IGVsZW1lbnQ7XG5cbiAgcmV0dXJuIHNjcm9sbEhlaWdodCA+IGNsaWVudEhlaWdodCB8fCBzY3JvbGxXaWR0aCA+IGNsaWVudFdpZHRoO1xufTtcbiJdfQ==
|
|
@@ -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';
|
|
@@ -84,9 +84,9 @@ class LetDirective {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
88
|
-
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
87
|
+
LetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: LetDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
88
|
+
LetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: LetDirective, isStandalone: true, selector: "[etLet]", inputs: { etLet: "etLet" }, ngImport: i0 });
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: LetDirective, decorators: [{
|
|
90
90
|
type: Directive,
|
|
91
91
|
args: [{
|
|
92
92
|
selector: '[etLet]',
|
|
@@ -117,9 +117,9 @@ class RepeatDirective {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
121
|
-
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
120
|
+
RepeatDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: RepeatDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
121
|
+
RepeatDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: RepeatDirective, isStandalone: true, selector: "[etRepeat]", inputs: { repeatCount: ["etRepeat", "repeatCount"] }, ngImport: i0 });
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: RepeatDirective, decorators: [{
|
|
123
123
|
type: Directive,
|
|
124
124
|
args: [{
|
|
125
125
|
selector: '[etRepeat]',
|
|
@@ -260,8 +260,8 @@ class ViewportService {
|
|
|
260
260
|
return 'xs';
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
264
|
-
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
263
|
+
ViewportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, deps: [{ token: VIEWPORT_CONFIG, optional: true }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
264
|
+
ViewportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, providedIn: 'root' });
|
|
265
265
|
__decorate([
|
|
266
266
|
Memo(),
|
|
267
267
|
__metadata("design:type", Function),
|
|
@@ -279,7 +279,7 @@ __decorate([
|
|
|
279
279
|
__metadata("design:paramtypes", [Object]),
|
|
280
280
|
__metadata("design:returntype", void 0)
|
|
281
281
|
], ViewportService.prototype, "_buildMediaQuery", null);
|
|
282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ViewportService, decorators: [{
|
|
283
283
|
type: Injectable,
|
|
284
284
|
args: [{
|
|
285
285
|
providedIn: 'root',
|
|
@@ -315,9 +315,9 @@ class FocusVisibleService {
|
|
|
315
315
|
this._hadKeyboardEvent = false;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
319
|
-
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
320
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
318
|
+
FocusVisibleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FocusVisibleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
319
|
+
FocusVisibleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FocusVisibleService, providedIn: 'root' });
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FocusVisibleService, decorators: [{
|
|
321
321
|
type: Injectable,
|
|
322
322
|
args: [{
|
|
323
323
|
providedIn: 'root',
|
|
@@ -330,9 +330,9 @@ class ResizeObserverFactory {
|
|
|
330
330
|
return typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(callback);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
334
|
-
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
335
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
333
|
+
ResizeObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
+
ResizeObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, providedIn: 'root' });
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverFactory, decorators: [{
|
|
336
336
|
type: Injectable,
|
|
337
337
|
args: [{ providedIn: 'root' }]
|
|
338
338
|
}] });
|
|
@@ -388,9 +388,9 @@ class ResizeObserverService {
|
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
392
|
-
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
391
|
+
ResizeObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, deps: [{ token: ResizeObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
392
|
+
ResizeObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, providedIn: 'root' });
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ResizeObserverService, decorators: [{
|
|
394
394
|
type: Injectable,
|
|
395
395
|
args: [{ providedIn: 'root' }]
|
|
396
396
|
}], ctorParameters: function () { return [{ type: ResizeObserverFactory }]; } });
|
|
@@ -401,9 +401,9 @@ class MutationObserverFactory {
|
|
|
401
401
|
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
405
|
-
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
404
|
+
MutationObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
405
|
+
MutationObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
407
407
|
type: Injectable,
|
|
408
408
|
args: [{ providedIn: 'root' }]
|
|
409
409
|
}] });
|
|
@@ -463,9 +463,9 @@ class ContentObserverService {
|
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
467
|
-
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
468
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
466
|
+
ContentObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ContentObserverService, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
467
|
+
ContentObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ContentObserverService, providedIn: 'root' });
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ContentObserverService, decorators: [{
|
|
469
469
|
type: Injectable,
|
|
470
470
|
args: [{ providedIn: 'root' }]
|
|
471
471
|
}], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
|
|
@@ -476,9 +476,9 @@ class ClickObserverFactory {
|
|
|
476
476
|
return fromEvent(document, 'click');
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
480
|
-
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
479
|
+
ClickObserverFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
480
|
+
ClickObserverFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverFactory, providedIn: 'root' });
|
|
481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverFactory, decorators: [{
|
|
482
482
|
type: Injectable,
|
|
483
483
|
args: [{ providedIn: 'root' }]
|
|
484
484
|
}] });
|
|
@@ -532,13 +532,34 @@ class ClickObserverService {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
536
|
-
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.
|
|
537
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
535
|
+
ClickObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverService, deps: [{ token: ClickObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
536
|
+
ClickObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverService, providedIn: 'root' });
|
|
537
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickObserverService, decorators: [{
|
|
538
538
|
type: Injectable,
|
|
539
539
|
args: [{ providedIn: 'root' }]
|
|
540
540
|
}], ctorParameters: function () { return [{ type: ClickObserverFactory }]; } });
|
|
541
541
|
|
|
542
|
+
class DestroyService {
|
|
543
|
+
constructor() {
|
|
544
|
+
this._destroy$ = new Subject();
|
|
545
|
+
}
|
|
546
|
+
get destroy$() {
|
|
547
|
+
return this._destroy$.asObservable();
|
|
548
|
+
}
|
|
549
|
+
ngOnDestroy() {
|
|
550
|
+
this._destroy$.next(true);
|
|
551
|
+
this._destroy$.unsubscribe();
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
DestroyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DestroyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
555
|
+
DestroyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DestroyService, providedIn: 'any' });
|
|
556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: DestroyService, decorators: [{
|
|
557
|
+
type: Injectable,
|
|
558
|
+
args: [{
|
|
559
|
+
providedIn: 'any',
|
|
560
|
+
}]
|
|
561
|
+
}] });
|
|
562
|
+
|
|
542
563
|
class ObserveResizeDirective {
|
|
543
564
|
constructor() {
|
|
544
565
|
this._resizeObserver = inject(ResizeObserverService);
|
|
@@ -583,9 +604,9 @@ class ObserveResizeDirective {
|
|
|
583
604
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
584
605
|
}
|
|
585
606
|
}
|
|
586
|
-
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
587
|
-
ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
588
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
607
|
+
ObserveResizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
608
|
+
ObserveResizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ObserveResizeDirective, isStandalone: true, selector: "[etObserveResize]", inputs: { disabled: ["etObserveResizeDisabled", "disabled"], debounce: ["etObserveResizeDebounce", "debounce"] }, outputs: { event: "etObserveResize" }, exportAs: ["etObserveResize"], ngImport: i0 });
|
|
609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveResizeDirective, decorators: [{
|
|
589
610
|
type: Directive,
|
|
590
611
|
args: [{
|
|
591
612
|
selector: '[etObserveResize]',
|
|
@@ -647,9 +668,9 @@ class ObserveContentDirective {
|
|
|
647
668
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
648
669
|
}
|
|
649
670
|
}
|
|
650
|
-
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
651
|
-
ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
671
|
+
ObserveContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
672
|
+
ObserveContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ObserveContentDirective, isStandalone: true, selector: "[etObserveContent]", inputs: { disabled: ["etObserveContentDisabled", "disabled"], debounce: ["etObserveContentDebounce", "debounce"] }, outputs: { event: "etObserveContent" }, exportAs: ["etObserveContent"], ngImport: i0 });
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveContentDirective, decorators: [{
|
|
653
674
|
type: Directive,
|
|
654
675
|
args: [{
|
|
655
676
|
selector: '[etObserveContent]',
|
|
@@ -690,9 +711,9 @@ class ClickOutsideDirective {
|
|
|
690
711
|
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
691
712
|
}
|
|
692
713
|
}
|
|
693
|
-
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
694
|
-
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
695
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
714
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickOutsideDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
715
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ClickOutsideDirective, isStandalone: true, selector: "[etClickOutside]", outputs: { etClickOutside: "etClickOutside" }, ngImport: i0 });
|
|
716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
696
717
|
type: Directive,
|
|
697
718
|
args: [{
|
|
698
719
|
selector: '[etClickOutside]',
|
|
@@ -702,6 +723,312 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
|
|
|
702
723
|
type: Output
|
|
703
724
|
}] } });
|
|
704
725
|
|
|
726
|
+
const OBSERVE_SCROLL_STATE = new InjectionToken('OBSERVE_SCROLL_STATE');
|
|
727
|
+
|
|
728
|
+
const SCROLL_OBSERVER_IGNORE_TARGET_CLASS = 'et-scroll-observer-ignore-target';
|
|
729
|
+
class ScrollObserverIgnoreTargetDirective {
|
|
730
|
+
}
|
|
731
|
+
ScrollObserverIgnoreTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
732
|
+
ScrollObserverIgnoreTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ScrollObserverIgnoreTargetDirective, isStandalone: true, selector: "[etScrollObserverIgnoreTarget]", host: { classAttribute: "et-scroll-observer-ignore-target" }, ngImport: i0 });
|
|
733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ScrollObserverIgnoreTargetDirective, decorators: [{
|
|
734
|
+
type: Directive,
|
|
735
|
+
args: [{
|
|
736
|
+
selector: '[etScrollObserverIgnoreTarget]',
|
|
737
|
+
standalone: true,
|
|
738
|
+
host: {
|
|
739
|
+
class: SCROLL_OBSERVER_IGNORE_TARGET_CLASS,
|
|
740
|
+
},
|
|
741
|
+
}]
|
|
742
|
+
}] });
|
|
743
|
+
|
|
744
|
+
const provideViewportConfig = (viewportConfig) => {
|
|
745
|
+
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const clamp = (value, min = 0, max = 100) => {
|
|
749
|
+
return Math.max(min, Math.min(max, value));
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
const elementCanScroll = (element) => {
|
|
753
|
+
const { scrollHeight, clientHeight, scrollWidth, clientWidth } = element;
|
|
754
|
+
return scrollHeight > clientHeight || scrollWidth > clientWidth;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
class ObserveScrollStateDirective {
|
|
758
|
+
constructor() {
|
|
759
|
+
this._destroy$ = inject(DestroyService).destroy$;
|
|
760
|
+
this._elementRef = inject(ElementRef);
|
|
761
|
+
this._contentObserverService = inject(ContentObserverService);
|
|
762
|
+
this._resizeObserverService = inject(ResizeObserverService);
|
|
763
|
+
this._observedChildren = {
|
|
764
|
+
first: this._firstCurrentChild,
|
|
765
|
+
last: this._lastCurrentChild,
|
|
766
|
+
};
|
|
767
|
+
this._rootMargin = 0;
|
|
768
|
+
this._threshold = 1;
|
|
769
|
+
this._intersectionObserver = null;
|
|
770
|
+
this.etObserveScrollState = new EventEmitter();
|
|
771
|
+
}
|
|
772
|
+
get _firstCurrentChild() {
|
|
773
|
+
const element = this._elementRef.nativeElement.querySelector(`:first-child`);
|
|
774
|
+
return this._getNonIgnoredChild(element, 'next');
|
|
775
|
+
}
|
|
776
|
+
get _lastCurrentChild() {
|
|
777
|
+
const element = this._elementRef.nativeElement.querySelector(`:last-child`);
|
|
778
|
+
return this._getNonIgnoredChild(element, 'previous');
|
|
779
|
+
}
|
|
780
|
+
get observerRootMargin() {
|
|
781
|
+
return this._rootMargin;
|
|
782
|
+
}
|
|
783
|
+
set observerRootMargin(value) {
|
|
784
|
+
this._rootMargin = coerceNumberProperty(value);
|
|
785
|
+
}
|
|
786
|
+
get observerThreshold() {
|
|
787
|
+
return this._threshold;
|
|
788
|
+
}
|
|
789
|
+
set observerThreshold(value) {
|
|
790
|
+
this._threshold = coerceNumberProperty(value);
|
|
791
|
+
}
|
|
792
|
+
ngOnInit() {
|
|
793
|
+
this._contentObserverService
|
|
794
|
+
.observe(this._elementRef.nativeElement)
|
|
795
|
+
.pipe(tap(() => this._checkChildren()), takeUntil(this._destroy$))
|
|
796
|
+
.subscribe();
|
|
797
|
+
this._resizeObserverService
|
|
798
|
+
.observe(this._elementRef.nativeElement)
|
|
799
|
+
.pipe(debounceTime(25), tap(() => {
|
|
800
|
+
if (!this._intersectionObserver && elementCanScroll(this._elementRef.nativeElement)) {
|
|
801
|
+
this._checkChildren();
|
|
802
|
+
}
|
|
803
|
+
}), takeUntil(this._destroy$))
|
|
804
|
+
.subscribe();
|
|
805
|
+
this._checkChildren();
|
|
806
|
+
}
|
|
807
|
+
ngOnDestroy() {
|
|
808
|
+
this._clearIntersectionObserver();
|
|
809
|
+
}
|
|
810
|
+
_checkChildren() {
|
|
811
|
+
this._clearIntersectionObserver();
|
|
812
|
+
if (this._firstCurrentChild === this._lastCurrentChild ||
|
|
813
|
+
!this._firstCurrentChild ||
|
|
814
|
+
!this._lastCurrentChild ||
|
|
815
|
+
!elementCanScroll(this._elementRef.nativeElement)) {
|
|
816
|
+
this._unobserveChild('first');
|
|
817
|
+
this._unobserveChild('last');
|
|
818
|
+
this.etObserveScrollState.emit({
|
|
819
|
+
isAtStart: true,
|
|
820
|
+
isAtEnd: true,
|
|
821
|
+
canScroll: false,
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
this._intersectionObserver = this._initiateIntersectionObserver();
|
|
826
|
+
this._observeChild('first', this._firstCurrentChild);
|
|
827
|
+
this._observeChild('last', this._lastCurrentChild);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
_initiateIntersectionObserver() {
|
|
831
|
+
const observer = new IntersectionObserver((entries) => {
|
|
832
|
+
var _a, _b, _c, _d;
|
|
833
|
+
const { first, last } = this._observedChildren;
|
|
834
|
+
const isAtStart = (_b = (_a = entries.find((entry) => entry.target === first)) === null || _a === void 0 ? void 0 : _a.isIntersecting) !== null && _b !== void 0 ? _b : false;
|
|
835
|
+
const isAtEnd = (_d = (_c = entries.find((entry) => entry.target === last)) === null || _c === void 0 ? void 0 : _c.isIntersecting) !== null && _d !== void 0 ? _d : false;
|
|
836
|
+
this.etObserveScrollState.emit({
|
|
837
|
+
isAtStart,
|
|
838
|
+
isAtEnd,
|
|
839
|
+
canScroll: !isAtStart || !isAtEnd,
|
|
840
|
+
});
|
|
841
|
+
}, {
|
|
842
|
+
root: this._elementRef.nativeElement,
|
|
843
|
+
rootMargin: `${this._rootMargin}px`,
|
|
844
|
+
threshold: this._threshold,
|
|
845
|
+
});
|
|
846
|
+
return observer;
|
|
847
|
+
}
|
|
848
|
+
_observeChild(child, element) {
|
|
849
|
+
var _a;
|
|
850
|
+
(_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.observe(element);
|
|
851
|
+
this._observedChildren[child] = element;
|
|
852
|
+
}
|
|
853
|
+
_unobserveChild(child) {
|
|
854
|
+
var _a;
|
|
855
|
+
const observedChild = this._observedChildren[child];
|
|
856
|
+
if (!observedChild) {
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
(_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(observedChild);
|
|
860
|
+
this._observedChildren[child] = null;
|
|
861
|
+
}
|
|
862
|
+
_clearIntersectionObserver() {
|
|
863
|
+
var _a;
|
|
864
|
+
(_a = this._intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
865
|
+
this._intersectionObserver = null;
|
|
866
|
+
}
|
|
867
|
+
_getNonIgnoredChild(element, direction) {
|
|
868
|
+
if (!element) {
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
if (element === null || element === void 0 ? void 0 : element.classList.contains(SCROLL_OBSERVER_IGNORE_TARGET_CLASS)) {
|
|
872
|
+
const nextElement = element[`${direction}ElementSibling`];
|
|
873
|
+
if (!nextElement) {
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
876
|
+
return this._getNonIgnoredChild(nextElement, direction);
|
|
877
|
+
}
|
|
878
|
+
return element;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
ObserveScrollStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveScrollStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
882
|
+
ObserveScrollStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: ObserveScrollStateDirective, isStandalone: true, selector: "[etObserveScrollState]", inputs: { observerRootMargin: "observerRootMargin", observerThreshold: "observerThreshold" }, outputs: { etObserveScrollState: "etObserveScrollState" }, providers: [
|
|
883
|
+
{
|
|
884
|
+
provide: OBSERVE_SCROLL_STATE,
|
|
885
|
+
useExisting: ObserveScrollStateDirective,
|
|
886
|
+
},
|
|
887
|
+
], exportAs: ["etObserveScrollState"], ngImport: i0 });
|
|
888
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ObserveScrollStateDirective, decorators: [{
|
|
889
|
+
type: Directive,
|
|
890
|
+
args: [{
|
|
891
|
+
selector: '[etObserveScrollState]',
|
|
892
|
+
exportAs: 'etObserveScrollState',
|
|
893
|
+
standalone: true,
|
|
894
|
+
providers: [
|
|
895
|
+
{
|
|
896
|
+
provide: OBSERVE_SCROLL_STATE,
|
|
897
|
+
useExisting: ObserveScrollStateDirective,
|
|
898
|
+
},
|
|
899
|
+
],
|
|
900
|
+
}]
|
|
901
|
+
}], propDecorators: { observerRootMargin: [{
|
|
902
|
+
type: Input
|
|
903
|
+
}], observerThreshold: [{
|
|
904
|
+
type: Input
|
|
905
|
+
}], etObserveScrollState: [{
|
|
906
|
+
type: Output
|
|
907
|
+
}] } });
|
|
908
|
+
|
|
909
|
+
const CURSOR_DRAG_SCROLLING_CLASS = 'et-cursor-drag-scroll--scrolling';
|
|
910
|
+
const CURSOR_DRAG_SCROLLING_PREPARED_CLASS = 'et-cursor-drag-scroll--prepared';
|
|
911
|
+
|
|
912
|
+
class CursorDragScrollDirective {
|
|
913
|
+
constructor() {
|
|
914
|
+
this._destroy$ = inject(DestroyService).destroy$;
|
|
915
|
+
this._elementRef = inject(ElementRef);
|
|
916
|
+
this._contentObserverService = inject(ContentObserverService);
|
|
917
|
+
this._resizeObserverService = inject(ResizeObserverService);
|
|
918
|
+
this._bufferUntilScroll = 5;
|
|
919
|
+
this._mouseUp$ = new Subject();
|
|
920
|
+
this._isScrolling = false;
|
|
921
|
+
this._canScroll = false;
|
|
922
|
+
this._currentScrollState = {
|
|
923
|
+
top: 0,
|
|
924
|
+
left: 0,
|
|
925
|
+
x: 0,
|
|
926
|
+
y: 0,
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
ngAfterViewInit() {
|
|
930
|
+
combineLatest([
|
|
931
|
+
this._contentObserverService.observe(this._elementRef.nativeElement),
|
|
932
|
+
this._resizeObserverService.observe(this._elementRef.nativeElement),
|
|
933
|
+
])
|
|
934
|
+
.pipe(tap(() => this._updateCanScrollState()), takeUntil(this._destroy$))
|
|
935
|
+
.subscribe();
|
|
936
|
+
fromEvent(this._elementRef.nativeElement, 'mousedown')
|
|
937
|
+
.pipe(tap((e) => this._onMouseDown(e)), takeUntil(this._destroy$))
|
|
938
|
+
.subscribe();
|
|
939
|
+
this._updateCanScrollState();
|
|
940
|
+
}
|
|
941
|
+
_onMouseDown(e) {
|
|
942
|
+
var _a;
|
|
943
|
+
if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) || !this._canScroll) {
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
const element = this._elementRef.nativeElement;
|
|
947
|
+
element.classList.add(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
|
|
948
|
+
this._elementRef.nativeElement.style.scrollSnapType = 'none';
|
|
949
|
+
this._elementRef.nativeElement.style.scrollBehavior = 'unset';
|
|
950
|
+
this._currentScrollState = {
|
|
951
|
+
left: this._elementRef.nativeElement.scrollLeft,
|
|
952
|
+
top: this._elementRef.nativeElement.scrollTop,
|
|
953
|
+
x: e.clientX,
|
|
954
|
+
y: e.clientY,
|
|
955
|
+
};
|
|
956
|
+
fromEvent(document, 'mousemove')
|
|
957
|
+
.pipe(tap((e) => this._mouseMoveHandler(e)), takeUntil(this._mouseUp$), takeUntil(this._destroy$))
|
|
958
|
+
.subscribe();
|
|
959
|
+
fromEvent(document, 'mouseup')
|
|
960
|
+
.pipe(tap(() => this._mouseUpHandler()), take(1), takeUntil(this._destroy$))
|
|
961
|
+
.subscribe();
|
|
962
|
+
}
|
|
963
|
+
_mouseMoveHandler(e) {
|
|
964
|
+
var _a;
|
|
965
|
+
e.preventDefault();
|
|
966
|
+
if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const dx = e.clientX - this._currentScrollState.x;
|
|
970
|
+
const dy = e.clientY - this._currentScrollState.y;
|
|
971
|
+
if (Math.abs(dx) > this._bufferUntilScroll || Math.abs(dy) > this._bufferUntilScroll) {
|
|
972
|
+
const element = this._elementRef.nativeElement;
|
|
973
|
+
if (!this._isScrolling) {
|
|
974
|
+
this._isScrolling = true;
|
|
975
|
+
element.style.cursor = 'grabbing';
|
|
976
|
+
element.classList.add(CURSOR_DRAG_SCROLLING_CLASS);
|
|
977
|
+
element.scroll({
|
|
978
|
+
top: this._currentScrollState.top - dy,
|
|
979
|
+
left: this._currentScrollState.left - dx,
|
|
980
|
+
behavior: 'smooth',
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
element.scrollTop = this._currentScrollState.top - dy;
|
|
985
|
+
element.scrollLeft = this._currentScrollState.left - dx;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
_mouseUpHandler() {
|
|
990
|
+
var _a;
|
|
991
|
+
this._mouseUp$.next(true);
|
|
992
|
+
this._isScrolling = false;
|
|
993
|
+
if (!((_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
this._elementRef.nativeElement.style.scrollSnapType = '';
|
|
997
|
+
this._elementRef.nativeElement.style.scrollBehavior = '';
|
|
998
|
+
this._elementRef.nativeElement.style.cursor = 'grab';
|
|
999
|
+
this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_CLASS);
|
|
1000
|
+
this._elementRef.nativeElement.classList.remove(CURSOR_DRAG_SCROLLING_PREPARED_CLASS);
|
|
1001
|
+
}
|
|
1002
|
+
_updateCanScrollState() {
|
|
1003
|
+
this._canScroll = elementCanScroll(this._elementRef.nativeElement);
|
|
1004
|
+
if (this._canScroll) {
|
|
1005
|
+
this._elementRef.nativeElement.style.cursor = 'grab';
|
|
1006
|
+
}
|
|
1007
|
+
else {
|
|
1008
|
+
this._elementRef.nativeElement.style.cursor = 'default';
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
_checkCanScroll() {
|
|
1012
|
+
if (this._elementRef.nativeElement.scrollWidth > this._elementRef.nativeElement.clientWidth) {
|
|
1013
|
+
return true;
|
|
1014
|
+
}
|
|
1015
|
+
if (this._elementRef.nativeElement.scrollHeight > this._elementRef.nativeElement.clientHeight) {
|
|
1016
|
+
return true;
|
|
1017
|
+
}
|
|
1018
|
+
return false;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
CursorDragScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CursorDragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1022
|
+
CursorDragScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.8", type: CursorDragScrollDirective, isStandalone: true, selector: "[etCursorDragScroll]", exportAs: ["etCursorDragScroll"], ngImport: i0 });
|
|
1023
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: CursorDragScrollDirective, decorators: [{
|
|
1024
|
+
type: Directive,
|
|
1025
|
+
args: [{
|
|
1026
|
+
selector: '[etCursorDragScroll]',
|
|
1027
|
+
exportAs: 'etCursorDragScroll',
|
|
1028
|
+
standalone: true,
|
|
1029
|
+
}]
|
|
1030
|
+
}] });
|
|
1031
|
+
|
|
705
1032
|
const toArray = (value) => {
|
|
706
1033
|
return Array.from({ length: value }, (_, i) => i);
|
|
707
1034
|
};
|
|
@@ -712,24 +1039,16 @@ class ToArrayPipe {
|
|
|
712
1039
|
this.transform = toArray;
|
|
713
1040
|
}
|
|
714
1041
|
}
|
|
715
|
-
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
716
|
-
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.
|
|
717
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
1042
|
+
ToArrayPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ToArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1043
|
+
ToArrayPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: ToArrayPipe, isStandalone: true, name: "toArray" });
|
|
1044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: ToArrayPipe, decorators: [{
|
|
718
1045
|
type: Pipe,
|
|
719
1046
|
args: [{ name: 'toArray', standalone: true }]
|
|
720
1047
|
}] });
|
|
721
1048
|
|
|
722
|
-
const provideViewportConfig = (viewportConfig) => {
|
|
723
|
-
return { provide: VIEWPORT_CONFIG, useValue: viewportConfig };
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
const clamp = (value, min = 0, max = 100) => {
|
|
727
|
-
return Math.max(min, Math.min(max, value));
|
|
728
|
-
};
|
|
729
|
-
|
|
730
1049
|
/**
|
|
731
1050
|
* Generated bundle index. Do not edit.
|
|
732
1051
|
*/
|
|
733
1052
|
|
|
734
|
-
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 };
|
|
1053
|
+
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 };
|
|
735
1054
|
//# sourceMappingURL=ethlete-core.mjs.map
|