@toolbox-web/grid 2.5.0 → 2.6.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 (51) hide show
  1. package/README.md +15 -3
  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/types.d.ts +47 -31
  7. package/lib/plugins/clipboard/index.js.map +1 -1
  8. package/lib/plugins/column-virtualization/index.js.map +1 -1
  9. package/lib/plugins/context-menu/index.js.map +1 -1
  10. package/lib/plugins/editing/index.js.map +1 -1
  11. package/lib/plugins/export/index.js.map +1 -1
  12. package/lib/plugins/filtering/index.js.map +1 -1
  13. package/lib/plugins/grouping-columns/index.js.map +1 -1
  14. package/lib/plugins/grouping-rows/index.js.map +1 -1
  15. package/lib/plugins/master-detail/index.js.map +1 -1
  16. package/lib/plugins/multi-sort/index.js.map +1 -1
  17. package/lib/plugins/pinned-columns/index.js.map +1 -1
  18. package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts +28 -4
  19. package/lib/plugins/pinned-rows/index.d.ts +3 -2
  20. package/lib/plugins/pinned-rows/index.js +1 -1
  21. package/lib/plugins/pinned-rows/index.js.map +1 -1
  22. package/lib/plugins/pinned-rows/pinned-rows.d.ts +29 -1
  23. package/lib/plugins/pinned-rows/types.d.ts +96 -9
  24. package/lib/plugins/pivot/index.js.map +1 -1
  25. package/lib/plugins/print/index.js.map +1 -1
  26. package/lib/plugins/reorder-columns/index.js.map +1 -1
  27. package/lib/plugins/reorder-rows/index.js.map +1 -1
  28. package/lib/plugins/responsive/index.js +1 -1
  29. package/lib/plugins/responsive/index.js.map +1 -1
  30. package/lib/plugins/row-drag-drop/index.js.map +1 -1
  31. package/lib/plugins/row-drag-drop/types.d.ts +7 -0
  32. package/lib/plugins/selection/index.js.map +1 -1
  33. package/lib/plugins/server-side/index.js.map +1 -1
  34. package/lib/plugins/tooltip/index.js.map +1 -1
  35. package/lib/plugins/tree/index.js.map +1 -1
  36. package/lib/plugins/undo-redo/index.js.map +1 -1
  37. package/lib/plugins/visibility/VisibilityPlugin.d.ts +0 -11
  38. package/lib/plugins/visibility/index.d.ts +1 -2
  39. package/lib/plugins/visibility/index.js.map +1 -1
  40. package/lib/plugins/visibility/types.d.ts +32 -0
  41. package/package.json +1 -1
  42. package/public.d.ts +28 -67
  43. package/umd/grid.all.umd.js +1 -1
  44. package/umd/grid.all.umd.js.map +1 -1
  45. package/umd/grid.umd.js +1 -1
  46. package/umd/grid.umd.js.map +1 -1
  47. package/umd/plugins/pinned-rows.umd.js +1 -1
  48. package/umd/plugins/pinned-rows.umd.js.map +1 -1
  49. package/umd/plugins/responsive.umd.js +1 -1
  50. package/umd/plugins/responsive.umd.js.map +1 -1
  51. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -12,34 +12,6 @@ import { AfterCellRenderContext, AfterRowRenderContext, CellMouseEvent } from '.
12
12
  * @category Plugin Development
13
13
  */
14
14
  export type RowPositionEntry = RowPosition;
15
- /**
16
- * The compiled web component interface for DataGrid.
17
- *
18
- * This interface represents the `<tbw-grid>` custom element, combining
19
- * the public grid API with standard HTMLElement functionality.
20
- *
21
- * @example
22
- * ```typescript
23
- * // Query existing grid with type safety
24
- * import { queryGrid } from '@toolbox-web/grid';
25
- * const grid = queryGrid<Employee>('tbw-grid');
26
- * grid.rows = employees;
27
- * grid.on('cell-click', (detail) => console.log(detail));
28
- *
29
- * // Create grid programmatically
30
- * import { createGrid } from '@toolbox-web/grid';
31
- * const grid = createGrid<Employee>({
32
- * columns: [{ field: 'name' }, { field: 'email' }],
33
- * });
34
- * document.body.appendChild(grid);
35
- * ```
36
- *
37
- * @see {@link PublicGrid} for the public API methods and properties
38
- * @see {@link createGrid} for typed grid creation
39
- * @see {@link queryGrid} for typed grid querying
40
- */
41
- export interface DataGridElement extends PublicGrid, HTMLElement {
42
- }
43
15
  /**
44
16
  * Options for the {@link PublicGrid.scrollToRow} method.
45
17
  *
@@ -1287,7 +1259,7 @@ export interface ColumnEditorContext<TRow = any, TValue = any> {
1287
1259
  *
1288
1260
  * @see {@link CellRenderContext.grid}
1289
1261
  */
1290
- grid?: DataGridElement;
1262
+ grid?: PublicGrid<TRow> & HTMLElement;
1291
1263
  }
1292
1264
  /**
1293
1265
  * Context passed to custom view renderers (pure display – no commit helpers).
@@ -1343,7 +1315,7 @@ export interface CellRenderContext<TRow = any, TValue = any> {
1343
1315
  * };
1344
1316
  * ```
1345
1317
  */
1346
- grid?: DataGridElement;
1318
+ grid?: PublicGrid<TRow> & HTMLElement;
1347
1319
  /**
1348
1320
  * The cell DOM element being rendered into.
1349
1321
  * Framework adapters can use this to cache per-cell state (e.g., React roots).
@@ -3576,6 +3548,34 @@ export interface ColumnResizeDetail {
3576
3548
  /** New width in pixels. */
3577
3549
  width: number;
3578
3550
  }
3551
+ /**
3552
+ * Column resize-reset event detail.
3553
+ *
3554
+ * Fired when a user-resized column is restored to its original configured width
3555
+ * (e.g., via the column header context menu "Reset width" action). The `width`
3556
+ * field reflects the column's `__originalWidth` and may be `undefined` if the
3557
+ * column was originally auto-sized.
3558
+ *
3559
+ * @example
3560
+ * ```typescript
3561
+ * grid.on('column-resize-reset', ({ field, width }) => {
3562
+ * if (width === undefined) {
3563
+ * console.log(`Column ${field} restored to auto-size`);
3564
+ * } else {
3565
+ * console.log(`Column ${field} restored to ${width}px`);
3566
+ * }
3567
+ * });
3568
+ * ```
3569
+ *
3570
+ * @see {@link ColumnResizeDetail} for the resize-in-progress event
3571
+ * @category Events
3572
+ */
3573
+ export interface ColumnResizeResetDetail {
3574
+ /** Reset column field key. */
3575
+ field: string;
3576
+ /** Original configured width in pixels, or `undefined` if auto-sized. */
3577
+ width: number | undefined;
3578
+ }
3579
3579
  /**
3580
3580
  * Trigger type for cell activation.
3581
3581
  * - `'keyboard'`: Enter key pressed on focused cell
@@ -3714,7 +3714,6 @@ export interface ExternalMountEditorDetail<TRow = unknown> {
3714
3714
  *
3715
3715
  * @see {@link DataGridElement.on} for the recommended subscription API
3716
3716
  * @see {@link DataGridCustomEvent} for typed CustomEvent wrapper
3717
- * @see {@link DGEvents} for event name constants
3718
3717
  * @category Events
3719
3718
  */
3720
3719
  export interface DataGridEventMap<TRow = unknown> {
@@ -3931,6 +3930,23 @@ export interface DataGridEventMap<TRow = unknown> {
3931
3930
  * @group Core Events
3932
3931
  */
3933
3932
  'column-resize': ColumnResizeDetail;
3933
+ /**
3934
+ * Fired when a user-resized column is reset to its original configured width.
3935
+ * Triggered by the column header context menu "Reset width" action.
3936
+ *
3937
+ * @example
3938
+ * ```typescript
3939
+ * grid.on('column-resize-reset', ({ field, width }) => {
3940
+ * const widths = JSON.parse(localStorage.getItem('col-widths') ?? '{}');
3941
+ * delete widths[field];
3942
+ * localStorage.setItem('col-widths', JSON.stringify(widths));
3943
+ * });
3944
+ * ```
3945
+ *
3946
+ * @see {@link ColumnResizeResetDetail}
3947
+ * @group Core Events
3948
+ */
3949
+ 'column-resize-reset': ColumnResizeResetDetail;
3934
3950
  /**
3935
3951
  * Fired when column state changes — reordering, resizing, visibility toggle,
3936
3952
  * or sort changes. Use with `getColumnState()` / `columnState` setter for