@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.
- package/README.md +126 -41
- package/all.js +1065 -933
- package/all.js.map +1 -1
- package/index.js +39 -33
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +12 -2
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/types.d.ts +34 -1
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +155 -145
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts +31 -0
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/filter-model.d.ts +30 -3
- package/lib/plugins/filtering/filter-model.d.ts.map +1 -1
- package/lib/plugins/filtering/index.d.ts +1 -0
- package/lib/plugins/filtering/index.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +471 -361
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +32 -0
- package/lib/plugins/filtering/types.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts +4 -0
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +49 -39
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder/index.js +81 -78
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +58 -55
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +5 -2
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +18 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +110 -71
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +29 -29
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +2 -2
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- 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
|
|
172
|
-
|
|
|
173
|
-
| `rows`
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
| `
|
|
215
|
-
| `
|
|
216
|
-
| `mount-external-
|
|
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
|
};
|