@toolbox-web/grid 2.0.0-rc.1 → 2.0.0-rc.2

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 (95) hide show
  1. package/README.md +23 -6
  2. package/all.js +2 -2
  3. package/all.js.map +1 -1
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/internal/sorting.d.ts +4 -0
  7. package/lib/core/plugin/base-plugin.d.ts +31 -0
  8. package/lib/core/plugin/plugin-manager.d.ts +4 -1
  9. package/lib/core/plugin/types.d.ts +2 -0
  10. package/lib/core/types.d.ts +20 -1
  11. package/lib/plugins/clipboard/ClipboardPlugin.d.ts +8 -1
  12. package/lib/plugins/clipboard/index.js +1 -1
  13. package/lib/plugins/clipboard/index.js.map +1 -1
  14. package/lib/plugins/column-virtualization/index.js +1 -1
  15. package/lib/plugins/column-virtualization/index.js.map +1 -1
  16. package/lib/plugins/context-menu/index.js +1 -1
  17. package/lib/plugins/context-menu/index.js.map +1 -1
  18. package/lib/plugins/editing/index.js +1 -1
  19. package/lib/plugins/editing/index.js.map +1 -1
  20. package/lib/plugins/export/ExportPlugin.d.ts +8 -1
  21. package/lib/plugins/export/index.js +1 -1
  22. package/lib/plugins/export/index.js.map +1 -1
  23. package/lib/plugins/filtering/index.js +1 -1
  24. package/lib/plugins/filtering/index.js.map +1 -1
  25. package/lib/plugins/grouping-columns/index.js +1 -1
  26. package/lib/plugins/grouping-columns/index.js.map +1 -1
  27. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +33 -1
  28. package/lib/plugins/grouping-rows/grouping-rows.d.ts +15 -1
  29. package/lib/plugins/grouping-rows/index.js +2 -2
  30. package/lib/plugins/grouping-rows/index.js.map +1 -1
  31. package/lib/plugins/master-detail/index.js +1 -1
  32. package/lib/plugins/master-detail/index.js.map +1 -1
  33. package/lib/plugins/multi-sort/index.js +1 -1
  34. package/lib/plugins/multi-sort/index.js.map +1 -1
  35. package/lib/plugins/pinned-columns/index.js +1 -1
  36. package/lib/plugins/pinned-columns/index.js.map +1 -1
  37. package/lib/plugins/pinned-rows/index.js +1 -1
  38. package/lib/plugins/pinned-rows/index.js.map +1 -1
  39. package/lib/plugins/pivot/PivotPlugin.d.ts +10 -0
  40. package/lib/plugins/pivot/index.js +1 -1
  41. package/lib/plugins/pivot/index.js.map +1 -1
  42. package/lib/plugins/print/index.js +1 -1
  43. package/lib/plugins/print/index.js.map +1 -1
  44. package/lib/plugins/reorder-columns/index.js +1 -1
  45. package/lib/plugins/reorder-columns/index.js.map +1 -1
  46. package/lib/plugins/reorder-rows/RowReorderPlugin.d.ts +3 -0
  47. package/lib/plugins/reorder-rows/index.js +1 -1
  48. package/lib/plugins/reorder-rows/index.js.map +1 -1
  49. package/lib/plugins/responsive/index.js +1 -1
  50. package/lib/plugins/responsive/index.js.map +1 -1
  51. package/lib/plugins/selection/index.js +1 -1
  52. package/lib/plugins/selection/index.js.map +1 -1
  53. package/lib/plugins/server-side/index.js +1 -1
  54. package/lib/plugins/server-side/index.js.map +1 -1
  55. package/lib/plugins/tooltip/index.js +1 -1
  56. package/lib/plugins/tooltip/index.js.map +1 -1
  57. package/lib/plugins/tree/TreePlugin.d.ts +16 -0
  58. package/lib/plugins/tree/index.js +1 -1
  59. package/lib/plugins/tree/index.js.map +1 -1
  60. package/lib/plugins/tree/types.d.ts +6 -0
  61. package/lib/plugins/undo-redo/index.js +1 -1
  62. package/lib/plugins/undo-redo/index.js.map +1 -1
  63. package/lib/plugins/visibility/index.js +1 -1
  64. package/lib/plugins/visibility/index.js.map +1 -1
  65. package/package.json +1 -1
  66. package/umd/grid.all.umd.js +1 -1
  67. package/umd/grid.all.umd.js.map +1 -1
  68. package/umd/grid.umd.js +1 -1
  69. package/umd/grid.umd.js.map +1 -1
  70. package/umd/plugins/clipboard.umd.js +1 -1
  71. package/umd/plugins/clipboard.umd.js.map +1 -1
  72. package/umd/plugins/context-menu.umd.js +1 -1
  73. package/umd/plugins/context-menu.umd.js.map +1 -1
  74. package/umd/plugins/editing.umd.js +1 -1
  75. package/umd/plugins/editing.umd.js.map +1 -1
  76. package/umd/plugins/export.umd.js +1 -1
  77. package/umd/plugins/export.umd.js.map +1 -1
  78. package/umd/plugins/grouping-rows.umd.js +1 -1
  79. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  80. package/umd/plugins/multi-sort.umd.js +1 -1
  81. package/umd/plugins/multi-sort.umd.js.map +1 -1
  82. package/umd/plugins/pinned-columns.umd.js +1 -1
  83. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  84. package/umd/plugins/pivot.umd.js +1 -1
  85. package/umd/plugins/pivot.umd.js.map +1 -1
  86. package/umd/plugins/reorder-rows.umd.js +1 -1
  87. package/umd/plugins/reorder-rows.umd.js.map +1 -1
  88. package/umd/plugins/selection.umd.js +1 -1
  89. package/umd/plugins/selection.umd.js.map +1 -1
  90. package/umd/plugins/server-side.umd.js +1 -1
  91. package/umd/plugins/server-side.umd.js.map +1 -1
  92. package/umd/plugins/tooltip.umd.js +1 -1
  93. package/umd/plugins/tooltip.umd.js.map +1 -1
  94. package/umd/plugins/tree.umd.js +1 -1
  95. package/umd/plugins/tree.umd.js.map +1 -1
package/README.md CHANGED
@@ -711,10 +711,11 @@ export class MyPlugin extends BaseGridPlugin<MyPluginConfig> {
711
711
 
712
712
  ### Inter-Plugin Communication
713
713
 
714
- Plugins can communicate with each other using two systems:
714
+ Plugins can communicate with each other using three systems:
715
715
 
716
716
  1. **Event Bus** - For async notifications between plugins
717
717
  2. **Query System** - For sync state retrieval
718
+ 3. **Broadcast** - For events that both external consumers AND other plugins need
718
719
 
719
720
  #### Event Bus
720
721
 
@@ -738,12 +739,23 @@ export class MyPlugin extends BaseGridPlugin<MyConfig> {
738
739
  }
739
740
 
740
741
  private doSomething(): void {
741
- // Emit to other plugins (not DOM events)
742
+ // Emit to other plugins only (not DOM events)
742
743
  this.emitPluginEvent('my-event', { data: 'value' });
744
+
745
+ // Emit to both plugins AND external addEventListener consumers
746
+ this.broadcast('sort-change', { sortModel: [...this.sortModel] });
743
747
  }
744
748
  }
745
749
  ```
746
750
 
751
+ **Choosing the right emission method:**
752
+
753
+ | Method | Audience | Use when |
754
+ | ------------------------------------ | ------------------ | -------------------------------------------------- |
755
+ | `this.emit(type, detail)` | External consumers | Consumer-facing events with no plugin subscribers |
756
+ | `this.emitPluginEvent(type, detail)` | Other plugins only | Plugin-internal notifications |
757
+ | `this.broadcast(type, detail)` | Both | State changes that both plugins and consumers need |
758
+
747
759
  #### Query System
748
760
 
749
761
  Respond to queries from other plugins:
@@ -784,10 +796,15 @@ const responses = grid.queryPlugins<boolean>({
784
796
 
785
797
  **Built-in query types:**
786
798
 
787
- | Query Type | Context | Response | Description |
788
- | ------------------------ | ------------------- | ------------------- | ------------------------------- |
789
- | `CAN_MOVE_COLUMN` | `ColumnConfig` | `boolean` | Can the column be reordered? |
790
- | `GET_CONTEXT_MENU_ITEMS` | `ContextMenuParams` | `ContextMenuItem[]` | Get menu items for context menu |
799
+ | Query Type | Context | Response | Description |
800
+ | --------------------- | ------------------- | ------------------- | ------------------------------- |
801
+ | `sort:get-model` | | `SortModel` | Get current sort model |
802
+ | `sort:set-model` | `SortModel` | | Set sort model programmatically |
803
+ | `canMoveColumn` | `ColumnConfig` | `boolean` | Can the column be reordered? |
804
+ | `canMoveRow` | row object | `boolean` | Can the row be reordered? |
805
+ | `clipboard:copy` | — | — | Trigger copy action |
806
+ | `export:csv` | — | — | Trigger CSV export |
807
+ | `getContextMenuItems` | `ContextMenuParams` | `ContextMenuItem[]` | Get menu items for context menu |
791
808
 
792
809
  Plugins can also define custom query types for their own inter-plugin communication.
793
810