WIP

WIP

WIP

WIP

WIP

WIP: Remove trailing newlines

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP: All tests pass

WIP

WIP

WIP
This commit is contained in:
Andy Hanson
2016-11-28 11:16:06 -08:00
parent cd4debea25
commit 89fa98a712
1473 changed files with 77478 additions and 76346 deletions
+68 -68
View File
@@ -17,96 +17,96 @@ declare namespace AdazzleReactDataGrid {
* Gets the data to render in each row. Required.
* Can be an array or a function that takes an index and returns an object.
*/
rowGetter: Array<Object> | ((rowIdx: number) => Object)
rowGetter: Array<Object> | ((rowIdx: number) => Object);
/**
* The total number of rows to render. Required.
*/
rowsCount: number
rowsCount: number;
/**
* The columns to render.
*/
columns?: Array<Column>
columns?: Array<Column>;
/**
* Invoked when the user changes the value of a single cell.
* Should update that cell's value.
* @param e Information about the event
*/
onRowUpdated?: (e: RowUpdateEvent) => void
onRowUpdated?: (e: RowUpdateEvent) => void;
/**
* Invoked when the user pulls down the drag handle of an editable cell.
* Should update the values of the selected cells.
* @param e Information about the event
*/
onCellsDragged?: (e: CellDragEvent) => void
onCellsDragged?: (e: CellDragEvent) => void;
/**
* Invoked when the user double clicks on the drag handle of an editable cell.
* Should update the values of the cells beneath the selected cell.
* @param e Information about the event
*/
onDragHandleDoubleClick?: (e: DragHandleDoubleClickEvent) => void
onDragHandleDoubleClick?: (e: DragHandleDoubleClickEvent) => void;
/**
* Invoked when the user copies a value from one cell and pastes it into another (in the same column).
* Should update the value of the cell in row e.toRow.
* @param e Information about the event
*/
onCellCopyPaste?: (e: CellCopyPasteEvent) => void
onCellCopyPaste?: (e: CellCopyPasteEvent) => void;
/**
* Invoked after the user updates the grid rows in any way.
* @param e Information about the event
*/
onGridRowsUpdated?: (e: GridRowsUpdatedEvent) => void
onGridRowsUpdated?: (e: GridRowsUpdatedEvent) => void;
/**
* A toolbar to display above the grid.
* Consider using the toolbar included in "react-data-grid/addons".
*/
toolbar?: React.ReactElement<any>
toolbar?: React.ReactElement<any>;
/**
* A context menu to disiplay when the user right-clicks a cell.
* Consider using "react-contextmenu", included in "react-data-grid/addons".
*/
contextMenu?: React.ReactElement<any>
contextMenu?: React.ReactElement<any>;
/**
* A react component to customize how rows are rendered.
* If you want to define your own, consider extending ReactDataGrid.Row.
*/
rowRenderer?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>
rowRenderer?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>;
/**
* A component to display when there are no rows to render.
*/
emptyRowsView?: React.ComponentClass<any> | React.StatelessComponent<any>
emptyRowsView?: React.ComponentClass<any> | React.StatelessComponent<any>;
/**
* The minimum width of the entire grid in pixels.
*/
minWidth?: number
minWidth?: number;
/**
* The minimum height of the entire grid in pixels.
* @default 350
*/
minHeight?: number
minHeight?: number;
/**
* The height of each individual row in pixels.
* @default 35
*/
rowHeight?: number
rowHeight?: number;
/**
* The height of the header row in pixels.
* @default rowHeight
*/
headerRowHeight?: number
headerRowHeight?: number;
/**
* The minimum width of each column in pixels.
* @default 80
*/
minColumnWidth?: number
minColumnWidth?: number;
/**
* Invoked when a column has been resized.
* @param index The index of the column
* @param width The new width of the column
*/
onColumnResize?: (index: number, width: number) => void
onColumnResize?: (index: number, width: number) => void;
/**
* Controls what happens when the user navigates beyond the first or last cells.
@@ -115,7 +115,7 @@ declare namespace AdazzleReactDataGrid {
* 'none' will do nothing.
* @default none
*/
cellNavigationMode?: 'none' | 'loopOverRow' | 'changeRow'
cellNavigationMode?: 'none' | 'loopOverRow' | 'changeRow';
/**
* Called when the user sorts the grid by some column.
@@ -123,18 +123,18 @@ declare namespace AdazzleReactDataGrid {
* @param sortColumn The name of the column being sorted by
* @param sortDirection The direction to sort ('ASC'/'DESC'/'NONE')
*/
onGridSort?: (sortColumn: string, sortDirection: 'ASC' | 'DESC' | 'NONE') => void
onGridSort?: (sortColumn: string, sortDirection: 'ASC' | 'DESC' | 'NONE') => void;
/**
* Called when the user filters a column by some value.
* Should restrict the rows in rowGetter to only things that match the filter.
* @param filter The filter being added
*/
onAddFilter?: (filter: Filter) => void
onAddFilter?: (filter: Filter) => void;
/**
* Called when the user clears all filters.
* Should restore the rows in rowGetter to their original state.
*/
onClearFilters?: () => void
onClearFilters?: () => void;
/**
* When set to true or 'multi', enables multiple row select.
@@ -142,34 +142,34 @@ declare namespace AdazzleReactDataGrid {
* When set to false or not set, disables row select.
* @default false
*/
enableRowSelect?: boolean | 'single' | 'multi'
enableRowSelect?: boolean | 'single' | 'multi';
/**
* Called when a row is selected.
* @param rows The (complete) current selection of rows.
*/
onRowSelect?: (rows: Array<Object>) => void
onRowSelect?: (rows: Array<Object>) => void;
/**
* A property that's unique to every row.
* This property is required to enable row selection.
* @default 'id'
*/
rowKey?: string
rowKey?: string;
/**
* Enables cells to be selected when clicked.
* @default false
*/
enableCellSelect?: boolean
enableCellSelect?: boolean;
/**
* Called when a cell is selected.
* @param coordinates The row and column indices of the selected cell.
*/
onCellSelected?: (coordinates: {rowIdx: number, idx: number}) => void
onCellSelected?: (coordinates: {rowIdx: number, idx: number}) => void;
/**
* Called when a cell is deselected.
* @param coordinates The row and column indices of the deselected cell.
*/
onCellDeSelected?: (coordinates: {rowIdx: number, idx: number}) => void
onCellDeSelected?: (coordinates: {rowIdx: number, idx: number}) => void;
/**
* How long to wait before rendering a new row while scrolling in milliseconds.
@@ -200,54 +200,54 @@ declare namespace AdazzleReactDataGrid {
* A unique key for this column. Required.
* Each row should have a property with this name, which contains this column's value.
*/
key: string
key: string;
/**
* This column's display name. Required.
*/
name: string
name: string;
/**
* A custom width for this specific column.
* @default minColumnWidth from the ReactDataGrid
*/
width?: number
width?: number;
/**
* Whether this column can be resized by the user.
* @default false
*/
resizable?: boolean
resizable?: boolean;
/**
* Whether this column should stay fixed on the left as the user scrolls horizontally.
* @default false
*/
locked?: boolean
locked?: boolean;
/**
* Whether this column can be edited.
* @default false
*/
editable?: boolean
editable?: boolean;
/**
* Whether the rows in the grid can be sorted by this column.
* @default false
*/
sortable?: boolean
sortable?: boolean;
/**
* Whether the rows in the grid can be filtered by this column.
* @default false
*/
filterable?: boolean
filterable?: boolean;
/**
* The editor for this column. Several editors are available in "react-data-grid/addons".
* @default A simple text editor
*/
editor?: React.ReactElement<any>
editor?: React.ReactElement<any>;
/**
* A custom read-only formatter for this column. An image formatter is available in "react-data-grid/addons".
*/
formatter?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>
formatter?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>;
/**
* A custom formatter for this column's header.
*/
headerRenderer?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>
headerRenderer?: React.ReactElement<any> | React.ComponentClass<any> | React.StatelessComponent<any>;
/**
* Events to be bound to the cells in this specific column.
* Each event must respect this standard in order to work correctly:
@@ -255,8 +255,8 @@ declare namespace AdazzleReactDataGrid {
* function onXxx(ev :SyntheticEvent, (rowIdx, idx, name): args)
*/
events?: {
[name: string]: ColumnEventCallback
}
[name: string]: ColumnEventCallback;
};
}
interface ColumnEventCallback {
@@ -265,7 +265,7 @@ declare namespace AdazzleReactDataGrid {
* @param ev The react event
* @param args The row and column coordinates of the cell, and the name of the event.
*/
(ev: React.SyntheticEvent<any>, args: {rowIdx: number, idx: number, name: string}): void
(ev: React.SyntheticEvent<any>, args: {rowIdx: number, idx: number, name: string}): void;
}
/**
@@ -275,19 +275,19 @@ declare namespace AdazzleReactDataGrid {
/**
* The index of the updated row.
*/
rowIdx: number
rowIdx: number;
/**
* The columns that were updated and their values.
*/
updated: Object
updated: Object;
/**
* The name of the column that was updated.
*/
cellKey: string
cellKey: string;
/**
* The name of the key pressed to trigger the event ('Tab', 'Enter', etc.).
*/
key: string
key: string;
}
/**
@@ -297,19 +297,19 @@ declare namespace AdazzleReactDataGrid {
/**
* The name of the column that was dragged.
*/
cellKey: string
cellKey: string;
/**
* The row where the drag began.
*/
fromRow: number
fromRow: number;
/**
* The row where the drag ended.
*/
toRow: number
toRow: number;
/**
* The value of the cell that was dragged.
*/
value: any
value: any;
}
/**
@@ -319,19 +319,19 @@ declare namespace AdazzleReactDataGrid {
/**
* The row where the double click occurred.
*/
rowIdx: number
rowIdx: number;
/**
* The column where the double click occurred.
*/
idx: number
idx: number;
/**
* The values of the row.
*/
rowData: Object
rowData: Object;
/**
* The double click event.
*/
e: React.SyntheticEvent<any>
e: React.SyntheticEvent<any>;
}
/**
@@ -341,23 +341,23 @@ declare namespace AdazzleReactDataGrid {
/**
* The row that was pasted to.
*/
rowIdx: number
rowIdx: number;
/**
* The value that was pasted.
*/
value: any
value: any;
/**
* The row that was copied from.
*/
fromRow: number
fromRow: number;
/**
* The row that was pasted to.
*/
toRow: number
toRow: number;
/**
* The key of the column where the copy paste occurred.
*/
cellKey: string
cellKey: string;
}
/**
@@ -367,24 +367,24 @@ declare namespace AdazzleReactDataGrid {
/**
* The key of the column where the event occurred.
*/
cellKey: string
cellKey: string;
/**
* The top row affected by the event.
*/
fromRow: number
fromRow: number;
/**
* The bottom row affected by the event.
*/
toRow: number
toRow: number;
/**
* The columns that were updated and their values.
*/
updated: Object
updated: Object;
/**
* The action that occurred to trigger this event.
* One of 'cellUpdate', 'cellDrag', 'columnFill', or 'copyPaste'.
*/
action: 'cellUpdate' | 'cellDrag' | 'columnFill' | 'copyPaste'
action: 'cellUpdate' | 'cellDrag' | 'columnFill' | 'copyPaste';
}
/**
@@ -394,11 +394,11 @@ declare namespace AdazzleReactDataGrid {
/**
* The key of the column being filtered.
*/
columnKey: string
columnKey: string;
/**
* The term to filter by.
*/
filterTerm: string
filterTerm: string;
}
/**
@@ -459,7 +459,7 @@ declare namespace AdazzleReactDataGridPlugins {
export function ContextMenuLayer(
identifier: any,
configure?: (props: any) => any
): (Component: any) => any
): (Component: any) => any;
}
}
@@ -493,7 +493,7 @@ declare module "react-data-grid/addons" {
Formatters: typeof Formatters
Toolbar: typeof Toolbar
Menu: typeof Menu
}
};
}
}
}