@guiexpert/table 1.0.8 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -0
- package/css/main.css +18 -0
- package/css/table-classes.css +6 -0
- package/css/table-color-vars.css +12 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
|
|
2
|
+
# GuiExpert Table with plain JS
|
|
3
|
+
|
|
4
|
+
This is the base component of the GuiExpert Table Project. One can use this in a plain JS project.
|
|
5
|
+
|
|
6
|
+
## Become a master at creating web applications with large tables
|
|
7
|
+
|
|
8
|
+
This is the UI-agnostic table component for your next web app. 😊
|
|
9
|
+
|
|
10
|
+
<img src="https://raw.githubusercontent.com/guiexperttable/ge-table/main/apps/table-website/src/assets/screens/heatmap.png" width="50%">
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
- Handle large datasets easily
|
|
14
|
+
- Excellent performance for large tables by vertical and horizontal virtual scrolling
|
|
15
|
+
- Fully-featured (advanced sorting and filtering)
|
|
16
|
+
- Highly customizable data grid
|
|
17
|
+
- Outstanding performance
|
|
18
|
+
- No third-party dependencies
|
|
19
|
+
- UI-agnostic
|
|
20
|
+
- Column Interactions (resize, reorder)
|
|
21
|
+
- Sorting Rows
|
|
22
|
+
- Row, Column, and Range Selection
|
|
23
|
+
- Single and Multi Selection
|
|
24
|
+
- UI-agnostic
|
|
25
|
+
- Row and Column Spanning
|
|
26
|
+
- Fixed Columns (Left and Right)
|
|
27
|
+
- Tree table (Hierarchical View)
|
|
28
|
+
- Accessibility support: Keyboard Shortcuts
|
|
29
|
+
- Custom Filtering
|
|
30
|
+
- In-place Cell Editing
|
|
31
|
+
- Userdefined Key and Mouse Events
|
|
32
|
+
- Customizable Look & Feel (via CSS variables)
|
|
33
|
+
- Row sorting
|
|
34
|
+
- Column Reordering (Drag and Drop)
|
|
35
|
+
- State Persistence (Row Sorting, Column Order, Selection)
|
|
36
|
+
- Customizable Cell Contents via Renderer for Header, Body and Footer
|
|
37
|
+
- Full control over the HTML structure and style
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Links
|
|
41
|
+
|
|
42
|
+
- [Demos](https://gui.expert/demos)
|
|
43
|
+
- [Documentation](https://gui.expert/doc)
|
|
44
|
+
- [API](https://gui.expert/api)
|
|
45
|
+
|
|
46
|
+
## Get Started
|
|
47
|
+
|
|
48
|
+
Add the following NPM package to your existing plain JS project (run this in your project root directory):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
npm install --save @guiexpert/table
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Add an empty <div> element to your html code:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
<div
|
|
58
|
+
class="container-div"
|
|
59
|
+
style="width:100%;height:100%;background:transparent;margin:0;padding:0;"
|
|
60
|
+
></div>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If you are working with plain JS, you don't need to do this. If you are using TypeScript as a language, please import the following classes:
|
|
64
|
+
```
|
|
65
|
+
import {
|
|
66
|
+
EventAdapter,
|
|
67
|
+
SimpleDomService,
|
|
68
|
+
TableModelIf,
|
|
69
|
+
TableOptions,
|
|
70
|
+
TableScope } from "@guiexpert/table";
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
Create a table model.
|
|
75
|
+
Select ('querySelector') the <div> element and create a table scope.
|
|
76
|
+
Finally, call firstInit() at least once.
|
|
77
|
+
In this example, you will see the plain TS version. For plain JS, remove ': TableModelIf'.
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
const tableModel: TableModelIf = TableModelFactory
|
|
81
|
+
.createByArrayOfArraysParams<any>(param: {
|
|
82
|
+
columnLabels: [
|
|
83
|
+
['Header 1', 'Header 2']
|
|
84
|
+
],
|
|
85
|
+
data: [
|
|
86
|
+
['Text 1a', 'Text 2a'],
|
|
87
|
+
['Text 1b', 'Text 2b'],
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const ele = document.querySelector(".container-div") as HTMLDivElement;
|
|
92
|
+
|
|
93
|
+
const tableScope = new TableScope(
|
|
94
|
+
ele, tableModel, new SimpleDomService(), new TableOptions(), new EventAdapter()
|
|
95
|
+
);
|
|
96
|
+
tableScope.firstInit();
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
There are numerous possibilities to create table models.
|
|
100
|
+
Please refer to the [Documentation](https://gui.expert/doc) for further information or the [Demo](https://gui.expert/demos) section for examples.
|
|
101
|
+
|
|
102
|
+
|
package/css/main.css
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.ge-table {
|
|
2
|
+
display: block;
|
|
3
|
+
margin: 0;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
1
7
|
|
|
2
8
|
.ge-table-col-div {
|
|
3
9
|
text-align: center;
|
|
@@ -199,6 +205,12 @@ html,
|
|
|
199
205
|
|
|
200
206
|
--ge-table-dragged-col-div-bg: lightcyan;
|
|
201
207
|
--ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
|
|
208
|
+
|
|
209
|
+
--ge-table-color-col-resize-handle-hover-bg: cyan;
|
|
210
|
+
--ge-table-color-dragged-col-div-bg: #fafafa;
|
|
211
|
+
--ge-table-color-drop-zone-bg: #fafafa;
|
|
212
|
+
--ge-table-color-drop-zone: #fafafa;
|
|
213
|
+
--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text);
|
|
202
214
|
}
|
|
203
215
|
|
|
204
216
|
|
|
@@ -264,6 +276,12 @@ html,
|
|
|
264
276
|
--ge-table-body-west-selected-range-text: #000;
|
|
265
277
|
--ge-table-body-center-selected-range-text: #000;
|
|
266
278
|
--ge-table-body-east-selected-range-text: #000;
|
|
279
|
+
|
|
280
|
+
--ge-table-color-col-resize-handle-hover-bg: cyan;
|
|
281
|
+
--ge-table-color-dragged-col-div-bg: #fafafa;
|
|
282
|
+
--ge-table-color-drop-zone-bg: #fafafa;
|
|
283
|
+
--ge-table-color-drop-zone: #fafafa;
|
|
284
|
+
--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text);
|
|
267
285
|
}
|
|
268
286
|
/* Tree table */
|
|
269
287
|
|
package/css/table-classes.css
CHANGED
package/css/table-color-vars.css
CHANGED
|
@@ -73,6 +73,12 @@ html,
|
|
|
73
73
|
|
|
74
74
|
--ge-table-dragged-col-div-bg: lightcyan;
|
|
75
75
|
--ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
|
|
76
|
+
|
|
77
|
+
--ge-table-color-col-resize-handle-hover-bg: cyan;
|
|
78
|
+
--ge-table-color-dragged-col-div-bg: #fafafa;
|
|
79
|
+
--ge-table-color-drop-zone-bg: #fafafa;
|
|
80
|
+
--ge-table-color-drop-zone: #fafafa;
|
|
81
|
+
--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text);
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
|
|
@@ -138,4 +144,10 @@ html,
|
|
|
138
144
|
--ge-table-body-west-selected-range-text: #000;
|
|
139
145
|
--ge-table-body-center-selected-range-text: #000;
|
|
140
146
|
--ge-table-body-east-selected-range-text: #000;
|
|
147
|
+
|
|
148
|
+
--ge-table-color-col-resize-handle-hover-bg: cyan;
|
|
149
|
+
--ge-table-color-dragged-col-div-bg: #fafafa;
|
|
150
|
+
--ge-table-color-drop-zone-bg: #fafafa;
|
|
151
|
+
--ge-table-color-drop-zone: #fafafa;
|
|
152
|
+
--ge-table-color-tree-arrow-collapsed-color: var(--ge-table-body-west-text);
|
|
141
153
|
}
|