@kanunilabs/datagrid-react 1.0.2 → 1.1.1
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/LICENSE +3 -2
- package/README.md +247 -246
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +5 -134
- package/dist/index.d.ts +5 -134
- package/dist/index.js +2 -2
- package/dist/styles.css +2380 -2351
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, StateStoringConfig, RowKey, RowNode, GridColumnDef, DataGridCoreConfig, InferColumnsOptions, DescribeFilterOptions, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, SummaryDef, FilterNode,
|
|
4
|
-
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, DEFAULT_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GridColumnDef, GridDataType, GridEventMap, GridRowData, GridStateStore, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, RowDropPosition, RowKey, RowNode, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, lookupLabel, moveRowInArray, parseCsv, sniffDelimiter, summaryKey } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, StateStoringConfig, RowKey, RowNode, GridColumnDef, DataGridCoreConfig, InferColumnsOptions, GridTheme, GridPalette, DescribeFilterOptions, GridDensity, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, SummaryDef, FilterNode, ColumnState, BusyPhase, GridDictionary, DataRowNode, VirtualWindow, ChartSpec, ChartModel } from '@kanunilabs/datagrid-core';
|
|
4
|
+
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_PALETTES, GRID_THEMES, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridRowData, GridStateStore, GridTheme, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
7
7
|
type ExportKind = 'csv' | 'excel' | 'excel-selected' | 'pdf';
|
|
@@ -322,91 +322,7 @@ interface GridTooltipConfig {
|
|
|
322
322
|
type ReactColumnRuntime<TRow = GridRowData> = Omit<ColumnRuntime<TRow>, 'def'> & {
|
|
323
323
|
def: ReactGridColumnDef<TRow>;
|
|
324
324
|
};
|
|
325
|
-
|
|
326
|
-
type GridDensity = 'compact' | 'normal' | 'comfortable';
|
|
327
|
-
/** Row height each density resolves to — the value the virtualizer runs on. */
|
|
328
|
-
declare const DENSITY_ROW_HEIGHT: Record<GridDensity, number>;
|
|
329
|
-
/**
|
|
330
|
-
* A packaged look. Purely visual: no theme changes what the grid does, which
|
|
331
|
-
* columns it shows, or how any of it behaves.
|
|
332
|
-
*
|
|
333
|
-
* The palettes, metrics and line work live in DataGridThemes.css and are ours
|
|
334
|
-
* — nothing is imported or copied from a third-party grid's stylesheet. The
|
|
335
|
-
* names are the shared vocabulary for a grid's chrome and density, in the same
|
|
336
|
-
* way a typeface is described as "grotesque".
|
|
337
|
-
*/
|
|
338
|
-
type GridTheme =
|
|
339
|
-
/** Minimal chrome: no column rules, hairline rows, roomy radii. */
|
|
340
|
-
'quartz'
|
|
341
|
-
/** Dense and fully ruled — small type, tight padding, square corners. */
|
|
342
|
-
| 'balham'
|
|
343
|
-
/** Tall rhythm, rows-only rules, medium-weight tracked header, real elevation. */
|
|
344
|
-
| 'material'
|
|
345
|
-
/** Airy but fully framed, with a doubled rule anchoring the header band. */
|
|
346
|
-
| 'alpine'
|
|
347
|
-
/** KanuniLabs house theme: ink header, brand gold accent, warm near-white body. */
|
|
348
|
-
| 'kanuni'
|
|
349
|
-
/** The house theme in dark. Applies without `dark`. */
|
|
350
|
-
| 'kanuni-midnight';
|
|
351
|
-
/** Every packaged theme, in the order the docs and the playground list them. */
|
|
352
|
-
declare const GRID_THEMES: readonly GridTheme[];
|
|
353
|
-
/**
|
|
354
|
-
* Row height per theme and density.
|
|
355
|
-
*
|
|
356
|
-
* This table exists in JS and not in CSS for the same reason `DENSITY_ROW_HEIGHT`
|
|
357
|
-
* does: the row height is a CORE value — the virtualizer computes every row
|
|
358
|
-
* offset and the scroll extent from it — so it has to reach the engine as a
|
|
359
|
-
* number. Everything else a theme changes about the rhythm (header height, cell
|
|
360
|
-
* padding, type scale, control sizes) is CSS's, and lives only there, so the
|
|
361
|
-
* two can never hold different opinions about the same measurement.
|
|
362
|
-
*
|
|
363
|
-
* Keep in sync with the `--dg-header-height` values in DataGridThemes.css.
|
|
364
|
-
*/
|
|
365
|
-
declare const THEME_ROW_HEIGHT: Record<GridTheme, Record<GridDensity, number>>;
|
|
366
|
-
/**
|
|
367
|
-
* A colour scheme, independent of the theme.
|
|
368
|
-
*
|
|
369
|
-
* The theme decides the STRUCTURE — where the rules are drawn, how tall a row
|
|
370
|
-
* is, how round a control is, how much a popup lifts. A palette decides only
|
|
371
|
-
* the colours. They compose: `theme="balham" palette="nord"` is Balham's dense
|
|
372
|
-
* ruled grid in Nord's arctic blues; `theme="material" palette="nord"` is
|
|
373
|
-
* Material's tall airy one in the same blues.
|
|
374
|
-
*
|
|
375
|
-
* Each ships a light and a dark set, so `dark` keeps working across all of
|
|
376
|
-
* them. Every one clears WCAG AA on the surfaces that carry text — measured,
|
|
377
|
-
* and pinned by a test.
|
|
378
|
-
*
|
|
379
|
-
* The names are the colour schemes people already know from their editors. The
|
|
380
|
-
* hues are theirs; the mapping onto the grid's tokens, and the contrast work
|
|
381
|
-
* that mapping needs, are ours. No third-party stylesheet is involved.
|
|
382
|
-
*/
|
|
383
|
-
type GridPalette =
|
|
384
|
-
/** Arctic, desaturated blue-grey. The calmest of the six. */
|
|
385
|
-
'nord'
|
|
386
|
-
/** Near-black violet with high-chroma purple and pink. */
|
|
387
|
-
| 'dracula'
|
|
388
|
-
/** The fixed-lightness classic, designed as a matched light/dark pair. */
|
|
389
|
-
| 'solarized'
|
|
390
|
-
/** Warm retro, high contrast — the only genuinely warm light mode here. */
|
|
391
|
-
| 'gruvbox'
|
|
392
|
-
/** Pastel, with very close surface tones. Easy for a long reading session. */
|
|
393
|
-
| 'catppuccin'
|
|
394
|
-
/** Deep navy with violet and cyan; the most saturated dark. */
|
|
395
|
-
| 'tokyo-night';
|
|
396
|
-
/** Every packaged palette, in the order the docs and the playground list them. */
|
|
397
|
-
declare const GRID_PALETTES: readonly GridPalette[];
|
|
398
|
-
/**
|
|
399
|
-
* The modifier classes a theme contributes, as one string.
|
|
400
|
-
*
|
|
401
|
-
* Composed ONCE per grid and handed to the popup surfaces that render outside
|
|
402
|
-
* the grid's DOM (portals, dialogs, the row editor). Those cannot inherit the
|
|
403
|
-
* class through the cascade, and the tokens are declared on the theme class —
|
|
404
|
-
* so without this they render in the packaged palette while the grid behind
|
|
405
|
-
* them is in another one. It is the same reason `dark` is forwarded explicitly.
|
|
406
|
-
*
|
|
407
|
-
* A plain string, deliberately: nothing here is per-row or per-cell work.
|
|
408
|
-
*/
|
|
409
|
-
declare function themeClassName(theme?: GridTheme, density?: GridDensity, palette?: GridPalette): string;
|
|
325
|
+
|
|
410
326
|
interface GridMenuItem<TContext = unknown> {
|
|
411
327
|
/** Stable key; falls back to the index when omitted. */
|
|
412
328
|
id?: string;
|
|
@@ -1148,22 +1064,7 @@ interface GridFilterRowProps<TRow = GridRowData> {
|
|
|
1148
1064
|
*/
|
|
1149
1065
|
onCommit?: (columnId: string, raw: string) => void;
|
|
1150
1066
|
}
|
|
1151
|
-
|
|
1152
|
-
* Translate a raw input string into a filter node for one column.
|
|
1153
|
-
* Exported because it is pure and worth testing without a DOM.
|
|
1154
|
-
*/
|
|
1155
|
-
declare function parseFilterInput(columnId: string, raw: string, dataType: GridDataType | undefined): FilterNode | null;
|
|
1156
|
-
/**
|
|
1157
|
-
* The text that would produce `node` if it were typed into this column's box,
|
|
1158
|
-
* or null when no text would.
|
|
1159
|
-
*
|
|
1160
|
-
* Used to show a restored filter in the box that owns it. The candidate is
|
|
1161
|
-
* checked by parsing it back rather than trusted: a `contains` whose value
|
|
1162
|
-
* happens to start with `>=` would parse as an operator and quietly become a
|
|
1163
|
-
* different filter, and a box whose text does not mean what the grid is
|
|
1164
|
-
* filtering by is worse than an empty one.
|
|
1165
|
-
*/
|
|
1166
|
-
declare function filterInputFromNode(columnId: string, node: FilterNode | null, dataType: GridDataType | undefined): string | null;
|
|
1067
|
+
|
|
1167
1068
|
/** What the reconciler needs to know about one column. Kept tiny so it is testable. */
|
|
1168
1069
|
interface FilterInputSyncProbe {
|
|
1169
1070
|
/** The text is still on its way to the controller behind a debounce. */
|
|
@@ -1351,28 +1252,6 @@ interface GridFilterPanelProps<TRow = GridRowData> {
|
|
|
1351
1252
|
declare function GridFilterPanelImpl<TRow = GridRowData>({ controller, onOpenBuilder, alwaysVisible, describeOptions, labels, }: GridFilterPanelProps<TRow>): react.JSX.Element | null;
|
|
1352
1253
|
declare const GridFilterPanel: typeof GridFilterPanelImpl;
|
|
1353
1254
|
|
|
1354
|
-
/** English captions, kept as the exported constant this package already had. */
|
|
1355
|
-
declare const SUMMARY_TYPE_LABEL: Record<SummaryType, string>;
|
|
1356
|
-
/** The same map in the grid's own language. */
|
|
1357
|
-
declare function summaryTypeLabels(t: GridDictionary): Record<SummaryType, string>;
|
|
1358
|
-
/**
|
|
1359
|
-
* What the footer prints beside the value. A custom reducer's own `label` wins
|
|
1360
|
-
* — "Custom" beside a number tells the reader nothing about what it measures.
|
|
1361
|
-
*
|
|
1362
|
-
* `labels` is the resolved dictionary's map; omitted, it falls back to English
|
|
1363
|
-
* so the helper stays usable outside a grid (it is exported).
|
|
1364
|
-
*/
|
|
1365
|
-
declare function summaryLabel<TRow = unknown>(def: SummaryDef<TRow>, labels?: Record<SummaryType, string>): string;
|
|
1366
|
-
declare function formatSummaryValue<TRow>(def: SummaryDef<TRow>, value: number | null | undefined, column: GridColumnDef<TRow> | undefined): string;
|
|
1367
|
-
/**
|
|
1368
|
-
* Aggregations that make sense for a column's data type.
|
|
1369
|
-
*
|
|
1370
|
-
* `sum`/`avg` over text would coerce every cell through `Number()` and total a
|
|
1371
|
-
* column of names as 0 — a number that looks authoritative and means nothing.
|
|
1372
|
-
* min/max stay available for dates because ordering is defined there.
|
|
1373
|
-
*/
|
|
1374
|
-
declare function allowedSummaryTypes(dataType: GridColumnDef['dataType']): readonly SummaryType[];
|
|
1375
|
-
|
|
1376
1255
|
interface GridToolbarProps<TRow = GridRowData> {
|
|
1377
1256
|
controller: DataGridController<TRow>;
|
|
1378
1257
|
search?: boolean;
|
|
@@ -1749,13 +1628,5 @@ interface GridTextProviderProps {
|
|
|
1749
1628
|
declare function GridTextProvider({ locale, messages, children }: GridTextProviderProps): react.JSX.Element;
|
|
1750
1629
|
/** The resolved dictionary. Stable between language changes. */
|
|
1751
1630
|
declare function useGridText(): GridDictionary;
|
|
1752
|
-
/**
|
|
1753
|
-
* Substitute `{name}` placeholders.
|
|
1754
|
-
*
|
|
1755
|
-
* Deliberately not a template engine: the dictionary's placeholders are a fixed
|
|
1756
|
-
* contract checked by `locales.test.ts`, so anything cleverer would be a
|
|
1757
|
-
* feature nobody asked for on a hot path.
|
|
1758
|
-
*/
|
|
1759
|
-
declare function fillText(template: string, values: Record<string, string | number>): string;
|
|
1760
1631
|
|
|
1761
|
-
export { type AlignedGridsApi, BAND_ROW_HEIGHT, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_HEADER_MENU_LABELS,
|
|
1632
|
+
export { type AlignedGridsApi, BAND_ROW_HEIGHT, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditorRenderContext, type ExportOutcome, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, type GridRowProps, GridSummaryBar, type GridSummaryBarProps, GridSurfaceProvider, type GridSurfaceProviderProps, GridTextProvider, type GridTextProviderProps, GridToolbar, type GridToolbarProps, GridTooltip, type GridTooltipConfig, type GridTooltipProps, type HeaderMenuContext, type HeaderMenuDeps, type HeaderMenuLabels, type HeaderRenderContext, type NoteCellContext, PRINT_MAX_ROWS, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type TooltipState, type UseDataGridOptions, type UseDataGridResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, headerMenuLabels, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useGridChartData, useGridSurfaceClass, useGridText, usePrintLayout, useRowDrag, useStateStoring, writeClipboardText };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, StateStoringConfig, RowKey, RowNode, GridColumnDef, DataGridCoreConfig, InferColumnsOptions, DescribeFilterOptions, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, SummaryDef, FilterNode,
|
|
4
|
-
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, DEFAULT_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GridColumnDef, GridDataType, GridEventMap, GridRowData, GridStateStore, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, RowDropPosition, RowKey, RowNode, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, lookupLabel, moveRowInArray, parseCsv, sniffDelimiter, summaryKey } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, StateStoringConfig, RowKey, RowNode, GridColumnDef, DataGridCoreConfig, InferColumnsOptions, GridTheme, GridPalette, DescribeFilterOptions, GridDensity, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, SummaryDef, FilterNode, ColumnState, BusyPhase, GridDictionary, DataRowNode, VirtualWindow, ChartSpec, ChartModel } from '@kanunilabs/datagrid-core';
|
|
4
|
+
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_PALETTES, GRID_THEMES, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridRowData, GridStateStore, GridTheme, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
7
7
|
type ExportKind = 'csv' | 'excel' | 'excel-selected' | 'pdf';
|
|
@@ -322,91 +322,7 @@ interface GridTooltipConfig {
|
|
|
322
322
|
type ReactColumnRuntime<TRow = GridRowData> = Omit<ColumnRuntime<TRow>, 'def'> & {
|
|
323
323
|
def: ReactGridColumnDef<TRow>;
|
|
324
324
|
};
|
|
325
|
-
|
|
326
|
-
type GridDensity = 'compact' | 'normal' | 'comfortable';
|
|
327
|
-
/** Row height each density resolves to — the value the virtualizer runs on. */
|
|
328
|
-
declare const DENSITY_ROW_HEIGHT: Record<GridDensity, number>;
|
|
329
|
-
/**
|
|
330
|
-
* A packaged look. Purely visual: no theme changes what the grid does, which
|
|
331
|
-
* columns it shows, or how any of it behaves.
|
|
332
|
-
*
|
|
333
|
-
* The palettes, metrics and line work live in DataGridThemes.css and are ours
|
|
334
|
-
* — nothing is imported or copied from a third-party grid's stylesheet. The
|
|
335
|
-
* names are the shared vocabulary for a grid's chrome and density, in the same
|
|
336
|
-
* way a typeface is described as "grotesque".
|
|
337
|
-
*/
|
|
338
|
-
type GridTheme =
|
|
339
|
-
/** Minimal chrome: no column rules, hairline rows, roomy radii. */
|
|
340
|
-
'quartz'
|
|
341
|
-
/** Dense and fully ruled — small type, tight padding, square corners. */
|
|
342
|
-
| 'balham'
|
|
343
|
-
/** Tall rhythm, rows-only rules, medium-weight tracked header, real elevation. */
|
|
344
|
-
| 'material'
|
|
345
|
-
/** Airy but fully framed, with a doubled rule anchoring the header band. */
|
|
346
|
-
| 'alpine'
|
|
347
|
-
/** KanuniLabs house theme: ink header, brand gold accent, warm near-white body. */
|
|
348
|
-
| 'kanuni'
|
|
349
|
-
/** The house theme in dark. Applies without `dark`. */
|
|
350
|
-
| 'kanuni-midnight';
|
|
351
|
-
/** Every packaged theme, in the order the docs and the playground list them. */
|
|
352
|
-
declare const GRID_THEMES: readonly GridTheme[];
|
|
353
|
-
/**
|
|
354
|
-
* Row height per theme and density.
|
|
355
|
-
*
|
|
356
|
-
* This table exists in JS and not in CSS for the same reason `DENSITY_ROW_HEIGHT`
|
|
357
|
-
* does: the row height is a CORE value — the virtualizer computes every row
|
|
358
|
-
* offset and the scroll extent from it — so it has to reach the engine as a
|
|
359
|
-
* number. Everything else a theme changes about the rhythm (header height, cell
|
|
360
|
-
* padding, type scale, control sizes) is CSS's, and lives only there, so the
|
|
361
|
-
* two can never hold different opinions about the same measurement.
|
|
362
|
-
*
|
|
363
|
-
* Keep in sync with the `--dg-header-height` values in DataGridThemes.css.
|
|
364
|
-
*/
|
|
365
|
-
declare const THEME_ROW_HEIGHT: Record<GridTheme, Record<GridDensity, number>>;
|
|
366
|
-
/**
|
|
367
|
-
* A colour scheme, independent of the theme.
|
|
368
|
-
*
|
|
369
|
-
* The theme decides the STRUCTURE — where the rules are drawn, how tall a row
|
|
370
|
-
* is, how round a control is, how much a popup lifts. A palette decides only
|
|
371
|
-
* the colours. They compose: `theme="balham" palette="nord"` is Balham's dense
|
|
372
|
-
* ruled grid in Nord's arctic blues; `theme="material" palette="nord"` is
|
|
373
|
-
* Material's tall airy one in the same blues.
|
|
374
|
-
*
|
|
375
|
-
* Each ships a light and a dark set, so `dark` keeps working across all of
|
|
376
|
-
* them. Every one clears WCAG AA on the surfaces that carry text — measured,
|
|
377
|
-
* and pinned by a test.
|
|
378
|
-
*
|
|
379
|
-
* The names are the colour schemes people already know from their editors. The
|
|
380
|
-
* hues are theirs; the mapping onto the grid's tokens, and the contrast work
|
|
381
|
-
* that mapping needs, are ours. No third-party stylesheet is involved.
|
|
382
|
-
*/
|
|
383
|
-
type GridPalette =
|
|
384
|
-
/** Arctic, desaturated blue-grey. The calmest of the six. */
|
|
385
|
-
'nord'
|
|
386
|
-
/** Near-black violet with high-chroma purple and pink. */
|
|
387
|
-
| 'dracula'
|
|
388
|
-
/** The fixed-lightness classic, designed as a matched light/dark pair. */
|
|
389
|
-
| 'solarized'
|
|
390
|
-
/** Warm retro, high contrast — the only genuinely warm light mode here. */
|
|
391
|
-
| 'gruvbox'
|
|
392
|
-
/** Pastel, with very close surface tones. Easy for a long reading session. */
|
|
393
|
-
| 'catppuccin'
|
|
394
|
-
/** Deep navy with violet and cyan; the most saturated dark. */
|
|
395
|
-
| 'tokyo-night';
|
|
396
|
-
/** Every packaged palette, in the order the docs and the playground list them. */
|
|
397
|
-
declare const GRID_PALETTES: readonly GridPalette[];
|
|
398
|
-
/**
|
|
399
|
-
* The modifier classes a theme contributes, as one string.
|
|
400
|
-
*
|
|
401
|
-
* Composed ONCE per grid and handed to the popup surfaces that render outside
|
|
402
|
-
* the grid's DOM (portals, dialogs, the row editor). Those cannot inherit the
|
|
403
|
-
* class through the cascade, and the tokens are declared on the theme class —
|
|
404
|
-
* so without this they render in the packaged palette while the grid behind
|
|
405
|
-
* them is in another one. It is the same reason `dark` is forwarded explicitly.
|
|
406
|
-
*
|
|
407
|
-
* A plain string, deliberately: nothing here is per-row or per-cell work.
|
|
408
|
-
*/
|
|
409
|
-
declare function themeClassName(theme?: GridTheme, density?: GridDensity, palette?: GridPalette): string;
|
|
325
|
+
|
|
410
326
|
interface GridMenuItem<TContext = unknown> {
|
|
411
327
|
/** Stable key; falls back to the index when omitted. */
|
|
412
328
|
id?: string;
|
|
@@ -1148,22 +1064,7 @@ interface GridFilterRowProps<TRow = GridRowData> {
|
|
|
1148
1064
|
*/
|
|
1149
1065
|
onCommit?: (columnId: string, raw: string) => void;
|
|
1150
1066
|
}
|
|
1151
|
-
|
|
1152
|
-
* Translate a raw input string into a filter node for one column.
|
|
1153
|
-
* Exported because it is pure and worth testing without a DOM.
|
|
1154
|
-
*/
|
|
1155
|
-
declare function parseFilterInput(columnId: string, raw: string, dataType: GridDataType | undefined): FilterNode | null;
|
|
1156
|
-
/**
|
|
1157
|
-
* The text that would produce `node` if it were typed into this column's box,
|
|
1158
|
-
* or null when no text would.
|
|
1159
|
-
*
|
|
1160
|
-
* Used to show a restored filter in the box that owns it. The candidate is
|
|
1161
|
-
* checked by parsing it back rather than trusted: a `contains` whose value
|
|
1162
|
-
* happens to start with `>=` would parse as an operator and quietly become a
|
|
1163
|
-
* different filter, and a box whose text does not mean what the grid is
|
|
1164
|
-
* filtering by is worse than an empty one.
|
|
1165
|
-
*/
|
|
1166
|
-
declare function filterInputFromNode(columnId: string, node: FilterNode | null, dataType: GridDataType | undefined): string | null;
|
|
1067
|
+
|
|
1167
1068
|
/** What the reconciler needs to know about one column. Kept tiny so it is testable. */
|
|
1168
1069
|
interface FilterInputSyncProbe {
|
|
1169
1070
|
/** The text is still on its way to the controller behind a debounce. */
|
|
@@ -1351,28 +1252,6 @@ interface GridFilterPanelProps<TRow = GridRowData> {
|
|
|
1351
1252
|
declare function GridFilterPanelImpl<TRow = GridRowData>({ controller, onOpenBuilder, alwaysVisible, describeOptions, labels, }: GridFilterPanelProps<TRow>): react.JSX.Element | null;
|
|
1352
1253
|
declare const GridFilterPanel: typeof GridFilterPanelImpl;
|
|
1353
1254
|
|
|
1354
|
-
/** English captions, kept as the exported constant this package already had. */
|
|
1355
|
-
declare const SUMMARY_TYPE_LABEL: Record<SummaryType, string>;
|
|
1356
|
-
/** The same map in the grid's own language. */
|
|
1357
|
-
declare function summaryTypeLabels(t: GridDictionary): Record<SummaryType, string>;
|
|
1358
|
-
/**
|
|
1359
|
-
* What the footer prints beside the value. A custom reducer's own `label` wins
|
|
1360
|
-
* — "Custom" beside a number tells the reader nothing about what it measures.
|
|
1361
|
-
*
|
|
1362
|
-
* `labels` is the resolved dictionary's map; omitted, it falls back to English
|
|
1363
|
-
* so the helper stays usable outside a grid (it is exported).
|
|
1364
|
-
*/
|
|
1365
|
-
declare function summaryLabel<TRow = unknown>(def: SummaryDef<TRow>, labels?: Record<SummaryType, string>): string;
|
|
1366
|
-
declare function formatSummaryValue<TRow>(def: SummaryDef<TRow>, value: number | null | undefined, column: GridColumnDef<TRow> | undefined): string;
|
|
1367
|
-
/**
|
|
1368
|
-
* Aggregations that make sense for a column's data type.
|
|
1369
|
-
*
|
|
1370
|
-
* `sum`/`avg` over text would coerce every cell through `Number()` and total a
|
|
1371
|
-
* column of names as 0 — a number that looks authoritative and means nothing.
|
|
1372
|
-
* min/max stay available for dates because ordering is defined there.
|
|
1373
|
-
*/
|
|
1374
|
-
declare function allowedSummaryTypes(dataType: GridColumnDef['dataType']): readonly SummaryType[];
|
|
1375
|
-
|
|
1376
1255
|
interface GridToolbarProps<TRow = GridRowData> {
|
|
1377
1256
|
controller: DataGridController<TRow>;
|
|
1378
1257
|
search?: boolean;
|
|
@@ -1749,13 +1628,5 @@ interface GridTextProviderProps {
|
|
|
1749
1628
|
declare function GridTextProvider({ locale, messages, children }: GridTextProviderProps): react.JSX.Element;
|
|
1750
1629
|
/** The resolved dictionary. Stable between language changes. */
|
|
1751
1630
|
declare function useGridText(): GridDictionary;
|
|
1752
|
-
/**
|
|
1753
|
-
* Substitute `{name}` placeholders.
|
|
1754
|
-
*
|
|
1755
|
-
* Deliberately not a template engine: the dictionary's placeholders are a fixed
|
|
1756
|
-
* contract checked by `locales.test.ts`, so anything cleverer would be a
|
|
1757
|
-
* feature nobody asked for on a hot path.
|
|
1758
|
-
*/
|
|
1759
|
-
declare function fillText(template: string, values: Record<string, string | number>): string;
|
|
1760
1631
|
|
|
1761
|
-
export { type AlignedGridsApi, BAND_ROW_HEIGHT, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_HEADER_MENU_LABELS,
|
|
1632
|
+
export { type AlignedGridsApi, BAND_ROW_HEIGHT, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditorRenderContext, type ExportOutcome, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, type GridRowProps, GridSummaryBar, type GridSummaryBarProps, GridSurfaceProvider, type GridSurfaceProviderProps, GridTextProvider, type GridTextProviderProps, GridToolbar, type GridToolbarProps, GridTooltip, type GridTooltipConfig, type GridTooltipProps, type HeaderMenuContext, type HeaderMenuDeps, type HeaderMenuLabels, type HeaderRenderContext, type NoteCellContext, PRINT_MAX_ROWS, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type TooltipState, type UseDataGridOptions, type UseDataGridResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, headerMenuLabels, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useGridChartData, useGridSurfaceClass, useGridText, usePrintLayout, useRowDrag, useStateStoring, writeClipboardText };
|