@kanunilabs/datagrid-react 1.8.2 → 1.8.3

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,7 +1,7 @@
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, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, 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
- 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, 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, isPackagedTheme, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } 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, 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
+ 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. */
7
7
  type ExportKind = 'csv' | 'excel' | 'excel-selected' | 'pdf';
@@ -744,8 +744,29 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
744
744
  * supports. `false` makes the footer read-only.
745
745
  */
746
746
  footerMenu?: boolean;
747
- /** Toolbar with search, column chooser and export. */
748
- toolbar?: boolean;
747
+ /**
748
+ * Toolbar with search, column chooser and export. `true` shows all of it;
749
+ * an object picks the parts and sets the search box up:
750
+ *
751
+ * toolbar={{ export: false, columns: false,
752
+ * search: { maxLength: 100, debounce: 300, validate } }}
753
+ *
754
+ * Your own buttons: `toolbarItemsBefore` (start) and `toolbarItemsAfter`
755
+ * (end), e.g. `<GridToolbarButton>`.
756
+ */
757
+ toolbar?: boolean | ToolbarOptions;
758
+ /**
759
+ * Where the grid draws its popups (header filter, menus, date and lookup
760
+ * lists, dialogs): an element, or a function returning one. Default
761
+ * `document.body`.
762
+ *
763
+ * Set it when the grid sits in a modal (Radix Dialog and the like): the
764
+ * modal makes the rest of the page ignore the pointer, so a popup on <body>
765
+ * cannot be clicked. Pass the modal's content element (one without
766
+ * `overflow: hidden`). Popups stay in place even when the modal is moved
767
+ * with a CSS transform. Every popup carries `data-kanuni-portal`.
768
+ */
769
+ portalContainer?: PortalContainer;
749
770
  /**
750
771
  * The toolbar's Columns button — the popup listing HIDDEN columns. Default
751
772
  * true. The Enterprise wrapper turns it off when the side bar's Columns
@@ -1496,9 +1517,16 @@ interface GridHeaderFilterPopupProps {
1496
1517
  * matched nothing even though the value exists.
1497
1518
  */
1498
1519
  onSearch?: (needle: string) => void;
1520
+ /**
1521
+ * A server-side list, loaded in pieces (see `RemoteDistinctList`). When set,
1522
+ * the popup draws THAT instead of `entries`: the scroll bar is as long as the
1523
+ * server's list, the search box searches on the server, and Select all /
1524
+ * Clear / ticks are the pager's ("everything except these").
1525
+ */
1526
+ pager?: RemoteDistinctList;
1499
1527
  labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
1500
1528
  }
1501
- declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
1529
+ declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
1502
1530
 
1503
1531
  interface GridContextMenuProps<TContext> {
1504
1532
  x: number;
@@ -1630,9 +1658,16 @@ interface GridToolbarProps<TRow = GridRowData> {
1630
1658
  itemsAfter?: React.ReactNode;
1631
1659
  /** Milliseconds to wait after the last keystroke. Default 200. */
1632
1660
  searchDebounce?: number;
1661
+ /**
1662
+ * The search box's settings (`toolbar={{ search: {...} }}`): placeholder,
1663
+ * maxLength, debounce (wins over `searchDebounce`), applyOnBlur, validate.
1664
+ */
1665
+ searchOptions?: ToolbarSearchOptions;
1666
+ /** The export menu. Default true; false leaves it out whatever the formats. */
1667
+ exportMenu?: boolean;
1633
1668
  labels?: Partial<Record<'search' | 'csv' | 'excel' | 'excelSelected' | 'pdf' | 'columns' | 'exporting' | 'exportMenu', string>>;
1634
1669
  }
1635
- declare function GridToolbarImpl<TRow = GridRowData>({ controller, search, exportCsv, exportExcel, exportPdf, columnChooser, dark, onOpenColumnChooser, itemsBefore, itemsAfter, searchDebounce, labels, }: GridToolbarProps<TRow>): react.JSX.Element;
1670
+ declare function GridToolbarImpl<TRow = GridRowData>({ controller, search, exportCsv, exportExcel, exportPdf, columnChooser, dark, onOpenColumnChooser, itemsBefore, itemsAfter, searchDebounce, searchOptions, exportMenu, labels, }: GridToolbarProps<TRow>): react.JSX.Element;
1636
1671
  declare const GridToolbar: typeof GridToolbarImpl;
1637
1672
 
1638
1673
  /** A command button's icon — the shared paths of `toolbarIcons.ts` (see there for why). */
@@ -1641,6 +1676,26 @@ declare function ToolbarIcon({ name, size }: {
1641
1676
  size?: number;
1642
1677
  }): react.JSX.Element;
1643
1678
 
1679
+ interface GridToolbarButtonProps {
1680
+ /** The glyph, e.g. an inline SVG or `<ToolbarIcon name="columns" />`. */
1681
+ icon: ReactNode;
1682
+ /** The button's name: its accessible name and the start of its tooltip. */
1683
+ label: string;
1684
+ /** Keyboard shortcut shown in the tooltip ("Export (Ctrl+E)") and as `aria-keyshortcuts`. */
1685
+ shortcut?: string;
1686
+ /**
1687
+ * Set while the button cannot be used: it reads as unavailable, ignores
1688
+ * clicks, and the tooltip and screen reader give this reason.
1689
+ */
1690
+ disabledReason?: string;
1691
+ /** Show the label beside the icon. Default false (icon only). */
1692
+ showLabel?: boolean;
1693
+ onClick?: () => void;
1694
+ /** `data-testid` on the button. */
1695
+ testId?: string;
1696
+ }
1697
+ declare function GridToolbarButton({ icon, label, shortcut, disabledReason, showLabel, onClick, testId, }: GridToolbarButtonProps): react.JSX.Element;
1698
+
1644
1699
  interface GridColumnChooserProps<TRow = GridRowData> {
1645
1700
  controller: DataGridController<TRow>;
1646
1701
  /** Passed in so the panel re-renders when visibility changes. */
@@ -2012,9 +2067,16 @@ interface GridSurfaceProviderProps {
2012
2067
  theme?: GridThemeName;
2013
2068
  density?: GridDensity;
2014
2069
  palette?: GridPaletteName;
2070
+ /** Where popups are drawn (the grid's `portalContainer`). Default <body>. */
2071
+ portalContainer?: PortalContainer;
2015
2072
  children: ReactNode;
2016
2073
  }
2017
- declare function GridSurfaceProvider({ theme, density, palette, children, }: GridSurfaceProviderProps): react.JSX.Element;
2074
+ declare function GridSurfaceProvider({ theme, density, palette, portalContainer, children, }: GridSurfaceProviderProps): react.JSX.Element;
2075
+ /**
2076
+ * The element a popup is portalled into, read when the popup opens: <body>,
2077
+ * or the host inside the grid's `portalContainer` (core `portalTarget`).
2078
+ */
2079
+ declare function useGridPortalTarget(): () => HTMLElement;
2018
2080
  /**
2019
2081
  * The theme + density modifier classes for a surface rendered outside the grid.
2020
2082
  * `''` when the grid is unthemed, so appending it is always safe.
@@ -2446,4 +2508,4 @@ interface GridDialogProps {
2446
2508
  }
2447
2509
  declare function GridDialog({ open, title, message, cancelLabel, confirmLabel, danger, dark, onConfirm, onCancel, }: GridDialogProps): react.ReactPortal | null;
2448
2510
 
2449
- export { type AlignedGridsApi, BAND_ROW_HEIGHT, type BatchSaveError, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_EDIT_FORM_LABELS, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditFormField, type EditFormLabels, type EditModes, type EditorRenderContext, type ExportOutcome, type FilterRenderContext, GridCellEditor, type GridCellEditorProps, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridDateEditor, type GridDateEditorProps, GridDialog, type GridDialogProps, GridEditForm, type GridEditFormProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, GridLookupEditor, type GridLookupEditorProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, GridRowEditor, type GridRowEditorProps, 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 PendingDelete, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type RangeApi, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowLookupMap, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type SelectionStats, ToolbarIcon, type TooltipState, type UseDataGridOptions, type UseDataGridResult, type UseEditModesOptions, type UseGridEditingOptions, type UseGridEditingResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, editFormColumnIds, editFormLabels, headerMenuLabels, matchOptions, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useEditModes, useGridChartBoxData, useGridChartData, useGridChartXYData, useGridEditing, useGridSurfaceClass, useGridText, usePrintLayout, useRowDrag, useStateStoring, writeClipboardText };
2511
+ export { type AlignedGridsApi, BAND_ROW_HEIGHT, type BatchSaveError, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_EDIT_FORM_LABELS, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditFormField, type EditFormLabels, type EditModes, type EditorRenderContext, type ExportOutcome, type FilterRenderContext, GridCellEditor, type GridCellEditorProps, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridDateEditor, type GridDateEditorProps, GridDialog, type GridDialogProps, GridEditForm, type GridEditFormProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, GridLookupEditor, type GridLookupEditorProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, GridRowEditor, type GridRowEditorProps, type GridRowProps, GridSummaryBar, type GridSummaryBarProps, GridSurfaceProvider, type GridSurfaceProviderProps, GridTextProvider, type GridTextProviderProps, GridToolbar, GridToolbarButton, type GridToolbarButtonProps, type GridToolbarProps, GridTooltip, type GridTooltipConfig, type GridTooltipProps, type HeaderMenuContext, type HeaderMenuDeps, type HeaderMenuLabels, type HeaderRenderContext, type NoteCellContext, PRINT_MAX_ROWS, type PendingDelete, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type RangeApi, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowLookupMap, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type SelectionStats, ToolbarIcon, type TooltipState, type UseDataGridOptions, type UseDataGridResult, type UseEditModesOptions, type UseGridEditingOptions, type UseGridEditingResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, editFormColumnIds, editFormLabels, headerMenuLabels, matchOptions, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useEditModes, useGridChartBoxData, useGridChartData, useGridChartXYData, useGridEditing, useGridPortalTarget, 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, GridDataType, RowKey, LookupItem, GridDictionary, StateStoringConfig, RowNode, GridColumnDef, DataGridCoreConfig, FilterRenderContextBase, FilterNode, InferColumnsOptions, GridThemeName, GridPaletteName, DescribeFilterOptions, GridDensity, CardViewOptions, EditMode, RowChange, RowStatusSource, ColumnRuntime, ColumnLayout, SortDescriptor, ColumnModel, RowSaveStatus, DataRowNode, ColSpanPlan, SummaryDef, 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
- 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, 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, isPackagedTheme, lookupLabel, moveRowInArray, parseCsv, parseFilterInput, sniffDelimiter, summaryKey, summaryLabel, summaryTypeLabels, themeClassName } 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, 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
+ 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. */
7
7
  type ExportKind = 'csv' | 'excel' | 'excel-selected' | 'pdf';
@@ -744,8 +744,29 @@ interface DataGridProps<TRow = GridRowData> extends Omit<DataGridCoreConfig<TRow
744
744
  * supports. `false` makes the footer read-only.
745
745
  */
746
746
  footerMenu?: boolean;
747
- /** Toolbar with search, column chooser and export. */
748
- toolbar?: boolean;
747
+ /**
748
+ * Toolbar with search, column chooser and export. `true` shows all of it;
749
+ * an object picks the parts and sets the search box up:
750
+ *
751
+ * toolbar={{ export: false, columns: false,
752
+ * search: { maxLength: 100, debounce: 300, validate } }}
753
+ *
754
+ * Your own buttons: `toolbarItemsBefore` (start) and `toolbarItemsAfter`
755
+ * (end), e.g. `<GridToolbarButton>`.
756
+ */
757
+ toolbar?: boolean | ToolbarOptions;
758
+ /**
759
+ * Where the grid draws its popups (header filter, menus, date and lookup
760
+ * lists, dialogs): an element, or a function returning one. Default
761
+ * `document.body`.
762
+ *
763
+ * Set it when the grid sits in a modal (Radix Dialog and the like): the
764
+ * modal makes the rest of the page ignore the pointer, so a popup on <body>
765
+ * cannot be clicked. Pass the modal's content element (one without
766
+ * `overflow: hidden`). Popups stay in place even when the modal is moved
767
+ * with a CSS transform. Every popup carries `data-kanuni-portal`.
768
+ */
769
+ portalContainer?: PortalContainer;
749
770
  /**
750
771
  * The toolbar's Columns button — the popup listing HIDDEN columns. Default
751
772
  * true. The Enterprise wrapper turns it off when the side bar's Columns
@@ -1496,9 +1517,16 @@ interface GridHeaderFilterPopupProps {
1496
1517
  * matched nothing even though the value exists.
1497
1518
  */
1498
1519
  onSearch?: (needle: string) => void;
1520
+ /**
1521
+ * A server-side list, loaded in pieces (see `RemoteDistinctList`). When set,
1522
+ * the popup draws THAT instead of `entries`: the scroll bar is as long as the
1523
+ * server's list, the search box searches on the server, and Select all /
1524
+ * Clear / ticks are the pager's ("everything except these").
1525
+ */
1526
+ pager?: RemoteDistinctList;
1499
1527
  labels?: Partial<Record<'search' | 'selectAll' | 'clear' | 'apply' | 'cancel' | 'blank' | 'noMatch' | 'loading' | 'truncated', string>>;
1500
1528
  }
1501
- declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
1529
+ declare function GridHeaderFilterPopup({ gridId, columnId, headerLabel, entries, initialSelected, anchor, loading, dark, onApply, onClose, truncated, onSearch, pager, labels, }: GridHeaderFilterPopupProps): react.JSX.Element;
1502
1530
 
1503
1531
  interface GridContextMenuProps<TContext> {
1504
1532
  x: number;
@@ -1630,9 +1658,16 @@ interface GridToolbarProps<TRow = GridRowData> {
1630
1658
  itemsAfter?: React.ReactNode;
1631
1659
  /** Milliseconds to wait after the last keystroke. Default 200. */
1632
1660
  searchDebounce?: number;
1661
+ /**
1662
+ * The search box's settings (`toolbar={{ search: {...} }}`): placeholder,
1663
+ * maxLength, debounce (wins over `searchDebounce`), applyOnBlur, validate.
1664
+ */
1665
+ searchOptions?: ToolbarSearchOptions;
1666
+ /** The export menu. Default true; false leaves it out whatever the formats. */
1667
+ exportMenu?: boolean;
1633
1668
  labels?: Partial<Record<'search' | 'csv' | 'excel' | 'excelSelected' | 'pdf' | 'columns' | 'exporting' | 'exportMenu', string>>;
1634
1669
  }
1635
- declare function GridToolbarImpl<TRow = GridRowData>({ controller, search, exportCsv, exportExcel, exportPdf, columnChooser, dark, onOpenColumnChooser, itemsBefore, itemsAfter, searchDebounce, labels, }: GridToolbarProps<TRow>): react.JSX.Element;
1670
+ declare function GridToolbarImpl<TRow = GridRowData>({ controller, search, exportCsv, exportExcel, exportPdf, columnChooser, dark, onOpenColumnChooser, itemsBefore, itemsAfter, searchDebounce, searchOptions, exportMenu, labels, }: GridToolbarProps<TRow>): react.JSX.Element;
1636
1671
  declare const GridToolbar: typeof GridToolbarImpl;
1637
1672
 
1638
1673
  /** A command button's icon — the shared paths of `toolbarIcons.ts` (see there for why). */
@@ -1641,6 +1676,26 @@ declare function ToolbarIcon({ name, size }: {
1641
1676
  size?: number;
1642
1677
  }): react.JSX.Element;
1643
1678
 
1679
+ interface GridToolbarButtonProps {
1680
+ /** The glyph, e.g. an inline SVG or `<ToolbarIcon name="columns" />`. */
1681
+ icon: ReactNode;
1682
+ /** The button's name: its accessible name and the start of its tooltip. */
1683
+ label: string;
1684
+ /** Keyboard shortcut shown in the tooltip ("Export (Ctrl+E)") and as `aria-keyshortcuts`. */
1685
+ shortcut?: string;
1686
+ /**
1687
+ * Set while the button cannot be used: it reads as unavailable, ignores
1688
+ * clicks, and the tooltip and screen reader give this reason.
1689
+ */
1690
+ disabledReason?: string;
1691
+ /** Show the label beside the icon. Default false (icon only). */
1692
+ showLabel?: boolean;
1693
+ onClick?: () => void;
1694
+ /** `data-testid` on the button. */
1695
+ testId?: string;
1696
+ }
1697
+ declare function GridToolbarButton({ icon, label, shortcut, disabledReason, showLabel, onClick, testId, }: GridToolbarButtonProps): react.JSX.Element;
1698
+
1644
1699
  interface GridColumnChooserProps<TRow = GridRowData> {
1645
1700
  controller: DataGridController<TRow>;
1646
1701
  /** Passed in so the panel re-renders when visibility changes. */
@@ -2012,9 +2067,16 @@ interface GridSurfaceProviderProps {
2012
2067
  theme?: GridThemeName;
2013
2068
  density?: GridDensity;
2014
2069
  palette?: GridPaletteName;
2070
+ /** Where popups are drawn (the grid's `portalContainer`). Default <body>. */
2071
+ portalContainer?: PortalContainer;
2015
2072
  children: ReactNode;
2016
2073
  }
2017
- declare function GridSurfaceProvider({ theme, density, palette, children, }: GridSurfaceProviderProps): react.JSX.Element;
2074
+ declare function GridSurfaceProvider({ theme, density, palette, portalContainer, children, }: GridSurfaceProviderProps): react.JSX.Element;
2075
+ /**
2076
+ * The element a popup is portalled into, read when the popup opens: <body>,
2077
+ * or the host inside the grid's `portalContainer` (core `portalTarget`).
2078
+ */
2079
+ declare function useGridPortalTarget(): () => HTMLElement;
2018
2080
  /**
2019
2081
  * The theme + density modifier classes for a surface rendered outside the grid.
2020
2082
  * `''` when the grid is unthemed, so appending it is always safe.
@@ -2446,4 +2508,4 @@ interface GridDialogProps {
2446
2508
  }
2447
2509
  declare function GridDialog({ open, title, message, cancelLabel, confirmLabel, danger, dark, onConfirm, onCancel, }: GridDialogProps): react.ReactPortal | null;
2448
2510
 
2449
- export { type AlignedGridsApi, BAND_ROW_HEIGHT, type BatchSaveError, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_EDIT_FORM_LABELS, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditFormField, type EditFormLabels, type EditModes, type EditorRenderContext, type ExportOutcome, type FilterRenderContext, GridCellEditor, type GridCellEditorProps, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridDateEditor, type GridDateEditorProps, GridDialog, type GridDialogProps, GridEditForm, type GridEditFormProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, GridLookupEditor, type GridLookupEditorProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, GridRowEditor, type GridRowEditorProps, 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 PendingDelete, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type RangeApi, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowLookupMap, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type SelectionStats, ToolbarIcon, type TooltipState, type UseDataGridOptions, type UseDataGridResult, type UseEditModesOptions, type UseGridEditingOptions, type UseGridEditingResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, editFormColumnIds, editFormLabels, headerMenuLabels, matchOptions, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useEditModes, useGridChartBoxData, useGridChartData, useGridChartXYData, useGridEditing, useGridSurfaceClass, useGridText, usePrintLayout, useRowDrag, useStateStoring, writeClipboardText };
2511
+ export { type AlignedGridsApi, BAND_ROW_HEIGHT, type BatchSaveError, type CellMenuOptions, type CellRenderContext, type CellSlotContext, type CellTooltipOptions, DEFAULT_EDIT_FORM_LABELS, DEFAULT_HEADER_MENU_LABELS, DataGrid, type DataGridProps, type DistinctEntry, type EditFormField, type EditFormLabels, type EditModes, type EditorRenderContext, type ExportOutcome, type FilterRenderContext, GridCellEditor, type GridCellEditorProps, GridColumnChooser, type GridColumnChooserProps, GridContextMenu, type GridContextMenuProps, GridDateEditor, type GridDateEditorProps, GridDialog, type GridDialogProps, GridEditForm, type GridEditFormProps, GridFilterPanel, type GridFilterPanelProps, GridFilterRow, type GridFilterRowProps, GridFooterRow, type GridFooterRowProps, GridGroupPanel, type GridGroupPanelProps, GridHeader, GridHeaderBands, type GridHeaderBandsProps, GridHeaderFilterPopup, type GridHeaderFilterPopupProps, type GridHeaderProps, GridLoadingOverlay, type GridLoadingOverlayProps, GridLookupEditor, type GridLookupEditorProps, type GridMenuItem, GridNoteEditor, type GridNotesConfig, GridPager, type GridPagerProps, GridPinnedRows, type GridPinnedRowsProps, GridPopupPanel, type GridPopupPanelProps, GridPortal, type GridPortalProps, GridRow, GridRowEditor, type GridRowEditorProps, type GridRowProps, GridSummaryBar, type GridSummaryBarProps, GridSurfaceProvider, type GridSurfaceProviderProps, GridTextProvider, type GridTextProviderProps, GridToolbar, GridToolbarButton, type GridToolbarButtonProps, type GridToolbarProps, GridTooltip, type GridTooltipConfig, type GridTooltipProps, type HeaderMenuContext, type HeaderMenuDeps, type HeaderMenuLabels, type HeaderRenderContext, type NoteCellContext, PRINT_MAX_ROWS, type PendingDelete, type PrintLayoutOptions, type PrintLayoutState, ROW_DRAG_MIME, type RangeApi, type ReactColumnRuntime, type ReactGridColumnDef, type RowDragConfig, type RowDragHandlers, type RowDragPayload, type RowDropEvent, type RowLookupMap, type RowMenuContext, type RowReorderEvent, type RowTemplateContext, SHORTCUT_COPY, SHORTCUT_CUT, SHORTCUT_PASTE, type SelectionStats, ToolbarIcon, type TooltipState, type UseDataGridOptions, type UseDataGridResult, type UseEditModesOptions, type UseGridEditingOptions, type UseGridEditingResult, buildCellMenuItems, buildHeaderMenu, copyToClipboard, editFormColumnIds, editFormLabels, headerMenuLabels, matchOptions, measureBestFitWidth, reconcileFilterInputs, runGridExport, useAlignedGrids, useAnchoredPopup, useCellTooltip, useDataGrid, useEditModes, useGridChartBoxData, useGridChartData, useGridChartXYData, useGridEditing, useGridPortalTarget, useGridSurfaceClass, useGridText, usePrintLayout, useRowDrag, useStateStoring, writeClipboardText };