Skip to content

Instantly share code, notes, and snippets.

@michael-yx-wu
Created December 5, 2016 17:08
Show Gist options
  • Save michael-yx-wu/e0616c5b1ca0f636319e9ebb1304e22f to your computer and use it in GitHub Desktop.
Save michael-yx-wu/e0616c5b1ca0f636319e9ebb1304e22f to your computer and use it in GitHub Desktop.
Blueprint Table Loading Options
// column.ts
export type ColumnLoadingOptions = "cell"
| "column-header"
export const ColumnLoadingOptions = {
CELL: "cell" as ColumnLoadingOptions,
COLUMN_HEADER: "column-header" as ColumnLoadingOptions,
};
export interface IColumnProps extends IColumnNameProps, IProps {
...
loadingOptions?: Set<ColumnLoadingOptions>;
}
// rowHeader.tsx
export type RowHeaderLoadingOptions = "row-header";
export interface IRowHeaderProps extends ISelectableProps, IRowIndices, IRowHeights, ILockableLayout {
...
loadingOptions?: Set<ColumnLoadingOptions>;
}
// table.tsx
export type TableLoadingOptions = ColumnLoadingOptions | RowHeaderLoadingOptions;
export const TableLoadingOptions = {
CELL: "blah" as TableLoadingOptions,
COLUMN_HEADER: "column-header" as TableLoadingOptions,
ROW_HEADER: "row-header" as TableLoadingOptions,
};
export interface ITableProps extends IProps, IRowHeights, IColumnWidths {
...
/**
* An optional set of `TableLoadingOptions`. When non-empty, the table will
* show a loading animation for all cells that match the options provided.
* For example, a set containing `TableLoadingOptions.COLUMN_HEADER` will
* cause all column header cells to show a loading animation. For more
* granular loading behavior, try directly setting the `loadingOptions`
* prop on `Column` components.
* @default null
*/
loadingOptions?: Set<TableLoadingOptions>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment