@omnigrid/core 0.1.25 → 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/README.md +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +48 -8
- package/package.json +1 -1
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/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
|
-
*
|
|
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
|
*
|
|
@@ -220,12 +245,23 @@ export interface RowSpanLayout {
|
|
|
220
245
|
* Context passed to every row-level callback (`getRowStyle`, `getRowClass`,
|
|
221
246
|
* `rowClassRules`, `checkboxDisabled`, ...).
|
|
222
247
|
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
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.
|
|
251
|
+
* Group rows do not have raw row data.
|
|
225
252
|
*
|
|
226
253
|
* @api
|
|
227
254
|
*/
|
|
228
|
-
export type RowRenderParams<T> = RowNode<T
|
|
255
|
+
export type RowRenderParams<T> = (RowNode<T> & {
|
|
256
|
+
rowType: "leaf";
|
|
257
|
+
}) | {
|
|
258
|
+
id: RowId;
|
|
259
|
+
index: number;
|
|
260
|
+
rowType: "group";
|
|
261
|
+
data?: never;
|
|
262
|
+
isCollapsedGroup?: false;
|
|
263
|
+
parentGroup?: never;
|
|
264
|
+
};
|
|
229
265
|
export interface RowStyle {
|
|
230
266
|
[property: string]: string | number | undefined;
|
|
231
267
|
}
|
|
@@ -847,6 +883,10 @@ export interface PooledRow<T> {
|
|
|
847
883
|
index: number;
|
|
848
884
|
rowId: RowId;
|
|
849
885
|
data: T;
|
|
886
|
+
/** Row kind; omitted only by legacy custom DOM-pool bindings. */
|
|
887
|
+
type?: "group" | "leaf";
|
|
888
|
+
/** Group metadata for synthetic group rows. */
|
|
889
|
+
group?: GroupRowNode<T>;
|
|
850
890
|
offsetY: number;
|
|
851
891
|
height: number;
|
|
852
892
|
/** Pixel width of the row (sum of all column widths) — used to size the row node. */
|
|
@@ -951,13 +991,13 @@ export interface DomPoolUpdate<T> {
|
|
|
951
991
|
}>;
|
|
952
992
|
recycled: RowHost<T>[];
|
|
953
993
|
}
|
|
954
|
-
export
|
|
994
|
+
export type RowClickEvent<T> = RowRenderParams<T> & {
|
|
955
995
|
ctrlKey: boolean;
|
|
956
996
|
shiftKey: boolean;
|
|
957
|
-
}
|
|
958
|
-
export
|
|
997
|
+
};
|
|
998
|
+
export type RowHoverEvent<T> = RowRenderParams<T> & {
|
|
959
999
|
hovered: boolean;
|
|
960
|
-
}
|
|
1000
|
+
};
|
|
961
1001
|
export interface GridPlugin<T> {
|
|
962
1002
|
name: string;
|
|
963
1003
|
register(api: GridApi<T>): void | (() => void);
|