@kanunilabs/datagrid-react 1.8.3 → 1.8.5
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 +23 -4
- package/dist/index.d.ts +23 -4
- package/dist/index.js +3 -3
- package/dist/styles.css +18 -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 { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, 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, 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, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -120,6 +120,15 @@ interface PrintLayoutOptions {
|
|
|
120
120
|
* streams instead.
|
|
121
121
|
*/
|
|
122
122
|
maxRows?: number;
|
|
123
|
+
/**
|
|
124
|
+
* Called when a print is asked for and the result is over `maxRows`, so the
|
|
125
|
+
* grid prints the rows on screen only. Tell the user, or offer the PDF
|
|
126
|
+
* export: without it the shorter printout is silent (Tekax, 2026-10-28).
|
|
127
|
+
*/
|
|
128
|
+
onLimit?: (info: {
|
|
129
|
+
rows: number;
|
|
130
|
+
maxRows: number;
|
|
131
|
+
}) => void;
|
|
123
132
|
}
|
|
124
133
|
/** Default row cap. Report-sized results print; result sets do not. */
|
|
125
134
|
declare const PRINT_MAX_ROWS = 5000;
|
|
@@ -649,7 +658,9 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
649
658
|
* chevron is not rendered, because a control that opens nothing is worse than
|
|
650
659
|
* no control. `EnterpriseDataGrid` wires this to its own builder.
|
|
651
660
|
*/
|
|
652
|
-
onOpenFilterBuilder?: (
|
|
661
|
+
onOpenFilterBuilder?: (context?: {
|
|
662
|
+
columnId?: string;
|
|
663
|
+
}) => void;
|
|
653
664
|
/** Funnel button per header opening the distinct-value checklist popup. */
|
|
654
665
|
headerFilter?: boolean;
|
|
655
666
|
/**
|
|
@@ -1501,6 +1512,12 @@ interface GridHeaderFilterPopupProps {
|
|
|
1501
1512
|
*/
|
|
1502
1513
|
onApply: (filter: FilterNode | null) => void;
|
|
1503
1514
|
onClose: () => void;
|
|
1515
|
+
/**
|
|
1516
|
+
* Shows a "(Custom…)" entry above the list that opens the filter builder on
|
|
1517
|
+
* this column. Given only where a builder can be opened (the app's
|
|
1518
|
+
* `onOpenFilterBuilder`, or the Enterprise grid's own).
|
|
1519
|
+
*/
|
|
1520
|
+
onCustom?: () => void;
|
|
1504
1521
|
/**
|
|
1505
1522
|
* `entries` is only the first page of a longer list.
|
|
1506
1523
|
*
|
|
@@ -1526,7 +1543,7 @@ interface GridHeaderFilterPopupProps {
|
|
|
1526
1543
|
pager?: RemoteDistinctList;
|
|
1527
1544
|
labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
|
|
1528
1545
|
}
|
|
1529
|
-
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1546
|
+
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, onCustom, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1530
1547
|
|
|
1531
1548
|
interface GridContextMenuProps<TContext> {
|
|
1532
1549
|
x: number;
|
|
@@ -1543,8 +1560,10 @@ declare function GridContextMenu<TContext>({ x, y, items, context, onClose, dark
|
|
|
1543
1560
|
interface GridPortalProps {
|
|
1544
1561
|
children: ReactNode;
|
|
1545
1562
|
dark?: boolean;
|
|
1563
|
+
/** `data-kanuni-portal`'s value: a `popup` (default) the user works in, or a `tooltip`. */
|
|
1564
|
+
kind?: PortalKind;
|
|
1546
1565
|
}
|
|
1547
|
-
declare function GridPortal({ children, dark }: GridPortalProps): react.ReactPortal | null;
|
|
1566
|
+
declare function GridPortal({ children, dark, kind }: GridPortalProps): react.ReactPortal | null;
|
|
1548
1567
|
|
|
1549
1568
|
interface GridGroupPanelProps<TRow = GridRowData> {
|
|
1550
1569
|
/** Columns offered for grouping (groupable and visible). */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
3
|
+
import { GridRowData, DataGridController, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, ToolbarOptions, PortalContainer, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, RemoteDistinctList, PortalKind, ToolbarSearchOptions, ToolbarIconName, ColumnState, BusyPhase, VirtualWindow, ChartBoxSpec, ChartBoxModel, ChartSpec, ChartModel, ChartXYSpec, ChartXYModel, CellRange, RangeSelectionEngine, ColumnSelectMode, EditingEngine, ValidationRule, CrudHandlers, EditingPermissions, NewRowPosition, RowEditSession, LookupMatchMode } from '@kanunilabs/datagrid-core';
|
|
4
4
|
export { BusyChangedEvent, BusyPhase, ClientRowModel, ColumnLayout, ColumnLookup, ColumnModel, ColumnPin, ColumnRuntime, ColumnState, ColumnStateChangedEvent, ContentReadyEvent, CustomFilterOperator, CustomFilterOperatorId, DEFAULT_ROW_HEIGHT, DENSITY_ROW_HEIGHT, DataGridController, DataGridCoreConfig, DataRowNode, DataSource, 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, 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, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } from '@kanunilabs/datagrid-core';
|
|
5
5
|
|
|
6
6
|
/** Formats an export menu can offer. */
|
|
@@ -120,6 +120,15 @@ interface PrintLayoutOptions {
|
|
|
120
120
|
* streams instead.
|
|
121
121
|
*/
|
|
122
122
|
maxRows?: number;
|
|
123
|
+
/**
|
|
124
|
+
* Called when a print is asked for and the result is over `maxRows`, so the
|
|
125
|
+
* grid prints the rows on screen only. Tell the user, or offer the PDF
|
|
126
|
+
* export: without it the shorter printout is silent (Tekax, 2026-10-28).
|
|
127
|
+
*/
|
|
128
|
+
onLimit?: (info: {
|
|
129
|
+
rows: number;
|
|
130
|
+
maxRows: number;
|
|
131
|
+
}) => void;
|
|
123
132
|
}
|
|
124
133
|
/** Default row cap. Report-sized results print; result sets do not. */
|
|
125
134
|
declare const PRINT_MAX_ROWS = 5000;
|
|
@@ -649,7 +658,9 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
|
|
|
649
658
|
* chevron is not rendered, because a control that opens nothing is worse than
|
|
650
659
|
* no control. `EnterpriseDataGrid` wires this to its own builder.
|
|
651
660
|
*/
|
|
652
|
-
onOpenFilterBuilder?: (
|
|
661
|
+
onOpenFilterBuilder?: (context?: {
|
|
662
|
+
columnId?: string;
|
|
663
|
+
}) => void;
|
|
653
664
|
/** Funnel button per header opening the distinct-value checklist popup. */
|
|
654
665
|
headerFilter?: boolean;
|
|
655
666
|
/**
|
|
@@ -1501,6 +1512,12 @@ interface GridHeaderFilterPopupProps {
|
|
|
1501
1512
|
*/
|
|
1502
1513
|
onApply: (filter: FilterNode | null) => void;
|
|
1503
1514
|
onClose: () => void;
|
|
1515
|
+
/**
|
|
1516
|
+
* Shows a "(Custom…)" entry above the list that opens the filter builder on
|
|
1517
|
+
* this column. Given only where a builder can be opened (the app's
|
|
1518
|
+
* `onOpenFilterBuilder`, or the Enterprise grid's own).
|
|
1519
|
+
*/
|
|
1520
|
+
onCustom?: () => void;
|
|
1504
1521
|
/**
|
|
1505
1522
|
* `entries` is only the first page of a longer list.
|
|
1506
1523
|
*
|
|
@@ -1526,7 +1543,7 @@ interface GridHeaderFilterPopupProps {
|
|
|
1526
1543
|
pager?: RemoteDistinctList;
|
|
1527
1544
|
labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
|
|
1528
1545
|
}
|
|
1529
|
-
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1546
|
+
declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, onCustom, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
|
|
1530
1547
|
|
|
1531
1548
|
interface GridContextMenuProps<TContext> {
|
|
1532
1549
|
x: number;
|
|
@@ -1543,8 +1560,10 @@ declare function GridContextMenu<TContext>({ x, y, items, context, onClose, dark
|
|
|
1543
1560
|
interface GridPortalProps {
|
|
1544
1561
|
children: ReactNode;
|
|
1545
1562
|
dark?: boolean;
|
|
1563
|
+
/** `data-kanuni-portal`'s value: a `popup` (default) the user works in, or a `tooltip`. */
|
|
1564
|
+
kind?: PortalKind;
|
|
1546
1565
|
}
|
|
1547
|
-
declare function GridPortal({ children, dark }: GridPortalProps): react.ReactPortal | null;
|
|
1566
|
+
declare function GridPortal({ children, dark, kind }: GridPortalProps): react.ReactPortal | null;
|
|
1548
1567
|
|
|
1549
1568
|
interface GridGroupPanelProps<TRow = GridRowData> {
|
|
1550
1569
|
/** Columns offered for grouping (groupable and visible). */
|