-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
data-grid.js
48 lines (43 loc) · 1.46 KB
/
data-grid.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Data Grid custom element
* https://github.com/lekoala/data-grid/
* @license MIT
*/
import DataGrid from "./src/data-grid.js";
// Optional plugins
import ColumnResizer from "./src/plugins/column-resizer.js";
import ContextMenu from "./src/plugins/context-menu.js";
import DraggableHeaders from "./src/plugins/draggable-headers.js";
import TouchSupport from "./src/plugins/touch-support.js";
import SelectableRows from "./src/plugins/selectable-rows.js";
import FixedHeight from "./src/plugins/fixed-height.js";
import AutosizeColumn from "./src/plugins/autosize-column.js";
import ResponsiveGrid from "./src/plugins/responsive-grid.js";
import RowActions from "./src/plugins/row-actions.js";
import EditableColumn from "./src/plugins/editable-column.js";
import SpinnerSupport from "./src/plugins/spinner-support.js";
import SaveState from "./src/plugins/save-state.js";
// Using shorthand property names
// This make them reserved and keys will be preserved
// Actual class names are renamed
DataGrid.registerPlugins({
ColumnResizer,
ContextMenu,
DraggableHeaders,
TouchSupport,
SelectableRows,
FixedHeight,
AutosizeColumn,
ResponsiveGrid,
RowActions,
EditableColumn,
SpinnerSupport,
SaveState
});
// Prevent errors if included multiple times
if (!customElements.get("data-grid")) {
customElements.define("data-grid", DataGrid);
}
export default DataGrid;
const global = typeof globalThis !== "undefined" ? globalThis : self;
global.DataGrid = DataGrid;