@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.
Files changed (115) hide show
  1. package/dist/adapters/CalloutCell.d.ts +24 -0
  2. package/dist/adapters/CalloutCell.d.ts.map +1 -0
  3. package/dist/adapters/EditCellWrapper.d.ts +13 -0
  4. package/dist/adapters/EditCellWrapper.d.ts.map +1 -0
  5. package/dist/adapters/context.d.ts +45 -0
  6. package/dist/adapters/context.d.ts.map +1 -0
  7. package/dist/adapters/fromGridCustomizerDefinition.d.ts +43 -0
  8. package/dist/adapters/fromGridCustomizerDefinition.d.ts.map +1 -0
  9. package/dist/adapters/index.d.ts +10 -0
  10. package/dist/adapters/index.d.ts.map +1 -0
  11. package/dist/adapters/resolveGridFromDefinition.d.ts +92 -0
  12. package/dist/adapters/resolveGridFromDefinition.d.ts.map +1 -0
  13. package/dist/adapters/toDetailsListColumns.d.ts +5 -0
  14. package/dist/adapters/toDetailsListColumns.d.ts.map +1 -0
  15. package/dist/adapters/toGridCustomizerOverrides.d.ts +46 -0
  16. package/dist/adapters/toGridCustomizerOverrides.d.ts.map +1 -0
  17. package/dist/core/aggregate.d.ts +35 -0
  18. package/dist/core/aggregate.d.ts.map +1 -0
  19. package/dist/core/coercion.d.ts +9 -0
  20. package/dist/core/coercion.d.ts.map +1 -0
  21. package/dist/core/colorResolver.d.ts +15 -0
  22. package/dist/core/colorResolver.d.ts.map +1 -0
  23. package/dist/core/filter.d.ts +40 -0
  24. package/dist/core/filter.d.ts.map +1 -0
  25. package/dist/core/formatters.d.ts +9 -0
  26. package/dist/core/formatters.d.ts.map +1 -0
  27. package/dist/core/index.d.ts +12 -0
  28. package/dist/core/index.d.ts.map +1 -0
  29. package/dist/core/thresholds.d.ts +15 -0
  30. package/dist/core/thresholds.d.ts.map +1 -0
  31. package/dist/dnd/DroppableCell.d.ts +16 -0
  32. package/dist/dnd/DroppableCell.d.ts.map +1 -0
  33. package/dist/dnd/FileDropCell.d.ts +25 -0
  34. package/dist/dnd/FileDropCell.d.ts.map +1 -0
  35. package/dist/dnd/index.d.ts +7 -0
  36. package/dist/dnd/index.d.ts.map +1 -0
  37. package/dist/dnd/useFileDrop.d.ts +36 -0
  38. package/dist/dnd/useFileDrop.d.ts.map +1 -0
  39. package/dist/export/GridExportDialog.d.ts +29 -0
  40. package/dist/export/GridExportDialog.d.ts.map +1 -0
  41. package/dist/export/exportGrid.d.ts +17 -0
  42. package/dist/export/exportGrid.d.ts.map +1 -0
  43. package/dist/export/index.d.ts +4 -0
  44. package/dist/export/index.d.ts.map +1 -0
  45. package/dist/hosts/CardGrid.d.ts +12 -0
  46. package/dist/hosts/CardGrid.d.ts.map +1 -0
  47. package/dist/hosts/DataGrid.d.ts +10 -0
  48. package/dist/hosts/DataGrid.d.ts.map +1 -0
  49. package/dist/hosts/DetailsGrid.d.ts +3 -0
  50. package/dist/hosts/DetailsGrid.d.ts.map +1 -0
  51. package/dist/hosts/FocusedViewGrid.d.ts +10 -0
  52. package/dist/hosts/FocusedViewGrid.d.ts.map +1 -0
  53. package/dist/hosts/GridAggregateFooter.d.ts +36 -0
  54. package/dist/hosts/GridAggregateFooter.d.ts.map +1 -0
  55. package/dist/hosts/GridColumnChooser.d.ts +27 -0
  56. package/dist/hosts/GridColumnChooser.d.ts.map +1 -0
  57. package/dist/hosts/GridFilterBuilder.d.ts +32 -0
  58. package/dist/hosts/GridFilterBuilder.d.ts.map +1 -0
  59. package/dist/hosts/GridPaginationFooter.d.ts +11 -0
  60. package/dist/hosts/GridPaginationFooter.d.ts.map +1 -0
  61. package/dist/hosts/GroupedGrid.d.ts +9 -0
  62. package/dist/hosts/GroupedGrid.d.ts.map +1 -0
  63. package/dist/hosts/ReadOnlyGrid.d.ts +9 -0
  64. package/dist/hosts/ReadOnlyGrid.d.ts.map +1 -0
  65. package/dist/hosts/buildGroups.d.ts +14 -0
  66. package/dist/hosts/buildGroups.d.ts.map +1 -0
  67. package/dist/hosts/cardLayout.d.ts +22 -0
  68. package/dist/hosts/cardLayout.d.ts.map +1 -0
  69. package/dist/hosts/fill.d.ts +10 -0
  70. package/dist/hosts/fill.d.ts.map +1 -0
  71. package/dist/hosts/index.d.ts +19 -0
  72. package/dist/hosts/index.d.ts.map +1 -0
  73. package/dist/hosts/nested/NestedCardParent.d.ts +23 -0
  74. package/dist/hosts/nested/NestedCardParent.d.ts.map +1 -0
  75. package/dist/hosts/nested/NestedGrid.d.ts +17 -0
  76. package/dist/hosts/nested/NestedGrid.d.ts.map +1 -0
  77. package/dist/hosts/nested/NestedInline.d.ts +18 -0
  78. package/dist/hosts/nested/NestedInline.d.ts.map +1 -0
  79. package/dist/hosts/nested/NestedTriggerCell.d.ts +12 -0
  80. package/dist/hosts/nested/NestedTriggerCell.d.ts.map +1 -0
  81. package/dist/hosts/nested/labels.d.ts +10 -0
  82. package/dist/hosts/nested/labels.d.ts.map +1 -0
  83. package/dist/hosts/nested/useChildren.d.ts +15 -0
  84. package/dist/hosts/nested/useChildren.d.ts.map +1 -0
  85. package/dist/hosts/rowContextMenu.d.ts +11 -0
  86. package/dist/hosts/rowContextMenu.d.ts.map +1 -0
  87. package/dist/hosts/toolbar/GridToolbar.d.ts +9 -0
  88. package/dist/hosts/toolbar/GridToolbar.d.ts.map +1 -0
  89. package/dist/hosts/useEditState.d.ts +25 -0
  90. package/dist/hosts/useEditState.d.ts.map +1 -0
  91. package/dist/hosts/useGridContext.d.ts +15 -0
  92. package/dist/hosts/useGridContext.d.ts.map +1 -0
  93. package/dist/hosts/useRowContextMenu.d.ts +18 -0
  94. package/dist/hosts/useRowContextMenu.d.ts.map +1 -0
  95. package/dist/index.d.ts +22 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.esm.js +2783 -0
  98. package/dist/index.esm.js.map +1 -0
  99. package/dist/index.js +2847 -0
  100. package/dist/index.js.map +1 -0
  101. package/dist/navigation/index.d.ts +3 -0
  102. package/dist/navigation/index.d.ts.map +1 -0
  103. package/dist/navigation/navigateTo.d.ts +71 -0
  104. package/dist/navigation/navigateTo.d.ts.map +1 -0
  105. package/dist/registry/columnMapping.d.ts +15 -0
  106. package/dist/registry/columnMapping.d.ts.map +1 -0
  107. package/dist/registry/createCellRegistry.d.ts +8 -0
  108. package/dist/registry/createCellRegistry.d.ts.map +1 -0
  109. package/dist/registry/index.d.ts +4 -0
  110. package/dist/registry/index.d.ts.map +1 -0
  111. package/dist/registry/renderers.d.ts +15 -0
  112. package/dist/registry/renderers.d.ts.map +1 -0
  113. package/dist/types/index.d.ts +488 -0
  114. package/dist/types/index.d.ts.map +1 -0
  115. package/package.json +51 -0
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export interface CalloutCellProps {
3
+ /** The cell content (the normally-rendered cell). */
4
+ children: React.ReactNode;
5
+ /** Lazily produces the hover-preview content (only invoked while open). */
6
+ renderContent: () => React.ReactNode;
7
+ /**
8
+ * `'mouseleave'` (default) closes as soon as the pointer leaves the cell;
9
+ * `'timeout'` keeps the callout open for `timeoutDuration` ms and stays open
10
+ * while the pointer is over the callout (so its content is interactive).
11
+ */
12
+ dismissMode?: 'mouseleave' | 'timeout';
13
+ /** Grace period (ms) before dismiss when `dismissMode === 'timeout'`. Default 200. */
14
+ timeoutDuration?: number;
15
+ }
16
+ /**
17
+ * Wraps a cell in a hover-triggered Fluent v8 `Callout` showing preview content
18
+ * (e.g. a lookup's related-record fields). Consumed by `toDetailsListColumns` for
19
+ * any `ColumnDef` that declares `calloutContent` — the host wiring that the
20
+ * `ColumnDef.calloutContent`/`dismissMode`/`timeoutDuration` contract was always
21
+ * meant to drive (it was previously declared-but-unconsumed).
22
+ */
23
+ export declare function CalloutCell({ children, renderContent, dismissMode, timeoutDuration, }: CalloutCellProps): JSX.Element;
24
+ //# sourceMappingURL=CalloutCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalloutCell.d.ts","sourceRoot":"","sources":["../../src/adapters/CalloutCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,2EAA2E;IAC3E,aAAa,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACrC;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,aAAa,EACb,WAA0B,EAC1B,eAAqB,GACtB,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAqDhC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ /**
3
+ * Wraps an editable cell that is currently in edit mode. On mount (i.e. when the
4
+ * cell enters edit mode) it focuses the first focusable control, and it exits
5
+ * edit mode on Enter/Escape or on blur to outside — but NOT when focus moves into
6
+ * a Fluent portal (otherwise picking a Dropdown/Calendar/Lookup option would
7
+ * close the editor before the value commits).
8
+ */
9
+ export declare const EditCellWrapper: React.FC<{
10
+ onExit: () => void;
11
+ children: React.ReactNode;
12
+ }>;
13
+ //# sourceMappingURL=EditCellWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditCellWrapper.d.ts","sourceRoot":"","sources":["../../src/adapters/EditCellWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAWjD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAuBvF,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Shared render context + the single `buildCellProps` helper used by both host
3
+ * adapters, so formatted-value sourcing and edit-state threading live in ONE
4
+ * place (no per-adapter duplication).
5
+ */
6
+ import type { ColumnDef, GridCellProps, GridRegistry, GridSortState } from '../types';
7
+ import { type NavTarget } from '../navigation/navigateTo';
8
+ /** Read a row field value. */
9
+ export declare function getFieldValue<T>(item: T, fieldName: string): unknown;
10
+ /**
11
+ * Host-supplied formatted value (Dataverse `@OData…FormattedValue` sibling key),
12
+ * if present. Adapters prefer this over recomputing.
13
+ */
14
+ export declare function getSuppliedFormattedValue<T>(item: T, fieldName: string): string | undefined;
15
+ /** Per-render context shared with the column/override builders. */
16
+ export interface GridRenderContext<T = Record<string, unknown>> {
17
+ registry: GridRegistry;
18
+ editable?: boolean;
19
+ /**
20
+ * How an editable cell enters edit mode. `'click'` (default) = per-cell
21
+ * click-to-edit (one editor at a time, gated by `isEditing`); `'always'` =
22
+ * every editable cell shows its editor at once.
23
+ */
24
+ editTrigger?: 'click' | 'always';
25
+ /** Row-key accessor (default: `item.key`). */
26
+ getKey?: (item: T) => string;
27
+ /** Override the formatted-value lookup (default: OData sibling key). */
28
+ formattedValueAccessor?: (item: T, column: ColumnDef<T>) => string | undefined;
29
+ sort?: GridSortState;
30
+ onSortChange?: (fieldName: string, direction: 'asc' | 'desc') => void;
31
+ /** Resolve a row → a navigation target; synthesizes `onLinkClick` for link/lookup cells. */
32
+ navigateTo?: (item: T) => NavTarget | undefined;
33
+ isEditing?: (rowKey: string, fieldName: string) => boolean;
34
+ getEditedValue?: (rowKey: string, fieldName: string) => unknown;
35
+ isDirty?: (rowKey: string, fieldName: string) => boolean;
36
+ getError?: (rowKey: string, fieldName: string) => string | undefined;
37
+ onValueChange?: (rowKey: string, fieldName: string, value: unknown, originalValue: unknown) => void;
38
+ onValidationError?: (rowKey: string, fieldName: string, message: string | undefined) => void;
39
+ onEditStart?: (rowKey: string, fieldName: string) => void;
40
+ onEditEnd?: (rowKey: string, fieldName: string) => void;
41
+ }
42
+ export declare function defaultGetKey<T>(item: T): string;
43
+ /** Build the normalized cell contract for one (column, row) pair. */
44
+ export declare function buildCellProps<T>(column: ColumnDef<T>, item: T, ctx: GridRenderContext<T>): GridCellProps<T>;
45
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/adapters/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEtF,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAI5E,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI3F;AAED,mEAAmE;AACnE,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACjC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC7B,wEAAwE;IACxE,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IAG/E,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;IAEtE,4FAA4F;IAC5F,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE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ColumnDef[]`. The input shape is declared LOCALLY — grid-kit never imports
4
+ * form-runtime (sibling repo, zero-React, typecheck-standalone). Keep the local
5
+ * shape in sync with:
6
+ * msft/04-dynamics/dynamics-toolkit/packages/form-runtime/src/types/gridCustomizer.ts
7
+ */
8
+ import type { CellRendererType, ColumnDef } from '../types';
9
+ /** Subset of form-runtime's `GridColumnDefinition` we consume (structural). */
10
+ export interface GridColumnDefinitionLike {
11
+ id?: string;
12
+ fieldName: string;
13
+ attributeLogicalName?: string;
14
+ displayName: string;
15
+ dataType: string;
16
+ rendererType: string;
17
+ rendererConfig?: Record<string, unknown>;
18
+ editorType?: string;
19
+ isLocked?: boolean;
20
+ width?: number;
21
+ minWidth?: number;
22
+ maxWidth?: number;
23
+ isResizable?: boolean;
24
+ isSortable?: boolean;
25
+ isFilterable?: boolean;
26
+ /** Footer aggregate (form-runtime's `aggregateFunction`; identical literals). */
27
+ aggregateFunction?: 'sum' | 'avg' | 'count' | 'min' | 'max';
28
+ }
29
+ /** Subset of form-runtime's `GridCustomizerDefinition`. */
30
+ export interface GridCustomizerDefinitionLike {
31
+ columns: GridColumnDefinitionLike[];
32
+ isEditable?: boolean;
33
+ }
34
+ /**
35
+ * Map form-runtime's narrow `rendererType` + separate `dataType` onto grid-kit's
36
+ * 15-literal `CellRendererType`. form-runtime keeps the two separate (a column
37
+ * can be `rendererType:'text'` + `dataType:'numeric'`), so a naive 1:1 map would
38
+ * render numbers / links / toggles as plain text.
39
+ */
40
+ export declare function mapFormRuntimeRendererType(rendererType: string, dataType: string): CellRendererType;
41
+ export declare function fromGridCustomizerColumn<T = Record<string, unknown>>(col: GridColumnDefinitionLike): ColumnDef<T>;
42
+ export declare function fromGridCustomizerDefinition<T = Record<string, unknown>>(def: GridCustomizerDefinitionLike): ColumnDef<T>[];
43
+ //# sourceMappingURL=fromGridCustomizerDefinition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromGridCustomizerDefinition.d.ts","sourceRoot":"","sources":["../../src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AAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtE,GAAG,EAAE,4BAA4B,GAChC,SAAS,CAAC,CAAC,CAAC,EAAE,CAEhB"}
@@ -0,0 +1,10 @@
1
+ export { getFieldValue, getSuppliedFormattedValue, buildCellProps, defaultGetKey, } from './context';
2
+ export type { GridRenderContext } from './context';
3
+ export { toDetailsListColumns } from './toDetailsListColumns';
4
+ export { toGridCustomizerOverrides } from './toGridCustomizerOverrides';
5
+ export type { GcGridColumn, GcCellRendererProps, GcCellRenderer, GcCellRendererOverrides, GridCustomizerOverridesOptions, } from './toGridCustomizerOverrides';
6
+ export { fromGridCustomizerDefinition, fromGridCustomizerColumn, mapFormRuntimeRendererType, } from './fromGridCustomizerDefinition';
7
+ export type { GridColumnDefinitionLike, GridCustomizerDefinitionLike, } from './fromGridCustomizerDefinition';
8
+ export { resolveGridFromDefinition } from './resolveGridFromDefinition';
9
+ export type { GridTypeLike, GridDefinitionLike, ResolvedGrid, ResolveGridOptions, } from './resolveGridFromDefinition';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,cAAc,EACd,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Adapter: a (duck-typed) form-runtime `GridCustomizerDefinition` → the right
3
+ * grid-kit host + props. Lets a designer-authored grid drive grid-kit at runtime.
4
+ * grid-kit never imports form-runtime; keep these local shapes in sync with
5
+ * msft/04-dynamics/dynamics-toolkit/packages/form-runtime/src/types/gridCustomizer.ts
6
+ *
7
+ * Data-fetch stays with the consumer: nested children come from `opts.resolveNested`.
8
+ */
9
+ import type { CardGridProps, ColumnDef, FocusedViewConfig, FocusedViewGridProps, GridProps, GroupedGridProps, NestedDisplayMode, NestedGridProps, ReadOnlyGridProps } from '../types';
10
+ import { GridColumnDefinitionLike } from './fromGridCustomizerDefinition';
11
+ export type GridTypeLike = 'standard' | 'editable' | 'readonly' | 'focused-view' | 'card-list';
12
+ /** Subset of form-runtime's `GridCustomizerDefinition` (grid-level fields). */
13
+ export interface GridDefinitionLike {
14
+ columns: GridColumnDefinitionLike[];
15
+ isEditable?: boolean;
16
+ gridType?: GridTypeLike;
17
+ selectionMode?: 'none' | 'single' | 'multiple';
18
+ showCommandBar?: boolean;
19
+ /** Grid-level zebra striping (mirrors form-runtime's `alternateRowColors`). */
20
+ alternateRowColors?: {
21
+ even: string;
22
+ odd: string;
23
+ };
24
+ cardView?: {
25
+ enabled?: boolean;
26
+ cardsPerRow?: number;
27
+ cardHeight?: number;
28
+ titleField?: string;
29
+ subtitleField?: string;
30
+ imageField?: string;
31
+ };
32
+ nestedGridId?: string;
33
+ nestedDisplay?: {
34
+ mode?: NestedDisplayMode;
35
+ panelSize?: 'small' | 'medium' | 'large';
36
+ hoverDelay?: number;
37
+ calloutMaxRows?: number;
38
+ triggerLabel?: string;
39
+ triggerIcon?: string;
40
+ childSelectionMode?: 'none' | 'single' | 'multiple';
41
+ childEditable?: boolean;
42
+ childEditTrigger?: 'click' | 'always';
43
+ };
44
+ /** Child-selection gating relative to the parent (→ `NestedConfig.childSelectionGating`). */
45
+ nestedSelectionMode?: 'independent' | 'requires-parent';
46
+ focusedView?: {
47
+ config?: FocusedViewConfig;
48
+ primaryNameField?: string;
49
+ summaryFields?: {
50
+ label: string;
51
+ fieldName: string;
52
+ }[];
53
+ };
54
+ }
55
+ /** A grid-kit host choice + the props to render it with. */
56
+ export type ResolvedGrid<T = Record<string, unknown>> = {
57
+ host: 'data';
58
+ props: GridProps<T>;
59
+ } | {
60
+ host: 'readonly';
61
+ props: ReadOnlyGridProps<T>;
62
+ } | {
63
+ host: 'card';
64
+ props: CardGridProps<T>;
65
+ } | {
66
+ host: 'grouped';
67
+ props: GroupedGridProps<T>;
68
+ } | {
69
+ host: 'nested';
70
+ props: NestedGridProps<T>;
71
+ } | {
72
+ host: 'focused-view';
73
+ props: FocusedViewGridProps<T>;
74
+ };
75
+ export interface ResolveGridOptions<T> {
76
+ /**
77
+ * Supply the nested child grid's columns + a parent→children resolver. Called
78
+ * only when `def.nestedGridId` is set. grid-kit does NOT fetch — the consumer
79
+ * owns the relationship/FetchXML here.
80
+ */
81
+ resolveNested?: (def: GridDefinitionLike) => {
82
+ childColumns: ColumnDef[];
83
+ getChildren: (parent: T) => Record<string, unknown>[] | Promise<Record<string, unknown>[]>;
84
+ };
85
+ }
86
+ /**
87
+ * Resolve a grid definition into the host + props grid-kit should render.
88
+ * `nestedGridId` (with `opts.resolveNested`) wraps the result in a NestedGrid;
89
+ * otherwise the `gridType` selects card / focused-view / readonly / data.
90
+ */
91
+ export declare function resolveGridFromDefinition<T extends Record<string, unknown>>(def: GridDefinitionLike, items: T[], opts?: ResolveGridOptions<T>): ResolvedGrid<T>;
92
+ //# sourceMappingURL=resolveGridFromDefinition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveGridFromDefinition.d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;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK;QAC3C,YAAY,EAAE,SAAS,EAAE,CAAC;QAC1B,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;KAC5F,CAAC;CACH;AAwBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzE,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,CAAC,EAAE,EACV,IAAI,GAAE,kBAAkB,CAAC,CAAC,CAAM,GAC/B,YAAY,CAAC,CAAC,CAAC,CAyDjB"}
@@ -0,0 +1,5 @@
1
+ import type { IColumn } from '@fluentui/react';
2
+ import type { ColumnDef } from '../types';
3
+ import { GridRenderContext } from './context';
4
+ export declare function toDetailsListColumns<T>(columns: ColumnDef<T>[], ctx: GridRenderContext<T>): IColumn[];
5
+ //# sourceMappingURL=toDetailsListColumns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toDetailsListColumns.d.ts","sourceRoot":"","sources":["../../src/adapters/toDetailsListColumns.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAkB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAkB9D,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,CAqErG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Adapter: grid-kit `ColumnDef[]` → a Grid Customizer `cellRendererOverrides`
3
+ * map. The FC passes any Dataverse-supplied `formattedValue` straight through
4
+ * (never recomputed) and renders the SAME registry component the DetailsList
5
+ * path uses — this is the cross-host proof.
6
+ *
7
+ * TARGET CONTRACT: the export-engine `IGridCustomizer` ("full" / components-only)
8
+ * shape — `Record<columnKey, React.FC<CellRendererProps>>`, keyed by column
9
+ * logical name (optionally also by data type via `keyByDataType`), with a
10
+ * single-arg FC. This mirrors GridCustomizerCodeGenerator's emitted
11
+ * CellRendererProps / CellRendererOverrides and the hand-authored
12
+ * customizers (e.g. ContactGridCustomizer keyed by 'fullname').
13
+ *
14
+ * This is NOT the native PCF PAOneGrid (`pa-grid-control`) contract, which keys
15
+ * by `ColumnDataType` and calls `(props, rendererParams)` — a separate, two-arg
16
+ * shape grid-kit does not target here.
17
+ */
18
+ import React from 'react';
19
+ import type { ColumnDef, GridRegistry } from '../types';
20
+ export interface GcGridColumn {
21
+ name: string;
22
+ displayName?: string;
23
+ dataType?: string;
24
+ }
25
+ /** The per-cell props a Grid Customizer override receives (MS contract). */
26
+ export interface GcCellRendererProps {
27
+ value: unknown;
28
+ formattedValue?: string;
29
+ column: GcGridColumn;
30
+ rowData: Record<string, unknown>;
31
+ entityId: string;
32
+ entityName?: string;
33
+ isEditing?: boolean;
34
+ isDisabled?: boolean;
35
+ onChange?: (value: unknown) => void;
36
+ onEditStart?: () => void;
37
+ onEditEnd?: () => void;
38
+ }
39
+ export type GcCellRenderer = React.FC<GcCellRendererProps>;
40
+ export type GcCellRendererOverrides = Record<string, GcCellRenderer>;
41
+ export interface GridCustomizerOverridesOptions {
42
+ /** Also key overrides by renderer type (datatype-wide overrides). Default false. */
43
+ keyByDataType?: boolean;
44
+ }
45
+ export declare function toGridCustomizerOverrides<T extends Record<string, unknown>>(columns: ColumnDef<T>[], registry: GridRegistry, options?: GridCustomizerOverridesOptions): GcCellRendererOverrides;
46
+ //# sourceMappingURL=toGridCustomizerOverrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toGridCustomizerOver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,8BAAmC,GAC3C,uBAAuB,CA+CzB"}
@@ -0,0 +1,35 @@
1
+ export type AggregateFunction = 'sum' | 'avg' | 'count' | 'min' | 'max';
2
+ export interface AggregateResult {
3
+ fn: AggregateFunction;
4
+ value: number | null;
5
+ }
6
+ /**
7
+ * Compute one aggregate over a column's values.
8
+ * - `count` counts ALL rows (including null/empty values).
9
+ * - `sum`/`avg`/`min`/`max` consider only numeric-coercible values; over an empty
10
+ * numeric set they return `null` (so a footer renders blank, never NaN/Infinity).
11
+ * Implemented with a single pass (no `Math.min(...nums)` spread, which blows the
12
+ * argument limit on large grids).
13
+ */
14
+ export declare function computeAggregate(items: ReadonlyArray<Record<string, unknown>>, fieldName: string, fn: AggregateFunction): number | null;
15
+ /** Compute aggregates for every column that declared one → `{ fieldName: { fn, value } }`. */
16
+ export declare function computeAggregates<T extends Record<string, unknown>>(items: ReadonlyArray<T>, columns: ReadonlyArray<{
17
+ fieldName: string;
18
+ aggregate?: AggregateFunction;
19
+ }>): Record<string, AggregateResult>;
20
+ /**
21
+ * Per-group aggregates over a contiguous, group-ordered item array. `ranges` are
22
+ * `{ key, startIndex, count }` (the buckets from `buildGroups`); each group's
23
+ * rows are `orderedItems.slice(startIndex, startIndex + count)`. Returns
24
+ * `{ [groupKey]: { [fieldName]: { fn, value } } }`. Pure (no Fluent types) so it
25
+ * stays in framework-agnostic core and is unit-testable.
26
+ */
27
+ export declare function computeGroupAggregates<T extends Record<string, unknown>>(orderedItems: ReadonlyArray<T>, ranges: ReadonlyArray<{
28
+ key: string;
29
+ startIndex: number;
30
+ count: number;
31
+ }>, columns: ReadonlyArray<{
32
+ fieldName: string;
33
+ aggregate?: AggregateFunction;
34
+ }>): Record<string, Record<string, AggregateResult>>;
35
+ //# sourceMappingURL=aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/core/aggregate.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,iBAAiB,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC7C,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,iBAAiB,GACpB,MAAM,GAAG,IAAI,CA6Bf;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,OAAO,EAAE,aAAa,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAAC,GAC3E,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAQjC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,EAC9B,MAAM,EAAE,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EACzE,OAAO,EAAE,aAAa,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAAC,GAC3E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAMjD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Framework-agnostic value coercion. No React / no Fluent imports (enforced by
3
+ * the package ESLint guard on src/core/**).
4
+ */
5
+ export declare function toNumber(value: unknown): number | null;
6
+ export declare function toBool(value: unknown): boolean;
7
+ export declare function toDate(value: unknown): Date | null;
8
+ export declare function toDisplayString(value: unknown): string;
9
+ //# sourceMappingURL=coercion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coercion.d.ts","sourceRoot":"","sources":["../../src/core/coercion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAItD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK9C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAKlD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Framework-agnostic cell-color resolution. Wraps (does not reimplement)
3
+ * @khester/dynamics-utils contrast + hex helpers.
4
+ */
5
+ import { getContrastColor, normalizeHexColor } from '@khester/dynamics-utils';
6
+ export { getContrastColor, normalizeHexColor };
7
+ export interface ColorResolution {
8
+ /** Map of value → background color. */
9
+ colorMap?: Record<string | number, string>;
10
+ /** Function deriving a background color from the value. */
11
+ getBackgroundColor?: (value: string | number) => string;
12
+ }
13
+ /** Resolve the background color for a cell value, or undefined for none. */
14
+ export declare function resolveCellColor(value: unknown, res: ColorResolution): string | undefined;
15
+ //# sourceMappingURL=colorResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorResolver.d.ts","sourceRoot":"","sources":["../../src/core/colorResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC;CACzD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAQzF"}
@@ -0,0 +1,40 @@
1
+ export type FilterOperator = 'eq' | 'ne' | 'like' | 'not-like' | 'begins-with' | 'ends-with' | 'gt' | 'ge' | 'lt' | 'le' | 'on-or-after' | 'on-or-before' | 'in' | 'not-in' | 'null' | 'not-null';
2
+ /** How the conditions combine: `all` = AND, `any` = OR. */
3
+ export type FilterMatch = 'all' | 'any';
4
+ /**
5
+ * One filter condition. Values are strings (FetchXML-aligned); `values` holds the
6
+ * list for `in`/`not-in`. `null`/`not-null` need no value.
7
+ */
8
+ export interface FilterCondition {
9
+ fieldName: string;
10
+ operator: FilterOperator;
11
+ value?: string;
12
+ values?: string[];
13
+ }
14
+ /** A built filter: a flat list of conditions combined by `match`. */
15
+ export interface GridFilterModel {
16
+ match: FilterMatch;
17
+ conditions: FilterCondition[];
18
+ }
19
+ /** Whether `operator` needs an operand value (false for `null`/`not-null`). */
20
+ export declare function operatorRequiresValue(operator: FilterOperator): boolean;
21
+ /** Whether `operator` takes a list of values (`in`/`not-in`). */
22
+ export declare function operatorIsMultiValue(operator: FilterOperator): boolean;
23
+ /** A condition is applied only when fully specified (gates incomplete rows out). */
24
+ export declare function isConditionComplete(c: FilterCondition): boolean;
25
+ /**
26
+ * Evaluate one condition against a raw field value. Equality/relational compares
27
+ * are coercion-based: when both sides parse as numbers they compare numerically
28
+ * (so a numeric-looking text id like `'007'` equals `'7'`), dates compare by day,
29
+ * else case-insensitive text. Assumes a complete condition (see
30
+ * `isConditionComplete`) — `applyFilters` drops incomplete ones first; calling this
31
+ * directly on e.g. a `not-in` with no `values` returns `true` (matches everything).
32
+ */
33
+ export declare function evalCondition(raw: unknown, c: FilterCondition): boolean;
34
+ /**
35
+ * Filter `items` by `model` (client-side, in-memory). Incomplete conditions are
36
+ * ignored; with no complete condition the input is returned unchanged. `match`
37
+ * `'all'` ⇒ every condition must pass (AND); `'any'` ⇒ at least one (OR).
38
+ */
39
+ export declare function applyFilters<T>(items: T[], model: GridFilterModel | undefined, getValue?: (item: T, fieldName: string) => unknown): T[];
40
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/core/filter.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,UAAU,GACV,aAAa,GACb,WAAW,GACX,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,aAAa,GACb,cAAc,GACd,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAKD,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAEvE;AAED,iEAAiE;AACjE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAEtE;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,eAAe,GAAG,OAAO,CAK/D;AAgDD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CA4CvE;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,QAAQ,GAAE,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,OAAyB,GAClE,CAAC,EAAE,CAUL"}
@@ -0,0 +1,9 @@
1
+ import type { CellRendererType } from '../types';
2
+ export interface FormatConfig {
3
+ currencyCode?: string;
4
+ locale?: string;
5
+ dateOptions?: Intl.DateTimeFormatOptions;
6
+ }
7
+ /** Compute a fallback display string for a value given its renderer type. */
8
+ export declare function computeFormattedValue(value: unknown, rendererType: CellRendererType | string, config?: FormatConfig): string;
9
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/core/formatters.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CAC1C;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,gBAAgB,GAAG,MAAM,EACvC,MAAM,GAAE,YAAiB,GACxB,MAAM,CAoBR"}
@@ -0,0 +1,12 @@
1
+ export { toNumber, toBool, toDate, toDisplayString } from './coercion';
2
+ export { resolveThreshold } from './thresholds';
3
+ export type { ThresholdLevel, Thresholds } from './thresholds';
4
+ export { resolveCellColor, getContrastColor, normalizeHexColor } from './colorResolver';
5
+ export type { ColorResolution } from './colorResolver';
6
+ export { computeFormattedValue } from './formatters';
7
+ export type { FormatConfig } from './formatters';
8
+ export { computeAggregate, computeAggregates, computeGroupAggregates } from './aggregate';
9
+ export type { AggregateFunction, AggregateResult } from './aggregate';
10
+ export { applyFilters, evalCondition, isConditionComplete, operatorRequiresValue, operatorIsMultiValue, } from './filter';
11
+ export type { FilterOperator, FilterMatch, FilterCondition, GridFilterModel } from './filter';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxF,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1F,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Framework-agnostic threshold resolution (progress / KPI coloring).
3
+ */
4
+ export type ThresholdLevel = 'ok' | 'warning' | 'danger';
5
+ export interface Thresholds {
6
+ warning?: number;
7
+ danger?: number;
8
+ }
9
+ /**
10
+ * Resolve a value to a threshold level.
11
+ * - `direction: 'desc'` (default): lower is worse (e.g. completion %).
12
+ * - `direction: 'asc'`: higher is worse (e.g. error count).
13
+ */
14
+ export declare function resolveThreshold(value: number, thresholds?: Thresholds, direction?: 'desc' | 'asc'): ThresholdLevel;
15
+ //# sourceMappingURL=thresholds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../src/core/thresholds.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,UAAU,EACvB,SAAS,GAAE,MAAM,GAAG,KAAc,GACjC,cAAc,CAWhB"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { FileDropOptions } from './useFileDrop';
3
+ export interface DroppableCellProps extends FileDropOptions {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ /** `highlight` (outline + glow + tint) or `minimal` (tint only). Default `highlight`. */
8
+ variant?: 'highlight' | 'minimal';
9
+ }
10
+ /**
11
+ * Wraps any content as an HTML5 file-drop target with a drag-over highlight.
12
+ * Use inside a custom cell renderer (or directly) to accept files dropped from
13
+ * the OS onto a cell. The `fileDrop` registry cell type uses this internally.
14
+ */
15
+ export declare const DroppableCell: React.FC<DroppableCellProps>;
16
+ //# sourceMappingURL=DroppableCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DroppableCell.d.ts","sourceRoot":"","sources":["../../src/dnd/DroppableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,yFAAyF;IACzF,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6BtD,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { GridCellRenderer } from '../types';
2
+ /** Shape read off a `fileDrop` column's `rendererConfig`. */
3
+ export interface FileDropCellConfig {
4
+ /** Allowed extensions (e.g. `['.pdf', '.png']`). */
5
+ accept?: string[];
6
+ /** Allow multiple files (default false). */
7
+ multiple?: boolean;
8
+ /**
9
+ * Text shown in the cell. When omitted, the cell shows its own value (so a
10
+ * status like "Uploaded" stays visible), falling back to "Drop file" when the
11
+ * value is empty. Set `label` to force a fixed affordance regardless of value.
12
+ */
13
+ label?: string;
14
+ /** Called with the dropped files + the row + the column field name. */
15
+ onDrop?: (files: File[], item: unknown, fieldName: string) => void;
16
+ /** Called when a drop is rejected. */
17
+ onReject?: (reason: string, item: unknown, fieldName: string) => void;
18
+ }
19
+ /**
20
+ * Grid-kit-native cell renderer for `rendererType: 'fileDrop'`. Renders the cell
21
+ * as a droppable target; on drop it calls `rendererConfig.onDrop(files, item,
22
+ * fieldName)`. Unlike the other built-ins it does NOT wrap a canonical renderer.
23
+ */
24
+ export declare const FileDropCell: GridCellRenderer;
25
+ //# sourceMappingURL=FileDropCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileDropCell.d.ts","sourceRoot":"","sources":["../../src/dnd/FileDropCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGhE,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvE;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,gBAiB1B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { useFileDrop, isFileAccepted } from './useFileDrop';
2
+ export type { FileDropOptions, FileDropProps } from './useFileDrop';
3
+ export { DroppableCell } from './DroppableCell';
4
+ export type { DroppableCellProps } from './DroppableCell';
5
+ export { FileDropCell } from './FileDropCell';
6
+ export type { FileDropCellConfig } from './FileDropCell';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dnd/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { DragEvent } from 'react';
2
+ export interface FileDropOptions {
3
+ /** Called with the accepted dropped files. */
4
+ onDrop: (files: File[]) => void;
5
+ /** Allowed file extensions (e.g. `['.pdf', '.png']`). Empty/undefined = any. */
6
+ accept?: string[];
7
+ /** Allow multiple files (default false → only the first accepted file). */
8
+ multiple?: boolean;
9
+ /** Disable the drop target. */
10
+ disabled?: boolean;
11
+ /** Called when a drop is rejected (wrong type / no files). */
12
+ onReject?: (reason: string) => void;
13
+ }
14
+ export interface FileDropProps {
15
+ onDragEnter: (e: DragEvent) => void;
16
+ onDragOver: (e: DragEvent) => void;
17
+ onDragLeave: (e: DragEvent) => void;
18
+ onDrop: (e: DragEvent) => void;
19
+ }
20
+ /**
21
+ * Whether a file name matches an accept list of extensions (case-insensitive,
22
+ * leading dot optional). Empty/undefined accept = anything. Exported for reuse
23
+ * in custom drop targets.
24
+ */
25
+ export declare function isFileAccepted(name: string, accept?: string[]): boolean;
26
+ /**
27
+ * HTML5 file-drop behavior for a grid cell or row. Tracks drag depth (so the
28
+ * highlight doesn't flicker over child elements), validates the dropped files
29
+ * against `accept`, and exposes the drag-over state + the handler props to spread
30
+ * onto a wrapper element. Pure HTML5 — no drag library.
31
+ */
32
+ export declare function useFileDrop(opts: FileDropOptions): {
33
+ isDragOver: boolean;
34
+ dragProps: FileDropProps;
35
+ };
36
+ //# sourceMappingURL=useFileDrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileDrop.d.ts","sourceRoot":"","sources":["../../src/dnd/useFileDrop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAChC,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;CAChC;AAOD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAIvE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,aAAa,CAAA;CAAE,CA4DpG"}