@guiexpert/preact-table 0.0.1 → 1.0.2
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/{PreactTable.d.ts → GuiexpertTable.d.ts} +5 -5
- package/README.md +103 -0
- package/index.d.ts +1 -1
- package/index.js +61 -61
- package/index.mjs +6752 -6559
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from "preact";
|
|
2
2
|
import { TableModelIf, TableOptions } from "@guiexpert/table";
|
|
3
3
|
import { GeCheckboxEventFn, GeModelChangeEventFn, GeMouseEventFn, GeTableReadyEventFn } from "@guiexpert/react-table";
|
|
4
|
-
export interface
|
|
4
|
+
export interface GuiexpertTableProps {
|
|
5
5
|
tableModel: TableModelIf;
|
|
6
6
|
tableOptions?: TableOptions;
|
|
7
7
|
mouseMoved?: GeMouseEventFn;
|
|
@@ -13,12 +13,12 @@ export interface PreactTableProps {
|
|
|
13
13
|
modelChanged?: GeModelChangeEventFn;
|
|
14
14
|
tableReady?: GeTableReadyEventFn;
|
|
15
15
|
}
|
|
16
|
-
export declare class
|
|
16
|
+
export declare class GuiexpertTable extends Component {
|
|
17
17
|
ref: import("preact").RefObject<any>;
|
|
18
|
-
constructor(props:
|
|
18
|
+
constructor(props: GuiexpertTableProps);
|
|
19
19
|
componentDidMount(): void;
|
|
20
20
|
componentWillUnmount(): void;
|
|
21
|
-
initTable(ele: HTMLDivElement, props:
|
|
21
|
+
initTable(ele: HTMLDivElement, props: GuiexpertTableProps): void;
|
|
22
22
|
render(): import("preact").JSX.Element;
|
|
23
23
|
}
|
|
24
|
-
export default
|
|
24
|
+
export default GuiexpertTable;
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
# PreactTable (GuiExpert Table)
|
|
3
|
+
|
|
4
|
+
This is the preact component of the GuiExpert Table 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 two NPM packages to your existing preact project (run this in your project root directory):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
npm install --save @guiexpert/table @guiexpert/preact-table
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Add PreactTable component to a template:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
return (
|
|
58
|
+
<PreactTable
|
|
59
|
+
tableOptions={tableOptions}
|
|
60
|
+
tableModel={tableModel}
|
|
61
|
+
mouseClicked={console.info}
|
|
62
|
+
tableReady={tableReady}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Import the following classes in your component:
|
|
68
|
+
```
|
|
69
|
+
import { PreactTable } from "@guiexpert/preact-table";
|
|
70
|
+
import {
|
|
71
|
+
GeMouseEvent,
|
|
72
|
+
TableApi
|
|
73
|
+
TableModelFactory,
|
|
74
|
+
TableModelIf,
|
|
75
|
+
TableOptions,
|
|
76
|
+
TableOptionsIf
|
|
77
|
+
} from "@guiexpert/table";
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Add a tableModel property and a onTableReady method to the component:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
const tableModel: TableModelIf = TableModelFactory
|
|
85
|
+
.createByArrayOfArraysParams<any>(param: {
|
|
86
|
+
columnLabels: [
|
|
87
|
+
['Header 1', 'Header 2']
|
|
88
|
+
],
|
|
89
|
+
data: [
|
|
90
|
+
['Text 1a', 'Text 2a'],
|
|
91
|
+
['Text 1b', 'Text 2b'],
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
const tableOptions = new TableOptions();
|
|
95
|
+
|
|
96
|
+
function onTableReady(api: TableApi) {
|
|
97
|
+
console.info("onTableReady API:", api);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
There are numerous possibilities to create table models.
|
|
102
|
+
Please refer to the [Documentation](https://gui.expert/doc) for further information or the [Demo](https://gui.expert/demos) section for examples.
|
|
103
|
+
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./GuiexpertTable";
|
|
2
2
|
export * from "./ComponentRendererWrapper";
|