@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.
Files changed (40) hide show
  1. package/README.md +16 -3
  2. package/all.js +1 -1
  3. package/all.js.map +1 -1
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/types.d.ts +62 -7
  7. package/lib/features/registry.js +1 -1
  8. package/lib/plugins/clipboard/index.js +1 -1
  9. package/lib/plugins/column-virtualization/index.js +1 -1
  10. package/lib/plugins/context-menu/index.js +1 -1
  11. package/lib/plugins/editing/index.js +1 -1
  12. package/lib/plugins/editing/index.js.map +1 -1
  13. package/lib/plugins/editing/types.d.ts +0 -54
  14. package/lib/plugins/export/index.js +1 -1
  15. package/lib/plugins/filtering/index.js +1 -1
  16. package/lib/plugins/grouping-columns/index.js +1 -1
  17. package/lib/plugins/grouping-rows/index.js +1 -1
  18. package/lib/plugins/master-detail/index.js +1 -1
  19. package/lib/plugins/multi-sort/index.js +1 -1
  20. package/lib/plugins/pinned-columns/index.js +1 -1
  21. package/lib/plugins/pinned-rows/index.js +1 -1
  22. package/lib/plugins/pivot/index.js +1 -1
  23. package/lib/plugins/print/index.js +1 -1
  24. package/lib/plugins/reorder-columns/index.js +1 -1
  25. package/lib/plugins/responsive/index.js +1 -1
  26. package/lib/plugins/row-drag-drop/index.js +1 -1
  27. package/lib/plugins/selection/index.js +1 -1
  28. package/lib/plugins/server-side/index.js +1 -1
  29. package/lib/plugins/shell/index.js +1 -1
  30. package/lib/plugins/sticky-rows/index.js +1 -1
  31. package/lib/plugins/tooltip/index.js +1 -1
  32. package/lib/plugins/tree/index.js +1 -1
  33. package/lib/plugins/undo-redo/index.js +1 -1
  34. package/lib/plugins/visibility/index.js +1 -1
  35. package/package.json +1 -1
  36. package/umd/grid.all.umd.js +1 -1
  37. package/umd/grid.all.umd.js.map +1 -1
  38. package/umd/grid.umd.js +1 -1
  39. package/umd/grid.umd.js.map +1 -1
  40. 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 renderers/editors
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 renderers and editors at the type level that apply to all columns with matching `type`:
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