react-open-source-grid 1.6.2 → 1.6.3

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 CHANGED
@@ -40,6 +40,9 @@ Open http://localhost:5173 to see the demo.
40
40
 
41
41
  ## Usage
42
42
 
43
+ <details open>
44
+ <summary><b>TypeScript</b></summary>
45
+
43
46
  ```tsx
44
47
  import { DataGrid } from 'react-open-source-grid';
45
48
  import type { Column, Row } from 'react-open-source-grid';
@@ -63,6 +66,35 @@ const rows: Row[] = [
63
66
  />
64
67
  ```
65
68
 
69
+ </details>
70
+
71
+ <details>
72
+ <summary><b>JavaScript</b></summary>
73
+
74
+ ```jsx
75
+ import { DataGrid } from 'react-open-source-grid';
76
+
77
+ const columns = [
78
+ { field: 'id', headerName: 'ID', width: 70 },
79
+ { field: 'name', headerName: 'Name', width: 180, editable: true },
80
+ ];
81
+
82
+ const rows = [
83
+ { id: 1, name: 'John Doe' },
84
+ { id: 2, name: 'Jane Smith' },
85
+ ];
86
+
87
+ <DataGrid
88
+ columns={columns}
89
+ rows={rows}
90
+ onCellEdit={(rowIndex, field, value) => {
91
+ console.log('Edited:', rowIndex, field, value);
92
+ }}
93
+ />
94
+ ```
95
+
96
+ </details>
97
+
66
98
  ## Documentation
67
99
 
68
100
  - **Full Documentation**: See [DATAGRID_README.md](./DATAGRID_README.md)
@@ -270,7 +302,7 @@ Choose from **10 beautiful pre-built themes** to match your application's design
270
302
 
271
303
  ```tsx
272
304
  import { DataGrid, ThemeSelector } from 'react-open-source-grid';
273
- import type { ThemeName } from './components/DataGrid/themes';
305
+ import type { ThemeName } from 'react-open-source-grid';
274
306
 
275
307
  function App() {
276
308
  const [theme, setTheme] = useState<ThemeName>('quartz');