@omnigrid/core 0.1.26 → 0.1.27

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/dist/index.d.ts CHANGED
@@ -14,6 +14,6 @@ export { applyFilterModel, applyQuickFilter, isActiveCondition, isFilterModelAct
14
14
  export type { ColumnFilterModel, FilterCondition, FilterModel, FilterOperator } from "./filtering";
15
15
  export type { UIButtonControl, UICheckboxDescriptor, UIControlBase, UIControlDescriptor, UIGroupControl, UIInputControl, UIPopupAnchor, UIPopupDescriptor, UISelectControl, UISelectOption, UITextBlockControl, UIMultiSelectControl, UIMultiSelectOption, } from "./ui";
16
16
  export type { OverlayOptions, OverlayScope, OverlayState, OverlayType } from "./overlays";
17
- export type { BlockConfig, CellAlign, AggregationFunc, CellRenderParams, CellClassRules, CellSpan, CellSpanningParams, CheckboxControl, CheckboxRenderParams, ColSpanDef, ColumnClassRules, ColumnDataType, ColumnFilterType, ColumnDef, ColumnGroupDef, ColumnGroupViewport, ColumnLeafDef, ColumnStyle, ColumnStyleParams, DataProcessor, DataRowNode, DomPoolBindings, DomPoolUpdate, DomPoolUpdateOptions, GroupRowNode, GroupRowRenderParams, GroupRowRenderer, CoreGridApi, CoreGridState, GridApi, GridEvents, GridOptions, GridPlugin, GridState, PluginApiExtensions, PluginStateExtensions, HeaderClassRules, HeaderGroupClassRules, HeaderGroupRenderParams, HeaderRenderParams, HeaderStyle, OverlayComponent, OverlayComponentProps, PooledRow, Range, RowClassRules, RowClickEvent, RowHeightUpdateOptions, RowHost, RowHoverEvent, RowId, RowHierarchy, RowHierarchyScope, RowNode, RowRenderParams, RowSpanLayout, RowStyle, RowTransaction, ScrollPosition, SlotComponentContent, SlotContent, SlotHtmlContent, SlotMount, SlotMountOptions, SlotName, SlotNodeContent, SlotNodeEvent, SlotNodeEventName, SlotPosition, SlotProvider, SlotRenderContext, SortDirection, TransactionResult, TreeRowNode, ViewportData, ViewportState, VirtualItem, } from "./types";
17
+ export type { BlockConfig, CellAlign, AggregationFunc, CellRenderParams, CellClassRules, CellSpan, CellSpanningParams, CheckboxControl, CheckboxRenderParams, ColSpanDef, ColumnClassRules, ColumnDataType, ColumnFilterType, ColumnDef, ColumnGroupDef, ColumnGroupViewport, ColumnLeafDef, ColumnStyle, ColumnStyleParams, DataProcessor, DataRowNode, DomPoolBindings, DomPoolUpdate, DomPoolUpdateOptions, GroupRowNode, GroupRowRenderParams, GroupRowRenderer, CoreGridApi, CoreGridState, GridApi, GridEvents, GridOptions, GridPlugin, GridState, PluginApiExtensions, PluginStateExtensions, HeaderClassRules, HeaderGroupClassRules, HeaderGroupRenderParams, HeaderRenderParams, HeaderStyle, OverlayComponent, OverlayComponentProps, PooledRow, Range, RowClassRules, RowClickEvent, RowHeightUpdateOptions, RowHost, RowHoverEvent, RowId, RowHierarchy, RowHierarchyScope, RowGroupContext, RowGroupContextChild, RowNode, RowRenderParams, RowSpanLayout, RowStyle, RowTransaction, ScrollPosition, SlotComponentContent, SlotContent, SlotHtmlContent, SlotMount, SlotMountOptions, SlotName, SlotNodeContent, SlotNodeEvent, SlotNodeEventName, SlotPosition, SlotProvider, SlotRenderContext, SortDirection, TransactionResult, TreeRowNode, ViewportData, ViewportState, VirtualItem, } from "./types";
18
18
  export { getColumnGroups, flattenColumns, isColumnGroup, isColumnLeaf, getCellValue, getCellSpanningParams, resolveColSpan, getRowSpans } from "./columns";
19
19
  export { Virtualizer, RowHeightRegistry } from "./virtualizer";
package/dist/types.d.ts CHANGED
@@ -54,7 +54,7 @@ export type ColumnFilterType = "text" | "number" | "date" | "boolean" | "set" |
54
54
  *
55
55
  * `RowNode` is a lightweight view over a single processed row: the stable
56
56
  * `id` (from `getRowId`), the zero-based `index` in the processed dataset,
57
- * and the raw `data` object itself.
57
+ * the raw `data` object, and optional grouping context.
58
58
  *
59
59
  * @api
60
60
  */
@@ -65,6 +65,10 @@ export interface RowNode<T> {
65
65
  index: number;
66
66
  /** Raw row data object. */
67
67
  data: T;
68
+ /** Whether this row represents a collapsed single-child group. */
69
+ isCollapsedGroup?: boolean;
70
+ /** Immediate parent group and its acyclic child context, when grouped. */
71
+ parentGroup?: RowGroupContext<T>;
68
72
  }
69
73
  /** Aggregation function applied to column values within a group. */
70
74
  export type AggregationFunc<T = unknown> = (values: unknown[]) => unknown;
@@ -142,6 +146,8 @@ export interface DataRowNode<T> {
142
146
  level: number;
143
147
  /** The group this row belongs to. */
144
148
  parent: GroupRowNode<T>;
149
+ /** A cycle-free snapshot of the immediate parent group and its children. */
150
+ parentGroup?: RowGroupContext<T>;
145
151
  /**
146
152
  * Set when this leaf row is displayed as a collapsed single-child group
147
153
  * (`collapseSingleChildGroups: true`). Contains the grouping field, value,
@@ -155,6 +161,25 @@ export interface DataRowNode<T> {
155
161
  }
156
162
  /** A row in the flattened grouped output — either a group or a data row. */
157
163
  export type TreeRowNode<T> = GroupRowNode<T> | DataRowNode<T>;
164
+ /**
165
+ * A direct child in a cycle-free row group context.
166
+ *
167
+ * Leaf snapshots omit their parent references; nested groups retain their
168
+ * own child contexts.
169
+ *
170
+ * @api
171
+ */
172
+ export type RowGroupContextChild<T> = RowGroupContext<T> | Omit<DataRowNode<T>, "parent" | "parentGroup">;
173
+ /**
174
+ * A snapshot of a group and its immediate children, including nested groups
175
+ * and leaf snapshots without parent back-references.
176
+ *
177
+ * @api
178
+ */
179
+ export type RowGroupContext<T> = Omit<GroupRowNode<T>, "children"> & {
180
+ /** Immediate subgroup contexts and parent-free leaf snapshots. */
181
+ children: RowGroupContextChild<T>[];
182
+ };
158
183
  /**
159
184
  * Context passed to the `colSpan` resolver of a column.
160
185
  *
@@ -221,6 +246,8 @@ export interface RowSpanLayout {
221
246
  * `rowClassRules`, `checkboxDisabled`, ...).
222
247
  *
223
248
  * `rowType` distinguishes ordinary data rows from synthetic group rows.
249
+ * Leaf rows also report whether they represent a collapsed single-child group
250
+ * and include their immediate parent group context when grouping is active.
224
251
  * Group rows do not have raw row data.
225
252
  *
226
253
  * @api
@@ -232,6 +259,8 @@ export type RowRenderParams<T> = (RowNode<T> & {
232
259
  index: number;
233
260
  rowType: "group";
234
261
  data?: never;
262
+ isCollapsedGroup?: false;
263
+ parentGroup?: never;
235
264
  };
236
265
  export interface RowStyle {
237
266
  [property: string]: string | number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/core",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Framework-agnostic core engine for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",