import { BaseEventArgs, Draggable } from '@syncfusion/ej2-base'; import { Predicate, Query, Deferred } from '@syncfusion/ej2-data'; import { CurrentAction } from './type'; import { ColumnsModel, StackedHeadersModel } from '../models'; /** * Kanban Interface */ /** * Provides information about a ActionBegin, ActionComplete, ActionFailure event. * * @interface ActionEventArgs */ export interface ActionEventArgs extends BaseEventArgs { /** Returns the request type of the current action. */ requestType: string; /** Defines the cancel option for the action taking place. */ cancel?: boolean; /** Returns the target HTML element. */ target?: HTMLElement; /** Returns the appropriate added data based on the action. */ addedRecords?: Record[]; /** Returns the appropriate changed data based on the action. */ changedRecords?: Record[]; /** Returns the appropriate deleted data based on the action. */ deletedRecords?: Record[]; } /** * Provides information about virtual scroll information. * * @interface VirtualScrollInfo * @hidden */ export interface VirtualScrollInfo { column?: string | number; columnOverAllHeight?: number; columnHeight?: number; previousScrollTop?: number; currentScrollTop?: number; scrollDirection?: string; oldBlockIndex?: number[]; currentBlockIndex?: number[]; newBlockIndex?: number[]; offsets?: { [x: number]: number; }; tempOffsets?: { [x: number]: number; }; page?: number; totalColumnData?: number; block?: number; singleIndexCardCount?: number; maxBlock?: number; previousTimeStamps?: number; } /** @hidden */ export interface FilterStateObj { state: DataStateChangeEventArgs; deffered: Deferred; } /** * Provides information about a Card Click/Double Click event. * * @interface CardClickEventArgs */ export interface CardClickEventArgs extends BaseEventArgs { /** Returns the object of the element which is currently being clicked or double clicked. */ data: Record; /** Defines the cancel option for the action taking place. */ cancel?: boolean; /** Returns the actual HTML element on which the required custom styling can be applied. */ element: Element; /** Defines the type of the event. */ event?: Event | MouseEvent | KeyboardEvent; } /** * Provides information about a QueryCellInfo event. * * @interface QueryCellInfoEventArgs */ export interface QueryCellInfoEventArgs extends BaseEventArgs { /** Returns the object of the elements which is currently being rendered on the UI. */ data?: HeaderArgs[]; /** Returns the actual HTML element on which the required custom styling can be applied. */ element: Element; /** Defines the cancel option for the action taking place. */ cancel: boolean; /** Defines the request type of column rendering. */ requestType: string; } /** * Provides information about a CardRendered event. * * @interface CardRenderedEventArgs */ export interface CardRenderedEventArgs extends BaseEventArgs { /** Returns the object of the elements which is currently being rendered on the UI. */ data?: Record; /** Returns the actual HTML element on which the required custom styling can be applied. */ element: Element; /** Defines the cancel option for the action taking place. */ cancel: boolean; } /** * Provides information about a Drag, Drag Start/End event. * * @interface DragEventArgs */ export interface DragEventArgs extends BaseEventArgs { /** Returns the drag element. */ element: HTMLElement | HTMLElement[]; /** Returns the dragged event data. */ data: Record[]; /** Returns the mouse event. */ event: MouseEvent; /** Defines the cancel option. */ cancel?: boolean; /** Defines the dropped card position. */ dropIndex?: number; } /** * Provides information about a DialogOpen event. * * @interface DialogEventArgs */ export interface DialogEventArgs extends BaseEventArgs { /** Returns the cell or event data. */ data: Record; /** Returns the target element on which the popup is getting opened. */ target?: Element; /** Returns the popup wrapper element. */ element?: Element; /** Defines the cancel option. */ cancel?: boolean; /** Defines the dialog actions. */ requestType?: CurrentAction; } /** * Provides information about a DialogClose event. * * @interface DialogCloseEventArgs */ export interface DialogCloseEventArgs extends DialogEventArgs { /** Defines the dialog interaction. */ interaction?: string; } /** @private */ export interface SaveChanges { addedRecords: Record[]; changedRecords: Record[]; deletedRecords: Record[]; } /** @private */ export interface EJ2Instance extends HTMLElement { ej2_instances: Record[]; } /** @private */ export interface DragArgs extends BaseEventArgs { element?: HTMLElement; cloneElement?: HTMLElement; targetClone?: HTMLElement; draggedClone?: HTMLElement; targetCloneMulti?: HTMLElement; selectedCards?: HTMLElement | HTMLElement[]; instance?: Draggable; pageX?: number; pageY?: number; navigationInterval?: number; cardDetails?: Record[]; modifiedData?: Record[]; } /** * Provide information about Swimlane HeaderArgs * * @interface HeaderArgs * */ export interface HeaderArgs { /** Defines the Swimlane key field */ keyField: string | number; /** Defines the Swimlane header text field */ textField: string; /** Defines the number of Cards */ count?: number; } /** @private */ export interface DragEdges { left: boolean; right: boolean; top: boolean; bottom: boolean; } /** @private */ export interface ScrollPosition { content: ScrollOffset; column: { [key: string]: ScrollOffset; }; } /** @private */ export interface ScrollOffset { left?: number; top?: number; } /** @private */ export interface VirtualScrollDataReturnType { result: Record[]; } /** * Custom Sort Compare Function to sort Swimlane rows. * * @interface SortCompareFunction */ export interface SortComparerFunction { /** * Defines the Swimlane Header Arguments. * ```props * (param: HeaderArgs[]):- HeaderArgs[]; * ``` * */ (param: HeaderArgs[]): HeaderArgs[]; } /** Custom data service event types */ export interface DataStateChangeEventArgs { /** Defines the filter criteria */ where?: Predicate[]; /** Defines the Kanban action details */ action?: ActionEventArgs; /** Defines the remote table name */ table?: string; /** Defines the selected field names */ select?: string[]; /** Defines the filter dataSource */ updateData?: Function; } export interface PendingState { /** * The function which resolves the current action's promise. */ resolver?: Function; /** * Defines the current state of the action. */ isPending?: boolean; /** * DataSource changed through set model */ isDataChanged?: boolean; } /** * Provides information about changed the data event. * * @interface DataSourceChangedEventArgs */ export interface DataSourceChangedEventArgs { /** Defines the current action type. */ requestType?: string; /** Defines the state of the performed action */ state?: DataStateChangeEventArgs; /** Returns the appropriate added data based on the action. */ addedRecords?: Record[]; /** Returns the appropriate changed data based on the action. */ changedRecords?: Record[]; /** Returns the appropriate deleted data based on the action. */ deletedRecords?: Record[]; /** Defines the index value */ index?: number; /** Defines the end of editing function. */ endEdit?: Function; /** Defines the Cancel of editing process */ cancelEdit?: Function; /** Defines the query */ query?: Query; /** Defines the promise object. */ promise?: Promise; } /** * Provides information about a column drag and drop operations. * * @interface ColumnDragEventArgs */ export interface ColumnDragEventArgs { /** * If set to true, the drag operation will be canceled */ cancel?: boolean; /** * The original mouse or touch event that triggered the drag operation */ event: MouseEvent | TouchEvent; /** * The HTML element representing the column being dragged */ element: HTMLElement; /** * The index of the column before the drag operation began */ fromIndex?: number; /** * The index where the column is currently being dragged to */ toIndex?: number; /** * The data object representing the column being dragged */ column?: ColumnsModel | StackedHeadersModel; /** * The final index position where the column is dropped */ dropIndex?: number; }