@osumi/angular-tools 1.1.1 → 1.1.3

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, signal, Component, ViewEncapsulation, Renderer2, ElementRef, NgZone, output, Directive, Injectable, Injector } from '@angular/core';
2
+ import { inject, signal, Component, ViewEncapsulation, Renderer2, ElementRef, output, Directive, Injectable, Injector } from '@angular/core';
3
3
  import { MatButton, MatIconButton } from '@angular/material/button';
4
4
  import { MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
5
5
  import { NgClass, NgComponentOutlet } from '@angular/common';
@@ -8,8 +8,7 @@ import { FormsModule } from '@angular/forms';
8
8
  import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
9
9
  import { MatInput } from '@angular/material/input';
10
10
  import { MatIcon } from '@angular/material/icon';
11
- import { Subject, fromEvent, race } from 'rxjs';
12
- import { map, switchMap, elementAt, tap, takeUntil } from 'rxjs/operators';
11
+ import { Subject } from 'rxjs';
13
12
  import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
14
13
  import { ComponentPortal } from '@angular/cdk/portal';
15
14
 
@@ -133,92 +132,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
133
132
  args: [{ selector: 'oat-overlay', imports: [MatIcon, MatIconButton, NgComponentOutlet], template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\r\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>", styles: [":host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal{border-radius:6px;box-shadow:4px 4px 5px 0 var(--modals-bg-color)}.modal__header{border-top-left-radius:6px;border-top-right-radius:6px;display:flex;justify-content:space-between;align-items:center;padding:0 20px;height:48px;font-size:24px;background-color:var(--modals-main-color);color:#fff}.modal__header .btn-close{cursor:pointer}.modal__header--blue{background-color:var(--modals-color-blue)}.modal__header--yellow{background-color:var(--modals-color-yellow);color:var(--modals-color-black)}.modal__header--yellow>.btn-close{color:var(--modals-color-black)}.modal__header--red{background-color:var(--modals-color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--modals-color-white);border-bottom-right-radius:6px;height:calc(100% - 48px);overflow-y:auto;box-sizing:border-box}\n"] }]
134
133
  }] });
135
134
 
136
- var SwipeDirection;
137
- (function (SwipeDirection) {
138
- SwipeDirection["X"] = "x";
139
- SwipeDirection["Y"] = "y";
140
- })(SwipeDirection || (SwipeDirection = {}));
141
-
142
- function createSwipeSubscription({ domElement, onSwipeMove, onSwipeEnd, }) {
143
- if (!(domElement instanceof HTMLElement)) {
144
- throw new Error('Provided domElement should be an instance of HTMLElement');
145
- }
146
- if (typeof onSwipeMove !== 'function' && typeof onSwipeEnd !== 'function') {
147
- throw new Error('At least one of the following swipe event handler functions should be provided: onSwipeMove and/or onSwipeEnd');
148
- }
149
- const touchStarts$ = fromEvent(domElement, 'touchstart').pipe(map(getTouchCoordinates));
150
- const touchMoves$ = fromEvent(domElement, 'touchmove').pipe(map(getTouchCoordinates));
151
- const touchEnds$ = fromEvent(domElement, 'touchend').pipe(map(getTouchCoordinates));
152
- const touchCancels$ = fromEvent(domElement, 'touchcancel');
153
- const touchStartsWithDirection$ = touchStarts$.pipe(switchMap((touchStartEvent) => touchMoves$.pipe(elementAt(3), map((touchMoveEvent) => ({
154
- x: touchStartEvent.x,
155
- y: touchStartEvent.y,
156
- direction: getTouchDirection(touchStartEvent, touchMoveEvent),
157
- })))));
158
- return touchStartsWithDirection$
159
- .pipe(switchMap((touchStartEvent) => touchMoves$.pipe(map((touchMoveEvent) => getTouchDistance(touchStartEvent, touchMoveEvent)), tap((coordinates) => {
160
- if (typeof onSwipeMove !== 'function') {
161
- return;
162
- }
163
- onSwipeMove(getSwipeEvent(touchStartEvent, coordinates));
164
- }), takeUntil(race(touchEnds$.pipe(map((touchEndEvent) => getTouchDistance(touchStartEvent, touchEndEvent)), tap((coordinates) => {
165
- if (typeof onSwipeEnd !== 'function') {
166
- return;
167
- }
168
- onSwipeEnd(getSwipeEvent(touchStartEvent, coordinates));
169
- })), touchCancels$)))))
170
- .subscribe();
171
- }
172
- function getTouchCoordinates(touchEvent) {
173
- return {
174
- x: touchEvent.changedTouches[0].clientX,
175
- y: touchEvent.changedTouches[0].clientY,
176
- };
177
- }
178
- function getTouchDistance(startCoordinates, moveCoordinates) {
179
- return {
180
- x: moveCoordinates.x - startCoordinates.x,
181
- y: moveCoordinates.y - startCoordinates.y,
182
- };
183
- }
184
- function getTouchDirection(startCoordinates, moveCoordinates) {
185
- const { x, y } = getTouchDistance(startCoordinates, moveCoordinates);
186
- return Math.abs(x) < Math.abs(y) ? SwipeDirection.Y : SwipeDirection.X;
187
- }
188
- function getSwipeEvent(touchStartEvent, coordinates) {
189
- return {
190
- direction: touchStartEvent.direction,
191
- distance: coordinates[touchStartEvent.direction],
192
- };
193
- }
194
-
195
135
  class SwipeDirective {
196
- elementRef = inject(ElementRef);
197
- zone = inject(NgZone);
198
- swipeSubscription;
199
- swipeMove = output();
136
+ el = inject(ElementRef);
137
+ renderer = inject(Renderer2);
200
138
  swipeEnd = output();
201
- ngOnInit() {
202
- this.zone.runOutsideAngular(() => {
203
- this.swipeSubscription = createSwipeSubscription({
204
- domElement: this.elementRef.nativeElement,
205
- onSwipeMove: (swipeMoveEvent) => this.swipeMove.emit(swipeMoveEvent),
206
- onSwipeEnd: (swipeEndEvent) => this.swipeEnd.emit(swipeEndEvent),
207
- });
208
- });
139
+ startX = 0;
140
+ startY = 0;
141
+ touchStartListener;
142
+ touchEndListener;
143
+ mouseDownListener;
144
+ mouseUpListener;
145
+ constructor() {
146
+ this.touchStartListener = this.renderer.listen(this.el.nativeElement, 'touchstart', (event) => this.onTouchStart(event));
147
+ this.touchEndListener = this.renderer.listen(this.el.nativeElement, 'touchend', (event) => this.onTouchEnd(event));
148
+ this.mouseDownListener = this.renderer.listen(this.el.nativeElement, 'mousedown', (event) => this.onMouseDown(event));
149
+ this.mouseUpListener = this.renderer.listen(this.el.nativeElement, 'mouseup', (event) => this.onMouseUp(event));
150
+ }
151
+ onTouchStart(event) {
152
+ this.startX = event.touches[0].clientX;
153
+ this.startY = event.touches[0].clientY;
154
+ }
155
+ onTouchEnd(event) {
156
+ const endX = event.changedTouches[0].clientX;
157
+ const endY = event.changedTouches[0].clientY;
158
+ const deltaX = endX - this.startX;
159
+ const deltaY = endY - this.startY;
160
+ this.swipeEnd.emit({ x: deltaX, y: deltaY });
161
+ }
162
+ onMouseDown(event) {
163
+ this.startX = event.clientX;
164
+ this.startY = event.clientY;
165
+ }
166
+ onMouseUp(event) {
167
+ const endX = event.clientX;
168
+ const endY = event.clientY;
169
+ const deltaX = endX - this.startX;
170
+ const deltaY = endY - this.startY;
171
+ this.swipeEnd.emit({ x: deltaX, y: deltaY });
209
172
  }
210
173
  ngOnDestroy() {
211
- this.swipeSubscription?.unsubscribe?.();
174
+ this.touchStartListener();
175
+ this.touchEndListener();
176
+ this.mouseDownListener();
177
+ this.mouseUpListener();
212
178
  }
213
179
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: SwipeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
214
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: SwipeDirective, isStandalone: true, selector: "[oatSwipe]", outputs: { swipeMove: "swipeMove", swipeEnd: "swipeEnd" }, ngImport: i0 });
180
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: SwipeDirective, isStandalone: true, selector: "[oatSwipe]", outputs: { swipeEnd: "swipeEnd" }, host: { listeners: { "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd($event)", "mousedown": "onMouseDown($event)", "mouseup": "onMouseUp($event)" } }, ngImport: i0 });
215
181
  }
216
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: SwipeDirective, decorators: [{
217
183
  type: Directive,
218
184
  args: [{
219
185
  selector: '[oatSwipe]',
186
+ standalone: true,
187
+ host: {
188
+ '(touchstart)': 'onTouchStart($event)',
189
+ '(touchend)': 'onTouchEnd($event)',
190
+ '(mousedown)': 'onMouseDown($event)',
191
+ '(mouseup)': 'onMouseUp($event)',
192
+ },
220
193
  }]
221
- }] });
194
+ }], ctorParameters: () => [] });
222
195
 
223
196
  class DialogService {
224
197
  dialog = inject(MatDialog);
@@ -309,5 +282,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
309
282
  * Generated bundle index. Do not edit.
310
283
  */
311
284
 
312
- export { AlertDialogComponent, ConfirmDialogComponent, CustomOverlayRef, DialogService, FormDialogComponent, OverlayComponent, OverlayService, SwipeDirection, SwipeDirective, createSwipeSubscription };
285
+ export { AlertDialogComponent, ConfirmDialogComponent, CustomOverlayRef, DialogService, FormDialogComponent, OverlayComponent, OverlayService, SwipeDirective };
313
286
  //# sourceMappingURL=osumi-angular-tools.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"osumi-angular-tools.mjs","sources":["../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/model/custom-overlay-ref.model.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.html","../../../projects/osumi-angular-tools/src/lib/interfaces/swipe.interface.ts","../../../projects/osumi-angular-tools/src/lib/swipe-core/swipe-core.ts","../../../projects/osumi-angular-tools/src/lib/directives/swipe.directive.ts","../../../projects/osumi-angular-tools/src/lib/services/dialog.service.ts","../../../projects/osumi-angular-tools/src/lib/services/overlay.service.ts","../../../projects/osumi-angular-tools/src/public-api.ts","../../../projects/osumi-angular-tools/src/osumi-angular-tools.ts"],"sourcesContent":["import { Component, inject, signal, WritableSignal } from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n@Component({\r\n selector: 'oat-alert-dialog',\r\n templateUrl: './alert-dialog.component.html',\r\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\r\n})\r\nexport class AlertDialogComponent {\r\n public dialogRef: MatDialogRef<AlertDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import { NgClass } from '@angular/common';\r\nimport {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n@Component({\r\n selector: 'oat-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrl: './confirm-dialog.component.scss',\r\n imports: [\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatButton,\r\n NgClass,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class ConfirmDialogComponent {\r\n public dialogRef: MatDialogRef<ConfirmDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public warn: WritableSignal<boolean> = signal<boolean>(false);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\nimport { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { DialogField } from '../../../interfaces/dialogs.interface';\r\n\r\n@Component({\r\n selector: 'oat-form-dialog',\r\n templateUrl: './form-dialog.component.html',\r\n styleUrl: './form-dialog.component.scss',\r\n imports: [\r\n FormsModule,\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatFormField,\r\n MatLabel,\r\n MatInput,\r\n MatHint,\r\n MatButton,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class FormDialogComponent {\r\n public dialogRef: MatDialogRef<FormDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public fields: WritableSignal<DialogField[]> = signal<DialogField[]>([]);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t[mat-dialog-close]=\"fields\">{{ ok() }}</button>\r\n</div>","import { OverlayRef } from '@angular/cdk/overlay';\r\nimport { Type } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { OverlayCloseEvent } from '../interfaces/modals.interface';\r\n\r\n// R = Response Data Type, T = Data passed to Modal Type\r\nexport class CustomOverlayRef<R = any, T = any> {\r\n afterClosed$ = new Subject<OverlayCloseEvent<R | null>>();\r\n\r\n constructor(\r\n public overlay: OverlayRef,\r\n public content: Type<any>,\r\n public data: T,\r\n public closeOnBackdropCLick: boolean = true\r\n ) {\r\n if (closeOnBackdropCLick) {\r\n overlay.backdropClick().subscribe({\r\n next: () => {\r\n this._close('backdropClick', null);\r\n },\r\n });\r\n }\r\n }\r\n\r\n close(data?: any): void {\r\n this._close('close', data!);\r\n }\r\n\r\n private _close(type: 'backdropClick' | 'close', data: R | null): void {\r\n this.overlay.dispose();\r\n this.afterClosed$.next({\r\n type,\r\n data,\r\n });\r\n\r\n this.afterClosed$.complete();\r\n }\r\n}\r\n","import { NgComponentOutlet } from '@angular/common';\r\nimport { Component, inject, OnInit, Renderer2, Type } from '@angular/core';\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { Modal } from '../../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../../model/custom-overlay-ref.model';\r\n\r\n@Component({\r\n selector: 'oat-overlay',\r\n templateUrl: './overlay.component.html',\r\n styleUrls: ['./overlay.component.scss'],\r\n imports: [MatIcon, MatIconButton, NgComponentOutlet],\r\n})\r\nexport class OverlayComponent implements OnInit {\r\n private customOverlayRef: CustomOverlayRef<any, Modal> =\r\n inject(CustomOverlayRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n\r\n content: Type<any> = this.customOverlayRef.content;\r\n inputData: Modal = { modalTitle: '', modalColor: 'blue' };\r\n\r\n ngOnInit(): void {\r\n this.listenToEscKey();\r\n this.inputData = this.customOverlayRef.data;\r\n }\r\n\r\n private listenToEscKey(): void {\r\n this.renderer.listen('window', 'keyup', (event: KeyboardEvent): void => {\r\n if (event.key === 'Escape') {\r\n this.close();\r\n }\r\n });\r\n }\r\n\r\n close(): void {\r\n this.customOverlayRef.close(null);\r\n }\r\n}\r\n","<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\r\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>","export interface SwipeCoordinates {\r\n x: number;\r\n y: number;\r\n}\r\n\r\nexport enum SwipeDirection {\r\n X = 'x',\r\n Y = 'y',\r\n}\r\n\r\nexport interface SwipeStartEvent {\r\n x: number;\r\n y: number;\r\n direction: SwipeDirection;\r\n}\r\n\r\nexport interface SwipeEvent {\r\n direction: SwipeDirection;\r\n distance: number;\r\n}\r\n\r\nexport interface SwipeSubscriptionConfig {\r\n domElement: HTMLElement;\r\n onSwipeMove?: (event: SwipeEvent) => void;\r\n onSwipeEnd?: (event: SwipeEvent) => void;\r\n}\r\n","import { fromEvent, Observable, race, Subscription } from 'rxjs';\r\nimport { elementAt, map, switchMap, takeUntil, tap } from 'rxjs/operators';\r\nimport {\r\n SwipeCoordinates,\r\n SwipeDirection,\r\n SwipeEvent,\r\n SwipeStartEvent,\r\n SwipeSubscriptionConfig,\r\n} from '../interfaces/swipe.interface';\r\n\r\nexport function createSwipeSubscription({\r\n domElement,\r\n onSwipeMove,\r\n onSwipeEnd,\r\n}: SwipeSubscriptionConfig): Subscription {\r\n if (!(domElement instanceof HTMLElement)) {\r\n throw new Error('Provided domElement should be an instance of HTMLElement');\r\n }\r\n\r\n if (typeof onSwipeMove !== 'function' && typeof onSwipeEnd !== 'function') {\r\n throw new Error(\r\n 'At least one of the following swipe event handler functions should be provided: onSwipeMove and/or onSwipeEnd'\r\n );\r\n }\r\n\r\n const touchStarts$: Observable<SwipeCoordinates> = fromEvent<TouchEvent>(\r\n domElement,\r\n 'touchstart'\r\n ).pipe(map(getTouchCoordinates));\r\n const touchMoves$: Observable<SwipeCoordinates> = fromEvent<TouchEvent>(\r\n domElement,\r\n 'touchmove'\r\n ).pipe(map(getTouchCoordinates));\r\n const touchEnds$: Observable<SwipeCoordinates> = fromEvent<TouchEvent>(\r\n domElement,\r\n 'touchend'\r\n ).pipe(map(getTouchCoordinates));\r\n const touchCancels$: Observable<TouchEvent> = fromEvent<TouchEvent>(\r\n domElement,\r\n 'touchcancel'\r\n );\r\n\r\n const touchStartsWithDirection$: Observable<SwipeStartEvent> =\r\n touchStarts$.pipe(\r\n switchMap(\r\n (touchStartEvent: SwipeCoordinates): Observable<SwipeStartEvent> =>\r\n touchMoves$.pipe(\r\n elementAt(3),\r\n map(\r\n (touchMoveEvent: SwipeCoordinates): SwipeStartEvent => ({\r\n x: touchStartEvent.x,\r\n y: touchStartEvent.y,\r\n direction: getTouchDirection(touchStartEvent, touchMoveEvent),\r\n })\r\n )\r\n )\r\n )\r\n );\r\n\r\n return touchStartsWithDirection$\r\n .pipe(\r\n switchMap(\r\n (touchStartEvent: SwipeStartEvent): Observable<SwipeCoordinates> =>\r\n touchMoves$.pipe(\r\n map(\r\n (touchMoveEvent: SwipeCoordinates): SwipeCoordinates =>\r\n getTouchDistance(touchStartEvent, touchMoveEvent)\r\n ),\r\n tap((coordinates: SwipeCoordinates): void => {\r\n if (typeof onSwipeMove !== 'function') {\r\n return;\r\n }\r\n onSwipeMove(getSwipeEvent(touchStartEvent, coordinates));\r\n }),\r\n takeUntil(\r\n race(\r\n touchEnds$.pipe(\r\n map(\r\n (touchEndEvent: SwipeCoordinates): SwipeCoordinates =>\r\n getTouchDistance(touchStartEvent, touchEndEvent)\r\n ),\r\n tap((coordinates: SwipeCoordinates): void => {\r\n if (typeof onSwipeEnd !== 'function') {\r\n return;\r\n }\r\n onSwipeEnd(getSwipeEvent(touchStartEvent, coordinates));\r\n })\r\n ),\r\n touchCancels$\r\n )\r\n )\r\n )\r\n )\r\n )\r\n .subscribe();\r\n}\r\n\r\nfunction getTouchCoordinates(touchEvent: TouchEvent): SwipeCoordinates {\r\n return {\r\n x: touchEvent.changedTouches[0].clientX,\r\n y: touchEvent.changedTouches[0].clientY,\r\n };\r\n}\r\n\r\nfunction getTouchDistance(\r\n startCoordinates: SwipeCoordinates,\r\n moveCoordinates: SwipeCoordinates\r\n): SwipeCoordinates {\r\n return {\r\n x: moveCoordinates.x - startCoordinates.x,\r\n y: moveCoordinates.y - startCoordinates.y,\r\n };\r\n}\r\n\r\nfunction getTouchDirection(\r\n startCoordinates: SwipeCoordinates,\r\n moveCoordinates: SwipeCoordinates\r\n): SwipeDirection {\r\n const { x, y } = getTouchDistance(startCoordinates, moveCoordinates);\r\n return Math.abs(x) < Math.abs(y) ? SwipeDirection.Y : SwipeDirection.X;\r\n}\r\n\r\nfunction getSwipeEvent(\r\n touchStartEvent: SwipeStartEvent,\r\n coordinates: SwipeCoordinates\r\n): SwipeEvent {\r\n return {\r\n direction: touchStartEvent.direction,\r\n distance: coordinates[touchStartEvent.direction],\r\n };\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n inject,\r\n NgZone,\r\n OnDestroy,\r\n OnInit,\r\n output,\r\n OutputEmitterRef,\r\n} from '@angular/core';\r\nimport { Subscription } from 'rxjs';\r\nimport { SwipeEvent } from '../interfaces/swipe.interface';\r\nimport { createSwipeSubscription } from '../swipe-core/swipe-core';\r\n\r\n@Directive({\r\n selector: '[oatSwipe]',\r\n})\r\nexport class SwipeDirective implements OnInit, OnDestroy {\r\n private elementRef: ElementRef = inject(ElementRef);\r\n private zone: NgZone = inject(NgZone);\r\n private swipeSubscription: Subscription | undefined;\r\n\r\n swipeMove: OutputEmitterRef<SwipeEvent> = output<SwipeEvent>();\r\n swipeEnd: OutputEmitterRef<SwipeEvent> = output<SwipeEvent>();\r\n\r\n ngOnInit(): void {\r\n this.zone.runOutsideAngular((): void => {\r\n this.swipeSubscription = createSwipeSubscription({\r\n domElement: this.elementRef.nativeElement,\r\n onSwipeMove: (swipeMoveEvent: SwipeEvent): void =>\r\n this.swipeMove.emit(swipeMoveEvent),\r\n onSwipeEnd: (swipeEndEvent: SwipeEvent): void =>\r\n this.swipeEnd.emit(swipeEndEvent),\r\n });\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.swipeSubscription?.unsubscribe?.();\r\n }\r\n}\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { Observable } from 'rxjs';\r\nimport { AlertDialogComponent } from '../components/dialogs/alert-dialog/alert-dialog.component';\r\nimport { ConfirmDialogComponent } from '../components/dialogs/confirm-dialog/confirm-dialog.component';\r\nimport { FormDialogComponent } from '../components/dialogs/form-dialog/form-dialog.component';\r\nimport { DialogOptions } from '../interfaces/dialogs.interface';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DialogService {\r\n private dialog: MatDialog = inject(MatDialog);\r\n\r\n public confirm(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<ConfirmDialogComponent> = this.dialog.open(\r\n ConfirmDialogComponent\r\n );\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.warn !== undefined) {\r\n dialogRef.componentInstance.warn.set(options.warn);\r\n }\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n public alert(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<AlertDialogComponent> =\r\n this.dialog.open(AlertDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n public form(options: DialogOptions): Observable<DialogOptions> {\r\n const dialogRef: MatDialogRef<FormDialogComponent> =\r\n this.dialog.open(FormDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n if (options.fields !== undefined) {\r\n dialogRef.componentInstance.fields.set(options.fields);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n}\r\n","import { Overlay, OverlayConfig } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { inject, Injectable, Injector, Type } from '@angular/core';\r\nimport { OverlayComponent } from '../components/overlay/overlay.component';\r\nimport { Modal } from '../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../model/custom-overlay-ref.model';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class OverlayService {\r\n private overlay: Overlay = inject(Overlay);\r\n private injector: Injector = inject(Injector);\r\n\r\n open<R = any>(\r\n content: Type<any>,\r\n data: Modal,\r\n panelCssClasses: string[] = [],\r\n closeOnBackdropCLick: boolean = true\r\n ): CustomOverlayRef<R> {\r\n const _panelCssClasses: string[] = ['modals-panel'].concat(panelCssClasses);\r\n const config = new OverlayConfig({\r\n hasBackdrop: true,\r\n panelClass: _panelCssClasses,\r\n backdropClass: 'modals-background',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n\r\n const overlayRef = this.overlay.create(config);\r\n\r\n const customOverlayRef = new CustomOverlayRef(\r\n overlayRef,\r\n content,\r\n data,\r\n closeOnBackdropCLick\r\n );\r\n const injector = this.createInjector(customOverlayRef, this.injector);\r\n overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));\r\n\r\n return customOverlayRef;\r\n }\r\n\r\n private createInjector(ref: CustomOverlayRef, inj: Injector): Injector {\r\n return Injector.create({\r\n providers: [{ provide: CustomOverlayRef, useValue: ref }],\r\n parent: inj,\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of osumi-angular-tools\r\n */\r\nexport * from './lib/components/dialogs/alert-dialog/alert-dialog.component';\r\nexport * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';\r\nexport * from './lib/components/dialogs/form-dialog/form-dialog.component';\r\nexport * from './lib/components/overlay/overlay.component';\r\nexport * from './lib/directives/swipe.directive';\r\nexport * from './lib/interfaces/dialogs.interface';\r\nexport * from './lib/interfaces/modals.interface';\r\nexport * from './lib/interfaces/swipe.interface';\r\nexport * from './lib/model/custom-overlay-ref.model';\r\nexport * from './lib/services/dialog.service';\r\nexport * from './lib/services/overlay.service';\r\nexport * from './lib/swipe-core/swipe-core';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAca,oBAAoB,CAAA;AACxB,IAAA,SAAS,GAAuC,MAAM,CAAC,YAAY,CAAC;AAEpE,IAAA,KAAK,GAA2B,MAAM,CAAS,EAAE,CAAC;AAClD,IAAA,OAAO,GAA2B,MAAM,CAAS,EAAE,CAAC;AACpD,IAAA,EAAE,GAA2B,MAAM,CAAS,WAAW,CAAC;uGALpD,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECdjC,qTAUM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.mjs","sources":["../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/model/custom-overlay-ref.model.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.html","../../../projects/osumi-angular-tools/src/lib/directives/swipe.directive.ts","../../../projects/osumi-angular-tools/src/lib/services/dialog.service.ts","../../../projects/osumi-angular-tools/src/lib/services/overlay.service.ts","../../../projects/osumi-angular-tools/src/public-api.ts","../../../projects/osumi-angular-tools/src/osumi-angular-tools.ts"],"sourcesContent":["import { Component, inject, signal, WritableSignal } from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n@Component({\r\n selector: 'oat-alert-dialog',\r\n templateUrl: './alert-dialog.component.html',\r\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\r\n})\r\nexport class AlertDialogComponent {\r\n public dialogRef: MatDialogRef<AlertDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import { NgClass } from '@angular/common';\r\nimport {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n@Component({\r\n selector: 'oat-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrl: './confirm-dialog.component.scss',\r\n imports: [\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatButton,\r\n NgClass,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class ConfirmDialogComponent {\r\n public dialogRef: MatDialogRef<ConfirmDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public warn: WritableSignal<boolean> = signal<boolean>(false);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\nimport { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { DialogField } from '../../../interfaces/dialogs.interface';\r\n\r\n@Component({\r\n selector: 'oat-form-dialog',\r\n templateUrl: './form-dialog.component.html',\r\n styleUrl: './form-dialog.component.scss',\r\n imports: [\r\n FormsModule,\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatFormField,\r\n MatLabel,\r\n MatInput,\r\n MatHint,\r\n MatButton,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class FormDialogComponent {\r\n public dialogRef: MatDialogRef<FormDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public fields: WritableSignal<DialogField[]> = signal<DialogField[]>([]);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t[mat-dialog-close]=\"fields\">{{ ok() }}</button>\r\n</div>","import { OverlayRef } from '@angular/cdk/overlay';\r\nimport { Type } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { OverlayCloseEvent } from '../interfaces/modals.interface';\r\n\r\n// R = Response Data Type, T = Data passed to Modal Type\r\nexport class CustomOverlayRef<R = any, T = any> {\r\n afterClosed$ = new Subject<OverlayCloseEvent<R | null>>();\r\n\r\n constructor(\r\n public overlay: OverlayRef,\r\n public content: Type<any>,\r\n public data: T,\r\n public closeOnBackdropCLick: boolean = true\r\n ) {\r\n if (closeOnBackdropCLick) {\r\n overlay.backdropClick().subscribe({\r\n next: () => {\r\n this._close('backdropClick', null);\r\n },\r\n });\r\n }\r\n }\r\n\r\n close(data?: any): void {\r\n this._close('close', data!);\r\n }\r\n\r\n private _close(type: 'backdropClick' | 'close', data: R | null): void {\r\n this.overlay.dispose();\r\n this.afterClosed$.next({\r\n type,\r\n data,\r\n });\r\n\r\n this.afterClosed$.complete();\r\n }\r\n}\r\n","import { NgComponentOutlet } from '@angular/common';\r\nimport { Component, inject, OnInit, Renderer2, Type } from '@angular/core';\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { Modal } from '../../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../../model/custom-overlay-ref.model';\r\n\r\n@Component({\r\n selector: 'oat-overlay',\r\n templateUrl: './overlay.component.html',\r\n styleUrls: ['./overlay.component.scss'],\r\n imports: [MatIcon, MatIconButton, NgComponentOutlet],\r\n})\r\nexport class OverlayComponent implements OnInit {\r\n private customOverlayRef: CustomOverlayRef<any, Modal> =\r\n inject(CustomOverlayRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n\r\n content: Type<any> = this.customOverlayRef.content;\r\n inputData: Modal = { modalTitle: '', modalColor: 'blue' };\r\n\r\n ngOnInit(): void {\r\n this.listenToEscKey();\r\n this.inputData = this.customOverlayRef.data;\r\n }\r\n\r\n private listenToEscKey(): void {\r\n this.renderer.listen('window', 'keyup', (event: KeyboardEvent): void => {\r\n if (event.key === 'Escape') {\r\n this.close();\r\n }\r\n });\r\n }\r\n\r\n close(): void {\r\n this.customOverlayRef.close(null);\r\n }\r\n}\r\n","<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\r\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>","import {\r\n Directive,\r\n ElementRef,\r\n inject,\r\n OnDestroy,\r\n output,\r\n OutputEmitterRef,\r\n Renderer2,\r\n} from '@angular/core';\r\nimport { SwipeData } from '../interfaces/swipe.interface';\r\n\r\n@Directive({\r\n selector: '[oatSwipe]',\r\n standalone: true,\r\n host: {\r\n '(touchstart)': 'onTouchStart($event)',\r\n '(touchend)': 'onTouchEnd($event)',\r\n '(mousedown)': 'onMouseDown($event)',\r\n '(mouseup)': 'onMouseUp($event)',\r\n },\r\n})\r\nexport class SwipeDirective implements OnDestroy {\r\n private el: ElementRef = inject(ElementRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n swipeEnd: OutputEmitterRef<SwipeData> = output<SwipeData>();\r\n\r\n private startX: number = 0;\r\n private startY: number = 0;\r\n\r\n private touchStartListener: () => void;\r\n private touchEndListener: () => void;\r\n private mouseDownListener: () => void;\r\n private mouseUpListener: () => void;\r\n\r\n constructor() {\r\n this.touchStartListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchstart',\r\n (event: TouchEvent): void => this.onTouchStart(event)\r\n );\r\n this.touchEndListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchend',\r\n (event: TouchEvent): void => this.onTouchEnd(event)\r\n );\r\n this.mouseDownListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mousedown',\r\n (event: MouseEvent): void => this.onMouseDown(event)\r\n );\r\n this.mouseUpListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mouseup',\r\n (event: MouseEvent): void => this.onMouseUp(event)\r\n );\r\n }\r\n\r\n onTouchStart(event: TouchEvent): void {\r\n this.startX = event.touches[0].clientX;\r\n this.startY = event.touches[0].clientY;\r\n }\r\n\r\n onTouchEnd(event: TouchEvent): void {\r\n const endX: number = event.changedTouches[0].clientX;\r\n const endY: number = event.changedTouches[0].clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n onMouseDown(event: MouseEvent): void {\r\n this.startX = event.clientX;\r\n this.startY = event.clientY;\r\n }\r\n\r\n onMouseUp(event: MouseEvent): void {\r\n const endX: number = event.clientX;\r\n const endY: number = event.clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.touchStartListener();\r\n this.touchEndListener();\r\n this.mouseDownListener();\r\n this.mouseUpListener();\r\n }\r\n}\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { Observable } from 'rxjs';\r\nimport { AlertDialogComponent } from '../components/dialogs/alert-dialog/alert-dialog.component';\r\nimport { ConfirmDialogComponent } from '../components/dialogs/confirm-dialog/confirm-dialog.component';\r\nimport { FormDialogComponent } from '../components/dialogs/form-dialog/form-dialog.component';\r\nimport { DialogOptions } from '../interfaces/dialogs.interface';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class DialogService {\r\n private dialog: MatDialog = inject(MatDialog);\r\n\r\n public confirm(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<ConfirmDialogComponent> = this.dialog.open(\r\n ConfirmDialogComponent\r\n );\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.warn !== undefined) {\r\n dialogRef.componentInstance.warn.set(options.warn);\r\n }\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n public alert(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<AlertDialogComponent> =\r\n this.dialog.open(AlertDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n public form(options: DialogOptions): Observable<DialogOptions> {\r\n const dialogRef: MatDialogRef<FormDialogComponent> =\r\n this.dialog.open(FormDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n if (options.fields !== undefined) {\r\n dialogRef.componentInstance.fields.set(options.fields);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n}\r\n","import { Overlay, OverlayConfig } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { inject, Injectable, Injector, Type } from '@angular/core';\r\nimport { OverlayComponent } from '../components/overlay/overlay.component';\r\nimport { Modal } from '../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../model/custom-overlay-ref.model';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class OverlayService {\r\n private overlay: Overlay = inject(Overlay);\r\n private injector: Injector = inject(Injector);\r\n\r\n open<R = any>(\r\n content: Type<any>,\r\n data: Modal,\r\n panelCssClasses: string[] = [],\r\n closeOnBackdropCLick: boolean = true\r\n ): CustomOverlayRef<R> {\r\n const _panelCssClasses: string[] = ['modals-panel'].concat(panelCssClasses);\r\n const config = new OverlayConfig({\r\n hasBackdrop: true,\r\n panelClass: _panelCssClasses,\r\n backdropClass: 'modals-background',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n\r\n const overlayRef = this.overlay.create(config);\r\n\r\n const customOverlayRef = new CustomOverlayRef(\r\n overlayRef,\r\n content,\r\n data,\r\n closeOnBackdropCLick\r\n );\r\n const injector = this.createInjector(customOverlayRef, this.injector);\r\n overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));\r\n\r\n return customOverlayRef;\r\n }\r\n\r\n private createInjector(ref: CustomOverlayRef, inj: Injector): Injector {\r\n return Injector.create({\r\n providers: [{ provide: CustomOverlayRef, useValue: ref }],\r\n parent: inj,\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of osumi-angular-tools\r\n */\r\nexport * from './lib/components/dialogs/alert-dialog/alert-dialog.component';\r\nexport * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';\r\nexport * from './lib/components/dialogs/form-dialog/form-dialog.component';\r\nexport * from './lib/components/overlay/overlay.component';\r\nexport * from './lib/directives/swipe.directive';\r\nexport * from './lib/interfaces/dialogs.interface';\r\nexport * from './lib/interfaces/modals.interface';\r\nexport * from './lib/interfaces/swipe.interface';\r\nexport * from './lib/model/custom-overlay-ref.model';\r\nexport * from './lib/services/dialog.service';\r\nexport * from './lib/services/overlay.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n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Q,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC;AACrE,QAAA,UAAU,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,gBAAgB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAExE,QAAA,OAAO,gBAAgB;;IAGjB,cAAc,CAAC,GAAqB,EAAE,GAAa,EAAA;QACzD,OAAO,QAAQ,CAAC,MAAM,CAAC;YACrB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACzD,YAAA,MAAM,EAAE,GAAG;AACZ,SAAA,CAAC;;uGArCO,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACPlC;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,14 +1,22 @@
1
- import { OnDestroy, OnInit, OutputEmitterRef } from '@angular/core';
2
- import { SwipeEvent } from '../interfaces/swipe.interface';
1
+ import { OnDestroy, OutputEmitterRef } from '@angular/core';
2
+ import { SwipeData } from '../interfaces/swipe.interface';
3
3
  import * as i0 from "@angular/core";
4
- export declare class SwipeDirective implements OnInit, OnDestroy {
5
- private elementRef;
6
- private zone;
7
- private swipeSubscription;
8
- swipeMove: OutputEmitterRef<SwipeEvent>;
9
- swipeEnd: OutputEmitterRef<SwipeEvent>;
10
- ngOnInit(): void;
4
+ export declare class SwipeDirective implements OnDestroy {
5
+ private el;
6
+ private renderer;
7
+ swipeEnd: OutputEmitterRef<SwipeData>;
8
+ private startX;
9
+ private startY;
10
+ private touchStartListener;
11
+ private touchEndListener;
12
+ private mouseDownListener;
13
+ private mouseUpListener;
14
+ constructor();
15
+ onTouchStart(event: TouchEvent): void;
16
+ onTouchEnd(event: TouchEvent): void;
17
+ onMouseDown(event: MouseEvent): void;
18
+ onMouseUp(event: MouseEvent): void;
11
19
  ngOnDestroy(): void;
12
20
  static ɵfac: i0.ɵɵFactoryDeclaration<SwipeDirective, never>;
13
- static ɵdir: i0.ɵɵDirectiveDeclaration<SwipeDirective, "[oatSwipe]", never, {}, { "swipeMove": "swipeMove"; "swipeEnd": "swipeEnd"; }, never, never, true, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SwipeDirective, "[oatSwipe]", never, {}, { "swipeEnd": "swipeEnd"; }, never, never, true, never>;
14
22
  }
@@ -1,22 +1,4 @@
1
- export interface SwipeCoordinates {
1
+ export interface SwipeData {
2
2
  x: number;
3
3
  y: number;
4
4
  }
5
- export declare enum SwipeDirection {
6
- X = "x",
7
- Y = "y"
8
- }
9
- export interface SwipeStartEvent {
10
- x: number;
11
- y: number;
12
- direction: SwipeDirection;
13
- }
14
- export interface SwipeEvent {
15
- direction: SwipeDirection;
16
- distance: number;
17
- }
18
- export interface SwipeSubscriptionConfig {
19
- domElement: HTMLElement;
20
- onSwipeMove?: (event: SwipeEvent) => void;
21
- onSwipeEnd?: (event: SwipeEvent) => void;
22
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osumi/angular-tools",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Tools to be used on Angular projects.",
5
5
  "author": "Iñigo Gorosabel",
6
6
  "license": "MIT",
package/public-api.d.ts CHANGED
@@ -9,4 +9,3 @@ export * from './lib/interfaces/swipe.interface';
9
9
  export * from './lib/model/custom-overlay-ref.model';
10
10
  export * from './lib/services/dialog.service';
11
11
  export * from './lib/services/overlay.service';
12
- export * from './lib/swipe-core/swipe-core';
@@ -30,6 +30,16 @@
30
30
  "description": "Correcciones de ESLint y primera versión de Swipe",
31
31
  "version": "1.1.1",
32
32
  "factory": "./noop/index#noop"
33
+ },
34
+ "osumi-angular-tools-1-1-2": {
35
+ "description": "Swipe simplificado",
36
+ "version": "1.1.2",
37
+ "factory": "./noop/index#noop"
38
+ },
39
+ "osumi-angular-tools-1-1-3": {
40
+ "description": "Pruebas para propagación de eventos en Swipe",
41
+ "version": "1.1.3",
42
+ "factory": "./noop/index#noop"
33
43
  }
34
44
  }
35
45
  }
@@ -1,3 +0,0 @@
1
- import { Subscription } from 'rxjs';
2
- import { SwipeSubscriptionConfig } from '../interfaces/swipe.interface';
3
- export declare function createSwipeSubscription({ domElement, onSwipeMove, onSwipeEnd, }: SwipeSubscriptionConfig): Subscription;