UNPKG

@tomino/dynamic-form-semantic-ui

Version:

Semantic UI form renderer based on dynamic form generation

51 lines (50 loc) 2.15 kB
/// <reference types="react" /> import { EditorContextType } from '../editor/editor_context'; export declare type Processor<T> = { children: (owner: T) => T[]; name: (owner: T) => string; id: (owner: T) => string; disableDrop?: (owner: T, schema: any) => boolean; }; export declare function clearAll(context?: EditorContextType): void; export declare class DragDrop<T> { startClass: string; endClass: string; findIndex: (e: React.DragEvent, rects: HTMLDivElement[], i: number) => boolean; findPosition: (e: React.DragEvent, rect: ClientRect, previousEnd: number, nextStart: number) => string; placeholderClass: string; paddingElement: 'paddingBottom' | 'paddingRight'; allowParenting: boolean; context: EditorContextType; owner: T; processor: Processor<T>; uid: string; dropHandler: (to: number, position?: string) => void; endDragHandler: (e?: React.DragEvent) => void; add: boolean; initialised: boolean; constructor(layout: 'row' | 'column', owner: T, processor: Processor<T>, dropStyle: string, uid: string, dropHandler: (to: number, position?: string) => void, endDragHandler: (e?: React.DragEvent) => void, allowParenting: boolean, height?: number, context?: EditorContextType); readonly config: { currentStacks: string[]; active: HTMLDivElement[]; padMap: HTMLDivElement[]; drops: { position: string; index: number; }; }; init: (container: HTMLDivElement) => void; findRect(e: React.DragEvent, elements: HTMLDivElement[]): number; clear(): void; dragEnd(e: React.DragEvent): void; onDragOver: (e: import("react").DragEvent<HTMLDivElement>) => void; onDragEnd: (e: import("react").DragEvent<Element>) => void; onDragLeave: () => void; onDrop: (e: import("react").DragEvent<Element>) => void; props(): { onDragOver: (e: import("react").DragEvent<HTMLDivElement>) => void; onDragEnd: (e: import("react").DragEvent<Element>) => void; onDrop: (e: import("react").DragEvent<Element>) => void; onDragLeave: () => void; }; }