@true-directive/base
Version:
The set of base classes for the TrueDirective Grid
73 lines (72 loc) • 3.14 kB
TypeScript
/**
* Copyright (c) 2018-2019 Aleksey Melnikov, True Directive Company.
* @link https://truedirective.com/
* @license MIT
*/
import { GridPart } from './enums';
import { Column } from './column.class';
import { ColumnBand } from './column-band.class';
import { GridLayoutSelection } from './grid-layout-selection.class';
import { UIAction } from './ui-action.class';
import { ColumnCollection } from './column-collection.class';
/**
* Разметка секции грида.
* Содержит колонки только своей секции
* Пересчитывает их ширину
* Содержит информацию о выделенных областях своей секции
* @return [description]
*/
export declare class GridLayout {
place: GridPart;
groupLevels: boolean;
columns: Column[];
bands: ColumnBand[];
totalWidth: number;
readonly selection: GridLayoutSelection;
tag: string;
private _levelColumns;
private _autoWidth;
private _widthUnit;
private _levelIndent;
readonly levelColumns: Column[];
readonly isLeft: boolean;
readonly isCenter: boolean;
readonly isRight: boolean;
updateGroupedColumns(groupedColumns: Column[]): void;
updateTreeColumns(maxLevel: number): void;
readonly levelsWidth: number;
private columnDataWidth;
columnHeaderWidth(col: Column): number;
displayedHeaderWidth(col: Column): string;
readonly headerWidth: string;
readonly dataWidth: string;
visibleColumnCount(groupedTemp: any): number;
update(columns: Column[], widthUnit?: string, levelIndent?: number, clientWidth?: number, autoWidth?: boolean): void;
private minWidth;
private removeColumnWithLowPriority;
private fixedSize;
private calcWidth;
resize(widthUnit: string, levelIndent: number, clientWidth: number, autoWidth: boolean): void;
/**
* Is it possible to reorder the column at the specified coordinates?
* @param mouseAction User action info with mouse coordinates
* @param items List of column headers or bands
* @param r0 Header bounding rectangle
* @param hasL We have part positioned to left of this part
* @param hasR We have part positioned to right of this part
* @param columns Columns collection of the grid
* @return Possibility of reordering, position
*/
canDrop(mouseAction: UIAction, items: any[], r0: DOMRect, hasL: boolean, hasR: boolean, columns: ColumnCollection): any;
/**
* Returns the column index in the column list by field name
* @param fieldName Name of the field to be searched
* @return Column index
*/
static columnIndex(layouts: GridLayout[], fieldName: string): number;
static columnByIndex(layouts: GridLayout[], index: number): Column;
static columnCount(layouts: GridLayout[]): number;
static firstColumn(layouts: GridLayout[]): Column;
static lastColumn(layouts: GridLayout[]): Column;
constructor(place: GridPart);
}