js: draggable deprecated & add touch api
This commit is contained in:
6
doric-js/lib/src/widget/draggable.d.ts
vendored
6
doric-js/lib/src/widget/draggable.d.ts
vendored
@@ -1,6 +1,12 @@
|
||||
import { View } from "../ui/view";
|
||||
import { Stack } from "../widget/layouts";
|
||||
/**
|
||||
* @deprecated The class should not be used, please use GestureContainer class instead
|
||||
*/
|
||||
export declare class Draggable extends Stack {
|
||||
onDrag?: (x: number, y: number) => void;
|
||||
}
|
||||
/**
|
||||
* @deprecated The function should not be used, please use gestureContainer function instead
|
||||
*/
|
||||
export declare function draggable(views: View | View[], config?: Partial<Draggable>): Draggable;
|
||||
|
@@ -25,12 +25,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
import { Property, View } from "../ui/view";
|
||||
import { Stack } from "../widget/layouts";
|
||||
import { layoutConfig } from "../util/layoutconfig";
|
||||
/**
|
||||
* @deprecated The class should not be used, please use GestureContainer class instead
|
||||
*/
|
||||
export class Draggable extends Stack {
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], Draggable.prototype, "onDrag", void 0);
|
||||
/**
|
||||
* @deprecated The function should not be used, please use gestureContainer function instead
|
||||
*/
|
||||
export function draggable(views, config) {
|
||||
const ret = new Draggable;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
|
24
doric-js/lib/src/widget/gesture.d.ts
vendored
24
doric-js/lib/src/widget/gesture.d.ts
vendored
@@ -31,5 +31,29 @@ export declare class GestureContainer extends Stack {
|
||||
* @param orientation: the orientation of this swipe
|
||||
*/
|
||||
onSwipe?: (orientation: SwipeOrientation) => void;
|
||||
/**
|
||||
* Called when the finger touch down on the screen
|
||||
* @param x: the value of event occurs on the x-axis
|
||||
* @param y: the value of event occurs on the y-axis
|
||||
*/
|
||||
onTouchDown?: (x: number, y: number) => void;
|
||||
/**
|
||||
* Called when the finger moving on the screen
|
||||
* @param x: the value of event occurs on the x-axis
|
||||
* @param y: the value of event occurs on the y-axis
|
||||
*/
|
||||
onTouchMove?: (x: number, y: number) => void;
|
||||
/**
|
||||
* Called when the finger touch up off from the screen
|
||||
* @param x: the value of event occurs on the x-axis
|
||||
* @param y: the value of event occurs on the y-axis
|
||||
*/
|
||||
onTouchUp?: (x: number, y: number) => void;
|
||||
/**
|
||||
* Called when the finger leave from screen
|
||||
* @param x: the value of event occurs on the x-axis
|
||||
* @param y: the value of event occurs on the y-axis
|
||||
*/
|
||||
onTouchCancel?: (x: number, y: number) => void;
|
||||
}
|
||||
export declare function gestureContainer(views: View | View[], config?: Partial<GestureContainer>): GestureContainer;
|
||||
|
@@ -62,6 +62,22 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], GestureContainer.prototype, "onSwipe", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], GestureContainer.prototype, "onTouchDown", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], GestureContainer.prototype, "onTouchMove", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], GestureContainer.prototype, "onTouchUp", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], GestureContainer.prototype, "onTouchCancel", void 0);
|
||||
export function gestureContainer(views, config) {
|
||||
const ret = new GestureContainer;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
|
Reference in New Issue
Block a user