@orca-fe/transformer
Version:
Transformer Container
35 lines (34 loc) • 1.66 kB
TypeScript
import React from 'react';
import type { Bounds, ResizeType } from './utils';
export interface TransformerBoxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
/** 是否禁用 */
disabled?: boolean;
/** 是否选中状态,选中状态下,才可以进行边框调整 */
checked?: boolean;
/** 最小拖动距离 */
minDragDistance?: number;
/** 默认的Bounds信息 */
defaultBounds?: Bounds;
/** Bounds信息 */
bounds?: Bounds;
/** 开始拖动时的回调函数 */
onChangeStart?: (e: Event, type: ResizeType) => void;
/** 拖动前的回调函数 */
onDragBefore?: (e: MouseEvent | TouchEvent) => boolean;
/** Bounds信息变化时的回调函数 */
onBoundsChange?: (bounds: Bounds) => void;
/** 结束拖动时的回调函数 */
onChangeEnd?: (bounds: Bounds) => void;
/** 静态点击(非拖拽)时的回调函数 */
onClickFixed?: (e: MouseEvent) => void;
/** 是否受控模式,开启后,拖拽的过程,会实时触发 onBoundsChange */
controlledMode?: boolean;
/** 修改内容挂载点,默认挂载到边框内部。指定内挂载位置,可实现渲染多个 Box 时,内容不会遮挡边框,造成效果不佳 */
portal?: () => HTMLElement | SVGSVGElement;
/** 限制移动区域,设置之后,会以中心点为基准,不能移动超过 limitBounds 的范围 */
limitBounds?: Bounds;
/** 支持旋转 */
rotateEnabled?: boolean;
}
declare const TransformerBox: (props: TransformerBoxProps) => import("react/jsx-runtime").JSX.Element;
export default TransformerBox;