@revolist/react-datagrid 4.11.17 → 4.11.19
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 +82 -26
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# React Data Grid minimalist adapter
|
|
2
2
|
|
|
3
|
-
Post new issues [here](https://github.com/revolist/revogrid). Happy coding! 💻
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
> [!NOTE]
|
|
5
|
+
> Repository Notice: This repo is read-only. Create new issues at the [revogrid repo](https://github.com/revolist/revogrid)
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
<p align="center">
|
|
8
9
|
<a href="https://rv-grid.com">
|
|
9
|
-
<img src="./assets/logo.svg" alt="
|
|
10
|
+
<img src="./assets/logo.svg" alt="React Data Grid" height="150" />
|
|
10
11
|
</a>
|
|
11
12
|
</p>
|
|
12
13
|
|
|
@@ -19,12 +20,10 @@ Post new issues [here](https://github.com/revolist/revogrid). Happy coding! 💻
|
|
|
19
20
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=revolist_revogrid&metric=alert_status" alt="Sonar Quality Gate"/>
|
|
20
21
|
</p>
|
|
21
22
|
|
|
22
|
-
#
|
|
23
23
|
|
|
24
|
-
<h3 align="center">Powerful
|
|
24
|
+
<h3 align="center">Powerful React Data Grid component built on top of <a href="https://github.com/revolist/revogrid" target="_blank">RevoGrid</a>.</h3>
|
|
25
25
|
<p align="center">
|
|
26
26
|
Support Millions of cells and thousands of columns easy and efficiently for fast data rendering. Easy to use.
|
|
27
|
-
|
|
28
27
|
</p>
|
|
29
28
|
|
|
30
29
|
<p align="center">
|
|
@@ -119,25 +118,70 @@ Support Millions of cells and thousands of columns easy and efficiently for fast
|
|
|
119
118
|
|
|
120
119
|
- **Rich API & Additional Improvements**: Explore hundreds of other small customizations and improvements in [RevoGrid](https://rv-grid.com/).
|
|
121
120
|
|
|
121
|
+
## Installation
|
|
122
122
|
|
|
123
|
-
### Usage React
|
|
124
123
|
|
|
125
124
|
With NPM:
|
|
126
125
|
|
|
127
126
|
```bash
|
|
128
|
-
npm i @revolist/react-datagrid
|
|
127
|
+
npm i @revolist/react-datagrid
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
With PNPM:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pnpm add @revolist/react-datagrid
|
|
129
134
|
```
|
|
130
135
|
|
|
131
136
|
With Yarn:
|
|
132
137
|
|
|
133
138
|
```bash
|
|
134
|
-
yarn add @revolist/react-datagrid
|
|
139
|
+
yarn add @revolist/react-datagrid
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
With Bun:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
bun add @revolist/react-datagrid
|
|
135
146
|
```
|
|
136
147
|
|
|
148
|
+
> [!NOTE]
|
|
149
|
+
> Previous package name: `@revolist/revogrid-react` was renamed to `@revolist/react-datagrid`.
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## Basic Usage
|
|
154
|
+
|
|
155
|
+
### Simplest Usage
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
import { useState } from 'react'
|
|
159
|
+
import { RevoGrid } from '@revolist/react-datagrid'
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* note: columns & source need a "stable" reference in order to prevent infinite re-renders
|
|
163
|
+
*/
|
|
164
|
+
const columns = [
|
|
165
|
+
{ prop: 'name', name: 'First' },
|
|
166
|
+
{ prop: 'details', name: 'Second' },
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
function App() {
|
|
170
|
+
const [source] = useState([
|
|
171
|
+
{ name: '1', details: 'Item 1' },
|
|
172
|
+
{ name: '2', details: 'Item 2' },
|
|
173
|
+
]);
|
|
174
|
+
return (<RevoGrid columns={columns} source={source} />)
|
|
175
|
+
}
|
|
176
|
+
export default App
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Cell Template Usage
|
|
181
|
+
|
|
137
182
|
```tsx
|
|
138
|
-
// App.tsx
|
|
139
183
|
import { useState } from 'react';
|
|
140
|
-
import { RevoGrid, Template,
|
|
184
|
+
import { RevoGrid, Template, type ColumnDataSchemaModel } from '@revolist/react-datagrid';
|
|
141
185
|
|
|
142
186
|
/**
|
|
143
187
|
* Custom cell component
|
|
@@ -145,6 +189,27 @@ import { RevoGrid, Template, Editor, type EditorType, type ColumnDataSchemaModel
|
|
|
145
189
|
const Cell = ({ model, prop, value }: ColumnDataSchemaModel) => {
|
|
146
190
|
return <div><strong>{value}</strong></div>;
|
|
147
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* note: columns & source need a "stable" reference in order to prevent infinite re-renders
|
|
194
|
+
*/
|
|
195
|
+
const columns = [
|
|
196
|
+
{ prop: 'name', name: 'First', cellTemplate: Template(Cell) },
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
function App() {
|
|
200
|
+
const [source] = useState([{ name: '1' }, { name: '2' }]);
|
|
201
|
+
return (<RevoGrid columns={columns} source={source} />)
|
|
202
|
+
}
|
|
203
|
+
export default App
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Editor Usage
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
// App.tsx
|
|
211
|
+
import { useState } from 'react';
|
|
212
|
+
import { RevoGrid, Editor, type EditorType, type Editors } from '@revolist/react-datagrid';
|
|
148
213
|
|
|
149
214
|
/**
|
|
150
215
|
* Custom editor component
|
|
@@ -153,8 +218,7 @@ const Button = ({ close } : EditorType) => {
|
|
|
153
218
|
return <button onClick={close}>Close</button>
|
|
154
219
|
};
|
|
155
220
|
|
|
156
|
-
const
|
|
157
|
-
const gridEditors: Editors = { [MY_EDITOR]: Editor(Button) };
|
|
221
|
+
const gridEditors: Editors = { ['custom-editor']: Editor(Button) };
|
|
158
222
|
|
|
159
223
|
/**
|
|
160
224
|
* note: columns & source need a "stable" reference in order to prevent infinite re-renders
|
|
@@ -162,13 +226,8 @@ const gridEditors: Editors = { [MY_EDITOR]: Editor(Button) };
|
|
|
162
226
|
const columns = [
|
|
163
227
|
{
|
|
164
228
|
prop: 'name',
|
|
165
|
-
name: '
|
|
166
|
-
editor:
|
|
167
|
-
cellTemplate: Template(Cell),
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
prop: 'details',
|
|
171
|
-
name: 'Second',
|
|
229
|
+
name: 'Custom editor',
|
|
230
|
+
editor: 'custom-editor',
|
|
172
231
|
},
|
|
173
232
|
];
|
|
174
233
|
|
|
@@ -177,17 +236,14 @@ function App() {
|
|
|
177
236
|
{ name: '1', details: 'Item 1' },
|
|
178
237
|
{ name: '2', details: 'Item 2' },
|
|
179
238
|
]);
|
|
180
|
-
return (
|
|
181
|
-
<>
|
|
182
|
-
<RevoGrid columns={columns} source={source} editors={gridEditors} />
|
|
183
|
-
</>
|
|
184
|
-
)
|
|
239
|
+
return (<RevoGrid columns={columns} source={source} editors={gridEditors} />)
|
|
185
240
|
}
|
|
186
241
|
|
|
187
242
|
export default App
|
|
188
243
|
|
|
189
244
|
```
|
|
190
245
|
|
|
246
|
+
|
|
191
247
|
[Example and guide](https://rv-grid.com/guide/react/)
|
|
192
248
|
|
|
193
249
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revolist/react-datagrid",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "4.11.
|
|
4
|
+
"version": "4.11.19",
|
|
5
5
|
"description": "React DataGrid Spreadsheet component with native cell render support",
|
|
6
6
|
"main": "./dist/react-datagrid.umd.cjs",
|
|
7
7
|
"module": "./dist/react-datagrid.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"homepage": "https://github.com/revolist/revogrid#readme",
|
|
65
65
|
"license": "MIT",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@revolist/revogrid": "4.11.
|
|
67
|
+
"@revolist/revogrid": "4.11.18"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/react": "^18.3.2",
|