@toolbox-web/grid 1.17.0 → 1.19.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.
Files changed (66) hide show
  1. package/README.md +126 -41
  2. package/all.js +1065 -933
  3. package/all.js.map +1 -1
  4. package/index.js +39 -33
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +12 -2
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/header.d.ts.map +1 -1
  9. package/lib/core/internal/keyboard.d.ts.map +1 -1
  10. package/lib/core/types.d.ts +34 -1
  11. package/lib/core/types.d.ts.map +1 -1
  12. package/lib/plugins/clipboard/index.js.map +1 -1
  13. package/lib/plugins/column-virtualization/index.js.map +1 -1
  14. package/lib/plugins/context-menu/index.js.map +1 -1
  15. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  16. package/lib/plugins/editing/index.js +155 -145
  17. package/lib/plugins/editing/index.js.map +1 -1
  18. package/lib/plugins/export/index.js.map +1 -1
  19. package/lib/plugins/filtering/FilteringPlugin.d.ts +31 -0
  20. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  21. package/lib/plugins/filtering/filter-model.d.ts +30 -3
  22. package/lib/plugins/filtering/filter-model.d.ts.map +1 -1
  23. package/lib/plugins/filtering/index.d.ts +1 -0
  24. package/lib/plugins/filtering/index.d.ts.map +1 -1
  25. package/lib/plugins/filtering/index.js +471 -361
  26. package/lib/plugins/filtering/index.js.map +1 -1
  27. package/lib/plugins/filtering/types.d.ts +32 -0
  28. package/lib/plugins/filtering/types.d.ts.map +1 -1
  29. package/lib/plugins/grouping-columns/index.js.map +1 -1
  30. package/lib/plugins/grouping-rows/index.js.map +1 -1
  31. package/lib/plugins/master-detail/index.js.map +1 -1
  32. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +4 -0
  33. package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
  34. package/lib/plugins/multi-sort/index.js +49 -39
  35. package/lib/plugins/multi-sort/index.js.map +1 -1
  36. package/lib/plugins/pinned-columns/index.js.map +1 -1
  37. package/lib/plugins/pinned-rows/index.js.map +1 -1
  38. package/lib/plugins/pivot/index.js.map +1 -1
  39. package/lib/plugins/print/index.js.map +1 -1
  40. package/lib/plugins/reorder/index.js +81 -78
  41. package/lib/plugins/reorder/index.js.map +1 -1
  42. package/lib/plugins/responsive/index.js +58 -55
  43. package/lib/plugins/responsive/index.js.map +1 -1
  44. package/lib/plugins/row-reorder/index.js +5 -2
  45. package/lib/plugins/row-reorder/index.js.map +1 -1
  46. package/lib/plugins/selection/SelectionPlugin.d.ts +18 -0
  47. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  48. package/lib/plugins/selection/index.js +110 -71
  49. package/lib/plugins/selection/index.js.map +1 -1
  50. package/lib/plugins/server-side/index.js.map +1 -1
  51. package/lib/plugins/tree/index.js.map +1 -1
  52. package/lib/plugins/undo-redo/index.js.map +1 -1
  53. package/lib/plugins/visibility/index.js.map +1 -1
  54. package/package.json +1 -1
  55. package/umd/grid.all.umd.js +29 -29
  56. package/umd/grid.all.umd.js.map +1 -1
  57. package/umd/grid.umd.js +2 -2
  58. package/umd/grid.umd.js.map +1 -1
  59. package/umd/plugins/editing.umd.js +1 -1
  60. package/umd/plugins/editing.umd.js.map +1 -1
  61. package/umd/plugins/filtering.umd.js +1 -1
  62. package/umd/plugins/filtering.umd.js.map +1 -1
  63. package/umd/plugins/multi-sort.umd.js +1 -1
  64. package/umd/plugins/multi-sort.umd.js.map +1 -1
  65. package/umd/plugins/selection.umd.js +2 -2
  66. package/umd/plugins/selection.umd.js.map +1 -1
package/README.md CHANGED
@@ -168,52 +168,137 @@ The grid supports configuration via HTML attributes with JSON-serialized values:
168
168
 
169
169
  ### Properties
170
170
 
171
- | Property | Type | Description |
172
- | ------------ | ---------------------- | -------------------------------------------------- |
173
- | `rows` | `T[]` | Data array |
174
- | `sourceRows` | `T[]` (readonly) | Original unfiltered/unprocessed rows |
175
- | `columns` | `ColumnConfig[]` | Column definitions ( `gridConfig.columns`) |
176
- | `gridConfig` | `GridConfig` | Full configuration object (single source of truth) |
177
- | `fitMode` | `'stretch' \| 'fixed'` | Column sizing behavior (→ `gridConfig.fitMode`) |
171
+ | Property | Type | Description |
172
+ | ------------- | ----------------------------------- | -------------------------------------------------- |
173
+ | `rows` | `T[]` | Data array |
174
+ | `columns` | `ColumnConfig[]` | Column definitions (→ `gridConfig.columns`) |
175
+ | `gridConfig` | `GridConfig` | Full configuration object (single source of truth) |
176
+ | `fitMode` | `'stretch' \| 'fixed'` | Column sizing behavior ( `gridConfig.fitMode`) |
177
+ | `loading` | `boolean \| LoadingContext` | Grid-level loading state |
178
+ | `columnState` | `GridColumnState[]` | Get/set column widths, order, visibility, sort |
179
+ | `changedRows` | `T[]` (readonly) | Rows with pending edits (requires EditingPlugin) |
180
+ | `sortState` | `Map<string, SortState>` (readonly) | Current sort state per column |
178
181
 
179
182
  ### Methods
180
183
 
181
- | Method | Returns | Description |
182
- | ---------------------------------- | --------------------- | ------------------------------------------- |
183
- | `ready()` | `Promise<void>` | Resolves when fully initialized |
184
- | `forceLayout()` | `Promise<void>` | Force re-layout |
185
- | `getConfig()` | `Promise<GridConfig>` | Get effective configuration |
186
- | `getRowId(row)` | `string` | Get unique identifier for a row |
187
- | `getRow(id)` | `T \| undefined` | Get row by its ID |
188
- | `updateRow(id, changes, source?)` | `void` | Update a single row by ID |
189
- | `updateRows(updates, source?)` | `void` | Batch update multiple rows |
190
- | `resetChangedRows(silent?)` | `Promise<void>` | Clear change tracking |
191
- | `beginBulkEdit(rowIndex)` | `Promise<void>` | Start row editing |
192
- | `commitActiveRowEdit()` | `Promise<void>` | Commit current edit |
193
- | `setColumnVisible(field, visible)` | `boolean` | Set column visibility |
194
- | `setColumnOrder(order)` | `void` | Reorder columns by field array |
195
- | `getAllColumns()` | `ColumnInfo[]` | Get all columns with visibility status |
196
- | `getPlugin(PluginClass)` | `P \| undefined` | Get plugin instance by class |
197
- | `getPluginByName(name)` | `Plugin \| undefined` | Get plugin instance by name |
198
- | `animateRow(index, type)` | `void` | Animate a single row (change/insert/remove) |
199
- | `animateRows(indices, type)` | `void` | Animate multiple rows at once |
200
- | `animateRowById(id, type)` | `boolean` | Animate row by ID (returns true if found) |
184
+ #### Data Methods
185
+
186
+ | Method | Returns | Description |
187
+ | --------------------------------- | --------------------- | ------------------------------- |
188
+ | `ready()` | `Promise<void>` | Resolves when fully initialized |
189
+ | `forceLayout()` | `Promise<void>` | Force re-layout |
190
+ | `getConfig()` | `Promise<GridConfig>` | Get effective configuration |
191
+ | `getRowId(row)` | `string` | Get unique identifier for a row |
192
+ | `getRow(id)` | `T \| undefined` | Get row by its ID |
193
+ | `updateRow(id, changes, source?)` | `void` | Update a single row by ID |
194
+ | `updateRows(updates, source?)` | `void` | Batch update multiple rows |
195
+
196
+ #### Editing Methods (require EditingPlugin)
197
+
198
+ | Method | Returns | Description |
199
+ | --------------------------- | ------- | ----------------------- |
200
+ | `beginBulkEdit(rowIndex)` | `void` | Start row editing |
201
+ | `commitActiveRowEdit()` | `void` | Commit current row edit |
202
+ | `cancelActiveRowEdit()` | `void` | Cancel current row edit |
203
+ | `resetChangedRows(silent?)` | `void` | Clear change tracking |
204
+
205
+ #### Column Methods
206
+
207
+ | Method | Returns | Description |
208
+ | ---------------------------------- | ------------------- | -------------------------------------- |
209
+ | `setColumnVisible(field, visible)` | `boolean` | Set column visibility |
210
+ | `toggleColumnVisibility(field)` | `void` | Toggle column visible/hidden |
211
+ | `isColumnVisible(field)` | `boolean` | Check if column is visible |
212
+ | `showAllColumns()` | `void` | Show all hidden columns |
213
+ | `setColumnOrder(order)` | `void` | Reorder columns by field array |
214
+ | `getColumnOrder()` | `string[]` | Get current column order |
215
+ | `getAllColumns()` | `ColumnInfo[]` | Get all columns with visibility status |
216
+ | `getColumnState()` | `GridColumnState[]` | Get column state (for persistence) |
217
+ | `resetColumnState()` | `void` | Reset to initial column configuration |
218
+
219
+ #### Shell Methods
220
+
221
+ | Method | Returns | Description |
222
+ | ------------------------------------- | ----------------------- | ------------------------------------- |
223
+ | `openToolPanel()` | `void` | Open the tool panel sidebar |
224
+ | `closeToolPanel()` | `void` | Close the tool panel sidebar |
225
+ | `toggleToolPanel()` | `void` | Toggle tool panel open/closed |
226
+ | `toggleToolPanelSection(sectionId)` | `void` | Toggle a tool panel accordion section |
227
+ | `isToolPanelOpen` | `boolean` (getter) | Whether tool panel is open |
228
+ | `expandedToolPanelSections` | `string[]` (getter) | IDs of expanded accordion sections |
229
+ | `getToolPanels()` | `ToolPanelDefinition[]` | Get registered tool panels |
230
+ | `registerToolPanel(panel)` | `void` | Register a custom tool panel |
231
+ | `unregisterToolPanel(panelId)` | `void` | Remove a registered tool panel |
232
+ | `registerHeaderContent(content)` | `void` | Add custom header content |
233
+ | `unregisterHeaderContent(contentId)` | `void` | Remove custom header content |
234
+ | `registerToolbarContent(content)` | `void` | Add custom toolbar button |
235
+ | `unregisterToolbarContent(contentId)` | `void` | Remove custom toolbar button |
236
+
237
+ #### Style Methods
238
+
239
+ | Method | Returns | Description |
240
+ | ------------------------- | ---------------------------- | ---------------------------------------- |
241
+ | `registerStyles(id, css)` | `void` | Register custom CSS (adoptedStyleSheets) |
242
+ | `unregisterStyles(id)` | `void` | Remove custom CSS by ID |
243
+ | `getRegisteredStyles()` | `Map<string, CSSStyleSheet>` | Get all registered styles |
244
+
245
+ #### Loading Methods
246
+
247
+ | Method | Returns | Description |
248
+ | --------------------------------------- | --------- | -------------------------------- |
249
+ | `setRowLoading(rowId, loading)` | `void` | Show/hide row loading indicator |
250
+ | `setCellLoading(rowId, field, loading)` | `void` | Show/hide cell loading indicator |
251
+ | `isRowLoading(rowId)` | `boolean` | Check if row is loading |
252
+ | `isCellLoading(rowId, field)` | `boolean` | Check if cell is loading |
253
+ | `clearAllLoading()` | `void` | Clear all loading states |
254
+
255
+ #### Animation Methods
256
+
257
+ | Method | Returns | Description |
258
+ | ---------------------------- | --------- | ------------------------------------------- |
259
+ | `animateRow(index, type)` | `void` | Animate a single row (change/insert/remove) |
260
+ | `animateRows(indices, type)` | `void` | Animate multiple rows at once |
261
+ | `animateRowById(id, type)` | `boolean` | Animate row by ID (returns true if found) |
262
+
263
+ #### Plugin Methods
264
+
265
+ | Method | Returns | Description |
266
+ | ------------------------ | --------------------- | ---------------------------- |
267
+ | `getPlugin(PluginClass)` | `P \| undefined` | Get plugin instance by class |
268
+ | `getPluginByName(name)` | `Plugin \| undefined` | Get plugin instance by name |
201
269
 
202
270
  ### Events
203
271
 
204
- | Event | Detail | Description |
205
- | ----------------------- | --------------------------- | ---------------------------------- |
206
- | `cell-commit` | `CellCommitDetail` | Cell value committed (inline edit) |
207
- | `cell-change` | `CellChangeDetail` | Row updated via Row Update API |
208
- | `row-commit` | `RowCommitDetail` | Row edit committed |
209
- | `changed-rows-reset` | `ChangedRowsResetDetail` | Change tracking cleared |
210
- | `sort-change` | `SortChangeDetail` | Sort state changed |
211
- | `column-resize` | `ColumnResizeDetail` | Column resized |
212
- | `column-state-change` | `ColumnState` | Column state changed |
213
- | `activate-cell` | `ActivateCellDetail` | Cell activated |
214
- | `group-toggle` | `GroupToggleDetail` | Row group expanded/collapsed |
215
- | `mount-external-view` | `ExternalMountViewDetail` | External view mount request |
216
- | `mount-external-editor` | `ExternalMountEditorDetail` | External editor mount request |
272
+ #### Core Events
273
+
274
+ | Event | Detail | Description |
275
+ | ----------------------- | --------------------------- | ------------------------------------------------- |
276
+ | `cell-click` | `CellClickDetail` | Cell clicked |
277
+ | `row-click` | `RowClickDetail` | Row clicked |
278
+ | `cell-activate` | `CellActivateDetail` | Cell activated via keyboard or click (cancelable) |
279
+ | `cell-change` | `CellChangeDetail` | Row updated via Row Update API |
280
+ | `sort-change` | `SortChangeDetail` | Sort state changed |
281
+ | `column-resize` | `ColumnResizeDetail` | Column resized |
282
+ | `column-state-change` | `GridColumnState` | Column state changed |
283
+ | `group-toggle` | `GroupToggleDetail` | Row group expanded/collapsed |
284
+ | `mount-external-view` | `ExternalMountViewDetail` | External view mount request |
285
+ | `mount-external-editor` | `ExternalMountEditorDetail` | External editor mount request |
286
+
287
+ #### Editing Events (require EditingPlugin)
288
+
289
+ | Event | Detail | Description |
290
+ | -------------------- | ------------------------ | --------------------------------- |
291
+ | `cell-commit` | `CellCommitDetail` | Cell value committed (cancelable) |
292
+ | `row-commit` | `RowCommitDetail` | Row edit committed (cancelable) |
293
+ | `edit-open` | `EditOpenDetail` | Row entered edit mode |
294
+ | `edit-close` | `EditCloseDetail` | Row left edit mode |
295
+ | `changed-rows-reset` | `ChangedRowsResetDetail` | Change tracking cleared |
296
+
297
+ #### Deprecated Events
298
+
299
+ | Event | Detail | Description |
300
+ | --------------- | -------------------- | ------------------------------------------ |
301
+ | `activate-cell` | `ActivateCellDetail` | ⚠️ Deprecated. Use `cell-activate` instead |
217
302
 
218
303
  Import event names from the `DGEvents` constant:
219
304
 
@@ -250,7 +335,7 @@ Configure animation behavior globally:
250
335
  grid.gridConfig = {
251
336
  animation: {
252
337
  mode: 'on', // 'on' | 'off' | 'reduced-motion'
253
- style: 'smooth', // Animation easing
338
+ style: 'smooth', // Animation easing (alias for `easing`)
254
339
  duration: 200, // Default duration in ms
255
340
  },
256
341
  };