Socket
Socket
Sign inDemoInstall

@blueprintjs/table

Package Overview
Dependencies
Maintainers
1
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/table - npm Package Compare versions

Comparing version 1.18.0 to 1.19.0

6

dist/common/utils.js

@@ -43,3 +43,7 @@ /**

times: function (n, callback) {
return Array.apply(null, Array(n)).map(function (_none, index) { return callback(index); });
var result = Array(n);
for (var index = 0; index < n; index++) {
result[index] = callback(index);
}
return result;
},

@@ -46,0 +50,0 @@ /**

2

dist/headers/headerCell.d.ts

@@ -25,3 +25,3 @@ import * as React from "react";

* anywhere in the header.
* @deprecated since v1.20.0; use `renderMenu` instead
* @deprecated since v1.17.0; use `renderMenu` instead
*/

@@ -28,0 +28,0 @@ menu?: JSX.Element;

@@ -11,3 +11,3 @@ /**

import { IFocusedCellCoordinates } from "./common/cell";
import { Grid } from "./common/grid";
import { Grid, IColumnIndices, IRowIndices } from "./common/grid";
import { Rect } from "./common/rect";

@@ -23,9 +23,2 @@ import { IColumnWidths } from "./headers/columnHeader";

/**
* If `true`, there will be a single "focused" cell at all times,
* which can be used to interact with the table as though it is a
* spreadsheet. When false, no such cell will exist.
* @default false
*/
enableFocus?: boolean;
/**
* If `false`, only a single region of a single column/row/cell may be

@@ -43,2 +36,16 @@ * selected at one time. Using `ctrl` or `meta` key will have no effect,

/**
* A sparse number array with a length equal to the number of columns. Any
* non-null value will be used to set the width of the column at the same
* index. Note that if you want to update these values when the user
* drag-resizes a column, you may define a callback for `onColumnWidthChanged`.
*/
columnWidths?: Array<number | null | undefined>;
/**
* If `true`, there will be a single "focused" cell at all times,
* which can be used to interact with the table as though it is a
* spreadsheet. When false, no such cell will exist.
* @default false
*/
enableFocus?: boolean;
/**
* If `true`, empty space in the table container will be filled with empty

@@ -50,2 +57,8 @@ * cells instead of a blank background.

/**
* If defined, will set the focused cell state. This changes
* the focused cell to controlled mode, meaning you are in charge of
* setting the focus in response to events in the `onFocus` callback.
*/
focusedCell?: IFocusedCellCoordinates;
/**
* If defined, this callback will be invoked for each cell when the user

@@ -69,2 +82,17 @@ * attempts to copy a selection via `mod+c`. The returned data will be copied

/**
* If `false`, hides the row headers and settings menu.
* @default true
*/
isRowHeaderShown?: boolean;
/**
* If `false`, disables reordering of rows.
* @default false
*/
isRowReorderable?: boolean;
/**
* If `false`, disables resizing of rows.
* @default false
*/
isRowResizable?: boolean;
/**
* A list of `TableLoadingOption`. Set this prop to specify whether to

@@ -76,14 +104,6 @@ * render the loading state for the column header, row header, and body

/**
* If resizing is enabled, this callback will be invoked when the user
* finishes drag-resizing a column.
* The number of rows in the table.
*/
onColumnWidthChanged?: IIndexedResizeCallback;
numRows?: number;
/**
* A sparse number array with a length equal to the number of columns. Any
* non-null value will be used to set the width of the column at the same
* index. Note that if you want to update these values when the user
* drag-resizes a column, you may define a callback for `onColumnWidthChanged`.
*/
columnWidths?: Array<number | null | undefined>;
/**
* If reordering is enabled, this callback will be invoked when the user finishes

@@ -94,12 +114,21 @@ * drag-reordering one or more columns.

/**
* If `false`, disables reordering of rows.
* @default false
* If resizing is enabled, this callback will be invoked when the user
* finishes drag-resizing a column.
*/
isRowReorderable?: boolean;
onColumnWidthChanged?: IIndexedResizeCallback;
/**
* If `false`, disables resizing of rows.
* @default false
* If you want to do something after the copy or if you want to notify the
* user if a copy fails, you may provide this optional callback.
*
* Due to browser limitations, the copy can fail. This usually occurs if
* the selection is too large, like 20,000+ cells. The copy will also fail
* if the browser does not support the copy method (see
* `Clipboard.isCopySupported`).
*/
isRowResizable?: boolean;
onCopy?: (success: boolean) => void;
/**
* A callback called when the focus is changed in the table.
*/
onFocus?: (focusedCell: IFocusedCellCoordinates) => void;
/**
* If resizing is enabled, this callback will be invoked when the user

@@ -110,14 +139,2 @@ * finishes drag-resizing a row.

/**
* A sparse number array with a length equal to the number of rows. Any
* non-null value will be used to set the height of the row at the same
* index. Note that if you want to update these values when the user
* drag-resizes a row, you may define a callback for `onRowHeightChanged`.
*/
rowHeights?: Array<number | null | undefined>;
/**
* If `false`, hides the row headers and settings menu.
* @default true
*/
isRowHeaderShown?: boolean;
/**
* If reordering is enabled, this callback will be invoked when the user finishes

@@ -132,20 +149,6 @@ * drag-reordering one or more rows.

/**
* A callback called when the focus is changed in the table.
* A callback called when the visible cell indices change in the table.
*/
onFocus?: (focusedCell: IFocusedCellCoordinates) => void;
onVisibleCellsChange?: (rowIndices: IRowIndices, columnIndices: IColumnIndices) => void;
/**
* If you want to do something after the copy or if you want to notify the
* user if a copy fails, you may provide this optional callback.
*
* Due to browser limitations, the copy can fail. This usually occurs if
* the selection is too large, like 20,000+ cells. The copy will also fail
* if the browser does not support the copy method (see
* `Clipboard.isCopySupported`).
*/
onCopy?: (success: boolean) => void;
/**
* Render each row's header cell.
*/
renderRowHeader?: IRowHeaderRenderer;
/**
* An optional callback for displaying a context menu when right-clicking

@@ -159,11 +162,12 @@ * on the table body. The callback is supplied with an array of

/**
* The number of rows in the table.
* Render each row's header cell.
*/
numRows?: number;
renderRowHeader?: IRowHeaderRenderer;
/**
* If defined, will set the focused cell state. This changes
* the focused cell to controlled mode, meaning you are in charge of
* setting the focus in response to events in the `onFocus` callback.
* A sparse number array with a length equal to the number of rows. Any
* non-null value will be used to set the height of the row at the same
* index. Note that if you want to update these values when the user
* drag-resizes a row, you may define a callback for `onRowHeightChanged`.
*/
focusedCell?: IFocusedCellCoordinates;
rowHeights?: Array<number | null | undefined>;
/**

@@ -225,2 +229,11 @@ * If defined, will set the selected regions in the cells. If defined, this

/**
* The coordinates of the currently focused table cell
*/
focusedCell?: IFocusedCellCoordinates;
/**
* An array of pixel offsets for resize guides, which are drawn over the
* table body when a row is being resized.
*/
horizontalGuides?: number[];
/**
* If `true`, will disable updates that will cause re-renders of children

@@ -239,17 +252,2 @@ * components. This is used, for example, to disable layout updates while

/**
* The `Rect` bounds of the viewport used to perform virtual viewport
* performance enhancements.
*/
viewportRect?: Rect;
/**
* An array of pixel offsets for resize guides, which are drawn over the
* table body when a column is being resized.
*/
verticalGuides?: number[];
/**
* An array of pixel offsets for resize guides, which are drawn over the
* table body when a row is being resized.
*/
horizontalGuides?: number[];
/**
* An array of row heights. These are initialized updated when the user

@@ -264,5 +262,11 @@ * drags row header resize handles.

/**
* The coordinates of the currently focused table cell
* An array of pixel offsets for resize guides, which are drawn over the
* table body when a column is being resized.
*/
focusedCell?: IFocusedCellCoordinates;
verticalGuides?: number[];
/**
* The `Rect` bounds of the viewport used to perform virtual viewport
* performance enhancements.
*/
viewportRect?: Rect;
}

@@ -363,2 +367,4 @@ export declare class Table extends AbstractComponent<ITableProps, ITableState> {

private hasLoadingOption;
private updateViewportRect;
private invokeOnVisibleCellsChangeCallback(viewportRect);
private setBodyRef;

@@ -365,0 +371,0 @@ private setMenuRef;

@@ -255,3 +255,3 @@ /**

var viewportRect = _this.locator.getViewportRect();
_this.setState({ viewportRect: viewportRect });
_this.updateViewportRect(viewportRect);
}

@@ -467,2 +467,6 @@ };

};
_this.updateViewportRect = function (nextViewportRect) {
_this.setState({ viewportRect: nextViewportRect });
_this.invokeOnVisibleCellsChangeCallback(nextViewportRect);
};
_this.setBodyRef = function (ref) { return _this.bodyElement = ref; };

@@ -617,6 +621,6 @@ _this.setMenuRef = function (ref) { return _this.menuElement = ref; };

this.locator = new locator_1.Locator(this.rootTableElement, this.bodyElement, this.grid);
this.setState({ viewportRect: this.locator.getViewportRect() });
this.updateViewportRect(this.locator.getViewportRect());
this.resizeSensorDetach = resizeSensor_1.ResizeSensor.attach(this.rootTableElement, function () {
if (!_this.state.isLayoutLocked) {
_this.setState({ viewportRect: _this.locator.getViewportRect() });
_this.updateViewportRect(_this.locator.getViewportRect());
}

@@ -810,2 +814,3 @@ });

this.grid = new grid_1.Grid(rowHeights, columnWidths, grid_1.Grid.DEFAULT_BLEED, defaultRowHeight, defaultColumnWidth);
this.invokeOnVisibleCellsChangeCallback(this.state.viewportRect);
}

@@ -878,5 +883,10 @@ };

var nextViewportRect = new rect_1.Rect(nextScrollLeft, nextScrollTop, viewportRect.width, viewportRect.height);
this.setState({ viewportRect: nextViewportRect });
this.updateViewportRect(nextViewportRect);
}
};
Table.prototype.invokeOnVisibleCellsChangeCallback = function (viewportRect) {
var columnIndices = this.grid.getColumnIndicesInRect(viewportRect);
var rowIndices = this.grid.getRowIndicesInRect(viewportRect);
core_1.Utils.safeInvoke(this.props.onVisibleCellsChange, rowIndices, columnIndices);
};
return Table;

@@ -883,0 +893,0 @@ }(core_1.AbstractComponent));

{
"name": "@blueprintjs/table",
"version": "1.18.0",
"version": "1.19.0",
"description": "Scalable interactive table component",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -56,3 +56,7 @@ /**

times<T>(n: number, callback: (i: number) => T): T[] {
return Array.apply(null, Array(n)).map((_none: any, index: number) => callback(index));
const result: T[] = Array(n);
for (let index = 0; index < n; index++) {
result[index] = callback(index);
}
return result;
},

@@ -59,0 +63,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc