@toolbox-web/grid 3.7.1 → 3.8.1
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 +16 -3
- package/all.js +1 -1
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/types.d.ts +62 -7
- package/lib/features/registry.js +1 -1
- package/lib/plugins/clipboard/index.js +1 -1
- package/lib/plugins/column-virtualization/index.js +1 -1
- package/lib/plugins/context-menu/index.js +1 -1
- package/lib/plugins/editing/index.js +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/types.d.ts +0 -54
- package/lib/plugins/export/index.js +1 -1
- package/lib/plugins/filtering/index.js +1 -1
- package/lib/plugins/grouping-columns/index.js +1 -1
- package/lib/plugins/grouping-rows/index.js +1 -1
- package/lib/plugins/master-detail/index.js +1 -1
- package/lib/plugins/multi-sort/index.js +1 -1
- package/lib/plugins/pinned-columns/index.js +1 -1
- package/lib/plugins/pinned-rows/index.js +1 -1
- package/lib/plugins/pivot/index.js +1 -1
- package/lib/plugins/print/index.js +1 -1
- package/lib/plugins/reorder-columns/index.js +1 -1
- package/lib/plugins/responsive/index.js +1 -1
- package/lib/plugins/row-drag-drop/index.js +1 -1
- package/lib/plugins/selection/index.js +1 -1
- package/lib/plugins/server-side/index.js +1 -1
- package/lib/plugins/shell/index.js +1 -1
- package/lib/plugins/sticky-rows/index.js +1 -1
- package/lib/plugins/tooltip/index.js +1 -1
- package/lib/plugins/tree/index.js +1 -1
- package/lib/plugins/undo-redo/index.js +1 -1
- package/lib/plugins/visibility/index.js +1 -1
- package/package.json +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/editing.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -434,7 +434,7 @@ interface GridConfig {
|
|
|
434
434
|
icons?: GridIcons; // Centralized icon configuration
|
|
435
435
|
shell?: ShellConfig; // Optional header bar and tool panels
|
|
436
436
|
getRowId?: (row: T) => string; // Custom row ID resolver
|
|
437
|
-
typeDefaults?: Record<string, TypeDefault<T>>; // Type-level
|
|
437
|
+
typeDefaults?: Record<string, TypeDefault<T>>; // Type-level column defaults
|
|
438
438
|
}
|
|
439
439
|
```
|
|
440
440
|
|
|
@@ -473,7 +473,13 @@ Icons can be strings (text or HTML) or `HTMLElement` instances. Plugins use grid
|
|
|
473
473
|
|
|
474
474
|
### Type-Level Defaults
|
|
475
475
|
|
|
476
|
-
Define
|
|
476
|
+
Define column config at the type level that applies to all columns with a matching `type`. A type
|
|
477
|
+
default accepts **any** `ColumnConfig` property, plus the column properties contributed by whichever
|
|
478
|
+
plugins you import (`editor` / `editorParams` from the editing plugin, `filterType` from the
|
|
479
|
+
filtering plugin, and so on).
|
|
480
|
+
|
|
481
|
+
These six properties are never inherited, because they identify or position a single column:
|
|
482
|
+
`field`, `header`, `order`, `group`, `hidden`, `utility`.
|
|
477
483
|
|
|
478
484
|
```typescript
|
|
479
485
|
grid.gridConfig = {
|
|
@@ -499,17 +505,24 @@ grid.gridConfig = {
|
|
|
499
505
|
},
|
|
500
506
|
currency: {
|
|
501
507
|
editorParams: { min: 0, step: 0.01 },
|
|
508
|
+
width: 120,
|
|
509
|
+
cellClass: 'numeric',
|
|
502
510
|
},
|
|
503
511
|
},
|
|
504
512
|
columns: [
|
|
505
513
|
{ field: 'country', type: 'country', editable: true }, // Uses country renderer/editor
|
|
506
|
-
{ field: 'salary', type: 'currency', editable: true }, // Uses currency editorParams
|
|
514
|
+
{ field: 'salary', type: 'currency', editable: true }, // Uses currency editorParams, width, cellClass
|
|
515
|
+
{ field: 'bonus', type: 'currency', width: 200 }, // Column-level width wins
|
|
507
516
|
],
|
|
508
517
|
};
|
|
509
518
|
```
|
|
510
519
|
|
|
511
520
|
**Resolution Priority:** Column-level → `gridConfig.typeDefaults` → Framework adapter → Built-in
|
|
512
521
|
|
|
522
|
+
Resolution is per-property and shallow: a column keeps any value it defines itself (including falsy
|
|
523
|
+
ones such as `sortable: false`), and inherits the type-level value only where it left the property
|
|
524
|
+
`undefined` or `null`.
|
|
525
|
+
|
|
513
526
|
Framework adapters (`@toolbox-web/grid-react`, `@toolbox-web/grid-angular`) provide app-level type registries for React/Angular components.
|
|
514
527
|
|
|
515
528
|
### Plugin Configuration Example
|