@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
48 lines (47 loc) • 2.16 kB
TypeScript
import DragMoveFoundation, { DragMoveAdapter } from '@douyinfe/semi-foundation/lib/cjs/dragMove/foundation';
import BaseComponent from '../_base/baseComponent';
import { ReactNode } from 'react';
import PropTypes from 'prop-types';
import React from 'react';
export interface DragMoveProps {
handler?: () => ReactNode;
constrainer?: () => ReactNode | 'parent';
children?: ReactNode | undefined | any;
onMouseDown?: (e: MouseEvent) => void;
onMouseMove?: (e: MouseEvent) => void;
onMouseUp?: (e: MouseEvent) => void;
onTouchStart?: (e: TouchEvent) => void;
onTouchMove?: (e: TouchEvent) => void;
onTouchEnd?: (e: TouchEvent) => void;
onTouchCancel?: (e: TouchEvent) => void;
allowMove?: (e: MouseEvent | TouchEvent, element: HTMLElement) => boolean;
customMove?: (e: HTMLElement, top: number, left: number) => void;
}
export default class DragMove extends BaseComponent<DragMoveProps, null> {
static propTypes: {
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
handler: PropTypes.Requireable<(...args: any[]) => any>;
allowInputDrag: PropTypes.Requireable<boolean>;
constrainNode: PropTypes.Requireable<(...args: any[]) => any>;
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
onMouseMove: PropTypes.Requireable<(...args: any[]) => any>;
onMouseUp: PropTypes.Requireable<(...args: any[]) => any>;
onTouchStart: PropTypes.Requireable<(...args: any[]) => any>;
onTouchMove: PropTypes.Requireable<(...args: any[]) => any>;
onTouchEnd: PropTypes.Requireable<(...args: any[]) => any>;
onTouchCancel: PropTypes.Requireable<(...args: any[]) => any>;
};
static __SemiComponentName__: string;
static defaultProps: {
allowInputDrag: boolean;
};
constructor(props: DragMoveProps);
elementRef: React.RefObject<unknown>;
foundation: DragMoveFoundation;
get adapter(): DragMoveAdapter<DragMoveProps, null>;
componentDidMount(): void;
componentWillUnmount(): void;
render(): React.FunctionComponentElement<{
ref: (node: React.ReactNode) => void;
}>;
}