@antv/s2-react-components
Version:
React components for S2
30 lines (29 loc) • 1.51 kB
TypeScript
import type { SheetType } from '@antv/s2';
import type { DraggableLocation } from 'react-beautiful-dnd';
import { ColIcon, RowIcon, ValueIcon } from '../common/icons';
import { DroppableType, FieldType } from './constant';
import type { SwitcherFields, SwitcherItem, SwitcherResult, SwitcherState } from './interface';
export declare const getSwitcherConfig: (allowExchangeHeader?: boolean) => {
rows: {
text: string;
icon: typeof RowIcon;
droppableType: DroppableType;
};
columns: {
text: string;
icon: typeof ColIcon;
droppableType: DroppableType;
};
values: {
text: string;
icon: typeof ValueIcon;
droppableType: DroppableType;
};
};
export declare const getSwitcherClassName: (...classNames: string[]) => string;
export declare const getMainLayoutClassName: (sheetType: SheetType | undefined) => string;
export declare const shouldCrossRows: (sheetType: SheetType | undefined, type: FieldType) => boolean;
export declare const moveItem: (source: SwitcherItem[] | undefined, destination: SwitcherItem[] | undefined, droppableSource: DraggableLocation, droppableDestination: DraggableLocation) => SwitcherState;
export declare const checkItem: (source: SwitcherItem[] | undefined, checked: boolean, id: string, parentId?: string) => SwitcherItem[];
export declare const generateSwitchResult: (state: SwitcherState) => SwitcherResult;
export declare const getSwitcherState: (fields: SwitcherFields) => SwitcherState;