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