@libs-ui/components-device-support 0.2.299 → 0.2.302
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.
|
@@ -4,8 +4,10 @@ export declare class LibsUiComponentsDeviceSupportHandleClickDirective implement
|
|
|
4
4
|
readonly ignoreStopPropagation: import("@angular/core").InputSignal<boolean>;
|
|
5
5
|
private elementRef;
|
|
6
6
|
private destroyRef;
|
|
7
|
+
readonly elementHandleClick: import("@angular/core").InputSignal<HTMLElement | Window | Document | undefined>;
|
|
7
8
|
readonly outClick: import("@angular/core").OutputEmitterRef<Event>;
|
|
8
9
|
ngAfterViewInit(): void;
|
|
10
|
+
private get Element();
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsDeviceSupportHandleClickDirective, never>;
|
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<LibsUiComponentsDeviceSupportHandleClickDirective, "[libsUiComponentsDeviceSupportHandleClickDirective]", never, { "ignoreStopPropagation": { "alias": "ignoreStopPropagation"; "required": false; "isSignal": true; }; }, { "outClick": "outClick"; }, never, never, true, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LibsUiComponentsDeviceSupportHandleClickDirective, "[libsUiComponentsDeviceSupportHandleClickDirective]", never, { "ignoreStopPropagation": { "alias": "ignoreStopPropagation"; "required": false; "isSignal": true; }; "elementHandleClick": { "alias": "elementHandleClick"; "required": false; "isSignal": true; }; }, { "outClick": "outClick"; }, never, never, true, never>;
|
|
11
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DestroyRef, Directive, ElementRef, inject, input, output } from '@angular/core';
|
|
2
2
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
-
import {
|
|
3
|
+
import { getEventNameHandleClick } from '@libs-ui/utils';
|
|
4
4
|
import { fromEvent } from 'rxjs';
|
|
5
5
|
import { tap } from 'rxjs/operators';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -8,19 +8,21 @@ export class LibsUiComponentsDeviceSupportHandleClickDirective {
|
|
|
8
8
|
ignoreStopPropagation = input(false);
|
|
9
9
|
elementRef = inject(ElementRef);
|
|
10
10
|
destroyRef = inject(DestroyRef);
|
|
11
|
+
elementHandleClick = input();
|
|
11
12
|
outClick = output();
|
|
12
13
|
ngAfterViewInit() {
|
|
13
|
-
|
|
14
|
-
const mouseEventType = deviceInfo.device?.type === 'desktop' ? 'click' : 'touchstart';
|
|
15
|
-
fromEvent(this.elementRef.nativeElement, mouseEventType).pipe(tap((e) => {
|
|
14
|
+
fromEvent(this.Element, getEventNameHandleClick).pipe(tap((e) => {
|
|
16
15
|
if (!this.ignoreStopPropagation()) {
|
|
17
16
|
e.stopPropagation();
|
|
18
17
|
}
|
|
19
18
|
this.outClick.emit(e);
|
|
20
19
|
}), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
21
20
|
}
|
|
21
|
+
get Element() {
|
|
22
|
+
return this.elementHandleClick() || this.elementRef.nativeElement;
|
|
23
|
+
}
|
|
22
24
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsDeviceSupportHandleClickDirective, isStandalone: true, selector: "[libsUiComponentsDeviceSupportHandleClickDirective]", inputs: { ignoreStopPropagation: { classPropertyName: "ignoreStopPropagation", publicName: "ignoreStopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClick: "outClick" }, ngImport: i0 });
|
|
25
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsDeviceSupportHandleClickDirective, isStandalone: true, selector: "[libsUiComponentsDeviceSupportHandleClickDirective]", inputs: { ignoreStopPropagation: { classPropertyName: "ignoreStopPropagation", publicName: "ignoreStopPropagation", isSignal: true, isRequired: false, transformFunction: null }, elementHandleClick: { classPropertyName: "elementHandleClick", publicName: "elementHandleClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClick: "outClick" }, ngImport: i0 });
|
|
24
26
|
}
|
|
25
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, decorators: [{
|
|
26
28
|
type: Directive,
|
|
@@ -30,4 +32,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
30
32
|
standalone: true,
|
|
31
33
|
}]
|
|
32
34
|
}] });
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlLXN1cHBvcnQtaGFuZGxlLWNsaWNrLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMtdWkvY29tcG9uZW50cy9kZXZpY2Utc3VwcG9ydC9zcmMvZGV2aWNlLXN1cHBvcnQtaGFuZGxlLWNsaWNrLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWlCLFVBQVUsRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3hHLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3pELE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxNQUFNLENBQUM7QUF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lucHV0PEhUTUxFbGVtZW50IHwgV2luZG93IHwgRG9jdW1lbnQ+KCk7XG5cbiAgcmVhZG9ubHkgb3V0Q2xpY2sgPSBvdXRwdXQ8RXZlbnQ+KCk7XG5cbiAgbmdBZnRlclZpZXdJbml0KCkge1xuICAgIGZyb21FdmVudDxFdmVudD4odGhpcy5FbGVtZW50LCBnZXRFdmVudE5hbWVIYW5kbGVDbGljaykucGlwZSh0YXAoKGU6IEV2ZW50KSA9PiB7XG4gICAgICBpZiAoIXRoaXMuaWdub3JlU3RvcFByb3BhZ2F0aW9uKCkpIHtcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgIH1cbiAgICAgIHRoaXMub3V0Q2xpY2suZW1pdChlKTtcbiAgICB9KSwgdGFrZVVudGlsRGVzdHJveWVkKHRoaXMuZGVzdHJveVJlZikpLnN1YnNjcmliZSgpO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXQgRWxlbWVudCgpOiBIVE1MRWxlbWVudCB7XG4gICAgcmV0dXJuIHRoaXMuZWxlbWVudEhhbmRsZUNsaWNrKCkgfHwgdGhpcy5lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQ7XG4gIH1cblxufVxuIl19
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, inject, ElementRef, DestroyRef, output, Directive } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import {
|
|
4
|
+
import { getEventNameHandleClick } from '@libs-ui/utils';
|
|
5
5
|
import { fromEvent } from 'rxjs';
|
|
6
6
|
import { tap } from 'rxjs/operators';
|
|
7
7
|
|
|
@@ -9,19 +9,21 @@ class LibsUiComponentsDeviceSupportHandleClickDirective {
|
|
|
9
9
|
ignoreStopPropagation = input(false);
|
|
10
10
|
elementRef = inject(ElementRef);
|
|
11
11
|
destroyRef = inject(DestroyRef);
|
|
12
|
+
elementHandleClick = input();
|
|
12
13
|
outClick = output();
|
|
13
14
|
ngAfterViewInit() {
|
|
14
|
-
|
|
15
|
-
const mouseEventType = deviceInfo.device?.type === 'desktop' ? 'click' : 'touchstart';
|
|
16
|
-
fromEvent(this.elementRef.nativeElement, mouseEventType).pipe(tap((e) => {
|
|
15
|
+
fromEvent(this.Element, getEventNameHandleClick).pipe(tap((e) => {
|
|
17
16
|
if (!this.ignoreStopPropagation()) {
|
|
18
17
|
e.stopPropagation();
|
|
19
18
|
}
|
|
20
19
|
this.outClick.emit(e);
|
|
21
20
|
}), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
22
21
|
}
|
|
22
|
+
get Element() {
|
|
23
|
+
return this.elementHandleClick() || this.elementRef.nativeElement;
|
|
24
|
+
}
|
|
23
25
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsDeviceSupportHandleClickDirective, isStandalone: true, selector: "[libsUiComponentsDeviceSupportHandleClickDirective]", inputs: { ignoreStopPropagation: { classPropertyName: "ignoreStopPropagation", publicName: "ignoreStopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClick: "outClick" }, ngImport: i0 });
|
|
26
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsDeviceSupportHandleClickDirective, isStandalone: true, selector: "[libsUiComponentsDeviceSupportHandleClickDirective]", inputs: { ignoreStopPropagation: { classPropertyName: "ignoreStopPropagation", publicName: "ignoreStopPropagation", isSignal: true, isRequired: false, transformFunction: null }, elementHandleClick: { classPropertyName: "elementHandleClick", publicName: "elementHandleClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClick: "outClick" }, ngImport: i0 });
|
|
25
27
|
}
|
|
26
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, decorators: [{
|
|
27
29
|
type: Directive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libs-ui-components-device-support.mjs","sources":["../../../../../libs-ui/components/device-support/src/device-support-handle-click.directive.ts","../../../../../libs-ui/components/device-support/src/libs-ui-components-device-support.ts"],"sourcesContent":["import { AfterViewInit, DestroyRef, Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {
|
|
1
|
+
{"version":3,"file":"libs-ui-components-device-support.mjs","sources":["../../../../../libs-ui/components/device-support/src/device-support-handle-click.directive.ts","../../../../../libs-ui/components/device-support/src/libs-ui-components-device-support.ts"],"sourcesContent":["import { AfterViewInit, DestroyRef, Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { getEventNameHandleClick } from '@libs-ui/utils';\nimport { fromEvent } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[libsUiComponentsDeviceSupportHandleClickDirective]',\n standalone: true,\n})\nexport class LibsUiComponentsDeviceSupportHandleClickDirective implements AfterViewInit {\n readonly ignoreStopPropagation = input<boolean>(false);\n\n private elementRef = inject(ElementRef);\n private destroyRef = inject(DestroyRef);\n\n readonly elementHandleClick = input<HTMLElement | Window | Document>();\n\n readonly outClick = output<Event>();\n\n ngAfterViewInit() {\n fromEvent<Event>(this.Element, getEventNameHandleClick).pipe(tap((e: Event) => {\n if (!this.ignoreStopPropagation()) {\n e.stopPropagation();\n }\n this.outClick.emit(e);\n }), takeUntilDestroyed(this.destroyRef)).subscribe();\n }\n\n private get Element(): HTMLElement {\n return this.elementHandleClick() || this.elementRef.nativeElement;\n }\n\n}\n","/**\n * Generated bundle index. Do not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