@omnigrid/core 0.1.25 → 0.1.26

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 CHANGED
@@ -45,6 +45,8 @@ interface GridOptions<T> {
45
45
  }
46
46
  ```
47
47
 
48
+ Row callbacks receive `params.rowType` (`"leaf"` or `"group"`). Group rows are synthetic and have no `data`; checking `rowType` narrows the callback parameters.
49
+
48
50
  ### `ColumnDef<T>`
49
51
 
50
52
  `ColumnDef<T> = ColumnLeafDef<T> | ColumnGroupDef<T>`. Groups nest via `children`; width/visibility/pinning can be combined freely.
package/dist/types.d.ts CHANGED
@@ -220,12 +220,19 @@ export interface RowSpanLayout {
220
220
  * Context passed to every row-level callback (`getRowStyle`, `getRowClass`,
221
221
  * `rowClassRules`, `checkboxDisabled`, ...).
222
222
  *
223
- * Alias of `RowNode`: the stable row id, the zero-based index in the
224
- * processed dataset, and the raw row data object.
223
+ * `rowType` distinguishes ordinary data rows from synthetic group rows.
224
+ * Group rows do not have raw row data.
225
225
  *
226
226
  * @api
227
227
  */
228
- export type RowRenderParams<T> = RowNode<T>;
228
+ export type RowRenderParams<T> = (RowNode<T> & {
229
+ rowType: "leaf";
230
+ }) | {
231
+ id: RowId;
232
+ index: number;
233
+ rowType: "group";
234
+ data?: never;
235
+ };
229
236
  export interface RowStyle {
230
237
  [property: string]: string | number | undefined;
231
238
  }
@@ -847,6 +854,10 @@ export interface PooledRow<T> {
847
854
  index: number;
848
855
  rowId: RowId;
849
856
  data: T;
857
+ /** Row kind; omitted only by legacy custom DOM-pool bindings. */
858
+ type?: "group" | "leaf";
859
+ /** Group metadata for synthetic group rows. */
860
+ group?: GroupRowNode<T>;
850
861
  offsetY: number;
851
862
  height: number;
852
863
  /** Pixel width of the row (sum of all column widths) — used to size the row node. */
@@ -951,13 +962,13 @@ export interface DomPoolUpdate<T> {
951
962
  }>;
952
963
  recycled: RowHost<T>[];
953
964
  }
954
- export interface RowClickEvent<T> extends RowRenderParams<T> {
965
+ export type RowClickEvent<T> = RowRenderParams<T> & {
955
966
  ctrlKey: boolean;
956
967
  shiftKey: boolean;
957
- }
958
- export interface RowHoverEvent<T> extends RowRenderParams<T> {
968
+ };
969
+ export type RowHoverEvent<T> = RowRenderParams<T> & {
959
970
  hovered: boolean;
960
- }
971
+ };
961
972
  export interface GridPlugin<T> {
962
973
  name: string;
963
974
  register(api: GridApi<T>): void | (() => void);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/core",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Framework-agnostic core engine for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",