@kanunilabs/datagrid-react 1.8.11 → 1.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +57 -10
- package/dist/index.d.ts +57 -10
- package/dist/index.js +3 -3
- package/dist/styles.css +220 -0
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { RefObject, ReactNode, FocusEvent, MouseEvent } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, DataRowNode, CardField, RowSaveStatus, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnLookup, ColumnModel, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, EditingApi, NewRowPosition, ValidationRule, CrudHandlers, EditingPermissions, CommitOn, RowEditSession, ColumnNumberFormat, LookupMatchMode,
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, DataRowNode, CardField, RowSaveStatus, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnLookup, ColumnModel, ColSpanPlan, LookupMatchFold, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, EditingApi, NewRowPosition, ValidationRule, CrudHandlers, EditingPermissions, CommitOn, RowEditSession, ColumnNumberFormat, LookupMatchMode, LookupListColumn } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ChangesChangedEvent, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, CommitOn, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, EditingApi, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_COLOR_SCHEMES, GRID_PALETTES, GRID_THEMES, GridColorScheme, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridPaletteName, GridRowData, GridStateStore, GridTheme, GridThemeName, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, PortalContainer, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, SaveRejected, SaveRowError, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ToolbarOptions, ToolbarSearchOptions, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, isPackagedTheme, isSaveRejected, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -427,8 +427,11 @@ interface EditorRowApi {
|
|
|
427
427
|
* **Escape** cancels the editor (`cancel()`), and **Tab / Shift+Tab** walk
|
|
428
428
|
* the focusable elements INSIDE the box (text box → "…" button) and only
|
|
429
429
|
* past the last (first) one commit and move to the next (previous) cell —
|
|
430
|
-
* `commit({ move: 'next' })`. Enter
|
|
431
|
-
*
|
|
430
|
+
* `commit({ move: 'next' })`. **Enter** commits like the built-in editor
|
|
431
|
+
* (moves down, or stays with `editKeys.enter`; Shift+Enter stays) — except
|
|
432
|
+
* in a `<textarea>` or an editable region, where it types a new line. An
|
|
433
|
+
* editor that uses Enter itself (picking from its own list) calls
|
|
434
|
+
* `preventDefault()` in its handler. The
|
|
432
435
|
* editor's own shortcuts (F4, Alt+ArrowDown for its "…" button) are never
|
|
433
436
|
* taken by the grid.
|
|
434
437
|
* - Events from OUTSIDE the grid's DOM — a dialog the editor opens in a
|
|
@@ -451,8 +454,17 @@ interface EditorRowApi {
|
|
|
451
454
|
* to the scroller when the editor has closed.
|
|
452
455
|
*/
|
|
453
456
|
interface EditorRenderContext<TRow = GridRowData> {
|
|
454
|
-
/**
|
|
457
|
+
/**
|
|
458
|
+
* Current (uncommitted) editor value — what the built-in editor would show:
|
|
459
|
+
* the column's `valueGetter` result when it has one.
|
|
460
|
+
*/
|
|
455
461
|
value: unknown;
|
|
462
|
+
/**
|
|
463
|
+
* The column's `field` as stored in the row (pending edits applied), before
|
|
464
|
+
* any `valueGetter` — the bit set behind a "E;D;S" summary, say. Undefined
|
|
465
|
+
* when the column has no `field`.
|
|
466
|
+
*/
|
|
467
|
+
rawValue: unknown;
|
|
456
468
|
/** The row with pending edits applied — what a cascading list should read. */
|
|
457
469
|
row: TRow;
|
|
458
470
|
columnId: string;
|
|
@@ -1200,6 +1212,14 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
1200
1212
|
* the totals are the headline; the rows below are then the evidence for it.
|
|
1201
1213
|
*/
|
|
1202
1214
|
footerPosition?: 'top' | 'bottom';
|
|
1215
|
+
/**
|
|
1216
|
+
* Keep the bottom totals row on the grid's bottom edge when there are too few
|
|
1217
|
+
* rows to reach it (Tekax B.3), as a desktop data grid does. Default false:
|
|
1218
|
+
* the row follows the last data row and sticks to the edge only once the rows
|
|
1219
|
+
* scroll. Rows pinned to the bottom (`pinnedBottomRows`) move down with it.
|
|
1220
|
+
* No effect with `footerPosition: 'top'`.
|
|
1221
|
+
*/
|
|
1222
|
+
pinFooterToBottom?: boolean;
|
|
1203
1223
|
/**
|
|
1204
1224
|
* What to do with the column widths once the grid knows how much room it has
|
|
1205
1225
|
* (gap analysis P2.5). Default `'none'` — the configured widths are used as
|
|
@@ -1739,6 +1759,8 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1739
1759
|
* when it does not, they do not.
|
|
1740
1760
|
*/
|
|
1741
1761
|
searchNeedle?: string;
|
|
1762
|
+
/** The grid's `searchFold`: how `searchNeedle` was folded, and so the cell text. */
|
|
1763
|
+
searchFold?: LookupMatchFold;
|
|
1742
1764
|
/**
|
|
1743
1765
|
* The grid's cache of FUNCTION lookup lists (P-5.1): a closed cell shows the
|
|
1744
1766
|
* label, not the raw code. One stable object per grid; when a list arrives
|
|
@@ -1778,7 +1800,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1778
1800
|
onCellPointerEnter?: (ctx: CellSlotContext<TRow>, event: React.MouseEvent) => void;
|
|
1779
1801
|
onCellDoubleClick?: (ctx: CellSlotContext<TRow>) => void;
|
|
1780
1802
|
}
|
|
1781
|
-
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, statusColumn, rowNumberColumn, rowNumber, getNote, getSpan, resolveColSpans, findKind, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, lookupLabels, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderRowMessage, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, rowStatus, rowStatusText, rowStatusTint, rowStatusStrike, rowClass, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1803
|
+
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, statusColumn, rowNumberColumn, rowNumber, getNote, getSpan, resolveColSpans, findKind, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, searchFold, lookupLabels, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderRowMessage, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, rowStatus, rowStatusText, rowStatusTint, rowStatusStrike, rowClass, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1782
1804
|
declare const GridRow: typeof GridRowImpl;
|
|
1783
1805
|
|
|
1784
1806
|
interface GridFilterRowProps<TRow = GridRowData> {
|
|
@@ -2738,11 +2760,12 @@ interface UseGridEditingResult<TRow = GridRowData> {
|
|
|
2738
2760
|
/**
|
|
2739
2761
|
* A custom editor's commit (`renderEditor`'s `ctx.commit`, P-4.2): `'none'`
|
|
2740
2762
|
* stays on the cell, `'down'` moves down (whatever `editKeys.enter` says —
|
|
2741
|
-
* the editor asked), `'
|
|
2763
|
+
* the editor asked), `'enter'` is the grid's own Enter (down unless
|
|
2764
|
+
* `editKeys.enter`), `'next'` / `'previous'` walk to the adjacent editable
|
|
2742
2765
|
* cell like Tab, `'blur'` leaves focus where it is. False when a rule
|
|
2743
2766
|
* refused the value.
|
|
2744
2767
|
*/
|
|
2745
|
-
commitCustomEditor: (move: 'down' | 'next' | 'previous' | 'none' | 'blur') => boolean;
|
|
2768
|
+
commitCustomEditor: (move: 'down' | 'enter' | 'next' | 'previous' | 'none' | 'blur') => boolean;
|
|
2746
2769
|
/**
|
|
2747
2770
|
* `ctx.suspendBlurCommit` (P-4.1): while on, blur is not leaving the editor
|
|
2748
2771
|
* (`ctx.commitOnBlur`, the `commitOn: 'row'` send). Turning it off puts focus
|
|
@@ -2985,6 +3008,12 @@ interface GridLookupEditorProps {
|
|
|
2985
3008
|
* highlighted item; no match picks nothing. Ignored with `allowCustom`.
|
|
2986
3009
|
*/
|
|
2987
3010
|
typeAhead?: boolean;
|
|
3011
|
+
/** A grip on the open list's corner to resize it (`lookup.listResizable`, B.4.3). */
|
|
3012
|
+
listResizable?: boolean;
|
|
3013
|
+
/** The list as a table with a header row (`lookup.listColumns`, B.4.2). */
|
|
3014
|
+
listColumns?: readonly LookupListColumn[];
|
|
3015
|
+
/** A ▾ button that opens and closes the list (`lookup.dropButton`, B.4.2). */
|
|
3016
|
+
dropButton?: boolean;
|
|
2988
3017
|
/**
|
|
2989
3018
|
* Complete typed text to the one item left / an exact label on leaving.
|
|
2990
3019
|
* Default true. False: the "pick from the list" rule (K-3, see the top).
|
|
@@ -3003,6 +3032,8 @@ interface GridLookupEditorProps {
|
|
|
3003
3032
|
*/
|
|
3004
3033
|
onPick?: (item: LookupItem) => boolean;
|
|
3005
3034
|
invalid?: boolean;
|
|
3035
|
+
/** A read-only field (`LookupBox`): the box and its buttons do nothing. */
|
|
3036
|
+
disabled?: boolean;
|
|
3006
3037
|
/**
|
|
3007
3038
|
* Take focus on mount. True for a cell editor — it opened BECAUSE the user
|
|
3008
3039
|
* asked to edit that one cell. False in `row` mode, where every editable cell
|
|
@@ -3032,6 +3063,16 @@ interface GridLookupEditorProps {
|
|
|
3032
3063
|
* settles the typed text, as before.
|
|
3033
3064
|
*/
|
|
3034
3065
|
onBlurCommit?: () => void;
|
|
3066
|
+
/**
|
|
3067
|
+
* `lookup.onPickerOpen` (Tekax B.4.1), bound to the row: a "…" button and
|
|
3068
|
+
* Ctrl+Enter open the app's picker; its item is picked like a list item.
|
|
3069
|
+
*/
|
|
3070
|
+
onPickerOpen?: (text: string) => Promise<LookupItem | null> | LookupItem | null;
|
|
3071
|
+
/**
|
|
3072
|
+
* The grid's `suspendBlurCommit` (P-4.1): held while the picker is open, so
|
|
3073
|
+
* focus going to the app's dialog neither commits the cell nor sends the row.
|
|
3074
|
+
*/
|
|
3075
|
+
suspendBlurCommit?: (on: boolean, restoreTo?: () => HTMLElement | null) => void;
|
|
3035
3076
|
}
|
|
3036
3077
|
/**
|
|
3037
3078
|
* The same match, as items. Kept for callers and tests that want the simple
|
|
@@ -3039,7 +3080,7 @@ interface GridLookupEditorProps {
|
|
|
3039
3080
|
*/
|
|
3040
3081
|
declare function matchOptions(options: readonly LookupItem[], query: string, mode: LookupMatchMode): readonly LookupItem[];
|
|
3041
3082
|
/** The editor's settings that come straight from a column's `lookup`. */
|
|
3042
|
-
type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput' | 'typeAhead'>;
|
|
3083
|
+
type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput' | 'typeAhead' | 'listResizable' | 'listColumns' | 'dropButton'>;
|
|
3043
3084
|
/** `lookup` → the editor's props, one reading for the cell, row and form editors. */
|
|
3044
3085
|
declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined): LookupEditorSettings;
|
|
3045
3086
|
/**
|
|
@@ -3048,10 +3089,16 @@ declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined):
|
|
|
3048
3089
|
* neither — a plain pick, one cell, as before.
|
|
3049
3090
|
*/
|
|
3050
3091
|
declare function lookupPickValues(lookup: ColumnLookup<never> | undefined, columnId: string, item: LookupItem): Record<string, unknown> | null;
|
|
3051
|
-
declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, typeAhead, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
|
|
3092
|
+
declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, typeAhead, listResizable, listColumns, dropButton, autoCompleteSingle, onNoMatch, onPick, invalid, disabled, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, onPickerOpen, suspendBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
|
|
3052
3093
|
|
|
3053
3094
|
interface GridCellEditorProps {
|
|
3054
3095
|
value: unknown;
|
|
3096
|
+
/** The column's lookup when it is `multiple` (Tekax B.6): the check-box editor. */
|
|
3097
|
+
multipleLookup?: ColumnLookup<never>;
|
|
3098
|
+
/** `lookup.onPickerOpen`, bound to this cell (Tekax B.4.1). */
|
|
3099
|
+
onPickerOpen?: GridLookupEditorProps['onPickerOpen'];
|
|
3100
|
+
/** The grid's `suspendBlurCommit`, held while that picker is open. */
|
|
3101
|
+
suspendBlurCommit?: GridLookupEditorProps['suspendBlurCommit'];
|
|
3055
3102
|
dataType: GridDataType | undefined;
|
|
3056
3103
|
/**
|
|
3057
3104
|
* Choices for a lookup/select editor. `null` means the list is still being
|
|
@@ -3106,7 +3153,7 @@ interface GridCellEditorProps {
|
|
|
3106
3153
|
onTab: (direction: 1 | -1) => void;
|
|
3107
3154
|
onCancel: () => void;
|
|
3108
3155
|
}
|
|
3109
|
-
declare function GridCellEditor({ value, dataType, error, seeded, seedText, options, allowCustom, matchMode, lookupSettings, onPick, ariaLabel, dateFormat, numberFormat, numberLocale, onChange, onCommit, onTab, onCancel, }: GridCellEditorProps): react.JSX.Element;
|
|
3156
|
+
declare function GridCellEditor({ value, dataType, error, seeded, seedText, options, allowCustom, matchMode, lookupSettings, onPick, multipleLookup, onPickerOpen, suspendBlurCommit, ariaLabel, dateFormat, numberFormat, numberLocale, onChange, onCommit, onTab, onCancel, }: GridCellEditorProps): react.JSX.Element;
|
|
3110
3157
|
|
|
3111
3158
|
interface GridDateEditorProps {
|
|
3112
3159
|
value: unknown;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { RefObject, ReactNode, FocusEvent, MouseEvent } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, DataRowNode, CardField, RowSaveStatus, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnLookup, ColumnModel, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, EditingApi, NewRowPosition, ValidationRule, CrudHandlers, EditingPermissions, CommitOn, RowEditSession, ColumnNumberFormat, LookupMatchMode,
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, DataRowNode, CardField, RowSaveStatus, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnLookup, ColumnModel, ColSpanPlan, LookupMatchFold, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, EditingApi, NewRowPosition, ValidationRule, CrudHandlers, EditingPermissions, CommitOn, RowEditSession, ColumnNumberFormat, LookupMatchMode, LookupListColumn } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ChangesChangedEvent, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, CommitOn, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, EditingApi, FilterChangedEvent, FilterCondition, FilterGroupNode, FilterNode, FilterOperator, FocusedRowChangedEvent, GRID_COLOR_SCHEMES, GRID_PALETTES, GRID_THEMES, GridColorScheme, GridColumnDef, GridDataType, GridDensity, GridEventMap, GridPalette, GridPaletteName, GridRowData, GridStateStore, GridTheme, GridThemeName, GridViewState, GroupRowNode, GroupingConfig, HeaderBandCell, InferColumnsOptions, LoadOptions, LoadResult, LookupItem, NewRowPosition, PortalContainer, RowDropPosition, RowKey, RowNode, SUMMARY_TYPE_LABEL, SaveRejected, SaveRowError, ScrollingConfig, SelectionDescriptor, SortChangedEvent, SortDescriptor, SortDirection, StateStoringConfig, SummaryDef, SummaryType, THEME_ROW_HEIGHT, ToolbarOptions, ToolbarSearchOptions, ViewportChangedEvent, VirtualWindow, VirtualWindowEngine, allowedSummaryTypes, andFilters, attachStateStoring, bandDepth, bandPath, computeColumnLayout, computeHeaderBands, createRestDataSource, describeFilter, downloadBlob, fillText, filterInputFromNode, formatSummaryValue, humanizeField, importCsv, inferColumns, isDataRow, isDataSource, isFilterGroup, isGroupRow, isPackagedTheme, isSaveRejected, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -427,8 +427,11 @@ interface EditorRowApi {
|
|
|
427
427
|
* **Escape** cancels the editor (`cancel()`), and **Tab / Shift+Tab** walk
|
|
428
428
|
* the focusable elements INSIDE the box (text box → "…" button) and only
|
|
429
429
|
* past the last (first) one commit and move to the next (previous) cell —
|
|
430
|
-
* `commit({ move: 'next' })`. Enter
|
|
431
|
-
*
|
|
430
|
+
* `commit({ move: 'next' })`. **Enter** commits like the built-in editor
|
|
431
|
+
* (moves down, or stays with `editKeys.enter`; Shift+Enter stays) — except
|
|
432
|
+
* in a `<textarea>` or an editable region, where it types a new line. An
|
|
433
|
+
* editor that uses Enter itself (picking from its own list) calls
|
|
434
|
+
* `preventDefault()` in its handler. The
|
|
432
435
|
* editor's own shortcuts (F4, Alt+ArrowDown for its "…" button) are never
|
|
433
436
|
* taken by the grid.
|
|
434
437
|
* - Events from OUTSIDE the grid's DOM — a dialog the editor opens in a
|
|
@@ -451,8 +454,17 @@ interface EditorRowApi {
|
|
|
451
454
|
* to the scroller when the editor has closed.
|
|
452
455
|
*/
|
|
453
456
|
interface EditorRenderContext<TRow = GridRowData> {
|
|
454
|
-
/**
|
|
457
|
+
/**
|
|
458
|
+
* Current (uncommitted) editor value — what the built-in editor would show:
|
|
459
|
+
* the column's `valueGetter` result when it has one.
|
|
460
|
+
*/
|
|
455
461
|
value: unknown;
|
|
462
|
+
/**
|
|
463
|
+
* The column's `field` as stored in the row (pending edits applied), before
|
|
464
|
+
* any `valueGetter` — the bit set behind a "E;D;S" summary, say. Undefined
|
|
465
|
+
* when the column has no `field`.
|
|
466
|
+
*/
|
|
467
|
+
rawValue: unknown;
|
|
456
468
|
/** The row with pending edits applied — what a cascading list should read. */
|
|
457
469
|
row: TRow;
|
|
458
470
|
columnId: string;
|
|
@@ -1200,6 +1212,14 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
1200
1212
|
* the totals are the headline; the rows below are then the evidence for it.
|
|
1201
1213
|
*/
|
|
1202
1214
|
footerPosition?: 'top' | 'bottom';
|
|
1215
|
+
/**
|
|
1216
|
+
* Keep the bottom totals row on the grid's bottom edge when there are too few
|
|
1217
|
+
* rows to reach it (Tekax B.3), as a desktop data grid does. Default false:
|
|
1218
|
+
* the row follows the last data row and sticks to the edge only once the rows
|
|
1219
|
+
* scroll. Rows pinned to the bottom (`pinnedBottomRows`) move down with it.
|
|
1220
|
+
* No effect with `footerPosition: 'top'`.
|
|
1221
|
+
*/
|
|
1222
|
+
pinFooterToBottom?: boolean;
|
|
1203
1223
|
/**
|
|
1204
1224
|
* What to do with the column widths once the grid knows how much room it has
|
|
1205
1225
|
* (gap analysis P2.5). Default `'none'` — the configured widths are used as
|
|
@@ -1739,6 +1759,8 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1739
1759
|
* when it does not, they do not.
|
|
1740
1760
|
*/
|
|
1741
1761
|
searchNeedle?: string;
|
|
1762
|
+
/** The grid's `searchFold`: how `searchNeedle` was folded, and so the cell text. */
|
|
1763
|
+
searchFold?: LookupMatchFold;
|
|
1742
1764
|
/**
|
|
1743
1765
|
* The grid's cache of FUNCTION lookup lists (P-5.1): a closed cell shows the
|
|
1744
1766
|
* label, not the raw code. One stable object per grid; when a list arrives
|
|
@@ -1778,7 +1800,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1778
1800
|
onCellPointerEnter?: (ctx: CellSlotContext<TRow>, event: React.MouseEvent) => void;
|
|
1779
1801
|
onCellDoubleClick?: (ctx: CellSlotContext<TRow>) => void;
|
|
1780
1802
|
}
|
|
1781
|
-
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, statusColumn, rowNumberColumn, rowNumber, getNote, getSpan, resolveColSpans, findKind, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, lookupLabels, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderRowMessage, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, rowStatus, rowStatusText, rowStatusTint, rowStatusStrike, rowClass, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1803
|
+
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, statusColumn, rowNumberColumn, rowNumber, getNote, getSpan, resolveColSpans, findKind, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, searchFold, lookupLabels, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderRowMessage, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, rowStatus, rowStatusText, rowStatusTint, rowStatusStrike, rowClass, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1782
1804
|
declare const GridRow: typeof GridRowImpl;
|
|
1783
1805
|
|
|
1784
1806
|
interface GridFilterRowProps<TRow = GridRowData> {
|
|
@@ -2738,11 +2760,12 @@ interface UseGridEditingResult<TRow = GridRowData> {
|
|
|
2738
2760
|
/**
|
|
2739
2761
|
* A custom editor's commit (`renderEditor`'s `ctx.commit`, P-4.2): `'none'`
|
|
2740
2762
|
* stays on the cell, `'down'` moves down (whatever `editKeys.enter` says —
|
|
2741
|
-
* the editor asked), `'
|
|
2763
|
+
* the editor asked), `'enter'` is the grid's own Enter (down unless
|
|
2764
|
+
* `editKeys.enter`), `'next'` / `'previous'` walk to the adjacent editable
|
|
2742
2765
|
* cell like Tab, `'blur'` leaves focus where it is. False when a rule
|
|
2743
2766
|
* refused the value.
|
|
2744
2767
|
*/
|
|
2745
|
-
commitCustomEditor: (move: 'down' | 'next' | 'previous' | 'none' | 'blur') => boolean;
|
|
2768
|
+
commitCustomEditor: (move: 'down' | 'enter' | 'next' | 'previous' | 'none' | 'blur') => boolean;
|
|
2746
2769
|
/**
|
|
2747
2770
|
* `ctx.suspendBlurCommit` (P-4.1): while on, blur is not leaving the editor
|
|
2748
2771
|
* (`ctx.commitOnBlur`, the `commitOn: 'row'` send). Turning it off puts focus
|
|
@@ -2985,6 +3008,12 @@ interface GridLookupEditorProps {
|
|
|
2985
3008
|
* highlighted item; no match picks nothing. Ignored with `allowCustom`.
|
|
2986
3009
|
*/
|
|
2987
3010
|
typeAhead?: boolean;
|
|
3011
|
+
/** A grip on the open list's corner to resize it (`lookup.listResizable`, B.4.3). */
|
|
3012
|
+
listResizable?: boolean;
|
|
3013
|
+
/** The list as a table with a header row (`lookup.listColumns`, B.4.2). */
|
|
3014
|
+
listColumns?: readonly LookupListColumn[];
|
|
3015
|
+
/** A ▾ button that opens and closes the list (`lookup.dropButton`, B.4.2). */
|
|
3016
|
+
dropButton?: boolean;
|
|
2988
3017
|
/**
|
|
2989
3018
|
* Complete typed text to the one item left / an exact label on leaving.
|
|
2990
3019
|
* Default true. False: the "pick from the list" rule (K-3, see the top).
|
|
@@ -3003,6 +3032,8 @@ interface GridLookupEditorProps {
|
|
|
3003
3032
|
*/
|
|
3004
3033
|
onPick?: (item: LookupItem) => boolean;
|
|
3005
3034
|
invalid?: boolean;
|
|
3035
|
+
/** A read-only field (`LookupBox`): the box and its buttons do nothing. */
|
|
3036
|
+
disabled?: boolean;
|
|
3006
3037
|
/**
|
|
3007
3038
|
* Take focus on mount. True for a cell editor — it opened BECAUSE the user
|
|
3008
3039
|
* asked to edit that one cell. False in `row` mode, where every editable cell
|
|
@@ -3032,6 +3063,16 @@ interface GridLookupEditorProps {
|
|
|
3032
3063
|
* settles the typed text, as before.
|
|
3033
3064
|
*/
|
|
3034
3065
|
onBlurCommit?: () => void;
|
|
3066
|
+
/**
|
|
3067
|
+
* `lookup.onPickerOpen` (Tekax B.4.1), bound to the row: a "…" button and
|
|
3068
|
+
* Ctrl+Enter open the app's picker; its item is picked like a list item.
|
|
3069
|
+
*/
|
|
3070
|
+
onPickerOpen?: (text: string) => Promise<LookupItem | null> | LookupItem | null;
|
|
3071
|
+
/**
|
|
3072
|
+
* The grid's `suspendBlurCommit` (P-4.1): held while the picker is open, so
|
|
3073
|
+
* focus going to the app's dialog neither commits the cell nor sends the row.
|
|
3074
|
+
*/
|
|
3075
|
+
suspendBlurCommit?: (on: boolean, restoreTo?: () => HTMLElement | null) => void;
|
|
3035
3076
|
}
|
|
3036
3077
|
/**
|
|
3037
3078
|
* The same match, as items. Kept for callers and tests that want the simple
|
|
@@ -3039,7 +3080,7 @@ interface GridLookupEditorProps {
|
|
|
3039
3080
|
*/
|
|
3040
3081
|
declare function matchOptions(options: readonly LookupItem[], query: string, mode: LookupMatchMode): readonly LookupItem[];
|
|
3041
3082
|
/** The editor's settings that come straight from a column's `lookup`. */
|
|
3042
|
-
type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput' | 'typeAhead'>;
|
|
3083
|
+
type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput' | 'typeAhead' | 'listResizable' | 'listColumns' | 'dropButton'>;
|
|
3043
3084
|
/** `lookup` → the editor's props, one reading for the cell, row and form editors. */
|
|
3044
3085
|
declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined): LookupEditorSettings;
|
|
3045
3086
|
/**
|
|
@@ -3048,10 +3089,16 @@ declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined):
|
|
|
3048
3089
|
* neither — a plain pick, one cell, as before.
|
|
3049
3090
|
*/
|
|
3050
3091
|
declare function lookupPickValues(lookup: ColumnLookup<never> | undefined, columnId: string, item: LookupItem): Record<string, unknown> | null;
|
|
3051
|
-
declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, typeAhead, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
|
|
3092
|
+
declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, typeAhead, listResizable, listColumns, dropButton, autoCompleteSingle, onNoMatch, onPick, invalid, disabled, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, onPickerOpen, suspendBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
|
|
3052
3093
|
|
|
3053
3094
|
interface GridCellEditorProps {
|
|
3054
3095
|
value: unknown;
|
|
3096
|
+
/** The column's lookup when it is `multiple` (Tekax B.6): the check-box editor. */
|
|
3097
|
+
multipleLookup?: ColumnLookup<never>;
|
|
3098
|
+
/** `lookup.onPickerOpen`, bound to this cell (Tekax B.4.1). */
|
|
3099
|
+
onPickerOpen?: GridLookupEditorProps['onPickerOpen'];
|
|
3100
|
+
/** The grid's `suspendBlurCommit`, held while that picker is open. */
|
|
3101
|
+
suspendBlurCommit?: GridLookupEditorProps['suspendBlurCommit'];
|
|
3055
3102
|
dataType: GridDataType | undefined;
|
|
3056
3103
|
/**
|
|
3057
3104
|
* Choices for a lookup/select editor. `null` means the list is still being
|
|
@@ -3106,7 +3153,7 @@ interface GridCellEditorProps {
|
|
|
3106
3153
|
onTab: (direction: 1 | -1) => void;
|
|
3107
3154
|
onCancel: () => void;
|
|
3108
3155
|
}
|
|
3109
|
-
declare function GridCellEditor({ value, dataType, error, seeded, seedText, options, allowCustom, matchMode, lookupSettings, onPick, ariaLabel, dateFormat, numberFormat, numberLocale, onChange, onCommit, onTab, onCancel, }: GridCellEditorProps): react.JSX.Element;
|
|
3156
|
+
declare function GridCellEditor({ value, dataType, error, seeded, seedText, options, allowCustom, matchMode, lookupSettings, onPick, multipleLookup, onPickerOpen, suspendBlurCommit, ariaLabel, dateFormat, numberFormat, numberLocale, onChange, onCommit, onTab, onCancel, }: GridCellEditorProps): react.JSX.Element;
|
|
3110
3157
|
|
|
3111
3158
|
interface GridDateEditorProps {
|
|
3112
3159
|
value: unknown;
|