@toolbox-web/grid-react 0.0.2 → 0.0.4
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 +181 -56
- package/index.js +140 -141
- package/lib/data-grid.d.ts.map +1 -1
- package/package.json +50 -50
package/README.md
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
# @toolbox-web/grid-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@toolbox-web/grid-react)
|
|
4
|
+
[](../../LICENSE)
|
|
5
|
+
[](https://github.com/sponsors/OysteinAmundsen)
|
|
6
|
+
|
|
7
|
+
React adapter for `@toolbox-web/grid` data grid component. Provides components and hooks for declarative React integration with custom cell renderers and editors.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- ✅ **Full React integration** - Use JSX for cell renderers and editors
|
|
12
|
+
- ✅ **Declarative columns** - Define columns via props or `GridColumn` components
|
|
13
|
+
- ✅ **Render props** - Clean `children` syntax for custom cells
|
|
14
|
+
- ✅ **Hooks API** - `useGrid` and `useGridEvent` for programmatic access
|
|
15
|
+
- ✅ **Ref forwarding** - Access grid instance via `DataGridRef`
|
|
16
|
+
- ✅ **Master-detail** - `GridDetailPanel` for expandable rows
|
|
17
|
+
- ✅ **Tool panels** - `GridToolPanel` for custom sidebar content
|
|
18
|
+
- ✅ **Full type safety** - TypeScript generics support
|
|
19
|
+
- ✅ **React 18+** - Concurrent features and Suspense compatible
|
|
4
20
|
|
|
5
21
|
## Installation
|
|
6
22
|
|
|
7
23
|
```bash
|
|
24
|
+
# npm
|
|
8
25
|
npm install @toolbox-web/grid @toolbox-web/grid-react
|
|
26
|
+
|
|
27
|
+
# yarn
|
|
28
|
+
yarn add @toolbox-web/grid @toolbox-web/grid-react
|
|
29
|
+
|
|
30
|
+
# pnpm
|
|
31
|
+
pnpm add @toolbox-web/grid @toolbox-web/grid-react
|
|
32
|
+
|
|
33
|
+
# bun
|
|
34
|
+
bun add @toolbox-web/grid @toolbox-web/grid-react
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
### 1. Register the Grid Component
|
|
40
|
+
|
|
41
|
+
In your application entry point, import the grid registration:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// main.tsx or index.tsx
|
|
45
|
+
import '@toolbox-web/grid';
|
|
9
46
|
```
|
|
10
47
|
|
|
11
|
-
|
|
48
|
+
### 2. Use in Components
|
|
12
49
|
|
|
13
50
|
```tsx
|
|
14
|
-
import { DataGrid
|
|
51
|
+
import { DataGrid } from '@toolbox-web/grid-react';
|
|
15
52
|
|
|
16
53
|
interface Employee {
|
|
17
54
|
id: number;
|
|
@@ -60,11 +97,7 @@ const config: ReactGridConfig<Employee> = {
|
|
|
60
97
|
field: 'status',
|
|
61
98
|
header: 'Status',
|
|
62
99
|
// Custom React renderer - same property name as vanilla!
|
|
63
|
-
renderer: (ctx) => (
|
|
64
|
-
<span className={`badge badge-${ctx.value.toLowerCase()}`}>
|
|
65
|
-
{ctx.value}
|
|
66
|
-
</span>
|
|
67
|
-
),
|
|
100
|
+
renderer: (ctx) => <span className={`badge badge-${ctx.value.toLowerCase()}`}>{ctx.value}</span>,
|
|
68
101
|
},
|
|
69
102
|
],
|
|
70
103
|
};
|
|
@@ -74,6 +107,14 @@ function EmployeeGrid() {
|
|
|
74
107
|
}
|
|
75
108
|
```
|
|
76
109
|
|
|
110
|
+
**Renderer Context:**
|
|
111
|
+
|
|
112
|
+
| Property | Type | Description |
|
|
113
|
+
| -------- | --------- | ------------------------ |
|
|
114
|
+
| `value` | `TValue` | The cell value |
|
|
115
|
+
| `row` | `TRow` | The full row data object |
|
|
116
|
+
| `column` | `unknown` | The column configuration |
|
|
117
|
+
|
|
77
118
|
### Using GridColumn Components
|
|
78
119
|
|
|
79
120
|
Use the `GridColumn` component with a render prop:
|
|
@@ -125,6 +166,16 @@ const config: ReactGridConfig<Employee> = {
|
|
|
125
166
|
};
|
|
126
167
|
```
|
|
127
168
|
|
|
169
|
+
**Editor Context:**
|
|
170
|
+
|
|
171
|
+
| Property | Type | Description |
|
|
172
|
+
| -------- | ------------- | ---------------------------- |
|
|
173
|
+
| `value` | `TValue` | The current cell value |
|
|
174
|
+
| `row` | `TRow` | The full row data object |
|
|
175
|
+
| `column` | `unknown` | The column configuration |
|
|
176
|
+
| `commit` | `(v) => void` | Callback to commit new value |
|
|
177
|
+
| `cancel` | `() => void` | Callback to cancel editing |
|
|
178
|
+
|
|
128
179
|
### Using GridColumn
|
|
129
180
|
|
|
130
181
|
```tsx
|
|
@@ -179,11 +230,11 @@ function EmployeeGrid() {
|
|
|
179
230
|
|
|
180
231
|
**GridDetailPanel Props:**
|
|
181
232
|
|
|
182
|
-
| Prop | Type
|
|
183
|
-
| ------------------ |
|
|
184
|
-
| `children` | `(ctx: DetailPanelContext) => ReactNode`
|
|
185
|
-
| `showExpandColumn` | `boolean`
|
|
186
|
-
| `animation` | `'slide' \| 'fade' \| false`
|
|
233
|
+
| Prop | Type | Default | Description |
|
|
234
|
+
| ------------------ | ---------------------------------------- | --------- | ----------------------------------- |
|
|
235
|
+
| `children` | `(ctx: DetailPanelContext) => ReactNode` | Required | Render function for panel content |
|
|
236
|
+
| `showExpandColumn` | `boolean` | `true` | Show expand/collapse chevron column |
|
|
237
|
+
| `animation` | `'slide' \| 'fade' \| false` | `'slide'` | Animation style for expand/collapse |
|
|
187
238
|
|
|
188
239
|
## Custom Tool Panels with GridToolPanel
|
|
189
240
|
|
|
@@ -229,56 +280,58 @@ function EmployeeGrid() {
|
|
|
229
280
|
|
|
230
281
|
**GridToolPanel Props:**
|
|
231
282
|
|
|
232
|
-
| Prop | Type
|
|
233
|
-
| ---------- |
|
|
234
|
-
| `id` | `string`
|
|
235
|
-
| `title` | `string`
|
|
236
|
-
| `children` | `(ctx: ToolPanelContext) => ReactNode`
|
|
237
|
-
| `icon` | `string`
|
|
238
|
-
| `tooltip` | `string`
|
|
239
|
-
| `order` | `number`
|
|
283
|
+
| Prop | Type | Default | Description |
|
|
284
|
+
| ---------- | -------------------------------------- | -------- | --------------------------------- |
|
|
285
|
+
| `id` | `string` | Required | Unique panel identifier |
|
|
286
|
+
| `title` | `string` | Required | Panel title in accordion header |
|
|
287
|
+
| `children` | `(ctx: ToolPanelContext) => ReactNode` | Required | Render function for panel content |
|
|
288
|
+
| `icon` | `string` | - | Icon for the accordion header |
|
|
289
|
+
| `tooltip` | `string` | - | Tooltip text for header |
|
|
290
|
+
| `order` | `number` | `100` | Panel sort order (lower = higher) |
|
|
240
291
|
|
|
241
|
-
##
|
|
292
|
+
## Hooks
|
|
293
|
+
|
|
294
|
+
### useGrid
|
|
242
295
|
|
|
243
296
|
Access the grid instance for programmatic control:
|
|
244
297
|
|
|
245
298
|
```tsx
|
|
246
|
-
import { DataGrid,
|
|
247
|
-
import { useRef } from 'react';
|
|
299
|
+
import { DataGrid, useGrid } from '@toolbox-web/grid-react';
|
|
248
300
|
|
|
249
301
|
function MyComponent() {
|
|
250
|
-
const
|
|
302
|
+
const { ref, isReady, forceLayout, getConfig } = useGrid<Employee>();
|
|
251
303
|
|
|
252
304
|
const handleExport = async () => {
|
|
253
|
-
const config = await
|
|
305
|
+
const config = await getConfig();
|
|
254
306
|
console.log('Columns:', config?.columns);
|
|
255
307
|
};
|
|
256
308
|
|
|
257
309
|
return (
|
|
258
310
|
<>
|
|
259
311
|
<button onClick={handleExport}>Export</button>
|
|
260
|
-
<
|
|
312
|
+
<button onClick={() => forceLayout()}>Refresh Layout</button>
|
|
313
|
+
<DataGrid ref={ref} rows={employees} />
|
|
261
314
|
</>
|
|
262
315
|
);
|
|
263
316
|
}
|
|
264
317
|
```
|
|
265
318
|
|
|
266
|
-
|
|
319
|
+
### useGridEvent
|
|
267
320
|
|
|
268
|
-
|
|
321
|
+
Type-safe event subscription with automatic cleanup:
|
|
269
322
|
|
|
270
323
|
```tsx
|
|
271
|
-
import { DataGrid,
|
|
324
|
+
import { DataGrid, useGridEvent, DataGridRef } from '@toolbox-web/grid-react';
|
|
325
|
+
import { useRef } from 'react';
|
|
272
326
|
|
|
273
327
|
function MyComponent() {
|
|
274
|
-
const
|
|
328
|
+
const gridRef = useRef<DataGridRef>(null);
|
|
275
329
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
);
|
|
330
|
+
useGridEvent(gridRef, 'selection-change', (event) => {
|
|
331
|
+
console.log('Selected:', event.detail.selectedRows);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
return <DataGrid ref={gridRef} rows={employees} />;
|
|
282
335
|
}
|
|
283
336
|
```
|
|
284
337
|
|
|
@@ -297,27 +350,16 @@ function MyComponent() {
|
|
|
297
350
|
|
|
298
351
|
### Via useGridEvent Hook
|
|
299
352
|
|
|
300
|
-
|
|
301
|
-
import { DataGrid, useGridEvent, DataGridRef } from '@toolbox-web/grid-react';
|
|
302
|
-
|
|
303
|
-
function MyComponent() {
|
|
304
|
-
const gridRef = useRef<DataGridRef>(null);
|
|
305
|
-
|
|
306
|
-
useGridEvent(gridRef, 'selection-change', (event) => {
|
|
307
|
-
console.log('Selected:', event.detail.selectedRows);
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
return <DataGrid ref={gridRef} rows={employees} />;
|
|
311
|
-
}
|
|
312
|
-
```
|
|
353
|
+
See [useGridEvent](#usegridevent) above.
|
|
313
354
|
|
|
314
|
-
## Plugins
|
|
355
|
+
## Using Plugins
|
|
315
356
|
|
|
316
|
-
|
|
357
|
+
Import plugins individually for smaller bundles:
|
|
317
358
|
|
|
318
359
|
```tsx
|
|
319
360
|
import { DataGrid } from '@toolbox-web/grid-react';
|
|
320
|
-
import { SelectionPlugin
|
|
361
|
+
import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';
|
|
362
|
+
import { FilteringPlugin } from '@toolbox-web/grid/plugins/filtering';
|
|
321
363
|
|
|
322
364
|
function MyComponent() {
|
|
323
365
|
return (
|
|
@@ -335,6 +377,12 @@ function MyComponent() {
|
|
|
335
377
|
}
|
|
336
378
|
```
|
|
337
379
|
|
|
380
|
+
Or import all plugins at once (larger bundle, but convenient):
|
|
381
|
+
|
|
382
|
+
```tsx
|
|
383
|
+
import { SelectionPlugin, FilteringPlugin } from '@toolbox-web/grid/all';
|
|
384
|
+
```
|
|
385
|
+
|
|
338
386
|
## Custom Styles
|
|
339
387
|
|
|
340
388
|
Inject custom CSS into the grid's shadow DOM:
|
|
@@ -353,6 +401,38 @@ Inject custom CSS into the grid's shadow DOM:
|
|
|
353
401
|
|
|
354
402
|
## API Reference
|
|
355
403
|
|
|
404
|
+
### Exported Components
|
|
405
|
+
|
|
406
|
+
| Component | Description |
|
|
407
|
+
| ----------------- | ------------------------------------ |
|
|
408
|
+
| `DataGrid` | Main grid component wrapper |
|
|
409
|
+
| `GridColumn` | Declarative column with render props |
|
|
410
|
+
| `GridDetailPanel` | Master-detail expandable panel |
|
|
411
|
+
| `GridToolPanel` | Custom sidebar panel |
|
|
412
|
+
| `GridToolButtons` | Toolbar button container |
|
|
413
|
+
|
|
414
|
+
### Exported Hooks
|
|
415
|
+
|
|
416
|
+
| Hook | Description |
|
|
417
|
+
| -------------- | ----------------------------------------- |
|
|
418
|
+
| `useGrid` | Grid ref with ready state and methods |
|
|
419
|
+
| `useGridEvent` | Type-safe event subscription with cleanup |
|
|
420
|
+
|
|
421
|
+
### Exported Types
|
|
422
|
+
|
|
423
|
+
```typescript
|
|
424
|
+
import type {
|
|
425
|
+
ReactGridConfig,
|
|
426
|
+
ReactColumnConfig,
|
|
427
|
+
CellRenderContext,
|
|
428
|
+
ColumnEditorContext,
|
|
429
|
+
DetailPanelContext,
|
|
430
|
+
ToolPanelContext,
|
|
431
|
+
DataGridRef,
|
|
432
|
+
DataGridProps,
|
|
433
|
+
} from '@toolbox-web/grid-react';
|
|
434
|
+
```
|
|
435
|
+
|
|
356
436
|
### DataGrid Props
|
|
357
437
|
|
|
358
438
|
| Prop | Type | Description |
|
|
@@ -384,18 +464,63 @@ Inject custom CSS into the grid's shadow DOM:
|
|
|
384
464
|
### DataGridRef Methods
|
|
385
465
|
|
|
386
466
|
| Method | Description |
|
|
387
|
-
| ------------------------- | --------------------------- |
|
|
467
|
+
| ------------------------- | --------------------------- | -------------------- |
|
|
388
468
|
| `getConfig()` | Get effective configuration |
|
|
389
469
|
| `ready()` | Wait for grid ready |
|
|
390
470
|
| `forceLayout()` | Force layout recalculation |
|
|
391
471
|
| `toggleGroup(key)` | Toggle group expansion |
|
|
392
472
|
| `registerStyles(id, css)` | Register custom styles |
|
|
393
|
-
| `unregisterStyles(id)` | Remove custom styles
|
|
473
|
+
| `unregisterStyles(id)` | `void` | Remove custom styles |
|
|
474
|
+
|
|
475
|
+
### ReactGridAdapter
|
|
476
|
+
|
|
477
|
+
The adapter class is exported for advanced use cases:
|
|
478
|
+
|
|
479
|
+
```typescript
|
|
480
|
+
import { ReactGridAdapter } from '@toolbox-web/grid-react';
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
In most cases, the `DataGrid` component handles adapter registration automatically.
|
|
484
|
+
|
|
485
|
+
## Demo
|
|
486
|
+
|
|
487
|
+
See the full React demo at [`demos/employee-management/react/`](../../demos/employee-management/react/) which demonstrates:
|
|
488
|
+
|
|
489
|
+
- 15+ plugins with full configuration
|
|
490
|
+
- Custom editors (star rating, date picker, status select, bonus slider)
|
|
491
|
+
- Custom renderers (status badges, rating colors, top performer stars)
|
|
492
|
+
- Hooks for programmatic control
|
|
493
|
+
- Shell integration (header, tool panels)
|
|
494
|
+
- Master-detail expandable rows
|
|
394
495
|
|
|
395
496
|
## Requirements
|
|
396
497
|
|
|
397
498
|
- React 18.0.0 or higher
|
|
398
|
-
-
|
|
499
|
+
- `@toolbox-web/grid` >= 0.2.0
|
|
500
|
+
|
|
501
|
+
## Development
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
# Build the library
|
|
505
|
+
bun nx build grid-react
|
|
506
|
+
|
|
507
|
+
# Run tests
|
|
508
|
+
bun nx test grid-react
|
|
509
|
+
|
|
510
|
+
# Lint
|
|
511
|
+
bun nx lint grid-react
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Support This Project
|
|
517
|
+
|
|
518
|
+
This grid is built and maintained by a single developer in spare time. If it saves you time or money, consider sponsoring to keep development going:
|
|
519
|
+
|
|
520
|
+
[](https://github.com/sponsors/OysteinAmundsen)
|
|
521
|
+
[](https://www.patreon.com/c/OysteinAmundsen)
|
|
522
|
+
|
|
523
|
+
---
|
|
399
524
|
|
|
400
525
|
## License
|
|
401
526
|
|
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { DataGridElement as
|
|
3
|
-
import { useRef as G, useCallback as C, forwardRef as
|
|
2
|
+
import { DataGridElement as z } from "@toolbox-web/grid";
|
|
3
|
+
import { useRef as G, useCallback as C, forwardRef as B, useMemo as O, useEffect as R, useImperativeHandle as _, useState as x } from "react";
|
|
4
4
|
import { flushSync as b } from "react-dom";
|
|
5
5
|
import { createRoot as V } from "react-dom/client";
|
|
6
|
-
const F = /* @__PURE__ */ new WeakMap(),
|
|
7
|
-
function
|
|
6
|
+
const F = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new Map();
|
|
7
|
+
function W(n) {
|
|
8
8
|
const t = n.querySelector("tbw-grid-detail");
|
|
9
9
|
if (t) {
|
|
10
10
|
const r = F.get(t);
|
|
@@ -12,17 +12,17 @@ function H(n) {
|
|
|
12
12
|
}
|
|
13
13
|
const e = n.id || n.getAttribute("data-grid-id");
|
|
14
14
|
if (e)
|
|
15
|
-
return
|
|
15
|
+
return N.get(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, i = G(null),
|
|
17
|
+
function se(n) {
|
|
18
|
+
const { children: t, showExpandColumn: e = !0, animation: r = "slide" } = n, i = G(null), s = C(
|
|
19
19
|
(d) => {
|
|
20
20
|
if (i.current = d, !d) return;
|
|
21
21
|
F.set(d, t);
|
|
22
22
|
const u = d.closest("tbw-grid");
|
|
23
23
|
if (u) {
|
|
24
24
|
const l = u.id || u.getAttribute("data-grid-id");
|
|
25
|
-
l &&
|
|
25
|
+
l && N.set(l, t);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
[t]
|
|
@@ -30,32 +30,32 @@ function ce(n) {
|
|
|
30
30
|
return /* @__PURE__ */ L(
|
|
31
31
|
"tbw-grid-detail",
|
|
32
32
|
{
|
|
33
|
-
ref:
|
|
33
|
+
ref: s,
|
|
34
34
|
showExpandColumn: e ? void 0 : "false",
|
|
35
35
|
animation: r === !1 ? "false" : r
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function j(n) {
|
|
40
40
|
const t = /* @__PURE__ */ new WeakMap();
|
|
41
41
|
return (e) => {
|
|
42
42
|
const r = e.cellEl;
|
|
43
43
|
if (r) {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
44
|
+
const o = t.get(r);
|
|
45
|
+
if (o)
|
|
46
46
|
return b(() => {
|
|
47
|
-
|
|
48
|
-
}),
|
|
47
|
+
o.root.render(n(e));
|
|
48
|
+
}), o.container;
|
|
49
49
|
}
|
|
50
50
|
const i = document.createElement("div");
|
|
51
51
|
i.className = "react-cell-renderer", i.style.display = "contents";
|
|
52
|
-
const
|
|
52
|
+
const s = V(i);
|
|
53
53
|
return b(() => {
|
|
54
|
-
|
|
55
|
-
}), r && t.set(r, { root:
|
|
54
|
+
s.render(n(e));
|
|
55
|
+
}), r && t.set(r, { root: s, container: i }), i;
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function $(n) {
|
|
59
59
|
return (t) => {
|
|
60
60
|
const e = document.createElement("div");
|
|
61
61
|
e.className = "react-cell-editor", e.style.display = "contents";
|
|
@@ -65,32 +65,32 @@ function J(n) {
|
|
|
65
65
|
}), e;
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function J(n) {
|
|
69
69
|
if (!n) return;
|
|
70
70
|
if (!n.columns) return n;
|
|
71
71
|
const t = n.columns.map((e) => {
|
|
72
|
-
const { renderer: r, editor: i, ...
|
|
73
|
-
return r && (
|
|
72
|
+
const { renderer: r, editor: i, ...s } = e, o = { ...s };
|
|
73
|
+
return r && (o.renderer = j(r)), i && (o.editor = $(i)), o;
|
|
74
74
|
});
|
|
75
75
|
return {
|
|
76
76
|
...n,
|
|
77
77
|
columns: t
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
const t =
|
|
80
|
+
const H = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new Map();
|
|
81
|
+
function K(n) {
|
|
82
|
+
const t = H.get(n);
|
|
83
83
|
if (t) return t;
|
|
84
84
|
const e = n.id;
|
|
85
85
|
if (e)
|
|
86
86
|
return T.get(e);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
const { id: t, title: e, icon: r, tooltip: i, order:
|
|
88
|
+
function ce(n) {
|
|
89
|
+
const { id: t, title: e, icon: r, tooltip: i, order: s = 100, children: o } = n, d = G(null), u = C(
|
|
90
90
|
(l) => {
|
|
91
|
-
d.current = l, l && (
|
|
91
|
+
d.current = l, l && (H.set(l, o), t && T.set(t, o));
|
|
92
92
|
},
|
|
93
|
-
[
|
|
93
|
+
[o, t]
|
|
94
94
|
);
|
|
95
95
|
return /* @__PURE__ */ L(
|
|
96
96
|
"tbw-grid-tool-panel",
|
|
@@ -100,26 +100,26 @@ function de(n) {
|
|
|
100
100
|
title: e,
|
|
101
101
|
icon: r,
|
|
102
102
|
tooltip: i,
|
|
103
|
-
order:
|
|
103
|
+
order: s?.toString()
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
const S = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new Map();
|
|
108
|
-
function
|
|
108
|
+
function Q(n, t) {
|
|
109
109
|
const e = n.getAttribute("field"), r = S.get(n) ?? {};
|
|
110
110
|
if (r.renderer = t, S.set(n, r), e) {
|
|
111
111
|
const i = A.get(e) ?? {};
|
|
112
112
|
i.renderer = t, A.set(e, i);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function U(n, t) {
|
|
116
116
|
const e = n.getAttribute("field"), r = S.get(n) ?? {};
|
|
117
117
|
if (r.editor = t, S.set(n, r), e) {
|
|
118
118
|
const i = A.get(e) ?? {};
|
|
119
119
|
i.editor = t, A.set(e, i);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function X(n) {
|
|
123
123
|
let t = S.get(n)?.renderer;
|
|
124
124
|
if (!t) {
|
|
125
125
|
const e = n.getAttribute("field");
|
|
@@ -127,7 +127,7 @@ function Y(n) {
|
|
|
127
127
|
}
|
|
128
128
|
return t;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Y(n) {
|
|
131
131
|
let t = S.get(n)?.editor;
|
|
132
132
|
if (!t) {
|
|
133
133
|
const e = n.getAttribute("field");
|
|
@@ -135,10 +135,10 @@ function Z(n) {
|
|
|
135
135
|
}
|
|
136
136
|
return t;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function de() {
|
|
139
139
|
return Array.from(A.keys());
|
|
140
140
|
}
|
|
141
|
-
class
|
|
141
|
+
class Z {
|
|
142
142
|
mountedViews = [];
|
|
143
143
|
/**
|
|
144
144
|
* Determines if this adapter can handle the given element.
|
|
@@ -148,11 +148,11 @@ class ee {
|
|
|
148
148
|
const e = t.getAttribute("field");
|
|
149
149
|
let r = S.get(t);
|
|
150
150
|
if (!r && e) {
|
|
151
|
-
const
|
|
152
|
-
|
|
151
|
+
const o = A.get(e);
|
|
152
|
+
o && (o.renderer || o.editor) && (r = o, S.set(t, r));
|
|
153
153
|
}
|
|
154
|
-
const i = r?.renderer !== void 0,
|
|
155
|
-
return r !== void 0 && (i ||
|
|
154
|
+
const i = r?.renderer !== void 0, s = r?.editor !== void 0;
|
|
155
|
+
return r !== void 0 && (i || s);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Creates a view renderer function that renders a React component
|
|
@@ -166,14 +166,14 @@ class ee {
|
|
|
166
166
|
* allowing the grid to use its default rendering.
|
|
167
167
|
*/
|
|
168
168
|
createRenderer(t) {
|
|
169
|
-
const e =
|
|
169
|
+
const e = X(t);
|
|
170
170
|
if (!e)
|
|
171
171
|
return;
|
|
172
172
|
const r = /* @__PURE__ */ new WeakMap();
|
|
173
173
|
return (i) => {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const u = r.get(
|
|
174
|
+
const s = i.cellEl;
|
|
175
|
+
if (s) {
|
|
176
|
+
const u = r.get(s);
|
|
177
177
|
if (u)
|
|
178
178
|
return b(() => {
|
|
179
179
|
u.root.render(e(i));
|
|
@@ -183,14 +183,14 @@ class ee {
|
|
|
183
183
|
const w = V(l);
|
|
184
184
|
return b(() => {
|
|
185
185
|
w.render(e(i));
|
|
186
|
-
}), r.set(
|
|
186
|
+
}), r.set(s, { root: w, container: l, lastRowIndex: i.rowIndex ?? -1 }), this.mountedViews.push({ root: w, container: l }), l;
|
|
187
187
|
}
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
const d = V(
|
|
188
|
+
const o = document.createElement("div");
|
|
189
|
+
o.className = "react-cell-renderer", o.style.display = "contents";
|
|
190
|
+
const d = V(o);
|
|
191
191
|
return b(() => {
|
|
192
192
|
d.render(e(i));
|
|
193
|
-
}), this.mountedViews.push({ root: d, container:
|
|
193
|
+
}), this.mountedViews.push({ root: d, container: o }), o;
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
@@ -198,14 +198,14 @@ class ee {
|
|
|
198
198
|
* with commit/cancel callbacks passed as props.
|
|
199
199
|
*/
|
|
200
200
|
createEditor(t) {
|
|
201
|
-
const e =
|
|
201
|
+
const e = Y(t);
|
|
202
202
|
return e ? (r) => {
|
|
203
203
|
const i = document.createElement("div");
|
|
204
204
|
i.className = "react-cell-editor", i.style.display = "contents";
|
|
205
|
-
const
|
|
205
|
+
const s = V(i);
|
|
206
206
|
return b(() => {
|
|
207
|
-
|
|
208
|
-
}), this.mountedViews.push({ root:
|
|
207
|
+
s.render(e(r));
|
|
208
|
+
}), this.mountedViews.push({ root: s, container: i }), i;
|
|
209
209
|
} : () => document.createElement("div");
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
@@ -213,15 +213,15 @@ class ee {
|
|
|
213
213
|
* Renders React components for expandable detail rows.
|
|
214
214
|
*/
|
|
215
215
|
createDetailRenderer(t) {
|
|
216
|
-
const e =
|
|
216
|
+
const e = W(t);
|
|
217
217
|
if (e)
|
|
218
218
|
return (r, i) => {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
const
|
|
219
|
+
const s = document.createElement("div");
|
|
220
|
+
s.className = "react-detail-panel";
|
|
221
|
+
const o = { row: r, rowIndex: i }, d = V(s);
|
|
222
222
|
return b(() => {
|
|
223
|
-
d.render(e(
|
|
224
|
-
}), this.mountedViews.push({ root: d, container:
|
|
223
|
+
d.render(e(o));
|
|
224
|
+
}), this.mountedViews.push({ root: d, container: s }), s;
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
@@ -238,17 +238,17 @@ class ee {
|
|
|
238
238
|
* Renders React components into tool panel containers.
|
|
239
239
|
*/
|
|
240
240
|
createToolPanelRenderer(t) {
|
|
241
|
-
const e =
|
|
241
|
+
const e = K(t);
|
|
242
242
|
if (!e)
|
|
243
243
|
return;
|
|
244
244
|
const r = t.closest("tbw-grid");
|
|
245
245
|
return (i) => {
|
|
246
|
-
const
|
|
246
|
+
const s = {
|
|
247
247
|
grid: r ?? i
|
|
248
|
-
},
|
|
248
|
+
}, o = V(i);
|
|
249
249
|
return b(() => {
|
|
250
|
-
|
|
251
|
-
}), this.mountedViews.push({ root:
|
|
250
|
+
o.render(e(s));
|
|
251
|
+
}), this.mountedViews.push({ root: o, container: i }), () => {
|
|
252
252
|
const d = this.mountedViews.findIndex((u) => u.container === i);
|
|
253
253
|
if (d !== -1) {
|
|
254
254
|
const { root: u } = this.mountedViews[d];
|
|
@@ -288,40 +288,42 @@ class ee {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
let P = !1,
|
|
291
|
+
let P = !1, M = null;
|
|
292
292
|
function q() {
|
|
293
|
-
return P || (
|
|
293
|
+
return P || (M = new Z(), z.registerAdapter(M), P = !0), M;
|
|
294
294
|
}
|
|
295
295
|
q();
|
|
296
|
-
function
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
299
|
-
|
|
296
|
+
function ee(n, t) {
|
|
297
|
+
const e = n, r = e.getPluginByName?.("masterDetail");
|
|
298
|
+
if (r && typeof r.refreshDetailRenderer == "function") {
|
|
299
|
+
r.refreshDetailRenderer();
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
302
|
+
const i = n.querySelector("tbw-grid-detail");
|
|
303
|
+
!i || !W(n) || import("@toolbox-web/grid/all").then(({ MasterDetailPlugin: o }) => {
|
|
304
|
+
const d = t.createDetailRenderer(n);
|
|
305
|
+
if (!d) return;
|
|
306
|
+
const u = i.getAttribute("animation");
|
|
307
|
+
let l = "slide";
|
|
308
|
+
u === "false" ? l = !1 : u === "fade" && (l = "fade");
|
|
309
|
+
const w = i.getAttribute("showExpandColumn") !== "false", a = new o({
|
|
310
|
+
detailRenderer: d,
|
|
311
|
+
showExpandColumn: w,
|
|
312
|
+
animation: l
|
|
313
|
+
}), m = e.gridConfig || {}, E = m.plugins || [];
|
|
314
|
+
e.gridConfig = {
|
|
315
|
+
...m,
|
|
316
|
+
plugins: [...E, a]
|
|
317
|
+
};
|
|
318
|
+
}).catch(() => {
|
|
319
|
+
});
|
|
318
320
|
}
|
|
319
|
-
const
|
|
321
|
+
const ue = B(function(t, e) {
|
|
320
322
|
const {
|
|
321
323
|
rows: r,
|
|
322
324
|
gridConfig: i,
|
|
323
|
-
columns:
|
|
324
|
-
fitMode:
|
|
325
|
+
columns: s,
|
|
326
|
+
fitMode: o,
|
|
325
327
|
editOn: d,
|
|
326
328
|
customStyles: u,
|
|
327
329
|
className: l,
|
|
@@ -332,71 +334,68 @@ const ae = _(function(t, e) {
|
|
|
332
334
|
onRowClick: v,
|
|
333
335
|
onColumnStateChange: D,
|
|
334
336
|
onSortChange: I
|
|
335
|
-
} = t, f = G(null), k = G(null),
|
|
337
|
+
} = t, f = G(null), k = G(null), h = O(() => J(i), [i]);
|
|
336
338
|
return R(() => {
|
|
337
339
|
f.current && (f.current.rows = r);
|
|
338
340
|
}, [r]), R(() => {
|
|
339
|
-
f.current &&
|
|
340
|
-
}, [
|
|
341
|
-
f.current &&
|
|
342
|
-
}, [o]), R(() => {
|
|
343
|
-
f.current && s !== void 0 && (f.current.fitMode = s);
|
|
341
|
+
f.current && h && (f.current.gridConfig = h);
|
|
342
|
+
}, [h]), R(() => {
|
|
343
|
+
f.current && s && (f.current.columns = s);
|
|
344
344
|
}, [s]), R(() => {
|
|
345
|
+
f.current && o !== void 0 && (f.current.fitMode = o);
|
|
346
|
+
}, [o]), R(() => {
|
|
345
347
|
f.current && d !== void 0 && (f.current.editOn = d);
|
|
346
348
|
}, [d]), R(() => {
|
|
347
349
|
const c = f.current;
|
|
348
350
|
if (!c) return;
|
|
349
|
-
const
|
|
350
|
-
c.__frameworkAdapter =
|
|
351
|
+
const p = q();
|
|
352
|
+
c.__frameworkAdapter = p, ee(c, p);
|
|
351
353
|
let g = !1;
|
|
352
354
|
const y = requestAnimationFrame(() => {
|
|
353
|
-
g || (typeof c.refreshColumns == "function" && c.refreshColumns(),
|
|
354
|
-
g || te(c, z, h);
|
|
355
|
-
}).catch(() => {
|
|
356
|
-
}), typeof c.refreshShellHeader == "function" && c.refreshShellHeader());
|
|
355
|
+
g || (typeof c.refreshColumns == "function" && c.refreshColumns(), typeof c.refreshShellHeader == "function" && c.refreshShellHeader());
|
|
357
356
|
});
|
|
358
357
|
return () => {
|
|
359
358
|
g = !0, cancelAnimationFrame(y);
|
|
360
359
|
};
|
|
361
360
|
}, []), R(() => {
|
|
362
361
|
if (!f.current || !u) return;
|
|
363
|
-
const c = f.current,
|
|
362
|
+
const c = f.current, p = "react-custom-styles";
|
|
364
363
|
let g = !0;
|
|
365
364
|
return c.ready?.().then(() => {
|
|
366
|
-
g && u && (c.registerStyles?.(
|
|
365
|
+
g && u && (c.registerStyles?.(p, u), k.current = p);
|
|
367
366
|
}), () => {
|
|
368
367
|
g = !1, k.current && (c.unregisterStyles?.(k.current), k.current = null);
|
|
369
368
|
};
|
|
370
369
|
}, [u]), R(() => {
|
|
371
370
|
const c = f.current;
|
|
372
371
|
if (!c) return;
|
|
373
|
-
const
|
|
372
|
+
const p = [];
|
|
374
373
|
if (m) {
|
|
375
374
|
const g = ((y) => m(y.detail.rows));
|
|
376
|
-
c.addEventListener("rows-change", g),
|
|
375
|
+
c.addEventListener("rows-change", g), p.push(["rows-change", g]);
|
|
377
376
|
}
|
|
378
377
|
if (E) {
|
|
379
378
|
const g = ((y) => E(y));
|
|
380
|
-
c.addEventListener("cell-edit", g),
|
|
379
|
+
c.addEventListener("cell-edit", g), p.push(["cell-edit", g]);
|
|
381
380
|
}
|
|
382
381
|
if (v) {
|
|
383
382
|
const g = ((y) => v(y));
|
|
384
|
-
c.addEventListener("row-click", g),
|
|
383
|
+
c.addEventListener("row-click", g), p.push(["row-click", g]);
|
|
385
384
|
}
|
|
386
385
|
if (D) {
|
|
387
386
|
const g = ((y) => D(y));
|
|
388
|
-
c.addEventListener("column-state-change", g),
|
|
387
|
+
c.addEventListener("column-state-change", g), p.push(["column-state-change", g]);
|
|
389
388
|
}
|
|
390
389
|
if (I) {
|
|
391
390
|
const g = ((y) => I(y));
|
|
392
|
-
c.addEventListener("sort-change", g),
|
|
391
|
+
c.addEventListener("sort-change", g), p.push(["sort-change", g]);
|
|
393
392
|
}
|
|
394
393
|
return () => {
|
|
395
|
-
|
|
394
|
+
p.forEach(([g, y]) => {
|
|
396
395
|
c.removeEventListener(g, y);
|
|
397
396
|
});
|
|
398
397
|
};
|
|
399
|
-
}, [m, E, v, D, I]),
|
|
398
|
+
}, [m, E, v, D, I]), _(
|
|
400
399
|
e,
|
|
401
400
|
() => ({
|
|
402
401
|
get element() {
|
|
@@ -414,8 +413,8 @@ const ae = _(function(t, e) {
|
|
|
414
413
|
async toggleGroup(c) {
|
|
415
414
|
return f.current?.toggleGroup?.(c);
|
|
416
415
|
},
|
|
417
|
-
registerStyles(c,
|
|
418
|
-
f.current?.registerStyles?.(c,
|
|
416
|
+
registerStyles(c, p) {
|
|
417
|
+
f.current?.registerStyles?.(c, p);
|
|
419
418
|
},
|
|
420
419
|
unregisterStyles(c) {
|
|
421
420
|
f.current?.unregisterStyles?.(c);
|
|
@@ -427,8 +426,8 @@ const ae = _(function(t, e) {
|
|
|
427
426
|
{
|
|
428
427
|
ref: (c) => {
|
|
429
428
|
if (f.current = c, c) {
|
|
430
|
-
const
|
|
431
|
-
|
|
429
|
+
const p = c;
|
|
430
|
+
h && (p.gridConfig = h), r && (p.rows = r), s && (p.columns = s);
|
|
432
431
|
}
|
|
433
432
|
},
|
|
434
433
|
class: l,
|
|
@@ -437,14 +436,14 @@ const ae = _(function(t, e) {
|
|
|
437
436
|
}
|
|
438
437
|
);
|
|
439
438
|
});
|
|
440
|
-
function
|
|
439
|
+
function ae(n) {
|
|
441
440
|
const {
|
|
442
441
|
field: t,
|
|
443
442
|
header: e,
|
|
444
443
|
type: r,
|
|
445
444
|
editable: i,
|
|
446
|
-
sortable:
|
|
447
|
-
resizable:
|
|
445
|
+
sortable: s,
|
|
446
|
+
resizable: o,
|
|
448
447
|
width: d,
|
|
449
448
|
minWidth: u,
|
|
450
449
|
hidden: l,
|
|
@@ -456,20 +455,20 @@ function le(n) {
|
|
|
456
455
|
format: D
|
|
457
456
|
} = n, I = G(null), f = C(
|
|
458
457
|
(c) => {
|
|
459
|
-
I.current = c, c && (a &&
|
|
458
|
+
I.current = c, c && (a && Q(c, a), m && U(c, m));
|
|
460
459
|
},
|
|
461
460
|
[a, m, t]
|
|
462
|
-
), k = typeof d == "number" ? `${d}px` : d,
|
|
461
|
+
), k = typeof d == "number" ? `${d}px` : d, h = {
|
|
463
462
|
field: t,
|
|
464
463
|
ref: f
|
|
465
464
|
};
|
|
466
|
-
return e !== void 0 && (
|
|
465
|
+
return e !== void 0 && (h.header = e), r !== void 0 && (h.type = r), i !== void 0 && (h.editable = i), s !== void 0 && (h.sortable = s), o !== void 0 && (h.resizable = o), k !== void 0 && (h.width = k), u !== void 0 && (h["min-width"] = u), l !== void 0 && (h.hidden = l), w !== void 0 && (h["lock-visible"] = w), v !== void 0 && (h.multi = v), D && (h["data-has-format"] = "true"), E && (h["data-has-options"] = "true"), /* @__PURE__ */ L("tbw-grid-column", { ...h });
|
|
467
466
|
}
|
|
468
|
-
function
|
|
467
|
+
function le({ children: n }) {
|
|
469
468
|
return /* @__PURE__ */ L("tbw-grid-tool-buttons", { children: n });
|
|
470
469
|
}
|
|
471
|
-
function
|
|
472
|
-
const n = G(null), [t, e] =
|
|
470
|
+
function fe() {
|
|
471
|
+
const n = G(null), [t, e] = x(!1), [r, i] = x(null);
|
|
473
472
|
R(() => {
|
|
474
473
|
const a = n.current;
|
|
475
474
|
if (!a) return;
|
|
@@ -487,10 +486,10 @@ function ge() {
|
|
|
487
486
|
m = !1;
|
|
488
487
|
};
|
|
489
488
|
}, []);
|
|
490
|
-
const
|
|
489
|
+
const s = C(async () => {
|
|
491
490
|
const a = n.current;
|
|
492
491
|
return a ? await a.getConfig?.() ?? null : null;
|
|
493
|
-
}, []),
|
|
492
|
+
}, []), o = C(async () => {
|
|
494
493
|
const a = n.current;
|
|
495
494
|
a && await a.forceLayout?.();
|
|
496
495
|
}, []), d = C(async (a) => {
|
|
@@ -505,37 +504,37 @@ function ge() {
|
|
|
505
504
|
ref: n,
|
|
506
505
|
isReady: t,
|
|
507
506
|
config: r,
|
|
508
|
-
getConfig:
|
|
509
|
-
forceLayout:
|
|
507
|
+
getConfig: s,
|
|
508
|
+
forceLayout: o,
|
|
510
509
|
toggleGroup: d,
|
|
511
510
|
registerStyles: u,
|
|
512
511
|
unregisterStyles: l,
|
|
513
512
|
getVisibleColumns: w
|
|
514
513
|
};
|
|
515
514
|
}
|
|
516
|
-
function
|
|
515
|
+
function ge(n, t, e, r = []) {
|
|
517
516
|
const i = G(e);
|
|
518
517
|
R(() => {
|
|
519
518
|
i.current = e;
|
|
520
519
|
}, [e, ...r]), R(() => {
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
520
|
+
const s = n.current, o = s && "element" in s ? s.element : s;
|
|
521
|
+
if (!o) return;
|
|
523
522
|
const d = ((u) => {
|
|
524
523
|
i.current(u);
|
|
525
524
|
});
|
|
526
|
-
return
|
|
527
|
-
|
|
525
|
+
return o.addEventListener(t, d), () => {
|
|
526
|
+
o.removeEventListener(t, d);
|
|
528
527
|
};
|
|
529
528
|
}, [n, t]);
|
|
530
529
|
}
|
|
531
530
|
export {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
531
|
+
ue as DataGrid,
|
|
532
|
+
ae as GridColumn,
|
|
533
|
+
se as GridDetailPanel,
|
|
534
|
+
le as GridToolButtons,
|
|
535
|
+
ce as GridToolPanel,
|
|
536
|
+
Z as ReactGridAdapter,
|
|
537
|
+
de as getRegisteredFields,
|
|
538
|
+
fe as useGrid,
|
|
539
|
+
ge as useGridEvent
|
|
541
540
|
};
|
package/lib/data-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAA+D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpG,OAAO,aAAa,CAAC;AAErB,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@toolbox-web/grid-react",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "React adapter for @toolbox-web/grid data grid component",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
"./package.json": "./package.json",
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"default": "./dist/index.js"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"react",
|
|
19
|
-
"data-grid",
|
|
20
|
-
"web-component",
|
|
21
|
-
"toolbox-web"
|
|
22
|
-
],
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"author": "Oystein Amundsen",
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "https://github.com/OysteinAmundsen/toolbox.git",
|
|
28
|
-
"directory": "libs/grid-react"
|
|
29
|
-
},
|
|
30
|
-
"homepage": "https://github.com/OysteinAmundsen/toolbox/tree/main/libs/grid-react#readme",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/OysteinAmundsen/toolbox/issues"
|
|
33
|
-
},
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"react": "^19.0.0",
|
|
40
|
-
"react-dom": "^19.0.0",
|
|
41
|
-
"@types/react": "^19.0.0",
|
|
42
|
-
"@types/react-dom": "^19.0.0",
|
|
43
|
-
"@toolbox-web/grid": ">=0.2.0"
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"react": ">=18.0.0",
|
|
47
|
-
"react-dom": ">=18.0.0",
|
|
48
|
-
"@toolbox-web/grid": ">=0.2.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@toolbox-web/grid-react",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "React adapter for @toolbox-web/grid data grid component",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"react",
|
|
19
|
+
"data-grid",
|
|
20
|
+
"web-component",
|
|
21
|
+
"toolbox-web"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "Oystein Amundsen",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/OysteinAmundsen/toolbox.git",
|
|
28
|
+
"directory": "libs/grid-react"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/OysteinAmundsen/toolbox/tree/main/libs/grid-react#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/OysteinAmundsen/toolbox/issues"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"react": "^19.0.0",
|
|
40
|
+
"react-dom": "^19.0.0",
|
|
41
|
+
"@types/react": "^19.0.0",
|
|
42
|
+
"@types/react-dom": "^19.0.0",
|
|
43
|
+
"@toolbox-web/grid": ">=0.2.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": ">=18.0.0",
|
|
47
|
+
"react-dom": ">=18.0.0",
|
|
48
|
+
"@toolbox-web/grid": ">=0.2.0"
|
|
49
|
+
}
|
|
50
|
+
}
|