es-grid-template
Version:
es-grid-template
172 lines (171 loc) • 11.2 kB
TypeScript
import type * as React from "react";
import dayjs from "dayjs";
import type { EditType, IColumnType, TypeFilter } from "rc-master-ui";
import type { Key } from "react";
import type { ColumnsTable } from "./../index";
import type { AnyObject, ColumnTable, GetRowKey, IFormat } from "../type";
export declare const newGuid: () => any;
export declare const sumDataByField: (data: any[], field: string) => 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 isEmpty: (d: any) => boolean;
export declare const removeVietnameseTones: (str: any) => any;
export declare const isNullOrUndefined: (d: any) => boolean;
export declare const convertDayjsToDate: (dateString: string, format?: string) => Date;
export declare const convertDateToDayjs: (date: Date | undefined, format?: string) => dayjs.Dayjs;
export declare const isNameColor: (strColor: string) => boolean;
export declare const isColor: (value: string) => boolean;
export declare const getAllVisibleKeys: (columns: any[]) => any[];
export declare const getVisibleColumnKeys: (columns: any[]) => string[];
export declare function getHiddenParentKeys(columns: any[], parentKeys?: string[]): string[];
export declare const updateColumns: (columns: any[], includes: string[]) => any[];
export declare const updateColumnsByGroup: (columns: any[], columnsGroup: string[]) => any[];
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 customWeekStartEndFormat: (value: any, weekFormat: string) => string;
export declare const getTypeFilter: (col: ColumnTable<any>) => TypeFilter;
export declare const updateArrayByKey: (arr: any[], element: any, key: string) => any[];
export declare const getDateString: <T>(column: ColumnTable<T>, value: any) => string;
export declare const getEditType: <T>(column: ColumnTable<T>, rowData?: any) => EditType;
export declare const isDisable: <T>(column: ColumnTable<T>, rowData?: any) => boolean;
export declare const checkFieldKey: (key: string | undefined) => string;
export declare const convertLabelToTitle: (data: any[]) => any[];
export declare const convertArrayWithIndent: (inputArray: any[], parentIndent?: number) => any[];
export declare const getTemplate: (template: any, column?: ColumnTable) => React.ReactNode | React.ReactElement;
export declare const isObjEmpty: (obj: any) => boolean;
export declare const getColumnsVisible: <T>(columns: ColumnsTable<T>, index: number) => ColumnTable<T>[];
export declare const updateData: <Record = AnyObject>(initData: Record[], rows: Record[], key: keyof Record) => Record[];
export declare const parseBooleanToValue: (value: boolean, type: 'boolean' | 'number') => number | boolean;
export declare const genPresets: (presets?: import("@ant-design/colors").PalettesProps) => import("antd/es/color-picker/interface").PresetsItem[];
export declare function findAllChildrenKeys<RecordType>(data: readonly RecordType[], getRowKey: GetRowKey<RecordType>, childrenColumnName: string): Key[];
export declare function findAllChildrenKeys2<RecordType>(data: readonly RecordType[], rowKey: any, childrenColumnName: string): Key[];
export declare const flattenArray: <RecordType extends AnyObject = AnyObject>(arr: any[]) => RecordType[];
export declare const flattenData: <RecordType extends AnyObject = AnyObject>(childrenColumnName: string, data?: RecordType[]) => RecordType[];
export declare const unFlattenData: <RecordType extends AnyObject = AnyObject>(data: RecordType[]) => RecordType[];
export declare const countItemsBeforeIndex: (array: any[], index: number) => number;
export declare const getRowNumber: (array: any[], rowKey: any, key: any) => number;
export declare const getDefaultValue: (defaultValue: any) => AnyObject;
export declare const addRowIdArray: (inputArray: any[]) => any[];
export declare const findItemByKey: (array: any, key: string | number, value: any) => any;
export declare const getLastSelectCell: (selectCells: any) => {
row: number;
col: number;
};
export declare const getFirstSelectCell: (selectCells: any) => {
row: number;
col: number;
};
export declare const getRowsPasteIndex: (pasteRows: any) => number[];
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 convertFlatColumn: (array: ColumnsTable) => ColumnsTable[];
export declare const checkChild: (inputArray: any[]) => boolean;
export declare const isEditable: <RecordType>(column: ColumnTable, rowData: RecordType) => boolean | ((rowData: any) => boolean);
export declare const isArraysEqual: (arr1: any[], arr2: any[]) => boolean;
export declare const editAbleColumns: <T>(columns: ColumnsTable<T>) => ColumnTable<T>[];
export declare const findItemPath: (tree: any[], targetItem: any, rowKey: any, currentPage?: number, pageSize?: number) => any;
export declare const filterDataByColumns: (data: any[], queries: any) => any[];
export declare const filterDataByColumns2: (data: any[], queries: any) => any[];
export declare const removeFieldRecursive: (data: any[], field: string) => any[];
export declare const filterDataByColumns3: (data: any[], queries: any[]) => any[];
export declare const shouldInclude: (item: any, queries: any[]) => any;
export declare function filterDataByColumns4(data: any[], queries: any[], keysFilter: string[] | undefined): any[];
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 function invalidDate(date: any): boolean;
export declare const isContinuous: (set: any) => boolean;
export declare const parseCells: (cellSet: any) => {
row: any;
col: any;
key: any;
}[];
export declare const buildConnectedRegions: (cells: any) => any[];
export declare const isBottomMostInRegion: (rowIndex: number, colIndex: number, listSelectCell: any) => boolean;
export declare const isTopMostInRegion: (rowIndex: number, colIndex: number, listSelectCell: any) => boolean;
export declare function isRightMostInRegion(rowIndex: number, colIndex: number, listSelectCell: any): boolean;
export declare function isEqualSet(setA: any, setB: any): boolean;
export declare function isBottomMostInRanges(rowIndex: number, colIndex: number, regions: any[]): boolean;
export declare const mergedSets: (arr: any[]) => Set<unknown>;
export declare const sortedSetASC: (setValue: any) => Set<unknown>;
export declare const sortedSetDSC: (setValue: any) => Set<unknown>;
export declare function getBottomRowCells(cellSet: any): any[];
export declare function getCellsByPosition(cellSet: any, position?: string): any[];
export declare function getCellsByPosition2(cellSet: any, position?: string): any[];
export declare const addBorderClass: (selectedCells: any, type: string, className: string, id?: string, nextCellRight?: boolean) => void;
export declare const removeBorderClass: (selectedCells: any, type: string, className: string, id?: string) => void;
export declare const addBorderPasteClass: (selectedCells: any, type: string, className: string, id?: string, nextCellRight?: boolean) => void;
export declare const removeBorderPasteClass: (selectedCells: any, type: string, className: string, id?: string) => void;
export declare const removeBorderClass2: (className: string, id?: string) => void;
export declare const onAddBgSelectedCell: (selectedCells: any, id?: string, isFocusCellIndex?: boolean) => void;
export declare const onRemoveBgSelectedCell: (selectedCells: any, id?: string, rowsSelected?: any) => void;
export declare const onAddBgCellIndex: (selectedCells: any, id?: string, isFocusCellIndex?: boolean) => void;
export declare const onRemoveBgCellIndex: (selectedCells: any, id?: string, rowsSelected?: any) => void;
export declare const onAddBorderSelectedCell: (selectedCells: any, id?: string) => void;
export declare const onRemoveBorderSelectedCell: (selectedCells: any, id?: string) => void;
export declare const addClassBorderPasteCell: (pasteCells: any, type: 'up' | 'down', id?: string) => void;
export declare const removeClassBorderPasteCell: (pasteCells: any, type: 'up' | 'down', id?: string) => void;
export declare const addClassCellIndexSelected: (rowsSelected: any, id?: string) => void;
export declare const removeClassCellIndexSelected: (rowsSelected: any, id?: string) => void;
export declare const showDraggingPoint: (selectedCells: any, id?: any) => void;
export declare const hideDraggingPoint: (selectedCells: any, id?: any) => void;
export declare const isRangeCell: (selectedCells: any, type: string, rowIndex: number, colIndex: number) => boolean;
export declare const isSelectedCell: (selectedCells: any, rowIndex: number, colIndex: number) => any;
export declare function groupAndSum(data: any[], columns: any[], groupField?: string): unknown[];
export declare function groupArrayByColumns(data: any[], columns: string[] | undefined): any;
export declare const isFormattedNumber: (str: string) => boolean;
export declare const detectSeparators: (str: string) => {
thousandSeparator: string;
decimalSeparator: string;
};
export declare const convertFilters: (filters: any[]) => any[];
export declare const getAllRowKey: (data: any[]) => any[];
export declare function updateDataByFilter(tree: any[], filter: any[]): any[];
export declare function updateOrInsert(dataArray: any[], dataFilter: any[]): any[];
export declare function mergeWithFilter(dataArray: any[], dataFilter: any[]): any[];
export declare function mergeWithFilter2(dataArray: any[], dataFilter: any[]): any[];
export declare const removeInvisibleColumns: (columns: any[]) => any[];
export declare const sumByField: (data: any[], field: string) => number;
export declare const customFilterOption: (input: string, option: any) => any;