@ngutil/aria 0.0.73 → 0.0.74
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/esm2022/gestures/gesture-drag.mjs +3 -2
- package/esm2022/gestures/gesture-event.mjs +1 -2
- package/esm2022/gestures/gesture-longtap.mjs +3 -2
- package/esm2022/gestures/gesture-tap.mjs +4 -3
- package/esm2022/gestures/gesture.mjs +2 -3
- package/esm2022/gestures/gesture.service.mjs +4 -4
- package/fesm2022/ngutil-aria.mjs +11 -10
- package/fesm2022/ngutil-aria.mjs.map +1 -1
- package/gestures/gesture-drag.d.ts +2 -1
- package/gestures/gesture-event.d.ts +1 -7
- package/gestures/gesture-longtap.d.ts +4 -3
- package/gestures/gesture-tap.d.ts +4 -4
- package/gestures/gesture.d.ts +11 -3
- package/gestures/gesture.service.d.ts +3 -4
- package/package.json +3 -3
|
@@ -3,11 +3,12 @@ import { Mutable } from "utility-types";
|
|
|
3
3
|
import { Position } from "@ngutil/style";
|
|
4
4
|
import { Gesture, GestureCaptureState, GestureOptions } from "./gesture";
|
|
5
5
|
import { GestureDetail } from "./gesture-event";
|
|
6
|
-
export interface GestureDragDetail extends GestureDetail
|
|
6
|
+
export interface GestureDragDetail extends GestureDetail {
|
|
7
7
|
moveBy: Position;
|
|
8
8
|
}
|
|
9
9
|
export type GestureDragOptions = GestureOptions<GestureDragImpl>;
|
|
10
10
|
export declare class GestureDragImpl<T extends GestureDragDetail = GestureDragDetail> extends Gesture<T> {
|
|
11
|
+
readonly type = "gesture-drag";
|
|
11
12
|
readonly horizontal?: boolean;
|
|
12
13
|
readonly vertical?: boolean;
|
|
13
14
|
constructor(options?: GestureDragOptions);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Position } from "@ngutil/style";
|
|
2
|
-
export
|
|
3
|
-
type: N;
|
|
4
|
-
} : never;
|
|
5
|
-
declare const PHANTOM: unique symbol;
|
|
6
|
-
export interface GestureDetail<T extends string = string> {
|
|
7
|
-
readonly [PHANTOM]: T;
|
|
2
|
+
export interface GestureDetail {
|
|
8
3
|
readonly origin: GestureOrigin;
|
|
9
4
|
readonly target: HTMLElement;
|
|
10
5
|
readonly pointerType: GesturePointerType;
|
|
@@ -43,4 +38,3 @@ export interface GestureListenerConfig {
|
|
|
43
38
|
export declare const Listeners: {
|
|
44
39
|
[key: string]: GestureListenerConfig;
|
|
45
40
|
};
|
|
46
|
-
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { Gesture, GestureCaptureState, GestureOptions } from "./gesture";
|
|
3
3
|
import { GestureDetail } from "./gesture-event";
|
|
4
|
-
export type GestureLongTapDetail = GestureDetail
|
|
4
|
+
export type GestureLongTapDetail = GestureDetail;
|
|
5
5
|
export type GestureLongTapOptions = GestureOptions<GestureLongTapImpl>;
|
|
6
6
|
export declare class GestureLongTapImpl<T extends GestureLongTapDetail = GestureLongTapDetail> extends Gesture<T> {
|
|
7
|
+
readonly type = "gesture-longtap";
|
|
7
8
|
constructor(options?: GestureLongTapOptions);
|
|
8
9
|
capture(events: Observable<GestureDetail>): Observable<GestureCaptureState>;
|
|
9
10
|
handle(events: Observable<GestureDetail>): Observable<import("utility-types").Mutable<T>>;
|
|
10
11
|
}
|
|
11
|
-
export declare function gestureLongTap(options?: GestureLongTapOptions): GestureLongTapImpl<
|
|
12
|
-
export declare const GestureLongTap: GestureLongTapImpl<
|
|
12
|
+
export declare function gestureLongTap(options?: GestureLongTapOptions): GestureLongTapImpl<GestureDetail>;
|
|
13
|
+
export declare const GestureLongTap: GestureLongTapImpl<GestureDetail>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { Gesture, GestureCaptureState, GestureOptions } from "./gesture";
|
|
3
3
|
import { GestureDetail } from "./gesture-event";
|
|
4
|
-
export type GestureTapDetail = GestureDetail
|
|
4
|
+
export type GestureTapDetail = GestureDetail;
|
|
5
5
|
export type GestureTapOptions = GestureOptions<GestureTapImpl>;
|
|
6
6
|
export declare class GestureTapImpl<T extends GestureTapDetail = GestureTapDetail> extends Gesture<T> {
|
|
7
|
-
|
|
7
|
+
readonly type = "gesture-tap";
|
|
8
8
|
capture(events: Observable<GestureDetail>): Observable<GestureCaptureState>;
|
|
9
9
|
handle(events: Observable<GestureDetail>): Observable<import("utility-types").Mutable<T>>;
|
|
10
10
|
}
|
|
11
|
-
export declare function gestureTap(options?: GestureTapOptions): GestureTapImpl<
|
|
12
|
-
export declare const GestureTap: GestureTapImpl<
|
|
11
|
+
export declare function gestureTap(options?: GestureTapOptions): GestureTapImpl<GestureDetail>;
|
|
12
|
+
export declare const GestureTap: GestureTapImpl<GestureDetail>;
|
package/gestures/gesture.d.ts
CHANGED
|
@@ -8,10 +8,18 @@ export declare const enum GestureCaptureState {
|
|
|
8
8
|
Maybe = 3,
|
|
9
9
|
Instant = 4
|
|
10
10
|
}
|
|
11
|
-
type _GestureOptions = Partial<Omit<Gesture<any>, "originTypes" | "
|
|
11
|
+
type _GestureOptions = Partial<Omit<Gesture<any>, "originTypes" | "type" | FunctionKeys<Gesture<any>>>>;
|
|
12
12
|
export type GestureOptions<T extends object> = Partial<Omit<T, keyof Gesture<any> | FunctionKeys<T>>> & _GestureOptions;
|
|
13
|
+
export type GestureEvent<G extends Gesture> = G extends Gesture<infer E> & {
|
|
14
|
+
type: infer T;
|
|
15
|
+
} ? CustomEvent<E> & {
|
|
16
|
+
type: T;
|
|
17
|
+
} : never;
|
|
13
18
|
export declare abstract class Gesture<T extends GestureDetail = GestureDetail> {
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The name of the gesture
|
|
21
|
+
*/
|
|
22
|
+
abstract readonly type: string;
|
|
15
23
|
/**
|
|
16
24
|
* Gestures that depends on move distance, like drag, use this option
|
|
17
25
|
*/
|
|
@@ -44,7 +52,7 @@ export declare abstract class Gesture<T extends GestureDetail = GestureDetail> {
|
|
|
44
52
|
* The event types of the gesture can handle
|
|
45
53
|
*/
|
|
46
54
|
readonly originTypes: Array<string>;
|
|
47
|
-
constructor(
|
|
55
|
+
constructor(options?: _GestureOptions);
|
|
48
56
|
/**
|
|
49
57
|
* Test if the gesture should be captured.
|
|
50
58
|
* The given events is filterde by {@see Gesture#shouldCapture}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { ElementInput } from "@ngutil/common";
|
|
3
|
-
import { Gesture } from "./gesture";
|
|
4
|
-
import { GestureEvent } from "./gesture-event";
|
|
3
|
+
import { Gesture, GestureEvent } from "./gesture";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
|
-
type GesturesToEventsType<T extends Array<Gesture>> = T extends Array<infer G> ? (G extends Gesture
|
|
5
|
+
type GesturesToEventsType<T extends Array<Gesture>> = T extends Array<infer G> ? (G extends Gesture ? GestureEvent<G> : never) : never;
|
|
7
6
|
type GestureEventDiscriminator<T> = T extends {
|
|
8
7
|
type: infer N;
|
|
9
8
|
} ? {
|
|
10
9
|
type: N;
|
|
11
10
|
} & T : never;
|
|
12
11
|
export type GestureWatchReturns<T extends Array<Gesture>> = Observable<GestureEventDiscriminator<GesturesToEventsType<T>>>;
|
|
13
|
-
export type GestureListenReturns<T extends Array<Gesture>> = Observable<
|
|
12
|
+
export type GestureListenReturns<T extends Array<Gesture>> = Observable<GesturesToEventsType<T>>;
|
|
14
13
|
export declare class GestureService {
|
|
15
14
|
#private;
|
|
16
15
|
constructor();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngutil/aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/cdk": "18.2.6",
|
|
6
6
|
"@angular/common": "18.2.6",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"rxjs": "^7.8.1",
|
|
10
10
|
"tabbable": "^6.2.0",
|
|
11
11
|
"utility-types": "^3.11.0",
|
|
12
|
-
"@ngutil/common": "0.0.
|
|
13
|
-
"@ngutil/style": "0.0.
|
|
12
|
+
"@ngutil/common": "0.0.74",
|
|
13
|
+
"@ngutil/style": "0.0.74"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public",
|