UNPKG

es-grid-template

Version:

es-grid-template

159 lines (158 loc) 9.97 kB
import type { Row, Table } from "@tanstack/react-table"; import { type Column } from "@tanstack/react-table"; import type { VirtualItem } from "@tanstack/react-virtual"; import type { AnyObject, ColumnsTable, ColumnTable, EditType, FilterOperator, IColumnType, IFormat, RangeState, Sorter, TypeFilter } from "./../../grid-component/type"; import type { Key } from "react"; import { type CSSProperties } from "react"; import dayjs from "dayjs"; import type { IPositionCell } from "../useContext"; import type { ColumnDef } from "@tanstack/react-table"; import type { TreeDataNode } from "antd"; export declare const newGuid: () => any; export declare const convertDayjsToDate: (dateString: string, format?: string) => Date; export declare const convertDateToDayjs: (date: Date | undefined, format?: string) => dayjs.Dayjs; export declare const getCommonPinningStyles: (column: Column<any>) => CSSProperties; export declare const getCommonPinningStyles2: (header: any) => CSSProperties; export declare const sumSize: (items: any) => number; export declare const appendIfNotExists: (a: VirtualItem[], b: VirtualItem[]) => VirtualItem[]; export declare const getNewItemsOnly: (a: VirtualItem[], b: VirtualItem[]) => VirtualItem[]; export declare const extendsObject: <T extends AnyObject = AnyObject>(...list: T[]) => AnyObject; export declare const isEmpty: (d: any) => boolean; export declare const getFormat: (colFormat?: IFormat, format?: IFormat) => { thousandSeparator: string; decimalSeparator: string; decimalScale: number; allowNegative: boolean; prefix: string; suffix: string; fixedDecimalScale: boolean; dateFormat: string; datetimeFormat: string; timeFormat: string; weekFormat: string; monthFormat: string; yearFormat: string; }; export declare function convertFormat(formatStr: string): string; export declare const getDatepickerFormat: (type: EditType | TypeFilter | IColumnType, format?: IFormat) => string; export declare const getDateRangeFormat: (type: EditType | TypeFilter | IColumnType, format?: IFormat) => string; export declare const getTypeFilter: (col: any) => TypeFilter; export declare const addRowIdArray: (inputArray: any[]) => any[]; export declare function groupArrayByColumns(arr: any[], columns: string[] | undefined): any; export declare const flatColumns2: <RecordType>(columns: ColumnsTable<RecordType>) => ColumnsTable<RecordType>; export declare const flatColumnsWithoutParent: (columns: any[]) => any; export declare const checkThousandSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string; export declare const checkDecimalSeparator: (thousandSeparator: string | undefined, decimalSeparator: string | undefined) => string; export declare const getFixedFields: <T>(columns: ColumnsTable<T>, type: 'left' | 'right') => string[]; export declare function areStringArraysEqual(a: string[], b: string[]): boolean; export declare const getDefaultOperator: (col: ColumnTable) => FilterOperator; export declare function isEqualSet(setA: any, setB: any): boolean; export declare const getLastSelectCell: (selectCells: any) => { row: number; col: number; }; export declare function getCellsByPosition(cellSet: any, position?: string): any[]; export declare const onAddBgSelectedCell: (selectedCells: any, id?: string, isFocusCellIndex?: boolean) => void; export declare const onRemoveBgSelectedCell: (selectedCells: any, id?: string, rowsSelected?: any) => void; export declare function getColIdsBetween(table: Table<any>, a: string, b: string): string[]; export declare function getRowIdsBetween(table: Table<any>, a: string, b: string): string[]; export declare const updateArrayByKey: (arr: any[], element: any, key: string) => any[]; export declare const unFlattenData: <RecordType extends AnyObject = AnyObject>(data: RecordType[]) => RecordType[]; export declare const flattenArray: <RecordType extends AnyObject = AnyObject>(arr: any[]) => RecordType[]; export declare function updateOrInsert(dataArray: any[], dataFilter: any[]): any[]; export declare const findItemByKey: (array: any, key: string | number, value: any) => any; export declare const isFormattedNumber: (str: string) => boolean; export declare const detectSeparators: (str: string) => { thousandSeparator: string; decimalSeparator: string; }; export declare function isDateString(str: any): boolean; export declare function compareDates(date1: any, date2: any): boolean; export declare function compareDate(itemValue: any, value: any): boolean; export declare const removeVietnameseTones: (str: any) => any; export declare const shouldInclude: (item: any, queries: any[], ignoreAccents?: boolean) => any; export declare function sortData(data: any[], sorter: Sorter[]): any[]; export declare function filterDataByColumns(data: any[], queries: any[], sorter: Sorter[], keysFilter: string[] | undefined, ignoreAccents?: boolean): any[]; export declare const getAllRowKey: (data: any[]) => any[]; export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean); export declare const checkFieldKey: (key: string | undefined) => string; export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[]; export declare const convertLabelToTitle: (data: any[]) => any[]; export declare const isNullOrUndefined: (d: any) => boolean; export declare const isObjEmpty: (obj: any) => boolean; export declare const isDisable: <T>(column: ColumnTable<T>, rowData?: any) => boolean; export declare const customWeekStartEndFormat: (value: any, weekFormat: string) => string; export declare const parseBooleanToValue: (value: boolean, type: 'boolean' | 'number') => number | boolean; export declare const isNameColor: (strColor: string) => boolean; export declare const isColor: (value: string) => boolean; export declare const genPresets: (presets?: import("@ant-design/colors").PalettesProps) => import("antd/es/color-picker/interface").PresetsItem[]; export declare const getEditType: <T>(column: ColumnTable<T>, rowData?: any) => EditType; export declare const getDefaultValue: (defaultValue: any) => AnyObject; export declare const flattenData: <RecordType extends AnyObject = AnyObject>(childrenColumnName: string, data?: RecordType[]) => RecordType[]; export declare const getSelectedCellMatrix: (table: Table<any>, startCell: IPositionCell | undefined, endCell: IPositionCell | undefined) => RangeState; export declare function addRowsDownWithCtrl(arr: any, n: number): { combined: any; addedRows: any[]; } | { combined: any[]; addedRows: any[]; }; export declare function addRowsDown(arr: any, n: number): { combined: any; addedRows: any[]; } | { combined: any[]; addedRows: any[]; }; export declare function addRowsUpWithCtrl(array: any, n: number): { combined: any; addedRows: any[]; } | { combined: any[]; addedRows: any[]; }; export declare function addRowsUp(array: any, n: number): { combined: any; addedRows: any[]; } | { combined: any[]; addedRows: any[]; }; export declare const convertFilters: (filters: any[]) => any[]; export declare function getInvisibleColumns(columns: ColumnTable[]): Record<string, boolean>; export declare const getAllVisibleKeys: (columns: any[]) => any[]; export declare const getAllVisibleKeys1: (columns: ColumnTable[]) => any[]; export declare function getHiddenParentKeys(columns: any[], parentKeys?: string[]): string[]; export declare function getHiddenParentKeys1(columns: ColumnTable[], parentKeys?: string[]): string[]; export declare const getVisibleColumnKeys: (columns: any[]) => string[]; export declare const getVisibleColumnKeys1: (columns: any[]) => string[]; export declare function isObjEqual(obj1: any, obj2: any): boolean; export declare const sortByType: <T>(arr: ColumnTable<T>[]) => ColumnTable<T>[]; export declare function convertColumnsToTreeData<T>(columns: ColumnDef<T, any>[], groupColumns?: string[]): TreeDataNode[]; export declare const updateColumns1: (columns: ColumnTable[], includes: string[]) => ColumnTable[]; export declare const convertToObj: (arr: any) => { [k: string]: any; }; export declare const convertToObjTrue: (arr: any) => { [k: string]: any; }; export declare const getDiffent2Array: (a: any[], b: any[]) => any[]; export declare function findFirst(items: Column<any>[]): Column<any, unknown>; export declare function isTreeArray(arr: any[]): boolean; export declare function isTreeArray2(arr: any[]): boolean; export declare function updateColumnWidthsRecursive(columns: any[], sizing: Record<string, number>): any[]; export declare function updateWidthsByOther(source: any[], target: any[]): any[]; export declare function findAllChildrenKeys2<RecordType>(data: readonly RecordType[], rowKey: any, childrenColumnName: string): Key[]; export declare function parseExcelClipboardText(text: string): string[][]; export declare function parseExcelClipboard(e: React.ClipboardEvent): string[][]; export declare function arraysEqualIgnoreOrderFast(a: any[], b: any[]): boolean; export declare function filterByIds(a: any[], b: any[]): any[]; export declare function excludeItems(arrayA: any[], arrayB: any[]): any[]; export declare function getAllChildren(row: any): any; export declare function toggleRowAndChildren(row: Row<any>, isSelected?: boolean): void; export declare function countUnselectedChildren(row: Row<any>): number; export declare function removeDuplicatesByKey(arr: any[], key?: string): any[]; export declare const getTableHeight: (height?: number, minHeight?: number) => number; export declare const convertFlatColumn1: (array: ColumnsTable) => ColumnsTable[]; export declare const updateColumnsByGroup: (columns: any[], columnsGroup: string[]) => any[]; export declare const removeColumns: <RecordType>(columns: ColumnTable<RecordType>[], groupColumns: string[]) => ColumnsTable<RecordType>;