@kanunilabs/datagrid-react 1.8.9 → 1.8.10

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.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, FocusEvent, MouseEvent, RefObject } 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 } from '@kanunilabs/datagrid-core';
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, LookupMatchFold } 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. */
@@ -130,6 +130,13 @@ interface EditKeys {
130
130
  * are given.
131
131
  */
132
132
  typing?: boolean;
133
+ /**
134
+ * Space on a focused lookup cell opens its editor (and, with
135
+ * `lookup.openOnEdit`, its list) instead of doing nothing; the space is not
136
+ * typed into the box. While an editor is open Space types a space as usual.
137
+ * Default false (P-11).
138
+ */
139
+ space?: boolean;
133
140
  /**
134
141
  * A double-click (a double-tap on a touch screen) opens the cell's editor.
135
142
  * Default true.
@@ -261,6 +268,13 @@ interface PrintLayoutOptions {
261
268
  rows: number;
262
269
  maxRows: number;
263
270
  }) => void;
271
+ /**
272
+ * Print the column headers (band rows, header, filter row) at the top of
273
+ * EVERY page, not only the first (default true; Tekax P-15). A row is never
274
+ * split across two pages, whichever way this is set. The summary row prints
275
+ * once, after the last row.
276
+ */
277
+ repeatHeader?: boolean;
264
278
  }
265
279
  /** Default row cap. Report-sized results print; result sets do not. */
266
280
  declare const PRINT_MAX_ROWS = 5000;
@@ -280,7 +294,9 @@ interface PrintLayoutState {
280
294
  * — an ordinary `setState` would land after that and print the old, clipped
281
295
  * view. This is the case the API exists for.
282
296
  */
283
- declare function usePrintLayout<TRow = GridRowData>(controller: DataGridController<TRow>, options: boolean | PrintLayoutOptions | undefined): PrintLayoutState;
297
+ declare function usePrintLayout<TRow = GridRowData>(controller: DataGridController<TRow>, options: boolean | PrintLayoutOptions | undefined,
298
+ /** The grid's root element, for the repeating header's printable copy. */
299
+ rootRef?: RefObject<HTMLElement | null>): PrintLayoutState;
284
300
 
285
301
  /** MIME type carrying the payload. Custom so nothing else claims it. */
286
302
  declare const ROW_DRAG_MIME = "application/x-kanuni-row";
@@ -2937,8 +2953,30 @@ interface GridLookupEditorProps {
2937
2953
  * shows the code.
2938
2954
  */
2939
2955
  linked?: boolean;
2956
+ /**
2957
+ * How typed text and item text are folded before they are compared
2958
+ * (`lookup.matchFold`, P-13). Default `'case'` — the editor's old behaviour.
2959
+ */
2960
+ matchFold?: LookupMatchFold;
2940
2961
  /** Let text that matches nothing become the value. Default false. */
2941
2962
  allowCustom?: boolean;
2963
+ /**
2964
+ * Open the list as soon as the editor mounts (`lookup.openOnEdit`, P-11).
2965
+ * Only for an editor that takes focus (`autoFocus`) — in a row or form every
2966
+ * field would open its list at once.
2967
+ */
2968
+ openOnEdit?: boolean;
2969
+ /**
2970
+ * The editor was opened by TYPING and `value` is that one character: the
2971
+ * box starts with it as the typed text (list filtered by it, caret after
2972
+ * it). Acts only together with `openOnEdit`.
2973
+ */
2974
+ seeded?: boolean;
2975
+ /**
2976
+ * Refuse typing that matches no item (`lookup.restrictInput`, P-12).
2977
+ * Deleting is always free; ignored with `allowCustom`.
2978
+ */
2979
+ restrictInput?: boolean;
2942
2980
  /**
2943
2981
  * Complete typed text to the one item left / an exact label on leaving.
2944
2982
  * Default true. False: the "pick from the list" rule (K-3, see the top).
@@ -2993,7 +3031,7 @@ interface GridLookupEditorProps {
2993
3031
  */
2994
3032
  declare function matchOptions(options: readonly LookupItem[], query: string, mode: LookupMatchMode): readonly LookupItem[];
2995
3033
  /** The editor's settings that come straight from a column's `lookup`. */
2996
- type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch'>;
3034
+ type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput'>;
2997
3035
  /** `lookup` → the editor's props, one reading for the cell, row and form editors. */
2998
3036
  declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined): LookupEditorSettings;
2999
3037
  /**
@@ -3002,7 +3040,7 @@ declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined):
3002
3040
  * neither — a plain pick, one cell, as before.
3003
3041
  */
3004
3042
  declare function lookupPickValues(lookup: ColumnLookup<never> | undefined, columnId: string, item: LookupItem): Record<string, unknown> | null;
3005
- declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, linked, allowCustom, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
3043
+ declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
3006
3044
 
3007
3045
  interface GridCellEditorProps {
3008
3046
  value: unknown;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, FocusEvent, MouseEvent, RefObject } 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 } from '@kanunilabs/datagrid-core';
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, LookupMatchFold } 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. */
@@ -130,6 +130,13 @@ interface EditKeys {
130
130
  * are given.
131
131
  */
132
132
  typing?: boolean;
133
+ /**
134
+ * Space on a focused lookup cell opens its editor (and, with
135
+ * `lookup.openOnEdit`, its list) instead of doing nothing; the space is not
136
+ * typed into the box. While an editor is open Space types a space as usual.
137
+ * Default false (P-11).
138
+ */
139
+ space?: boolean;
133
140
  /**
134
141
  * A double-click (a double-tap on a touch screen) opens the cell's editor.
135
142
  * Default true.
@@ -261,6 +268,13 @@ interface PrintLayoutOptions {
261
268
  rows: number;
262
269
  maxRows: number;
263
270
  }) => void;
271
+ /**
272
+ * Print the column headers (band rows, header, filter row) at the top of
273
+ * EVERY page, not only the first (default true; Tekax P-15). A row is never
274
+ * split across two pages, whichever way this is set. The summary row prints
275
+ * once, after the last row.
276
+ */
277
+ repeatHeader?: boolean;
264
278
  }
265
279
  /** Default row cap. Report-sized results print; result sets do not. */
266
280
  declare const PRINT_MAX_ROWS = 5000;
@@ -280,7 +294,9 @@ interface PrintLayoutState {
280
294
  * — an ordinary `setState` would land after that and print the old, clipped
281
295
  * view. This is the case the API exists for.
282
296
  */
283
- declare function usePrintLayout<TRow = GridRowData>(controller: DataGridController<TRow>, options: boolean | PrintLayoutOptions | undefined): PrintLayoutState;
297
+ declare function usePrintLayout<TRow = GridRowData>(controller: DataGridController<TRow>, options: boolean | PrintLayoutOptions | undefined,
298
+ /** The grid's root element, for the repeating header's printable copy. */
299
+ rootRef?: RefObject<HTMLElement | null>): PrintLayoutState;
284
300
 
285
301
  /** MIME type carrying the payload. Custom so nothing else claims it. */
286
302
  declare const ROW_DRAG_MIME = "application/x-kanuni-row";
@@ -2937,8 +2953,30 @@ interface GridLookupEditorProps {
2937
2953
  * shows the code.
2938
2954
  */
2939
2955
  linked?: boolean;
2956
+ /**
2957
+ * How typed text and item text are folded before they are compared
2958
+ * (`lookup.matchFold`, P-13). Default `'case'` — the editor's old behaviour.
2959
+ */
2960
+ matchFold?: LookupMatchFold;
2940
2961
  /** Let text that matches nothing become the value. Default false. */
2941
2962
  allowCustom?: boolean;
2963
+ /**
2964
+ * Open the list as soon as the editor mounts (`lookup.openOnEdit`, P-11).
2965
+ * Only for an editor that takes focus (`autoFocus`) — in a row or form every
2966
+ * field would open its list at once.
2967
+ */
2968
+ openOnEdit?: boolean;
2969
+ /**
2970
+ * The editor was opened by TYPING and `value` is that one character: the
2971
+ * box starts with it as the typed text (list filtered by it, caret after
2972
+ * it). Acts only together with `openOnEdit`.
2973
+ */
2974
+ seeded?: boolean;
2975
+ /**
2976
+ * Refuse typing that matches no item (`lookup.restrictInput`, P-12).
2977
+ * Deleting is always free; ignored with `allowCustom`.
2978
+ */
2979
+ restrictInput?: boolean;
2942
2980
  /**
2943
2981
  * Complete typed text to the one item left / an exact label on leaving.
2944
2982
  * Default true. False: the "pick from the list" rule (K-3, see the top).
@@ -2993,7 +3031,7 @@ interface GridLookupEditorProps {
2993
3031
  */
2994
3032
  declare function matchOptions(options: readonly LookupItem[], query: string, mode: LookupMatchMode): readonly LookupItem[];
2995
3033
  /** The editor's settings that come straight from a column's `lookup`. */
2996
- type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch'>;
3034
+ type LookupEditorSettings = Pick<GridLookupEditorProps, 'matchMode' | 'codeMatchMode' | 'linked' | 'allowCustom' | 'autoCompleteSingle' | 'onNoMatch' | 'matchFold' | 'openOnEdit' | 'restrictInput'>;
2997
3035
  /** `lookup` → the editor's props, one reading for the cell, row and form editors. */
2998
3036
  declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined): LookupEditorSettings;
2999
3037
  /**
@@ -3002,7 +3040,7 @@ declare function lookupEditorSettings(lookup: ColumnLookup<never> | undefined):
3002
3040
  * neither — a plain pick, one cell, as before.
3003
3041
  */
3004
3042
  declare function lookupPickValues(lookup: ColumnLookup<never> | undefined, columnId: string, item: LookupItem): Record<string, unknown> | null;
3005
- declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, linked, allowCustom, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
3043
+ declare function GridLookupEditor({ options, value, matchMode, codeMatchMode, matchFold, linked, allowCustom, openOnEdit, seeded, restrictInput, autoCompleteSingle, onNoMatch, onPick, invalid, autoFocus, testId, columnId, ariaLabel, onChange, onCommit, commitOnPick, onCancel, onTab, onBlurCommit, }: GridLookupEditorProps): react.JSX.Element;
3006
3044
 
3007
3045
  interface GridCellEditorProps {
3008
3046
  value: unknown;