@toolbox-web/grid 1.23.4 → 1.24.0
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 +35 -6
- package/all.d.ts +2 -2
- package/all.d.ts.map +1 -1
- package/all.js +2 -2
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +21 -0
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/feature-hook.d.ts +8 -0
- package/lib/core/internal/feature-hook.d.ts.map +1 -0
- package/lib/core/plugin/base-plugin.d.ts +8 -2
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +1 -1
- package/lib/core/types.d.ts +59 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/features/clipboard.d.ts +8 -0
- package/lib/features/clipboard.d.ts.map +1 -0
- package/lib/features/clipboard.js +2 -0
- package/lib/features/clipboard.js.map +1 -0
- package/lib/features/column-virtualization.d.ts +8 -0
- package/lib/features/column-virtualization.d.ts.map +1 -0
- package/lib/features/column-virtualization.js +2 -0
- package/lib/features/column-virtualization.js.map +1 -0
- package/lib/features/context-menu.d.ts +8 -0
- package/lib/features/context-menu.d.ts.map +1 -0
- package/lib/features/context-menu.js +2 -0
- package/lib/features/context-menu.js.map +1 -0
- package/lib/features/editing.d.ts +8 -0
- package/lib/features/editing.d.ts.map +1 -0
- package/lib/features/editing.js +2 -0
- package/lib/features/editing.js.map +1 -0
- package/lib/features/export.d.ts +8 -0
- package/lib/features/export.d.ts.map +1 -0
- package/lib/features/export.js +2 -0
- package/lib/features/export.js.map +1 -0
- package/lib/features/filtering.d.ts +8 -0
- package/lib/features/filtering.d.ts.map +1 -0
- package/lib/features/filtering.js +2 -0
- package/lib/features/filtering.js.map +1 -0
- package/lib/features/grouping-columns.d.ts +8 -0
- package/lib/features/grouping-columns.d.ts.map +1 -0
- package/lib/features/grouping-columns.js +2 -0
- package/lib/features/grouping-columns.js.map +1 -0
- package/lib/features/grouping-rows.d.ts +8 -0
- package/lib/features/grouping-rows.d.ts.map +1 -0
- package/lib/features/grouping-rows.js +2 -0
- package/lib/features/grouping-rows.js.map +1 -0
- package/lib/features/magic-string.es-CkyDP9Ir.mjs.map +1 -0
- package/lib/features/master-detail.d.ts +8 -0
- package/lib/features/master-detail.d.ts.map +1 -0
- package/lib/features/master-detail.js +2 -0
- package/lib/features/master-detail.js.map +1 -0
- package/lib/features/multi-sort.d.ts +10 -0
- package/lib/features/multi-sort.d.ts.map +1 -0
- package/lib/features/multi-sort.js +2 -0
- package/lib/features/multi-sort.js.map +1 -0
- package/lib/features/pinned-columns.d.ts +18 -0
- package/lib/features/pinned-columns.d.ts.map +1 -0
- package/lib/features/pinned-columns.js +2 -0
- package/lib/features/pinned-columns.js.map +1 -0
- package/lib/features/pinned-rows.d.ts +8 -0
- package/lib/features/pinned-rows.d.ts.map +1 -0
- package/lib/features/pinned-rows.js +2 -0
- package/lib/features/pinned-rows.js.map +1 -0
- package/lib/features/pivot.d.ts +8 -0
- package/lib/features/pivot.d.ts.map +1 -0
- package/lib/features/pivot.js +2 -0
- package/lib/features/pivot.js.map +1 -0
- package/lib/features/print.d.ts +8 -0
- package/lib/features/print.d.ts.map +1 -0
- package/lib/features/print.js +2 -0
- package/lib/features/print.js.map +1 -0
- package/lib/features/registry.d.ts +50 -0
- package/lib/features/registry.d.ts.map +1 -0
- package/lib/features/registry.js +2 -0
- package/lib/features/registry.js.map +1 -0
- package/lib/features/registry.spec.js +5 -0
- package/lib/features/registry.spec.js.map +1 -0
- package/lib/features/reorder-columns.d.ts +10 -0
- package/lib/features/reorder-columns.d.ts.map +1 -0
- package/lib/features/reorder-columns.js +2 -0
- package/lib/features/reorder-columns.js.map +1 -0
- package/lib/features/reorder-rows.d.ts +10 -0
- package/lib/features/reorder-rows.d.ts.map +1 -0
- package/lib/features/reorder-rows.js +2 -0
- package/lib/features/reorder-rows.js.map +1 -0
- package/lib/features/responsive.d.ts +8 -0
- package/lib/features/responsive.d.ts.map +1 -0
- package/lib/features/responsive.js +2 -0
- package/lib/features/responsive.js.map +1 -0
- package/lib/features/selection.d.ts +8 -0
- package/lib/features/selection.d.ts.map +1 -0
- package/lib/features/selection.js +2 -0
- package/lib/features/selection.js.map +1 -0
- package/lib/features/server-side.d.ts +8 -0
- package/lib/features/server-side.d.ts.map +1 -0
- package/lib/features/server-side.js +2 -0
- package/lib/features/server-side.js.map +1 -0
- package/lib/features/tree.d.ts +8 -0
- package/lib/features/tree.d.ts.map +1 -0
- package/lib/features/tree.js +2 -0
- package/lib/features/tree.js.map +1 -0
- package/lib/features/undo-redo.d.ts +8 -0
- package/lib/features/undo-redo.d.ts.map +1 -0
- package/lib/features/undo-redo.js +2 -0
- package/lib/features/undo-redo.js.map +1 -0
- package/lib/features/visibility.d.ts +8 -0
- package/lib/features/visibility.d.ts.map +1 -0
- package/lib/features/visibility.js +2 -0
- package/lib/features/visibility.js.map +1 -0
- package/lib/plugins/clipboard/index.js +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/index.js +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +428 -27
- package/lib/plugins/filtering/types.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.d.ts +1 -1
- package/lib/plugins/grouping-columns/index.js +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.d.ts +2 -2
- package/lib/plugins/grouping-rows/index.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +2 -2
- package/lib/plugins/master-detail/index.js +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-columns/types.d.ts +3 -3
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/{reorder → reorder-columns}/ReorderPlugin.d.ts +5 -3
- package/lib/plugins/reorder-columns/ReorderPlugin.d.ts.map +1 -0
- package/lib/plugins/reorder-columns/column-drag.d.ts.map +1 -0
- package/lib/plugins/{reorder → reorder-columns}/index.d.ts +2 -2
- package/lib/plugins/reorder-columns/index.d.ts.map +1 -0
- package/lib/plugins/reorder-columns/index.js +2 -0
- package/lib/plugins/reorder-columns/index.js.map +1 -0
- package/lib/plugins/{reorder → reorder-columns}/types.d.ts +5 -0
- package/lib/plugins/reorder-columns/types.d.ts.map +1 -0
- package/lib/plugins/{row-reorder → reorder-rows}/RowReorderPlugin.d.ts +5 -3
- package/lib/plugins/reorder-rows/RowReorderPlugin.d.ts.map +1 -0
- package/lib/plugins/{row-reorder → reorder-rows}/index.d.ts +2 -2
- package/lib/plugins/reorder-rows/index.d.ts.map +1 -0
- package/lib/plugins/reorder-rows/index.js +2 -0
- package/lib/plugins/reorder-rows/index.js.map +1 -0
- package/lib/plugins/{row-reorder → reorder-rows}/types.d.ts +5 -0
- package/lib/plugins/reorder-rows/types.d.ts.map +1 -0
- package/lib/plugins/responsive/ResponsivePlugin.d.ts +2 -2
- package/lib/plugins/responsive/index.js +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/selection/index.js +1 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/VisibilityPlugin.d.ts +1 -1
- package/lib/plugins/visibility/index.js +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +17 -2
- package/public.d.ts +9 -2
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +1 -1
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/reorder-columns.umd.js +2 -0
- package/umd/plugins/reorder-columns.umd.js.map +1 -0
- package/umd/plugins/reorder-rows.umd.js +2 -0
- package/umd/plugins/reorder-rows.umd.js.map +1 -0
- package/umd/plugins/responsive.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +0 -1
- package/lib/plugins/reorder/column-drag.d.ts.map +0 -1
- package/lib/plugins/reorder/index.d.ts.map +0 -1
- package/lib/plugins/reorder/index.js +0 -2
- package/lib/plugins/reorder/index.js.map +0 -1
- package/lib/plugins/reorder/types.d.ts.map +0 -1
- package/lib/plugins/row-reorder/RowReorderPlugin.d.ts.map +0 -1
- package/lib/plugins/row-reorder/index.d.ts.map +0 -1
- package/lib/plugins/row-reorder/index.js +0 -2
- package/lib/plugins/row-reorder/index.js.map +0 -1
- package/lib/plugins/row-reorder/types.d.ts.map +0 -1
- package/umd/plugins/reorder.umd.js +0 -2
- package/umd/plugins/reorder.umd.js.map +0 -1
- package/umd/plugins/row-reorder.umd.js +0 -2
- package/umd/plugins/row-reorder.umd.js.map +0 -1
- /package/lib/plugins/{reorder → reorder-columns}/column-drag.d.ts +0 -0
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ import { createGrid, queryGrid } from '@toolbox-web/grid';
|
|
|
38
38
|
// Create a new typed grid
|
|
39
39
|
const grid = createGrid<Employee>({
|
|
40
40
|
columns: [{ field: 'name' }],
|
|
41
|
-
|
|
41
|
+
features: { selection: 'row' },
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
// Query an existing grid with proper typing
|
|
@@ -59,10 +59,13 @@ The grid supports multiple configuration methods, all converging into a **single
|
|
|
59
59
|
**1. Via `gridConfig` (recommended for complex setups):**
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
|
+
import '@toolbox-web/grid/features/selection';
|
|
63
|
+
import '@toolbox-web/grid/features/editing';
|
|
64
|
+
|
|
62
65
|
grid.gridConfig = {
|
|
63
66
|
columns: [{ field: 'name' }, { field: 'age', type: 'number' }],
|
|
64
67
|
fitMode: 'stretch',
|
|
65
|
-
|
|
68
|
+
features: { selection: 'row', editing: true },
|
|
66
69
|
shell: { header: { title: 'My Data Grid' } },
|
|
67
70
|
};
|
|
68
71
|
```
|
|
@@ -420,7 +423,8 @@ See the [documentation](https://toolboxjs.com/) for complete configuration examp
|
|
|
420
423
|
interface GridConfig {
|
|
421
424
|
columns?: ColumnConfig[];
|
|
422
425
|
fitMode?: 'stretch' | 'fixed';
|
|
423
|
-
|
|
426
|
+
features?: Partial<FeatureConfig>; // Declarative feature configuration (recommended)
|
|
427
|
+
plugins?: BaseGridPlugin[]; // Manual plugin instances (advanced)
|
|
424
428
|
icons?: GridIcons; // Centralized icon configuration
|
|
425
429
|
shell?: ShellConfig; // Optional header bar and tool panels
|
|
426
430
|
getRowId?: (row: T) => string; // Custom row ID resolver
|
|
@@ -504,7 +508,32 @@ Framework adapters (`@toolbox-web/grid-react`, `@toolbox-web/grid-angular`) prov
|
|
|
504
508
|
|
|
505
509
|
### Plugin Configuration Example
|
|
506
510
|
|
|
507
|
-
|
|
511
|
+
#### Feature Props (Recommended)
|
|
512
|
+
|
|
513
|
+
The simplest way to enable plugins is via **feature props** on `gridConfig.features`. Import the feature side-effect modules, then set the config declaratively:
|
|
514
|
+
|
|
515
|
+
```typescript
|
|
516
|
+
import '@toolbox-web/grid/features/selection';
|
|
517
|
+
import '@toolbox-web/grid/features/grouping-rows';
|
|
518
|
+
import '@toolbox-web/grid/features/filtering';
|
|
519
|
+
|
|
520
|
+
grid.gridConfig = {
|
|
521
|
+
features: {
|
|
522
|
+
selection: { mode: 'row', multiple: true },
|
|
523
|
+
groupingRows: { groupOn: (row) => row.category, fullWidth: false, aggregators: { total: 'sum' } },
|
|
524
|
+
filtering: { debounceMs: 200 },
|
|
525
|
+
},
|
|
526
|
+
};
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Each feature import registers a factory; the grid creates the plugin instances from your config. This pattern is **tree-shakeable** — only imported features are bundled.
|
|
530
|
+
|
|
531
|
+
> [!TIP]
|
|
532
|
+
> For prototyping, import all features at once: `import '@toolbox-web/grid/features';`
|
|
533
|
+
|
|
534
|
+
#### Manual Plugin Instantiation (Advanced)
|
|
535
|
+
|
|
536
|
+
For full control (e.g., custom plugin subclasses or mixed feature+plugin setups), pass class instances to `plugins`:
|
|
508
537
|
|
|
509
538
|
```typescript
|
|
510
539
|
import { GroupingRowsPlugin } from '@toolbox-web/grid/plugins/grouping-rows';
|
|
@@ -629,8 +658,8 @@ The grid uses a plugin architecture for optional features. Each plugin has its o
|
|
|
629
658
|
| Master-Detail | Expandable detail rows | [README](./src/lib/plugins/master-detail/README.md) |
|
|
630
659
|
| Pinned Columns | Sticky columns | [README](./src/lib/plugins/pinned-columns/README.md) |
|
|
631
660
|
| Pinned Rows | Footer aggregations | [README](./src/lib/plugins/pinned-rows/README.md) |
|
|
632
|
-
| Reorder
|
|
633
|
-
|
|
|
661
|
+
| Reorder Columns | Column drag reordering | [README](./src/lib/plugins/reorder-columns/README.md) |
|
|
662
|
+
| Reorder Rows | Row drag reordering | [README](./src/lib/plugins/reorder-rows/README.md) |
|
|
634
663
|
| Visibility | Column visibility UI | [README](./src/lib/plugins/visibility/README.md) |
|
|
635
664
|
| Responsive | Card layout for mobile | [README](./src/lib/plugins/responsive/README.md) |
|
|
636
665
|
| Clipboard | Copy/paste | [README](./src/lib/plugins/clipboard/README.md) |
|
package/all.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export * from './lib/plugins/pinned-columns';
|
|
|
17
17
|
export * from './lib/plugins/pinned-rows';
|
|
18
18
|
export * from './lib/plugins/pivot';
|
|
19
19
|
export * from './lib/plugins/print';
|
|
20
|
-
export * from './lib/plugins/reorder';
|
|
20
|
+
export * from './lib/plugins/reorder-columns';
|
|
21
|
+
export * from './lib/plugins/reorder-rows';
|
|
21
22
|
export * from './lib/plugins/responsive';
|
|
22
|
-
export * from './lib/plugins/row-reorder';
|
|
23
23
|
export * from './lib/plugins/selection';
|
|
24
24
|
export * from './lib/plugins/server-side';
|
|
25
25
|
export * from './lib/plugins/tree';
|
package/all.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../libs/grid/src/all.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,iBAAiB,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAA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