@dataverse-kit/form-runtime 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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/dist/businessRules-U1_MBgyG.d.cts +372 -0
  4. package/dist/businessRules-U1_MBgyG.d.ts +372 -0
  5. package/dist/context.cjs +151 -0
  6. package/dist/context.cjs.map +1 -0
  7. package/dist/context.d.cts +132 -0
  8. package/dist/context.d.ts +132 -0
  9. package/dist/context.mjs +113 -0
  10. package/dist/context.mjs.map +1 -0
  11. package/dist/control-DFOg_pc_.d.cts +1027 -0
  12. package/dist/control-DaXBm-52.d.ts +1027 -0
  13. package/dist/gridCustomizer-C0V9FAE_.d.ts +569 -0
  14. package/dist/gridCustomizer-mJO-kmQ4.d.cts +569 -0
  15. package/dist/hooks.cjs +85 -0
  16. package/dist/hooks.cjs.map +1 -0
  17. package/dist/hooks.d.cts +24 -0
  18. package/dist/hooks.d.ts +24 -0
  19. package/dist/hooks.mjs +60 -0
  20. package/dist/hooks.mjs.map +1 -0
  21. package/dist/icons.cjs +202 -0
  22. package/dist/icons.cjs.map +1 -0
  23. package/dist/icons.d.cts +130 -0
  24. package/dist/icons.d.ts +130 -0
  25. package/dist/icons.mjs +165 -0
  26. package/dist/icons.mjs.map +1 -0
  27. package/dist/index.cjs +6509 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/index.d.cts +410 -0
  30. package/dist/index.d.ts +410 -0
  31. package/dist/index.mjs +6490 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/dist/runtime-capabilities-BdGDdu0d.d.cts +119 -0
  34. package/dist/runtime-capabilities-Brfc7loJ.d.ts +119 -0
  35. package/dist/theme-BfeZIxmZ.d.cts +74 -0
  36. package/dist/theme-BfeZIxmZ.d.ts +74 -0
  37. package/dist/theme.cjs +215 -0
  38. package/dist/theme.cjs.map +1 -0
  39. package/dist/theme.d.cts +32 -0
  40. package/dist/theme.d.ts +32 -0
  41. package/dist/theme.mjs +186 -0
  42. package/dist/theme.mjs.map +1 -0
  43. package/dist/types.cjs +976 -0
  44. package/dist/types.cjs.map +1 -0
  45. package/dist/types.d.cts +813 -0
  46. package/dist/types.d.ts +813 -0
  47. package/dist/types.mjs +902 -0
  48. package/dist/types.mjs.map +1 -0
  49. package/dist/utils.cjs +250 -0
  50. package/dist/utils.cjs.map +1 -0
  51. package/dist/utils.d.cts +99 -0
  52. package/dist/utils.d.ts +99 -0
  53. package/dist/utils.mjs +220 -0
  54. package/dist/utils.mjs.map +1 -0
  55. package/dist/v8.cjs +4622 -0
  56. package/dist/v8.cjs.map +1 -0
  57. package/dist/v8.d.cts +730 -0
  58. package/dist/v8.d.ts +730 -0
  59. package/dist/v8.mjs +4622 -0
  60. package/dist/v8.mjs.map +1 -0
  61. package/dist/v9.cjs +19 -0
  62. package/dist/v9.cjs.map +1 -0
  63. package/dist/v9.d.cts +2 -0
  64. package/dist/v9.d.ts +2 -0
  65. package/dist/v9.mjs +1 -0
  66. package/dist/v9.mjs.map +1 -0
  67. package/package.json +113 -0
@@ -0,0 +1,569 @@
1
+ import { N as FormDataSource, q as CommandBarItem } from './control-DaXBm-52.js';
2
+
3
+ /**
4
+ * Focused View configuration types for Work Item Appearance settings.
5
+ * Supports up to 4 rows, each with primary + optional secondary fields and icons.
6
+ */
7
+ /**
8
+ * A field reference in the focused view configuration.
9
+ */
10
+ interface FocusedViewField {
11
+ /** Logical field name (e.g., "emailaddress1") */
12
+ fieldName: string;
13
+ /** Display label for the field */
14
+ label: string;
15
+ /** Alias for linked entity fields (e.g., "primarycontact") */
16
+ linkedEntityAlias?: string;
17
+ /** Attribute type for icon display (e.g., "String", "DateTime") */
18
+ attributeType?: string;
19
+ }
20
+ /**
21
+ * A row in the focused view configuration.
22
+ * Each row can have 1-2 fields and an optional icon.
23
+ */
24
+ interface FocusedViewRow {
25
+ /** Unique identifier for the row */
26
+ id: string;
27
+ /** Primary field (required) */
28
+ primaryField: FocusedViewField;
29
+ /** Secondary field (optional, shown on the right) */
30
+ secondaryField?: FocusedViewField;
31
+ /** Icon name to display (e.g., "FavoriteStarFill") */
32
+ iconName?: string;
33
+ }
34
+ /**
35
+ * Complete focused view configuration matching Dynamics 365 Work Item Appearance.
36
+ */
37
+ interface FocusedViewConfig {
38
+ /** 1-4 rows of field configuration */
39
+ rows: FocusedViewRow[];
40
+ /** Show "Up next activity" section at bottom */
41
+ showUpNextActivity?: boolean;
42
+ }
43
+ /**
44
+ * Icon options for focused view rows.
45
+ */
46
+ declare const FOCUSED_VIEW_ICON_OPTIONS: readonly [{
47
+ readonly iconName: "";
48
+ readonly label: "None";
49
+ }, {
50
+ readonly iconName: "FavoriteStarFill";
51
+ readonly label: "Star";
52
+ }, {
53
+ readonly iconName: "NumberSymbol";
54
+ readonly label: "Number";
55
+ }, {
56
+ readonly iconName: "Clock";
57
+ readonly label: "Time";
58
+ }, {
59
+ readonly iconName: "Phone";
60
+ readonly label: "Phone";
61
+ }, {
62
+ readonly iconName: "Mail";
63
+ readonly label: "Email";
64
+ }, {
65
+ readonly iconName: "Calendar";
66
+ readonly label: "Calendar";
67
+ }, {
68
+ readonly iconName: "Contact";
69
+ readonly label: "Contact";
70
+ }, {
71
+ readonly iconName: "Money";
72
+ readonly label: "Currency";
73
+ }, {
74
+ readonly iconName: "StatusCircleCheckmark";
75
+ readonly label: "Status";
76
+ }];
77
+ /**
78
+ * Maximum number of rows allowed in focused view configuration.
79
+ */
80
+ declare const MAX_FOCUSED_VIEW_ROWS = 4;
81
+ /**
82
+ * Legacy summary field format for backward compatibility.
83
+ */
84
+ interface LegacySummaryField {
85
+ label: string;
86
+ fieldName: string;
87
+ }
88
+ /**
89
+ * Migrates legacy summary fields format to new FocusedViewConfig.
90
+ * @param primaryNameField - Legacy primary name field
91
+ * @param summaryFields - Legacy summary fields array
92
+ * @returns New FocusedViewConfig
93
+ */
94
+ declare function migrateLegacyConfig(primaryNameField: string, summaryFields: LegacySummaryField[]): FocusedViewConfig;
95
+ /**
96
+ * Creates a default focused view configuration.
97
+ * @param primaryNameField - Optional primary name field
98
+ * @returns Default FocusedViewConfig
99
+ */
100
+ declare function createDefaultFocusedViewConfig(primaryNameField?: string): FocusedViewConfig;
101
+ /**
102
+ * Validates a focused view configuration.
103
+ * @param config - Configuration to validate
104
+ * @returns True if valid
105
+ */
106
+ declare function isValidFocusedViewConfig(config: unknown): config is FocusedViewConfig;
107
+ /**
108
+ * Grid column interface (subset of SubgridColumn for typing).
109
+ */
110
+ interface GridColumnInput {
111
+ key: string;
112
+ name: string;
113
+ fieldName: string;
114
+ }
115
+ /**
116
+ * Creates a focused view configuration from grid columns.
117
+ * Takes the first 4 columns and converts them to focused view rows.
118
+ * @param columns - Array of grid columns
119
+ * @returns FocusedViewConfig with rows based on columns
120
+ */
121
+ declare function createConfigFromColumns(columns: GridColumnInput[]): FocusedViewConfig;
122
+
123
+ /**
124
+ * Grid Customizer Type Definitions
125
+ *
126
+ * Models the grid customization structure for PCF Grid Customizers and
127
+ * Fluent UI DetailsList configurations. Supports column-level renderer
128
+ * selection, callouts, nested grids, aggregations, and export to code.
129
+ *
130
+ * Design principles:
131
+ * - Matches Microsoft PCF Grid Customizer cellRendererOverrides pattern
132
+ * - Reuses CalloutDefinition from form.ts for column callouts
133
+ * - JSON-serializable for IndexedDB persistence
134
+ * - Supports undo/redo via Immer patches (all types are plain objects)
135
+ */
136
+
137
+ /** Data types for grid columns (maps to Dynamics 365 attribute types) */
138
+ type GridColumnDataType = 'text' | 'numeric' | 'currency' | 'date' | 'datetime' | 'boolean' | 'optionset' | 'lookup' | 'image' | 'url' | 'email' | 'phone';
139
+ /** Available renderer types for grid columns */
140
+ type CellRendererType = 'text' | 'lookup' | 'optionset' | 'currency' | 'progress' | 'date' | 'boolean' | 'rating' | 'composite';
141
+ /** Available editor types for editable grid columns */
142
+ type CellEditorType = 'text' | 'dropdown' | 'number' | 'date' | 'toggle' | 'none';
143
+ /** Aggregate functions for footer row */
144
+ type AggregateFunction = 'sum' | 'avg' | 'count' | 'min' | 'max';
145
+ type GridSelectionMode = 'none' | 'single' | 'multiple';
146
+ type GridPaginationMode = 'pagination' | 'infinite-scroll';
147
+ /**
148
+ * Grid layout/behavior mode. Replaces the older subgrid-control `gridType`
149
+ * property and folds together what used to be the `isEditable` toggle and
150
+ * `cardView.enabled` flag.
151
+ *
152
+ * - `standard` — default DetailsList rendering, read-only cells
153
+ * - `editable` — inline cell editing enabled (column-level `isLocked` overrides)
154
+ * - `readonly` — like standard but hides the command bar and disables selection
155
+ * - `focused-view` — list-detail layout (Dynamics 365 Work Item Appearance)
156
+ * - `card-list` — card layout instead of rows; uses `cardView` config
157
+ */
158
+ type GridType = 'standard' | 'editable' | 'readonly' | 'focused-view' | 'card-list';
159
+ /**
160
+ * Chart pane configuration shown alongside or in place of the grid records.
161
+ * Mirrors Dynamics 365 grid chart options.
162
+ */
163
+ interface GridChartConfig {
164
+ /** Saved chart ID (`savedqueryvisualizationid`) shown by default */
165
+ defaultChartId?: string;
166
+ /** When true, hides the records list and only shows the chart */
167
+ showChartOnly?: boolean;
168
+ /** Whether the user can switch charts at runtime */
169
+ allowChartChange?: boolean;
170
+ }
171
+ /**
172
+ * Focused-view configuration on the grid customizer. Used only when
173
+ * `gridType === 'focused-view'`. Fields legacy-migrated from the subgrid
174
+ * control's `primaryNameField` + `summaryFields` continue to work — see
175
+ * `LegacySummaryField` and `migrateLegacyConfig`.
176
+ */
177
+ interface GridFocusedViewSettings {
178
+ /** Structured row configuration */
179
+ config?: FocusedViewConfig;
180
+ /** Legacy primary name attribute (kept for backward compatibility) */
181
+ primaryNameField?: string;
182
+ /** Legacy flat summary fields (kept for backward compatibility) */
183
+ summaryFields?: LegacySummaryField[];
184
+ }
185
+ /** Slot types for the composite renderer */
186
+ type CompositeSlotType = 'icon' | 'text' | 'badge' | 'link' | 'image' | 'spacer' | 'progress' | 'rating';
187
+ /** Conditional style rule — first match wins in an ordered list */
188
+ interface ConditionalStyle {
189
+ /** Field to evaluate (can be any field in the row, not just this column) */
190
+ field: string;
191
+ /** Comparison operator */
192
+ operator: 'eq' | 'gt' | 'lt' | 'gte' | 'lte' | 'contains' | 'between';
193
+ /** Value to compare against */
194
+ value: string | number;
195
+ /** End value for 'between' operator */
196
+ valueTo?: string | number;
197
+ /** Style to apply when condition matches */
198
+ style: Record<string, string>;
199
+ }
200
+ /** A composable slot within a composite cell renderer */
201
+ interface CompositeSlot {
202
+ /** Unique identifier */
203
+ id: string;
204
+ /** Slot type determines what is rendered */
205
+ type: CompositeSlotType;
206
+ /** Bind to a row field (dynamic), or omit for static value */
207
+ fieldBinding?: string;
208
+ /** Static value (icon name, text, URL, etc.) when no field binding */
209
+ staticValue?: string;
210
+ /** Base style applied when no conditional style matches */
211
+ defaultStyle?: Record<string, string>;
212
+ /**
213
+ * Ordered list of conditional styles — first match wins.
214
+ * Falls through to defaultStyle if no condition matches.
215
+ * Consistent with StatusBadgeConfig's option-value-to-color pattern.
216
+ */
217
+ conditionalStyles?: ConditionalStyle[];
218
+ }
219
+ /** Configuration for the composite renderer */
220
+ interface CompositeRendererConfig {
221
+ /** Layout direction for slots */
222
+ layout: 'horizontal' | 'vertical';
223
+ /** Gap between slots in pixels */
224
+ gap: number;
225
+ /** Ordered list of composable slots */
226
+ slots: CompositeSlot[];
227
+ }
228
+ /** Configuration for a single grid column */
229
+ interface GridColumnDefinition {
230
+ /** Unique identifier */
231
+ id: string;
232
+ /** Logical field name (maps to entity attribute) */
233
+ fieldName: string;
234
+ /**
235
+ * Dataverse attribute logical name this column renders. When set alongside
236
+ * the grid's `dataSource`, enables code generation (models/constants/hooks)
237
+ * and validation against the entity's attribute list. Defaults to the same
238
+ * value as `fieldName` when the column is added from the entity picker, but
239
+ * the two stay independent so `fieldName` can remain a render-only key.
240
+ */
241
+ attributeLogicalName?: string;
242
+ /** Display header text */
243
+ displayName: string;
244
+ /** Data type of the column */
245
+ dataType: GridColumnDataType;
246
+ /** Column width in pixels */
247
+ width: number;
248
+ /** Minimum column width */
249
+ minWidth?: number;
250
+ /** Maximum column width */
251
+ maxWidth?: number;
252
+ /** Whether the column is resizable */
253
+ isResizable: boolean;
254
+ /** Whether the column is visible */
255
+ isVisible: boolean;
256
+ /** Display order (lower = leftmost) */
257
+ order: number;
258
+ /** Cell renderer type */
259
+ rendererType: CellRendererType;
260
+ /**
261
+ * Type-specific renderer configuration.
262
+ * Shape depends on rendererType — enforced at the UI layer per config panel.
263
+ * Examples:
264
+ * optionset → { displayMode: 'box', options: [...], showIcon: true }
265
+ * currency → { currencyCode: 'USD', showTrend: true, decimals: 2 }
266
+ * progress → { min: 0, max: 100, thresholds: { warning: 30, danger: 10 } }
267
+ * composite → CompositeRendererConfig
268
+ */
269
+ rendererConfig: Record<string, unknown>;
270
+ /** Cell editor type (for editable grids). 'none' disables editing. */
271
+ editorType?: CellEditorType;
272
+ /** Type-specific editor configuration */
273
+ editorConfig?: Record<string, unknown>;
274
+ /**
275
+ * When true, this column is locked even if the parent grid is editable.
276
+ * Used for read-only fields, computed values, or fields the current user
277
+ * lacks permission to edit. Renders a lock icon in the column header.
278
+ */
279
+ isLocked?: boolean;
280
+ /** Whether this column is sortable */
281
+ isSortable: boolean;
282
+ /** Default sort direction (when column is the initial sort) */
283
+ defaultSortDirection?: 'asc' | 'desc';
284
+ /** Whether this column is filterable */
285
+ isFilterable: boolean;
286
+ /** Filter control type */
287
+ filterType?: 'text' | 'dropdown' | 'date-range' | 'number-range';
288
+ /** Aggregate function for footer row (only valid on numeric columns) */
289
+ aggregateFunction?: AggregateFunction;
290
+ /** Whether to show a lookup preview card on hover (only applies to lookup columns) */
291
+ showLookupPreview?: boolean;
292
+ /**
293
+ * Field logical names (on rendererConfig.targetEntity) to render in the
294
+ * preview card. Empty/undefined shows an empty-state prompting the user
295
+ * to pick fields. Values are resolved against the row's Dataverse record,
296
+ * preferring the `@OData.Community.Display.V1.FormattedValue` sibling key.
297
+ */
298
+ previewFields?: string[];
299
+ }
300
+ /** Custom toolbar button */
301
+ interface GridToolbarButton {
302
+ /** Unique identifier */
303
+ id: string;
304
+ /** Button label text */
305
+ text: string;
306
+ /** Fluent UI icon name */
307
+ iconName?: string;
308
+ /** Position in toolbar */
309
+ position: 'primary' | 'overflow';
310
+ }
311
+ /** Toolbar feature toggles */
312
+ interface GridToolbarConfig {
313
+ /** Show search box */
314
+ showSearch: boolean;
315
+ /** Show column filter dropdowns */
316
+ showFilters: boolean;
317
+ /** Show list/card view toggle */
318
+ showViewToggle: boolean;
319
+ /** Show export button */
320
+ showExport: boolean;
321
+ /** Show refresh button */
322
+ showRefresh: boolean;
323
+ /** Show column chooser button */
324
+ showColumnChooser: boolean;
325
+ /** Custom toolbar buttons */
326
+ customButtons: GridToolbarButton[];
327
+ }
328
+ /** Configuration for card view alternative layout */
329
+ interface GridCardViewConfig {
330
+ /** Whether card view is available */
331
+ enabled: boolean;
332
+ /** Number of cards per row */
333
+ cardsPerRow: number;
334
+ /** Card height in pixels */
335
+ cardHeight: number;
336
+ /** Field to use as card title */
337
+ titleField?: string;
338
+ /** Field to use as card subtitle */
339
+ subtitleField?: string;
340
+ /** Field to use as card image */
341
+ imageField?: string;
342
+ }
343
+ /**
344
+ * Top-level grid customizer definition.
345
+ // ─── Nested Relationship Binding ─────────────────────────────────────────────
346
+
347
+ /**
348
+ * Records which Dataverse relationship links a parent grid to its nested
349
+ * child grid. Stored on `GridCustomizerDefinition.nestedRelationship`.
350
+ *
351
+ * - `parentField` is the attribute on the parent row whose value gets
352
+ * substituted into the child grid's FetchXML placeholder.
353
+ * - `childField` is the FK on the child entity that holds the parent's id.
354
+ *
355
+ * Example for Account → Contacts via `contact_customer_accounts`:
356
+ * parentField = "accountid", childField = "parentcustomerid",
357
+ * relatedEntity = "contact", relationshipType = "OneToMany".
358
+ */
359
+ interface GridNestedRelationship {
360
+ /** Dataverse relationship SchemaName. */
361
+ schemaName: string;
362
+ /** Relationship type. */
363
+ relationshipType: 'OneToMany' | 'ManyToOne';
364
+ /** Child entity logical name (should match the nested grid's dataSource.entityName). */
365
+ relatedEntity: string;
366
+ /** Parent attribute that provides the id to substitute into the child FetchXML. */
367
+ parentField: string;
368
+ /** Child attribute holding the FK back to the parent. */
369
+ childField: string;
370
+ /** Friendly label shown in the designer + codegen comments. */
371
+ displayName?: string;
372
+ }
373
+ /** Configuration for lookup preview cards shown on hover */
374
+ interface LookupPreviewConfig {
375
+ /** Master toggle for the entire grid */
376
+ enabled: boolean;
377
+ /** Hover delay in ms before showing preview (default: 300) */
378
+ hoverDelay?: number;
379
+ /** Card width in pixels (default: 320) */
380
+ cardWidth?: number;
381
+ }
382
+ /**
383
+ * How nested-grid child records surface to the user. The `inline` mode is the
384
+ * legacy chevron-expand affordance available on standard / editable / readonly
385
+ * grids. The other three modes are required for `focused-view` and `card-list`
386
+ * grids, which have no row-level chevron column.
387
+ *
388
+ * - `inline` — chevron expand under the parent row (DetailsList only)
389
+ * - `detail-pane` — render child grid inside the focused-view detail panel
390
+ * - `side-panel` — click "View N related" → opens a Panel with full child grid
391
+ * - `hover-callout` — hover a count badge → compact callout preview (top N rows)
392
+ */
393
+ type NestedDisplayMode = 'inline' | 'detail-pane' | 'side-panel' | 'hover-callout';
394
+ /** Side-panel size token shared with Fluent UI Panel sizes */
395
+ type NestedSidePanelSize = 'small' | 'medium' | 'large';
396
+ /**
397
+ * Configuration for how a parent grid's nested grid (`nestedGridId`) surfaces
398
+ * its child records. Lives on the parent `GridCustomizerDefinition` — the
399
+ * single source of truth — and is ignored when `nestedGridId` is unset.
400
+ *
401
+ * Defaults populated by the v11 → v12 migration based on parent `gridType`:
402
+ * - focused-view → `{ mode: 'detail-pane' }`
403
+ * - card-list → `{ mode: 'side-panel', panelSize: 'medium' }`
404
+ * - everything else → `{ mode: 'inline' }`
405
+ */
406
+ interface NestedDisplayConfig {
407
+ /** How children are surfaced. */
408
+ mode: NestedDisplayMode;
409
+ /** Side-panel size when `mode === 'side-panel'`. Default: 'medium'. */
410
+ panelSize?: NestedSidePanelSize;
411
+ /** Hover delay (ms) when `mode === 'hover-callout'`. Default: 300. */
412
+ hoverDelay?: number;
413
+ /** Max rows shown in the hover-callout preview. Default: 5. */
414
+ calloutMaxRows?: number;
415
+ /**
416
+ * Trigger label rendered on cards / detail-pane buttons. Supports the
417
+ * `{count}` token for child-row count substitution. Default:
418
+ * "View {count} related".
419
+ */
420
+ triggerLabel?: string;
421
+ /** Fluent icon name for the trigger button. Default: 'OpenPaneMirrored'. */
422
+ triggerIcon?: string;
423
+ }
424
+ /**
425
+ * Lives at the project level (FormBuilderProject.gridCustomizers[]).
426
+ * Can be referenced by subgrid controls via gridCustomizerId.
427
+ */
428
+ interface GridCustomizerDefinition {
429
+ /** Unique identifier */
430
+ id: string;
431
+ /** Display name */
432
+ name: string;
433
+ /** Optional description */
434
+ description?: string;
435
+ /**
436
+ * @deprecated Use `dataSource.entityName` instead. Kept for schema
437
+ * compatibility; the v6 → v7 migration synthesizes a `dataSource` from this
438
+ * field when it is the only signal available.
439
+ */
440
+ entityName?: string;
441
+ /**
442
+ * Dataverse data source this grid renders. When set, unlocks the column
443
+ * picker, metadata-aware previews, and DAL emission on export. Grids without
444
+ * a `dataSource` still work as free-form renderer overlays (legacy behavior).
445
+ */
446
+ dataSource?: FormDataSource;
447
+ /**
448
+ * Saved Dataverse view ID (`savedqueryid`/`userqueryid`) selected as the
449
+ * default view for this grid. When set, the dataSource.fetchXml is normally
450
+ * derived from this view's authored query. Optional — grids can also use
451
+ * custom FetchXML (`useCustomFetchXml`) or no view binding at all.
452
+ */
453
+ viewId?: string;
454
+ /**
455
+ * When true, `dataSource.fetchXml` is treated as user-authored and `viewId`
456
+ * is ignored. Mirrors the legacy subgrid-control `useCustomFetchXml` flag.
457
+ */
458
+ useCustomFetchXml?: boolean;
459
+ /** When true, runtime users can switch views from the grid header. */
460
+ allowViewChange?: boolean;
461
+ /** Column definitions */
462
+ columns: GridColumnDefinition[];
463
+ /**
464
+ * Layout/behavior mode. New code should branch on this enum; the older
465
+ * `isEditable` boolean and `cardView.enabled` flag are derived/back-filled
466
+ * from it for backward compatibility.
467
+ */
468
+ gridType?: GridType;
469
+ /**
470
+ * Maximum number of rows visible in the form-embedded preview / generated
471
+ * subgrid. Distinct from `pageSize` (which controls Dataverse paging in
472
+ * standalone PCF exports). Mirrors the legacy subgrid `maxRows`.
473
+ */
474
+ maxVisibleRows?: number;
475
+ /** Row selection mode */
476
+ selectionMode: GridSelectionMode;
477
+ /** Pagination strategy */
478
+ paginationMode: GridPaginationMode;
479
+ /** Rows per page */
480
+ pageSize: number;
481
+ /** Whether to show the command bar above the grid */
482
+ showCommandBar: boolean;
483
+ /**
484
+ * Whether command bar buttons display labels next to icons. When false,
485
+ * buttons render as icon-only. Per-item `iconOnly` overrides this for
486
+ * individual items. Defaults to true (set by the storage migration for
487
+ * legacy projects). Mirrors `form.settings.showCommandBarLabels`.
488
+ */
489
+ showCommandBarLabels?: boolean;
490
+ /**
491
+ * Whether the grid allows inline cell editing. When false, all cells are
492
+ * read-only regardless of column-level editor settings. When true, cells
493
+ * can be edited unless the column has `isLocked` set.
494
+ */
495
+ isEditable: boolean;
496
+ /** Toolbar feature configuration */
497
+ toolbar: GridToolbarConfig;
498
+ /** Card view configuration */
499
+ cardView: GridCardViewConfig;
500
+ /** Whether to show the grid title/name header */
501
+ showTitle: boolean;
502
+ /** Use compact row height */
503
+ compactMode: boolean;
504
+ /** Alternate row background color */
505
+ alternateRowColor: boolean;
506
+ /** Colors for alternating rows (used when alternateRowColor is true) */
507
+ alternateRowColors?: {
508
+ even: string;
509
+ odd: string;
510
+ };
511
+ /** References another GridCustomizerDefinition by ID for expandable row detail */
512
+ nestedGridId?: string;
513
+ /**
514
+ * Controls whether child-row selection in the nested grid requires the parent
515
+ * row to be selected first. 'independent' (default) lets users tick child rows
516
+ * without selecting the parent; 'requires-parent' disables child checkboxes
517
+ * until the parent row is selected (gating).
518
+ */
519
+ nestedSelectionMode?: 'independent' | 'requires-parent';
520
+ /**
521
+ * When set, the nested grid is bound to a Dataverse relationship so each
522
+ * parent row expands to show its actual child records. Without this field
523
+ * the nested grid renders static/mock data (legacy behavior).
524
+ */
525
+ nestedRelationship?: GridNestedRelationship;
526
+ /**
527
+ * How nested-grid child records surface when the parent gridType doesn't
528
+ * support inline expansion (focused-view, card-list). Ignored when
529
+ * `nestedGridId` is unset. The v11 → v12 migration backfills sensible
530
+ * defaults based on the parent gridType.
531
+ */
532
+ nestedDisplay?: NestedDisplayConfig;
533
+ /** Command bar items (shown when showCommandBar is true) */
534
+ commandBarItems?: CommandBarItem[];
535
+ /** Lookup preview card configuration for hover-over-lookup behavior */
536
+ lookupPreview?: LookupPreviewConfig;
537
+ /** Chart pane configuration (only used when chart features are enabled) */
538
+ chart?: GridChartConfig;
539
+ /**
540
+ * Focused-view configuration. Populated from the legacy subgrid
541
+ * `focusedViewConfig` / `primaryNameField` / `summaryFields` properties
542
+ * during migration. Read only when `gridType === 'focused-view'`.
543
+ */
544
+ focusedView?: GridFocusedViewSettings;
545
+ /** Sample data rows for preview */
546
+ sampleData?: Record<string, unknown>[];
547
+ /** How sample data is sourced */
548
+ sampleDataMode: 'auto' | 'manual' | 'dataverse';
549
+ /** ISO timestamp of creation */
550
+ createdAt: string;
551
+ /** ISO timestamp of last modification */
552
+ updatedAt: string;
553
+ }
554
+ /** Generate a unique ID for grid customizer entities */
555
+ declare function generateGridId(prefix?: string): string;
556
+ /** Create a default grid column definition */
557
+ declare function createDefaultGridColumn(overrides?: Partial<GridColumnDefinition>): GridColumnDefinition;
558
+ /** Create a default grid toolbar configuration */
559
+ declare function createDefaultToolbarConfig(): GridToolbarConfig;
560
+ /** Create a default card view configuration */
561
+ declare function createDefaultCardViewConfig(): GridCardViewConfig;
562
+ /** Create a default grid customizer definition */
563
+ declare function createDefaultGridCustomizer(overrides?: Partial<GridCustomizerDefinition>): GridCustomizerDefinition;
564
+ /** Create a default composite slot */
565
+ declare function createDefaultCompositeSlot(type?: CompositeSlotType): CompositeSlot;
566
+ /** Create a default composite renderer config */
567
+ declare function createDefaultCompositeRendererConfig(): CompositeRendererConfig;
568
+
569
+ export { type AggregateFunction as A, createDefaultCompositeSlot as B, type CellEditorType as C, createDefaultFocusedViewConfig as D, createDefaultGridColumn as E, FOCUSED_VIEW_ICON_OPTIONS as F, type GridCardViewConfig as G, createDefaultGridCustomizer as H, createDefaultToolbarConfig as I, generateGridId as J, isValidFocusedViewConfig as K, type LegacySummaryField as L, MAX_FOCUSED_VIEW_ROWS as M, type NestedDisplayConfig as N, migrateLegacyConfig as O, type CellRendererType as a, type CompositeRendererConfig as b, type CompositeSlot as c, type CompositeSlotType as d, type ConditionalStyle as e, type FocusedViewConfig as f, type FocusedViewField as g, type FocusedViewRow as h, type GridChartConfig as i, type GridColumnDataType as j, type GridColumnDefinition as k, type GridColumnInput as l, type GridCustomizerDefinition as m, type GridFocusedViewSettings as n, type GridNestedRelationship as o, type GridPaginationMode as p, type GridSelectionMode as q, type GridToolbarButton as r, type GridToolbarConfig as s, type GridType as t, type LookupPreviewConfig as u, type NestedDisplayMode as v, type NestedSidePanelSize as w, createConfigFromColumns as x, createDefaultCardViewConfig as y, createDefaultCompositeRendererConfig as z };