@dataverse-kit/grid-kit 0.1.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/dist/adapters/CalloutCell.d.ts +24 -0
- package/dist/adapters/CalloutCell.d.ts.map +1 -0
- package/dist/adapters/EditCellWrapper.d.ts +13 -0
- package/dist/adapters/EditCellWrapper.d.ts.map +1 -0
- package/dist/adapters/context.d.ts +45 -0
- package/dist/adapters/context.d.ts.map +1 -0
- package/dist/adapters/fromGridCustomizerDefinition.d.ts +43 -0
- package/dist/adapters/fromGridCustomizerDefinition.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +10 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/resolveGridFromDefinition.d.ts +92 -0
- package/dist/adapters/resolveGridFromDefinition.d.ts.map +1 -0
- package/dist/adapters/toDetailsListColumns.d.ts +5 -0
- package/dist/adapters/toDetailsListColumns.d.ts.map +1 -0
- package/dist/adapters/toGridCustomizerOverrides.d.ts +46 -0
- package/dist/adapters/toGridCustomizerOverrides.d.ts.map +1 -0
- package/dist/core/aggregate.d.ts +35 -0
- package/dist/core/aggregate.d.ts.map +1 -0
- package/dist/core/coercion.d.ts +9 -0
- package/dist/core/coercion.d.ts.map +1 -0
- package/dist/core/colorResolver.d.ts +15 -0
- package/dist/core/colorResolver.d.ts.map +1 -0
- package/dist/core/filter.d.ts +40 -0
- package/dist/core/filter.d.ts.map +1 -0
- package/dist/core/formatters.d.ts +9 -0
- package/dist/core/formatters.d.ts.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/thresholds.d.ts +15 -0
- package/dist/core/thresholds.d.ts.map +1 -0
- package/dist/dnd/DroppableCell.d.ts +16 -0
- package/dist/dnd/DroppableCell.d.ts.map +1 -0
- package/dist/dnd/FileDropCell.d.ts +25 -0
- package/dist/dnd/FileDropCell.d.ts.map +1 -0
- package/dist/dnd/index.d.ts +7 -0
- package/dist/dnd/index.d.ts.map +1 -0
- package/dist/dnd/useFileDrop.d.ts +36 -0
- package/dist/dnd/useFileDrop.d.ts.map +1 -0
- package/dist/export/GridExportDialog.d.ts +29 -0
- package/dist/export/GridExportDialog.d.ts.map +1 -0
- package/dist/export/exportGrid.d.ts +17 -0
- package/dist/export/exportGrid.d.ts.map +1 -0
- package/dist/export/index.d.ts +4 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/hosts/CardGrid.d.ts +12 -0
- package/dist/hosts/CardGrid.d.ts.map +1 -0
- package/dist/hosts/DataGrid.d.ts +10 -0
- package/dist/hosts/DataGrid.d.ts.map +1 -0
- package/dist/hosts/DetailsGrid.d.ts +3 -0
- package/dist/hosts/DetailsGrid.d.ts.map +1 -0
- package/dist/hosts/FocusedViewGrid.d.ts +10 -0
- package/dist/hosts/FocusedViewGrid.d.ts.map +1 -0
- package/dist/hosts/GridAggregateFooter.d.ts +36 -0
- package/dist/hosts/GridAggregateFooter.d.ts.map +1 -0
- package/dist/hosts/GridColumnChooser.d.ts +27 -0
- package/dist/hosts/GridColumnChooser.d.ts.map +1 -0
- package/dist/hosts/GridFilterBuilder.d.ts +32 -0
- package/dist/hosts/GridFilterBuilder.d.ts.map +1 -0
- package/dist/hosts/GridPaginationFooter.d.ts +11 -0
- package/dist/hosts/GridPaginationFooter.d.ts.map +1 -0
- package/dist/hosts/GroupedGrid.d.ts +9 -0
- package/dist/hosts/GroupedGrid.d.ts.map +1 -0
- package/dist/hosts/ReadOnlyGrid.d.ts +9 -0
- package/dist/hosts/ReadOnlyGrid.d.ts.map +1 -0
- package/dist/hosts/buildGroups.d.ts +14 -0
- package/dist/hosts/buildGroups.d.ts.map +1 -0
- package/dist/hosts/cardLayout.d.ts +22 -0
- package/dist/hosts/cardLayout.d.ts.map +1 -0
- package/dist/hosts/fill.d.ts +10 -0
- package/dist/hosts/fill.d.ts.map +1 -0
- package/dist/hosts/index.d.ts +19 -0
- package/dist/hosts/index.d.ts.map +1 -0
- package/dist/hosts/nested/NestedCardParent.d.ts +23 -0
- package/dist/hosts/nested/NestedCardParent.d.ts.map +1 -0
- package/dist/hosts/nested/NestedGrid.d.ts +17 -0
- package/dist/hosts/nested/NestedGrid.d.ts.map +1 -0
- package/dist/hosts/nested/NestedInline.d.ts +18 -0
- package/dist/hosts/nested/NestedInline.d.ts.map +1 -0
- package/dist/hosts/nested/NestedTriggerCell.d.ts +12 -0
- package/dist/hosts/nested/NestedTriggerCell.d.ts.map +1 -0
- package/dist/hosts/nested/labels.d.ts +10 -0
- package/dist/hosts/nested/labels.d.ts.map +1 -0
- package/dist/hosts/nested/useChildren.d.ts +15 -0
- package/dist/hosts/nested/useChildren.d.ts.map +1 -0
- package/dist/hosts/rowContextMenu.d.ts +11 -0
- package/dist/hosts/rowContextMenu.d.ts.map +1 -0
- package/dist/hosts/toolbar/GridToolbar.d.ts +9 -0
- package/dist/hosts/toolbar/GridToolbar.d.ts.map +1 -0
- package/dist/hosts/useEditState.d.ts +25 -0
- package/dist/hosts/useEditState.d.ts.map +1 -0
- package/dist/hosts/useGridContext.d.ts +15 -0
- package/dist/hosts/useGridContext.d.ts.map +1 -0
- package/dist/hosts/useRowContextMenu.d.ts +18 -0
- package/dist/hosts/useRowContextMenu.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +2783 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2847 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/navigateTo.d.ts +71 -0
- package/dist/navigation/navigateTo.d.ts.map +1 -0
- package/dist/registry/columnMapping.d.ts +15 -0
- package/dist/registry/columnMapping.d.ts.map +1 -0
- package/dist/registry/createCellRegistry.d.ts +8 -0
- package/dist/registry/createCellRegistry.d.ts.map +1 -0
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/renderers.d.ts +15 -0
- package/dist/registry/renderers.d.ts.map +1 -0
- package/dist/types/index.d.ts +488 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { IContextualMenuProps } from '@fluentui/react';
|
|
3
|
+
import type { NavTarget } from '../navigation/navigateTo';
|
|
4
|
+
import type { GridFilterModel } from '../core/filter';
|
|
5
|
+
/**
|
|
6
|
+
* grid-kit canonical contract.
|
|
7
|
+
*
|
|
8
|
+
* grid-kit OWNS this vocabulary (it does not import form-runtime, which is a
|
|
9
|
+
* sibling, zero-React, typecheck-standalone package). The literals are aligned
|
|
10
|
+
* with both `@khester/dynamics-cell-renderers`' `ListFieldType` and
|
|
11
|
+
* form-runtime's `CellRendererType` so a grid-customizer definition maps onto
|
|
12
|
+
* these via `fromGridCustomizerDefinition()` without a runtime dependency.
|
|
13
|
+
*/
|
|
14
|
+
/** Cell renderer types. Superset of the canonical library + form-runtime. */
|
|
15
|
+
export type CellRendererType = 'text' | 'link' | 'lookup' | 'optionset' | 'currency' | 'number' | 'date' | 'datetime' | 'boolean' | 'toggle' | 'icon' | 'progress' | 'coloredCell' | 'rating' | 'composite' | 'fileDrop';
|
|
16
|
+
/** Inline editor types for editable grids. `'none'` (or undefined) = read-only. */
|
|
17
|
+
export type CellEditorType = 'text' | 'number' | 'date' | 'dropdown' | 'toggle' | 'lookup' | 'none';
|
|
18
|
+
export type GridSelectionMode = 'none' | 'single' | 'multiple';
|
|
19
|
+
/**
|
|
20
|
+
* grid-kit's renderer-agnostic column. The host adapters convert this into the
|
|
21
|
+
* shape each grid host needs (Fluent `IColumn.onRender` or a GridCustomizer FC).
|
|
22
|
+
*/
|
|
23
|
+
export interface ColumnDef<T = Record<string, unknown>> {
|
|
24
|
+
/** Stable column key. */
|
|
25
|
+
key: string;
|
|
26
|
+
/** Logical attribute / row field this column reads. */
|
|
27
|
+
fieldName: string;
|
|
28
|
+
/** Header text. */
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Which renderer to use. A built-in `CellRendererType`, or any custom string
|
|
32
|
+
* registered via `registry.register(type, …)`. The `(string & {})` keeps
|
|
33
|
+
* autocomplete for the built-ins while allowing custom types without a cast.
|
|
34
|
+
*/
|
|
35
|
+
rendererType: CellRendererType | (string & {});
|
|
36
|
+
/**
|
|
37
|
+
* Type-specific renderer config. Shape depends on `rendererType` — e.g.
|
|
38
|
+
* progress → { max, color, showLabel }
|
|
39
|
+
* currency → { currencyCode, locale, decimals }
|
|
40
|
+
* coloredCell → { colorMap, getBackgroundColor }
|
|
41
|
+
* optionset → { options: [{ value, label, color }] }
|
|
42
|
+
* rating → { max, color, allowHalf }
|
|
43
|
+
* composite → CompositeRendererConfig (layout/gap/slots)
|
|
44
|
+
* lookup → { entitySetName, searchField, targetEntity, … }
|
|
45
|
+
*/
|
|
46
|
+
rendererConfig?: Record<string, unknown>;
|
|
47
|
+
/** Inline editor type (editable grids). Undefined/`'none'` ⇒ read-only. */
|
|
48
|
+
editorType?: CellEditorType;
|
|
49
|
+
/** Locked even when the grid is editable (computed/permission-gated fields). */
|
|
50
|
+
isLocked?: boolean;
|
|
51
|
+
width?: number;
|
|
52
|
+
minWidth?: number;
|
|
53
|
+
maxWidth?: number;
|
|
54
|
+
isResizable?: boolean;
|
|
55
|
+
isSortable?: boolean;
|
|
56
|
+
isFilterable?: boolean;
|
|
57
|
+
/** Footer aggregate for this (numeric) column. Rendered in the grid footer row. */
|
|
58
|
+
aggregate?: 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
59
|
+
/**
|
|
60
|
+
* Custom format for the aggregate footer cell. Default: `count` → integer;
|
|
61
|
+
* `sum`/`avg`/`min`/`max` → `computeFormattedValue` by `rendererType` (so a
|
|
62
|
+
* currency column's sum shows as currency); `null` → blank.
|
|
63
|
+
*/
|
|
64
|
+
aggregateFormat?: (value: number | null, fn: 'sum' | 'avg' | 'count' | 'min' | 'max') => string;
|
|
65
|
+
/** Link/record-link click handler. */
|
|
66
|
+
onLinkClick?: (item: T) => void;
|
|
67
|
+
/** Per-column value-change handler (4-arg, matches the editable cells). */
|
|
68
|
+
onValueChange?: (rowKey: string, fieldName: string, value: unknown, originalValue: unknown) => void;
|
|
69
|
+
/** Edit-mode validation — returns an error message or undefined. */
|
|
70
|
+
validate?: (value: unknown, rowKey: string) => string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Custom callout content shown on hover over the cell (e.g. a lookup's
|
|
73
|
+
* related-record preview). Consumed by the DetailsList host (`toDetailsListColumns`
|
|
74
|
+
* → `CalloutCell`); ignored when `onRender` (the escape hatch) is set, and not yet
|
|
75
|
+
* wired on the Grid Customizer host.
|
|
76
|
+
*/
|
|
77
|
+
calloutContent?: (item: T) => React.ReactNode;
|
|
78
|
+
/** Callout content shown on icon hover (icon columns). */
|
|
79
|
+
onIconMouseEnter?: (item: T) => React.ReactNode;
|
|
80
|
+
/** How the callout dismisses. */
|
|
81
|
+
dismissMode?: 'mouseleave' | 'timeout';
|
|
82
|
+
/** Auto-dismiss duration (ms) when `dismissMode === 'timeout'`. */
|
|
83
|
+
timeoutDuration?: number;
|
|
84
|
+
/** Escape hatch: fully custom cell render, bypassing the registry. */
|
|
85
|
+
onRender?: (item: T) => React.ReactNode;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The single normalized cell-render contract every grid-kit renderer speaks.
|
|
89
|
+
* A superset union of the three host shapes (DetailsList `onRender(item,idx,col)`,
|
|
90
|
+
* GridCustomizer `FC<CellRendererProps>`, and the canonical lib's
|
|
91
|
+
* `Cell({item,column,value,itemKey})`). Adapters build this per cell; renderers
|
|
92
|
+
* never reach back into a host.
|
|
93
|
+
*/
|
|
94
|
+
export interface GridCellProps<T = Record<string, unknown>> {
|
|
95
|
+
/** Raw field value. */
|
|
96
|
+
value: unknown;
|
|
97
|
+
/** Display string — host-supplied (Dataverse formatted value) or computed fallback. */
|
|
98
|
+
formattedValue: string;
|
|
99
|
+
/**
|
|
100
|
+
* Only set when the value was supplied by the host/platform (e.g. Dataverse
|
|
101
|
+
* `@OData…FormattedValue`), NOT when `formattedValue` is a computed fallback.
|
|
102
|
+
* Renderers use this to honor a real optionset/lookup label over the raw code.
|
|
103
|
+
*/
|
|
104
|
+
suppliedFormattedValue?: string;
|
|
105
|
+
/** Full row. */
|
|
106
|
+
item: T;
|
|
107
|
+
/** Row key (for change callbacks). */
|
|
108
|
+
itemKey: string;
|
|
109
|
+
/** Column definition. */
|
|
110
|
+
column: ColumnDef<T>;
|
|
111
|
+
isEditing?: boolean;
|
|
112
|
+
isDirty?: boolean;
|
|
113
|
+
editedValue?: unknown;
|
|
114
|
+
errorMessage?: string;
|
|
115
|
+
/** 4-arg change signal, matching the canonical editable cells. */
|
|
116
|
+
onValueChange?: (rowKey: string, fieldName: string, value: unknown, originalValue: unknown) => void;
|
|
117
|
+
onValidationError?: (rowKey: string, fieldName: string, message: string | undefined) => void;
|
|
118
|
+
onEditStart?: () => void;
|
|
119
|
+
onEditEnd?: () => void;
|
|
120
|
+
}
|
|
121
|
+
/** A grid-kit cell renderer is a component (rendered as an element, never called). */
|
|
122
|
+
export type GridCellRenderer<T = Record<string, unknown>> = React.ComponentType<GridCellProps<T>>;
|
|
123
|
+
/** Read + optional edit renderer pair for a cell type. */
|
|
124
|
+
export interface CellRegistration<T = Record<string, unknown>> {
|
|
125
|
+
read: GridCellRenderer<T>;
|
|
126
|
+
edit?: GridCellRenderer<T>;
|
|
127
|
+
}
|
|
128
|
+
/** The cell-renderer registry shared across both grid hosts. */
|
|
129
|
+
export interface GridRegistry {
|
|
130
|
+
/** Look up a registration (built-in or custom). */
|
|
131
|
+
get(type: CellRendererType | string): CellRegistration | undefined;
|
|
132
|
+
/** Register or override a cell type (built-in override or brand-new type). */
|
|
133
|
+
register(type: CellRendererType | string, reg: CellRegistration): void;
|
|
134
|
+
/** Resolve the renderer for a column, honoring read-vs-edit. */
|
|
135
|
+
resolve<T = Record<string, unknown>>(column: ColumnDef<T>, editable: boolean): GridCellRenderer<T>;
|
|
136
|
+
}
|
|
137
|
+
export interface GridSortState {
|
|
138
|
+
fieldName: string;
|
|
139
|
+
direction: 'asc' | 'desc';
|
|
140
|
+
}
|
|
141
|
+
export interface GridPaginationState {
|
|
142
|
+
currentPage: number;
|
|
143
|
+
pageSize: number;
|
|
144
|
+
totalItems: number;
|
|
145
|
+
}
|
|
146
|
+
export interface GridCommand {
|
|
147
|
+
key: string;
|
|
148
|
+
text: string;
|
|
149
|
+
iconName?: string;
|
|
150
|
+
onClick?: () => void;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
/** Render as a split button (primary `onClick` + a `subMenuProps` dropdown). */
|
|
153
|
+
split?: boolean;
|
|
154
|
+
/** Dropdown menu for split/menu commands (e.g. the export CSV/JSON choice). */
|
|
155
|
+
subMenuProps?: IContextualMenuProps;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A per-row command shown in the right-click context menu (`GridProps.rowCommands`).
|
|
159
|
+
*
|
|
160
|
+
* Intentionally NOT a `GridCommand`: that is a toolbar command with a zero-arg,
|
|
161
|
+
* optional `onClick`, a boolean `disabled`, and `split`/`subMenuProps` (meaningless
|
|
162
|
+
* per-row). A `RowCommand` is item-aware — `onClick(item)` and the `visible`/`disabled`
|
|
163
|
+
* predicates all receive the row. `onClick` takes only the item (no positional index):
|
|
164
|
+
* resolve the row off the item itself (e.g. a stamped `__rowIndex`) so callers can't
|
|
165
|
+
* mis-key on a display index.
|
|
166
|
+
*/
|
|
167
|
+
export interface RowCommand<T = Record<string, unknown>> {
|
|
168
|
+
key: string;
|
|
169
|
+
text: string;
|
|
170
|
+
iconName?: string;
|
|
171
|
+
onClick: (item: T) => void;
|
|
172
|
+
/** Hide this command for a row when it returns `false`. Default: shown. */
|
|
173
|
+
visible?: (item: T) => boolean;
|
|
174
|
+
/** Disable (grey out) this command for a row when it returns `true`. Default: enabled. */
|
|
175
|
+
disabled?: (item: T) => boolean;
|
|
176
|
+
}
|
|
177
|
+
/** Turnkey CSV/JSON export config (a toolbar split-button over the host's items). */
|
|
178
|
+
export interface GridExportConfig {
|
|
179
|
+
/** Show the Export split-button in the toolbar. */
|
|
180
|
+
enabled?: boolean;
|
|
181
|
+
/** Base filename (a date suffix is added). Default 'grid-export'. */
|
|
182
|
+
filename?: string;
|
|
183
|
+
/** Formats offered in the split-button menu. Default ['csv', 'json']. */
|
|
184
|
+
formats?: Array<'csv' | 'json'>;
|
|
185
|
+
/**
|
|
186
|
+
* `'all'` always exports every row in `items`. `'selected'` exports only the
|
|
187
|
+
* current selection (requires `selectionMode` ≠ 'none'; no-ops when nothing is
|
|
188
|
+
* selected). Default (unset): the selection when non-empty, else all `items`.
|
|
189
|
+
*/
|
|
190
|
+
scope?: 'all' | 'selected';
|
|
191
|
+
/**
|
|
192
|
+
* Open the `GridExportDialog` (format + column picker + filename) instead of
|
|
193
|
+
* exporting immediately. The split-button becomes a single "Export…" button.
|
|
194
|
+
*/
|
|
195
|
+
dialog?: boolean;
|
|
196
|
+
}
|
|
197
|
+
export interface GridToolbarConfig {
|
|
198
|
+
showSearch?: boolean;
|
|
199
|
+
searchPlaceholder?: string;
|
|
200
|
+
onSearch?: (term: string) => void;
|
|
201
|
+
commands?: GridCommand[];
|
|
202
|
+
}
|
|
203
|
+
/** Whole-row file-drop config (HTML5 drop of OS files onto a row). */
|
|
204
|
+
export interface RowFileDropConfig<T = Record<string, unknown>> {
|
|
205
|
+
/** Called with the row + the accepted dropped files. */
|
|
206
|
+
onDrop: (item: T, files: File[]) => void;
|
|
207
|
+
/** Allowed extensions (e.g. `['.pdf', '.png']`). Empty/undefined = any. */
|
|
208
|
+
accept?: string[];
|
|
209
|
+
/** Allow multiple files (default false → first accepted file only). */
|
|
210
|
+
multiple?: boolean;
|
|
211
|
+
/** Called when a drop is rejected (wrong type / no files). */
|
|
212
|
+
onReject?: (item: T, reason: string) => void;
|
|
213
|
+
}
|
|
214
|
+
export interface GridProps<T = Record<string, unknown>> {
|
|
215
|
+
items: T[];
|
|
216
|
+
columns: ColumnDef<T>[];
|
|
217
|
+
/** Defaults to `createCellRegistry()`. */
|
|
218
|
+
registry?: GridRegistry;
|
|
219
|
+
selectionMode?: GridSelectionMode;
|
|
220
|
+
/** Fires with the currently selected rows (requires `selectionMode` ≠ 'none'). */
|
|
221
|
+
onSelectionChanged?: (selectedItems: T[]) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Enables inline editing for columns whose `editorType` is set (and not
|
|
224
|
+
* `'none'`/locked). By default editing is **per-cell click-to-edit**
|
|
225
|
+
* (`editTrigger: 'click'`) — a cell shows read text until clicked, then its
|
|
226
|
+
* inline editor. Set `editTrigger: 'always'` for an Excel-like grid where
|
|
227
|
+
* every editable cell shows its editor at once.
|
|
228
|
+
*/
|
|
229
|
+
editable?: boolean;
|
|
230
|
+
/** Edit activation model when `editable`. Default `'click'`. */
|
|
231
|
+
editTrigger?: 'click' | 'always';
|
|
232
|
+
isLoading?: boolean;
|
|
233
|
+
sort?: GridSortState;
|
|
234
|
+
onSortChange?: (fieldName: string, direction: 'asc' | 'desc') => void;
|
|
235
|
+
/**
|
|
236
|
+
* Presentational pager only — the consumer MUST pre-slice `items` to the
|
|
237
|
+
* current page. The grid renders exactly what is in `items`; it does not
|
|
238
|
+
* page internally.
|
|
239
|
+
*/
|
|
240
|
+
pagination?: GridPaginationState;
|
|
241
|
+
onPageChange?: (page: number) => void;
|
|
242
|
+
/**
|
|
243
|
+
* Rows the aggregate footer computes over. Defaults to the displayed (filtered)
|
|
244
|
+
* rows — i.e. the current page when the consumer pre-paginates. Pass the FULL
|
|
245
|
+
* dataset here for cross-page grand totals; an active filter (`filterBuilder`) is
|
|
246
|
+
* applied to it too, so the total reflects what the filter shows across all pages.
|
|
247
|
+
* Note: on `<GroupedGrid>`, per-group subtotals (`showGroupAggregates`) stay
|
|
248
|
+
* page-scoped — only this overall footer goes cross-page — so they intentionally
|
|
249
|
+
* need not sum to the grand total.
|
|
250
|
+
*/
|
|
251
|
+
aggregateItems?: T[];
|
|
252
|
+
toolbar?: GridToolbarConfig;
|
|
253
|
+
/** Row-key accessor (default: `item.key`). */
|
|
254
|
+
getKey?: (item: T) => string;
|
|
255
|
+
/** Bubbled value-change from any editable cell. */
|
|
256
|
+
onValueChange?: (rowKey: string, fieldName: string, value: unknown, originalValue: unknown) => void;
|
|
257
|
+
onActiveItemChanged?: (item: T, index?: number) => void;
|
|
258
|
+
/** Compact row height. */
|
|
259
|
+
compact?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Fill the host's container: the grid root becomes a flex column at `height`
|
|
262
|
+
* (default 100%) and the list/cards scroll internally, so the toolbar + footers
|
|
263
|
+
* stay fixed. Default off (natural height). For dropping a grid into a surface-kit
|
|
264
|
+
* Section / Dialog / Panel that owns the available height.
|
|
265
|
+
*
|
|
266
|
+
* Requirements / limits:
|
|
267
|
+
* - The container MUST have a resolved height (a flex/grid parent or an explicit
|
|
268
|
+
* height) — `height: '100%'` against an auto-height parent renders nothing.
|
|
269
|
+
* - v1: the DetailsList column header scrolls with the body (not pinned).
|
|
270
|
+
* - Honored by side-panel / hover-callout nested modes (via DataGrid), but NOT by
|
|
271
|
+
* `<NestedGrid mode="inline">` (inline child height is driven by row expansion).
|
|
272
|
+
*/
|
|
273
|
+
fill?: boolean;
|
|
274
|
+
/** Explicit grid height (number = px, or any CSS value). With `fill`, defaults to '100%'. */
|
|
275
|
+
height?: number | string;
|
|
276
|
+
/** Make each row a file-drop target (OS files → `onDrop(item, files)`). */
|
|
277
|
+
rowFileDrop?: RowFileDropConfig<T>;
|
|
278
|
+
/**
|
|
279
|
+
* Adds a turnkey Export (CSV/JSON) split-button to the toolbar over the host's
|
|
280
|
+
* current `items` (or the selection when non-empty). Renders the toolbar even
|
|
281
|
+
* if `toolbar` is undefined.
|
|
282
|
+
*/
|
|
283
|
+
exportConfig?: GridExportConfig;
|
|
284
|
+
/**
|
|
285
|
+
* Zebra-stripe rows with the given even/odd row background colors. Composes
|
|
286
|
+
* with `rowFileDrop` (both share the DetailsList `onRenderRow`). No-op on
|
|
287
|
+
* CardGrid (no rows). Mirrors form-runtime's `alternateRowColors`.
|
|
288
|
+
*/
|
|
289
|
+
alternateRowColors?: {
|
|
290
|
+
even: string;
|
|
291
|
+
odd: string;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Resolve a row → a navigation target. When set, `link`/`lookup` cells open it
|
|
295
|
+
* on click and a toolbar "Open" command navigates the active/selected row.
|
|
296
|
+
* Executed via `Xrm.Navigation` (no-op + console on localhost / no Xrm).
|
|
297
|
+
*/
|
|
298
|
+
navigateTo?: (item: T) => NavTarget | undefined;
|
|
299
|
+
/** Row-level navigation hook, wired to DetailsList `onItemInvoked` (double-click / Enter). */
|
|
300
|
+
onRowNavigate?: (item: T) => void;
|
|
301
|
+
/**
|
|
302
|
+
* Per-row right-click context menu. When set (and non-empty), right-clicking a row
|
|
303
|
+
* opens a Fluent v8 `ContextualMenu` of these commands (the native browser menu is
|
|
304
|
+
* suppressed). When unset/empty the native menu is left intact (strict no-op for
|
|
305
|
+
* existing consumers). Honored by every host: the DetailsList-backed grids (`DataGrid`,
|
|
306
|
+
* `GroupedGrid`, and `<NestedGrid>`'s inline/side-panel/hover-callout/detail-pane
|
|
307
|
+
* parents), the card parents (`NestedCardParent`, per-card right-click), and the
|
|
308
|
+
* `FocusedViewGrid` rail.
|
|
309
|
+
*/
|
|
310
|
+
rowCommands?: RowCommand<T>[];
|
|
311
|
+
/**
|
|
312
|
+
* Adds a "Columns" toolbar command that opens a column-chooser panel
|
|
313
|
+
* (show/hide + reorder). The grid manages the visible set internally; opt-in.
|
|
314
|
+
*/
|
|
315
|
+
columnChooser?: boolean;
|
|
316
|
+
/** Notified with the new visible column keys (in order) when the chooser applies. */
|
|
317
|
+
onColumnOrderChange?: (visibleOrder: string[]) => void;
|
|
318
|
+
/**
|
|
319
|
+
* Adds a "Filters" toolbar command that opens a filter-builder panel (field +
|
|
320
|
+
* operator + value conditions combined with All/Any). The grid filters its
|
|
321
|
+
* in-memory `items` by the built model — the list, aggregate footer, and export
|
|
322
|
+
* scope all reflect the filter; opt-in. Operates on the passed `items`, so pair
|
|
323
|
+
* it with a client-side (non-paginated) dataset, like the aggregate footer; for
|
|
324
|
+
* server-side filtering, read `onFilterChange` and re-query.
|
|
325
|
+
*/
|
|
326
|
+
filterBuilder?: boolean;
|
|
327
|
+
/** Notified with the applied filter model when the filter panel applies. */
|
|
328
|
+
onFilterChange?: (model: GridFilterModel) => void;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Read-only grid: `<DataGrid>` with selection off, editing off, and command-bar
|
|
332
|
+
* commands stripped. A thin preset — no extra config.
|
|
333
|
+
*/
|
|
334
|
+
export type ReadOnlyGridProps<T = Record<string, unknown>> = Omit<GridProps<T>, 'selectionMode' | 'editable' | 'editTrigger' | 'onSelectionChanged' | 'onValueChange'>;
|
|
335
|
+
/**
|
|
336
|
+
* Card-view layout config. Mirrors form-runtime's `GridCardViewConfig` (minus
|
|
337
|
+
* its `enabled` flag — choosing `<CardGrid>` IS "enabled").
|
|
338
|
+
*/
|
|
339
|
+
export interface CardConfig {
|
|
340
|
+
/** Cards per row (CSS grid columns). Default 3. */
|
|
341
|
+
cardsPerRow?: number;
|
|
342
|
+
/** Fixed card height in px (otherwise content-sized). */
|
|
343
|
+
cardHeight?: number;
|
|
344
|
+
/** Column whose value is the card title. Default: first column. */
|
|
345
|
+
titleField?: string;
|
|
346
|
+
/** Column whose value is the card subtitle. */
|
|
347
|
+
subtitleField?: string;
|
|
348
|
+
/** Column whose value is an image URL shown as a card thumbnail. */
|
|
349
|
+
imageField?: string;
|
|
350
|
+
/**
|
|
351
|
+
* Columns rendered (label + value) in the card body. Default: all columns
|
|
352
|
+
* except the title/subtitle/image fields.
|
|
353
|
+
*/
|
|
354
|
+
bodyFields?: string[];
|
|
355
|
+
}
|
|
356
|
+
export interface CardGridProps<T = Record<string, unknown>> extends Omit<GridProps<T>, 'compact'> {
|
|
357
|
+
card?: CardConfig;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Grouping config for `<GroupedGrid>`. grid-kit-originated (form-runtime has no
|
|
361
|
+
* `groupBy` field yet); maps onto Fluent v8 DetailsList `IGroup[]`.
|
|
362
|
+
*/
|
|
363
|
+
export interface GroupConfig<T = Record<string, unknown>> {
|
|
364
|
+
/** Field whose value buckets rows into groups. */
|
|
365
|
+
groupBy: string;
|
|
366
|
+
/** Custom header label; default is the formatted group value. */
|
|
367
|
+
getGroupLabel?: (groupValue: unknown, items: T[]) => string;
|
|
368
|
+
/** Start groups collapsed. Default false. */
|
|
369
|
+
collapsedByDefault?: boolean;
|
|
370
|
+
/** Show a per-group count in the header. Default true. */
|
|
371
|
+
showCount?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Render a per-group subtotal footer row (aggregating each group's rows for the
|
|
374
|
+
* columns that declared an `aggregate`). Default false. The overall footer below
|
|
375
|
+
* the grid is unaffected. Subtotals always aggregate the displayed (page) rows of
|
|
376
|
+
* each group — only the overall footer goes cross-page via `aggregateItems`.
|
|
377
|
+
*/
|
|
378
|
+
showGroupAggregates?: boolean;
|
|
379
|
+
}
|
|
380
|
+
export interface GroupedGridProps<T = Record<string, unknown>> extends GridProps<T> {
|
|
381
|
+
group: GroupConfig<T>;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* How a parent row surfaces its child records. Mirrors form-runtime's
|
|
385
|
+
* `NestedDisplayMode`.
|
|
386
|
+
* - `inline` — chevron expands the child grid under the parent row
|
|
387
|
+
* - `detail-pane` — child grid renders in a master-detail pane (FocusedViewGrid)
|
|
388
|
+
* - `side-panel` — a trigger opens a Fluent Panel hosting the child grid
|
|
389
|
+
* - `hover-callout` — hovering a count badge shows a compact callout of top-N rows
|
|
390
|
+
*/
|
|
391
|
+
export type NestedDisplayMode = 'inline' | 'detail-pane' | 'side-panel' | 'hover-callout';
|
|
392
|
+
/** Side-panel size (maps to Fluent v8 `PanelType`). */
|
|
393
|
+
export type NestedSidePanelSize = 'small' | 'medium' | 'large';
|
|
394
|
+
/**
|
|
395
|
+
* Nested-grid config for `<NestedGrid>`. grid-kit never fetches — the consumer
|
|
396
|
+
* supplies `getChildren(parent)` (sync array or promise); it owns the
|
|
397
|
+
* relationship/FetchXML. The child grid is itself a grid-kit grid.
|
|
398
|
+
*/
|
|
399
|
+
export interface NestedConfig<T = Record<string, unknown>, C = Record<string, unknown>> {
|
|
400
|
+
/** How children surface. */
|
|
401
|
+
mode: NestedDisplayMode;
|
|
402
|
+
/** Child grid columns. */
|
|
403
|
+
childColumns: ColumnDef<C>[];
|
|
404
|
+
/** Resolve a parent row → its child rows (sync or async). */
|
|
405
|
+
getChildren: (parent: T) => C[] | Promise<C[]>;
|
|
406
|
+
/** Side-panel size when `mode === 'side-panel'`. Default 'medium'. */
|
|
407
|
+
panelSize?: NestedSidePanelSize;
|
|
408
|
+
/** Hover delay (ms) when `mode === 'hover-callout'`. Default 300. */
|
|
409
|
+
hoverDelay?: number;
|
|
410
|
+
/** Max rows shown in the hover-callout preview. Default 5. */
|
|
411
|
+
calloutMaxRows?: number;
|
|
412
|
+
/** Trigger label (supports the `{count}` token). Default "View {count} related". */
|
|
413
|
+
triggerLabel?: string;
|
|
414
|
+
/** Fluent icon name for the trigger. Default 'OpenPaneMirrored'. */
|
|
415
|
+
triggerIcon?: string;
|
|
416
|
+
/** Registry for the child grid; defaults to the parent's registry. */
|
|
417
|
+
childRegistry?: GridRegistry;
|
|
418
|
+
/**
|
|
419
|
+
* How parent rows render. `'rows'` (default) = DetailsList/DataGrid rows per
|
|
420
|
+
* `mode`. `'cards'` = each parent is a card that expands IN PLACE to reveal its
|
|
421
|
+
* child grid (`<NestedCardParent>`); `mode` is ignored for card parents.
|
|
422
|
+
*/
|
|
423
|
+
parentLayout?: 'rows' | 'cards';
|
|
424
|
+
/** Card layout config when `parentLayout === 'cards'` (reuses `CardConfig`). */
|
|
425
|
+
parentCard?: CardConfig;
|
|
426
|
+
/** Selection mode for the child grid. Default 'none'. */
|
|
427
|
+
childSelectionMode?: GridSelectionMode;
|
|
428
|
+
/**
|
|
429
|
+
* Gates child-row selection relative to the parent (mirrors form-runtime's
|
|
430
|
+
* `nestedSelectionMode`). `'independent'` (default) = children selectable
|
|
431
|
+
* regardless of parent. `'requires-parent'` = a parent's child grid is only
|
|
432
|
+
* selectable while that parent row is selected (inline mode; requires the
|
|
433
|
+
* parent grid to be selectable, i.e. `selectionMode` ≠ 'none'). De-selecting
|
|
434
|
+
* then re-selecting a parent restores that child grid's prior selection (the
|
|
435
|
+
* child keeps its own selection state while gated off).
|
|
436
|
+
*/
|
|
437
|
+
childSelectionGating?: 'independent' | 'requires-parent';
|
|
438
|
+
/** Fires with the selected child rows + their parent. */
|
|
439
|
+
onChildSelectionChanged?: (parent: T, selected: C[]) => void;
|
|
440
|
+
/** Make the child grid editable. */
|
|
441
|
+
childEditable?: boolean;
|
|
442
|
+
/** Edit activation for the child grid. Default 'click'. */
|
|
443
|
+
childEditTrigger?: 'click' | 'always';
|
|
444
|
+
/** Bubbled value-change from a child cell (with its parent row). */
|
|
445
|
+
onChildValueChange?: (parent: T, rowKey: string, fieldName: string, value: unknown, originalValue: unknown) => void;
|
|
446
|
+
}
|
|
447
|
+
export interface NestedGridProps<T = Record<string, unknown>, C = Record<string, unknown>> extends GridProps<T> {
|
|
448
|
+
nested: NestedConfig<T, C>;
|
|
449
|
+
}
|
|
450
|
+
/** A field reference in a focused-view summary row. Mirrors form-runtime `FocusedViewField`. */
|
|
451
|
+
export interface FocusedViewField {
|
|
452
|
+
fieldName: string;
|
|
453
|
+
label: string;
|
|
454
|
+
linkedEntityAlias?: string;
|
|
455
|
+
attributeType?: string;
|
|
456
|
+
}
|
|
457
|
+
/** A summary row in the focused-view left rail. Mirrors form-runtime `FocusedViewRow`. */
|
|
458
|
+
export interface FocusedViewRow {
|
|
459
|
+
id: string;
|
|
460
|
+
primaryField: FocusedViewField;
|
|
461
|
+
secondaryField?: FocusedViewField;
|
|
462
|
+
/** Fluent v8 icon name shown beside the row. */
|
|
463
|
+
iconName?: string;
|
|
464
|
+
}
|
|
465
|
+
/** Focused-view config for `<FocusedViewGrid>`. Mirrors form-runtime `FocusedViewConfig`. */
|
|
466
|
+
export interface FocusedViewConfig {
|
|
467
|
+
/** 1–4 summary rows for each left-rail item. */
|
|
468
|
+
rows: FocusedViewRow[];
|
|
469
|
+
/** Reserved (form-runtime parity) — show an "up next" activity slot. */
|
|
470
|
+
showUpNextActivity?: boolean;
|
|
471
|
+
/** Columns rendered in the right detail pane. Default: all columns. */
|
|
472
|
+
detailFields?: string[];
|
|
473
|
+
/**
|
|
474
|
+
* Right-pane layout: when `true`, the pane renders ONLY the nested child grid —
|
|
475
|
+
* no record-title heading, no detail-field list, no "Related" subheading. Use
|
|
476
|
+
* for a pure master/detail where the rail is the master and the pane is the
|
|
477
|
+
* related-records grid (the export-engine focused-view shape). Requires `nested`.
|
|
478
|
+
* Default (`false`/unset): the classic detail-field list, with the child grid
|
|
479
|
+
* appended under a "Related" heading when a `detail-pane` nested config is given.
|
|
480
|
+
*/
|
|
481
|
+
childOnly?: boolean;
|
|
482
|
+
}
|
|
483
|
+
export interface FocusedViewGridProps<T = Record<string, unknown>> extends GridProps<T> {
|
|
484
|
+
focusedView: FocusedViewConfig;
|
|
485
|
+
/** Optional child grid rendered in the detail pane (nested `mode: 'detail-pane'`). */
|
|
486
|
+
nested?: NestedConfig<T, Record<string, unknown>>;
|
|
487
|
+
}
|
|
488
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EA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E,OAAO,CAAC,CACvF,SAAQ,SAAS,CAAC,CAAC,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC5B;AAID,gGAAgG;AAChG,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,0FAA0F;AAC1F,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,gBAAgB,CAAC;IAC/B,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6FAA6F;AAC7F,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACrF,WAAW,EAAE,iBAAiB,CAAC;IAC/B,sFAAsF;IACtF,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dataverse-kit/grid-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared, registry-driven grid / detail-list components for Dynamics 365 (Fluent UI v8). Wraps @khester/dynamics-cell-renderers behind one cell-renderer registry usable by both a DetailsList grid and a Grid Customizer.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prebuild": "cd ../dynamics-utils && npm run build && cd ../dynamics-cell-renderers && npm run build",
|
|
11
|
+
"build": "rollup -c",
|
|
12
|
+
"dev": "rollup -c -w",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"typecheck:stories": "tsc -p tsconfig.stories.json",
|
|
16
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
17
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
18
|
+
"storybook": "storybook dev -p 6007",
|
|
19
|
+
"build-storybook": "storybook build",
|
|
20
|
+
"clean": "rimraf dist coverage tsconfig.tsbuildinfo .rollup.cache storybook-static"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@khester/dynamics-cell-renderers": "^1.1.0",
|
|
24
|
+
"@khester/dynamics-utils": "^1.2.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@fluentui/react": "^8.115.6",
|
|
28
|
+
"react": "^18.2.0",
|
|
29
|
+
"react-dom": "^18.2.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
33
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
34
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
35
|
+
"@storybook/addon-docs": "^10.4.4",
|
|
36
|
+
"@storybook/react-vite": "^10.4.4",
|
|
37
|
+
"@types/react": "^18.2.45",
|
|
38
|
+
"@types/react-dom": "^18.2.18",
|
|
39
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
40
|
+
"rimraf": "^5.0.5",
|
|
41
|
+
"rollup": "^4.6.1",
|
|
42
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
43
|
+
"storybook": "^10.4.4",
|
|
44
|
+
"typescript": "^5.3.3",
|
|
45
|
+
"vite": "^7.3.5",
|
|
46
|
+
"vitest": "^1.6.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
51
|
+
}
|