@libs-ui/components-device-support 0.2.299
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/README.md +3 -0
- package/device-support-handle-click.directive.d.ts +11 -0
- package/esm2022/device-support-handle-click.directive.mjs +33 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/libs-ui-components-device-support.mjs +5 -0
- package/fesm2022/libs-ui-components-device-support.mjs +40 -0
- package/fesm2022/libs-ui-components-device-support.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class LibsUiComponentsDeviceSupportHandleClickDirective implements AfterViewInit {
|
|
4
|
+
readonly ignoreStopPropagation: import("@angular/core").InputSignal<boolean>;
|
|
5
|
+
private elementRef;
|
|
6
|
+
private destroyRef;
|
|
7
|
+
readonly outClick: import("@angular/core").OutputEmitterRef<Event>;
|
|
8
|
+
ngAfterViewInit(): void;
|
|
9
|
+
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>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DestroyRef, Directive, ElementRef, inject, input, output } from '@angular/core';
|
|
2
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
+
import { getDeviceInfo } from '@libs-ui/utils';
|
|
4
|
+
import { fromEvent } from 'rxjs';
|
|
5
|
+
import { tap } from 'rxjs/operators';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class LibsUiComponentsDeviceSupportHandleClickDirective {
|
|
8
|
+
ignoreStopPropagation = input(false);
|
|
9
|
+
elementRef = inject(ElementRef);
|
|
10
|
+
destroyRef = inject(DestroyRef);
|
|
11
|
+
outClick = output();
|
|
12
|
+
ngAfterViewInit() {
|
|
13
|
+
const deviceInfo = getDeviceInfo();
|
|
14
|
+
const mouseEventType = deviceInfo.device?.type === 'desktop' ? 'click' : 'touchstart';
|
|
15
|
+
fromEvent(this.elementRef.nativeElement, mouseEventType).pipe(tap((e) => {
|
|
16
|
+
if (!this.ignoreStopPropagation()) {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
}
|
|
19
|
+
this.outClick.emit(e);
|
|
20
|
+
}), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
21
|
+
}
|
|
22
|
+
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 });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, decorators: [{
|
|
26
|
+
type: Directive,
|
|
27
|
+
args: [{
|
|
28
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
29
|
+
selector: '[libsUiComponentsDeviceSupportHandleClickDirective]',
|
|
30
|
+
standalone: true,
|
|
31
|
+
}]
|
|
32
|
+
}] });
|
|
33
|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XG4gICAgICB9XG4gICAgICB0aGlzLm91dENsaWNrLmVtaXQoZSk7XG4gICAgfSksIHRha2VVbnRpbERlc3Ryb3llZCh0aGlzLmRlc3Ryb3lSZWYpKS5zdWJzY3JpYmUoKTtcbiAgfVxuXG59XG4iXX0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from './device-support-handle-click.directive';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvZGV2aWNlLXN1cHBvcnQvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMseUNBQXlDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2RldmljZS1zdXBwb3J0LWhhbmRsZS1jbGljay5kaXJlY3RpdmUnO1xuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlicy11aS1jb21wb25lbnRzLWRldmljZS1zdXBwb3J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy11aS9jb21wb25lbnRzL2RldmljZS1zdXBwb3J0L3NyYy9saWJzLXVpLWNvbXBvbmVudHMtZGV2aWNlLXN1cHBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, inject, ElementRef, DestroyRef, output, Directive } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { getDeviceInfo } from '@libs-ui/utils';
|
|
5
|
+
import { fromEvent } from 'rxjs';
|
|
6
|
+
import { tap } from 'rxjs/operators';
|
|
7
|
+
|
|
8
|
+
class LibsUiComponentsDeviceSupportHandleClickDirective {
|
|
9
|
+
ignoreStopPropagation = input(false);
|
|
10
|
+
elementRef = inject(ElementRef);
|
|
11
|
+
destroyRef = inject(DestroyRef);
|
|
12
|
+
outClick = output();
|
|
13
|
+
ngAfterViewInit() {
|
|
14
|
+
const deviceInfo = getDeviceInfo();
|
|
15
|
+
const mouseEventType = deviceInfo.device?.type === 'desktop' ? 'click' : 'touchstart';
|
|
16
|
+
fromEvent(this.elementRef.nativeElement, mouseEventType).pipe(tap((e) => {
|
|
17
|
+
if (!this.ignoreStopPropagation()) {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
}
|
|
20
|
+
this.outClick.emit(e);
|
|
21
|
+
}), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
22
|
+
}
|
|
23
|
+
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 });
|
|
25
|
+
}
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsDeviceSupportHandleClickDirective, decorators: [{
|
|
27
|
+
type: Directive,
|
|
28
|
+
args: [{
|
|
29
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
30
|
+
selector: '[libsUiComponentsDeviceSupportHandleClickDirective]',
|
|
31
|
+
standalone: true,
|
|
32
|
+
}]
|
|
33
|
+
}] });
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Generated bundle index. Do not edit.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export { LibsUiComponentsDeviceSupportHandleClickDirective };
|
|
40
|
+
//# sourceMappingURL=libs-ui-components-device-support.mjs.map
|
|
@@ -0,0 +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 { getDeviceInfo } 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 outClick = output<Event>();\n\n ngAfterViewInit() {\n const deviceInfo = getDeviceInfo();\n const mouseEventType = deviceInfo.device?.type === 'desktop' ? 'click' : 'touchstart';\n\n\n fromEvent<Event>(this.elementRef.nativeElement, mouseEventType).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}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAWa,iDAAiD,CAAA;AACnD,IAAA,qBAAqB,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;AAE/C,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAE/B,QAAQ,GAAG,MAAM,EAAS,CAAC;IAEpC,eAAe,GAAA;AACb,QAAA,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;AACnC,QAAA,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,KAAK,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;AAGtF,QAAA,SAAS,CAAQ,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAQ,KAAI;AACpF,YAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE;gBACjC,CAAC,CAAC,eAAe,EAAE,CAAC;aACrB;AACD,YAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,SAAC,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;KACtD;wGAnBU,iDAAiD,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;4FAAjD,iDAAiD,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,EAAA,qBAAA,EAAA,EAAA,iBAAA,EAAA,uBAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAjD,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBAL7D,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,qDAAqD;AAC/D,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './device-support-handle-click.directive';
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@libs-ui/components-device-support",
|
|
3
|
+
"version": "0.2.299",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": ">=18.0.0",
|
|
6
|
+
"@angular/core": ">=18.0.0"
|
|
7
|
+
},
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"module": "fesm2022/libs-ui-components-device-support.mjs",
|
|
10
|
+
"typings": "index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
"./package.json": {
|
|
13
|
+
"default": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"esm2022": "./esm2022/libs-ui-components-device-support.mjs",
|
|
18
|
+
"esm": "./esm2022/libs-ui-components-device-support.mjs",
|
|
19
|
+
"default": "./fesm2022/libs-ui-components-device-support.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
}
|
|
25
|
+
}
|