import React, { ReactNode } from 'react'; export type AlignDirection = 'left' | 'center' | 'right'; export type MoveDirection = 'prev' | 'next' | 'current'; export type BGridEditTrigger = 'click' | 'dblclick'; export declare const DIRC_MAP: { next: number; prev: number; current: number; }; export interface BGridItemRenderProps { column: BGridColumn; index: number; columnIndex: number; item: BGridDataItem; values: T; value: any; editable?: boolean; handleSave?: (value: any, columnDirection?: MoveDirection, rowDirection?: MoveDirection) => void; handleCancel?: () => void; handleMove?: (columnDirection: MoveDirection, rowDirection: MoveDirection) => void; } export interface BGridTextEditorContext { index: number; columnIndex: number; item: BGridDataItem; values: T; column: BGridColumn; } export interface BGridCheckboxEditorContext extends BGridTextEditorContext { sourceIndex: number; value: unknown; } export type BGridCellValueChange = { key: BGridColumn['key']; columnId?: never; value: unknown; } | { columnId: string; key?: never; value: unknown; }; export interface BGridCommitOptions { move?: BGridCellMoveDirection; } export interface BGridCellCommitController { commit: (changes: readonly BGridCellValueChange[], options?: BGridCommitOptions) => Promise; cancel: () => void; } export type BGridEditSource = 'text' | 'plugin' | 'checkbox' | 'itemRender' | 'editorIcon'; export interface BGridChangeValueRow { index: number; sourceIndex: number; item: BGridDataItem; values: T; nextValues: T; } export interface BGridChangeValueParams extends BGridCellCommitController { source: BGridEditSource; column: BGridColumn; index: number; columnIndex: number; item: BGridDataItem; values: T; nextValues: T; changes: readonly BGridCellValueChange[]; rows: readonly BGridChangeValueRow[]; } export interface BGridEditorIconParams { column: BGridColumn; index: number; columnIndex: number; item: BGridDataItem; values: T; value: unknown; active: boolean; } export interface BGridEditorIconClickParams extends BGridEditorIconParams, BGridCellCommitController { } export type BGridEditorIconClickHandler = (params: BGridEditorIconClickParams) => void | (() => void) | Promise void)>; export interface BGridEditorIconConfig { render: React.ReactNode | ((params: BGridEditorIconParams) => React.ReactNode); ariaLabel?: string | ((params: BGridEditorIconParams) => string); visibility?: 'always' | 'hover' | 'active'; onClick?: BGridEditorIconClickHandler; } export interface BGridTextEditorConfig { type: 'text'; startOnInput?: boolean; commitOnBlur?: boolean; formatValue?: (value: unknown, context: BGridTextEditorContext) => string; parseValue?: (text: string, context: BGridTextEditorContext) => unknown; ariaLabel?: string | ((context: BGridTextEditorContext) => string); inputProps?: Pick, 'placeholder' | 'maxLength' | 'inputMode' | 'autoComplete' | 'spellCheck'>; } export interface BGridCheckboxHeaderConfig { ariaLabel?: string; disabled?: boolean; } export interface BGridCheckboxEditorConfig { type: 'checkbox'; /** Value written when the checkbox is checked. Defaults to true. */ trueValue?: unknown; /** Value written when the checkbox is unchecked. Defaults to false. */ falseValue?: unknown; /** Shows a select-all control in the column header for the currently available rows. */ header?: boolean | BGridCheckboxHeaderConfig; ariaLabel?: string | ((context: BGridCheckboxEditorContext) => string); label?: ReactNode | ((context: BGridCheckboxEditorContext) => ReactNode); disabled?: boolean | ((context: BGridCheckboxEditorContext) => boolean); } export interface BGridEditorPluginProps extends BGridTextEditorContext { sessionId: number; value: unknown; mode: 'preserve' | 'replace'; activation: BGridCellEditActivation; commit: BGridCellCommitController['commit']; cancel: BGridCellCommitController['cancel']; move: (direction: BGridCellMoveDirection) => void; getPortalContainer: () => HTMLElement; } export interface BGridPluginEditorConfig { type: 'plugin'; id: string; component: React.ComponentType>; getClipboardText?: (params: BGridCellClipboardTextParams) => any; /** * Restores text/plain clipboard input to the editor's stored value type. * Takes precedence over built-in fallback parser during multi-cell paste. * Throw to keep the current cell value and report parseValueFailed through onPasteError. */ parseClipboardText?: (text: string, params: BGridCellClipboardParseParams) => unknown; } export type BGridCellEditorConfig = BGridTextEditorConfig | BGridCheckboxEditorConfig | BGridPluginEditorConfig; export interface BGridCellClipboardTextParams { column: BGridColumn; index: number; columnIndex: number; item: BGridDataItem; values: T; value: any; } export interface BGridCellClipboardParseParams extends BGridCellClipboardTextParams { /** Original text/plain value read from the clipboard for this cell. */ text: string; } export interface BGridSearchCellParams { cell: BGridCellAddress; visibleIndex: number; sourceIndex: number; rowKey?: React.Key; columnIndex: number; columnId: string; column: BGridColumn; item: BGridDataItem; values: T; value: unknown; } export interface BGridCellExportValueParams { column: BGridColumn; columnId: string; visibleIndex?: number; sourceIndex: number; item: BGridDataItem; values: T; value: unknown; } export interface BGridColumn { id?: string; key: string | string[]; label: ReactNode; width: number; align?: AlignDirection; headerAlign?: AlignDirection; sortDisable?: boolean; className?: string; getClassName?: (item: BGridDataItem) => string; headerClassName?: string; headerStyle?: React.CSSProperties; itemRender?: React.FC>; editor?: BGridCellEditorConfig; editTrigger?: BGridEditTrigger; editorIcon?: BGridEditorIconConfig; onChangeValue?: (params: BGridChangeValueParams) => void | Promise; getClipboardText?: (params: BGridCellClipboardTextParams) => any; /** * Restores text/plain clipboard input to the column's stored value type. * Takes precedence over a built-in text editor's parseValue during multi-cell paste. * Throw to keep the current cell value and report parseValueFailed through onPasteError. */ parseClipboardText?: (text: string, params: BGridCellClipboardParseParams) => unknown; searchable?: boolean; getSearchText?: (params: BGridSearchCellParams) => unknown; editable?: boolean; /** Prevents users from hiding this column through the built-in visibility menu. @since 1.0.6 */ hideable?: boolean; toolbox?: boolean | BGridToolboxConfig; filter?: false | BGridColumnFilterConfig; sortComparator?: (a: unknown, b: unknown, params: { column: BGridColumn; aItem: BGridDataItem; bItem: BGridDataItem; }) => number; exportable?: boolean; exportHeader?: string | ((column: BGridColumn) => string); getExportValue?: (params: BGridCellExportValueParams) => unknown; } export interface BGridColumnGroup { label: ReactNode; groupStartIndex: number; groupEndIndex: number; align?: AlignDirection; headerAlign?: AlignDirection; } export interface BGridColumnGroupNode { id: string; label: ReactNode; headerAlign?: AlignDirection; className?: string; headerStyle?: React.CSSProperties; children: Array; } export interface BGridCellMergeColumn { wordWrap?: boolean; mergeBy: string | string[]; } export interface BGridSummaryItemRenderProps { column: BGridColumn; columnIndex: number; rowIndex?: number; data: BGridDataItem[]; } export interface BGridSummaryColumn { columnIndex: number; align?: AlignDirection; colSpan?: number; className?: string; style?: React.CSSProperties; getClassName?: (key: string | string[]) => string; itemRender?: (props: BGridSummaryItemRenderProps) => React.ReactNode; } export interface BGridSummaryRow { id?: string | number; className?: string; style?: React.CSSProperties; height?: number; columns: BGridSummaryColumn[]; } export interface BGridSummaryOptions { columns?: BGridSummaryColumn[]; rows?: (BGridSummaryRow | BGridSummaryColumn[])[]; position: 'top' | 'bottom'; } export declare enum BGridDataItemStatus { new = 0, edit = 1, remove = 2 } export type BGridDataItem = { values: T; status?: BGridDataItemStatus; /** Column instances directly edited since the data owner last cleared the edit state. */ editedColumnIds?: string[]; /** Stable key tokens whose underlying values changed since the data owner last cleared the change state. */ changedKeys?: string[]; checked?: boolean; parentItemIndex?: number; meta?: Record; }; export interface BGridProcessedRow { item: BGridDataItem; sourceIndex: number; rowKey?: React.Key; } export interface BGridPage { currentPage?: number; pageSize?: number; totalPages?: number; totalElements?: number; loading?: boolean; onChange?: (currentPage: number, pageSize?: number) => void; displayPaginationLength?: number; statusRender?: () => void; paginationRender?: () => void; } export interface BGridRowChecked { isRadio?: boolean; checkedIndexes?: number[]; checkedRowKeys?: React.Key[]; disabled?: (index: number, item: BGridDataItem) => boolean; onChange: (checkedIndexes: number[], checkedRowKeys: React.Key[], checkedAll?: CheckedAll) => void; } export interface BGridSortParam { columnId?: string; key?: string; index?: number; orderBy: 'asc' | 'desc'; } export interface BGridSortInfo { multiSort?: boolean; sortParams: BGridSortParam[]; onChange: (sortParams: BGridSortParam[]) => void; } export type BGridFilterOperator = 'contains' | 'equals' | 'notEquals' | 'gt' | 'gte' | 'lt' | 'lte' | 'between'; export type BGridFilterValue = string | number | boolean | null; interface BGridFilterParamBase { columnId: string; key: string | string[]; } export type BGridFilterParam = (BGridFilterParamBase & { type: 'values'; values: BGridFilterValue[]; }) | (BGridFilterParamBase & { type: 'text'; operator: 'contains' | 'equals' | 'notEquals'; value: string; }) | (BGridFilterParamBase & { type: 'number'; operator: Exclude; value?: number; min?: number; max?: number; }); export interface BGridDataQuery { sortParams: BGridSortParam[]; filterParams: BGridFilterParam[]; } export interface BGridDataQueryChangeEvent { type: 'sort' | 'filter'; columnId: string; action: 'apply' | 'clear'; } export interface BGridDataControl { mode?: 'manual' | 'client'; multiSort?: boolean; query: BGridDataQuery; onChange: (query: BGridDataQuery, event: BGridDataQueryChangeEvent) => void; } export interface BGridColumnFilterConfig { type: 'values' | 'text' | 'number'; caseSensitive?: boolean; values?: BGridFilterValue[]; getValue?: (item: BGridDataItem) => unknown; predicate?: (params: { item: BGridDataItem; value: unknown; filter: BGridFilterParam; }) => boolean; formatValue?: (value: unknown) => React.ReactNode; maxValueListItems?: number; } export interface BGridToolboxItem { id: string; label: React.ReactNode; disabled?: boolean; onClick: (params: { column: BGridColumn; columnId: string; columnIndex: number; }) => void; } export interface BGridToolboxRenderProps { column: BGridColumn; columnId: string; columnIndex: number; close: () => void; } export interface BGridToolboxIcons { sortAsc?: React.ReactNode; sortDesc?: React.ReactNode; filter?: React.ReactNode; filterBadge?: React.ReactNode; dropdown?: React.ReactNode; sortClear?: React.ReactNode; /** @since 1.0.6 */ hideColumn?: React.ReactNode; /** @since 1.0.6 */ showColumn?: React.ReactNode; /** @since 1.0.6 */ columns?: React.ReactNode; } /** Describes a column visibility change initiated by a user. @since 1.0.6 */ export interface BGridColumnVisibilityChangeEvent { type: 'hide' | 'show' | 'showAll'; columnId?: string; column?: BGridColumn; } /** Configures controlled or uncontrolled column visibility. @since 1.0.6 */ export interface BGridColumnVisibilityOptions { enabled?: boolean; /** Controlled list of hidden column IDs. */ hiddenColumnIds?: readonly string[]; /** Initial hidden column IDs when hiddenColumnIds is uncontrolled. */ defaultHiddenColumnIds?: readonly string[]; onChange?: (hiddenColumnIds: string[], event: BGridColumnVisibilityChangeEvent) => void; } export interface BGridColumnVisibilityItem { column: BGridColumn; columnId: string; hidden: boolean; hideable: boolean; } export interface BGridColumnVisibilityState { items: BGridColumnVisibilityItem[]; hiddenColumnIds: string[]; onChange: (hiddenColumnIds: string[], event: BGridColumnVisibilityChangeEvent) => void; } export interface BGridToolboxConfig { sort?: boolean; filter?: boolean; icons?: BGridToolboxIcons; extraItems?: BGridToolboxItem[]; render?: React.FC>; } export interface BGridClickParams { index: number; columnIndex: number; item: T; column: BGridColumn; } export interface BGridChangeColumnsInfo { width?: number; columns: BGridColumn[]; columnsGroup?: BGridColumnGroup[]; columnGroups?: BGridColumnGroupNode[]; } export interface BGridReorderInfo { enabled?: boolean; handleIcon?: React.ReactNode; onReorder?: (data: BGridDataItem[]) => void | boolean; } export interface BGridReorderingInfo { fromIndex?: number; toIndex?: number; phase?: 'dragging' | 'settling' | 'cancelling'; input?: 'pointer' | 'keyboard'; } export interface BGridPivotField { key: string | string[]; label?: ReactNode; width?: number; align?: AlignDirection; headerAlign?: AlignDirection; className?: string; headerClassName?: string; headerStyle?: React.CSSProperties; } export interface BGridPivotAggregateParams { values: any[]; items: BGridDataItem[]; rowValues: any[]; columnValues: any[]; value: BGridPivotValue; } export type BGridPivotAggregate = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'first' | ((params: BGridPivotAggregateParams) => any); export interface BGridPivotValue extends BGridPivotField { aggregate?: BGridPivotAggregate; itemRender?: React.FC>; getClipboardText?: (params: BGridPivotValueClipboardTextParams) => any; } export interface BGridPivotValueContext { sourceItems: BGridDataItem[]; rowValues: any[]; columnValues: any[]; pivotValue: BGridPivotValue; aggregate?: BGridPivotAggregate; } export interface BGridPivotValueItemRenderProps extends Omit>, 'column'>, BGridPivotValueContext { column: BGridColumn>; } export interface BGridPivotValueClipboardTextParams extends Omit>, 'column'>, BGridPivotValueContext { column: BGridColumn>; } export interface BGridPivotOptions { enabled?: boolean; rows: BGridPivotField[]; columns: BGridPivotField[]; values: BGridPivotValue[]; columnLabelSeparator?: string; emptyValue?: ReactNode; } export interface BGridCellAddress { rowIndex: number; columnIndex: number; } export type BGridSearchOpenReason = 'shortcut' | 'contextMenu' | 'external' | 'escape' | 'closeButton' | 'surfaceConflict'; export interface BGridSearchIcons { search?: React.ReactNode; previous?: React.ReactNode; next?: React.ReactNode; close?: React.ReactNode; } export interface BGridSearchLabels { inputAriaLabel?: string; placeholder?: string; previousAriaLabel?: string; nextAriaLabel?: string; closeAriaLabel?: string; searching?: string; noResults?: string; contextMenuItem?: React.ReactNode; formatResultCount?: (params: { activeResult: number; totalResults: number; loadedRowCount: number; paged: boolean; }) => React.ReactNode; } export interface BGridSearchOptions { enabled?: boolean; shortcut?: boolean; contextMenu?: boolean; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean, reason: BGridSearchOpenReason) => void; query?: string; defaultQuery?: string; onQueryChange?: (query: string) => void; getSearchText?: (params: BGridSearchCellParams) => unknown; icons?: BGridSearchIcons; labels?: BGridSearchLabels; } export interface BGridContextMenuTarget { cell: BGridCellAddress; visibleIndex: number; sourceIndex: number; rowKey?: React.Key; columnIndex: number; columnId: string; column: BGridColumn; item: BGridDataItem; values: T; value: unknown; } export type BGridContextMenuItem = { type?: 'item'; id: string; label: React.ReactNode; icon?: React.ReactNode; shortcut?: string; disabled?: boolean; onSelect: (target: BGridContextMenuTarget) => void | Promise; } | { type: 'separator'; id: string; }; export interface BGridContextMenuOptions { enabled?: boolean; items?: (target: BGridContextMenuTarget) => readonly BGridContextMenuItem[]; onOpenChange?: (open: boolean, target?: BGridContextMenuTarget) => void; } export interface BGridSearchMatch { cell: BGridCellAddress; visibleIndex: number; sourceIndex: number; rowKey?: React.Key; columnIndex: number; columnId: string; } export interface BGridContextMenuState { target: BGridContextMenuTarget; items: BGridContextMenuItem[]; clientX: number; clientY: number; keyboard: boolean; } export interface BGridCellInteractionRowScope { merged: boolean; visibleIndexes: readonly number[]; sourceIndexes: readonly number[]; } export interface BGridCellInteractionSessionBase { id: number; phase: 'active' | 'resolving' | 'committing'; cell: BGridCellAddress; hostCell: BGridCellAddress; rowScope: BGridCellInteractionRowScope; } export interface BGridCellEditSession extends BGridCellInteractionSessionBase { kind: 'editor'; mode: 'preserve' | 'replace'; activation: BGridCellEditActivation; originalValue: unknown; } export type BGridCellEditActivation = 'cell' | 'editorIcon'; export interface BGridEditorIconSession extends BGridCellInteractionSessionBase { kind: 'editorIcon'; } export type BGridCellInteractionSession = BGridCellEditSession | BGridEditorIconSession; export interface BGridCellCommitRequest { sessionId: number; source: BGridEditSource; changes: readonly BGridCellValueChange[]; options?: BGridCommitOptions; } export type BGridCellMoveDirection = 'up' | 'down' | 'left' | 'right' | 'home' | 'end' | 'pageUp' | 'pageDown' | 'first' | 'last' | 'next' | 'prev'; export interface BGridMoveActiveCellOptions { extendSelection?: boolean; toBoundary?: boolean; pageSize?: number; selectionEnabled?: boolean; } export interface BGridCellNavigationOptions { enabled?: boolean; activeCell?: BGridCellAddress; defaultActiveCell?: BGridCellAddress; onActiveCellChange?: (cell?: BGridCellAddress) => void; wrap?: boolean; editOnEnter?: boolean; keyRepeat?: { enabled?: boolean; interval?: number; }; } export interface BGridCellSelectionRange { startRowIndex: number; startColumnIndex: number; endRowIndex: number; endColumnIndex: number; } export type BGridCellSelectionCopyErrorReason = 'maxClipboardCells' | 'maxClipboardTextLength' | 'clipboardWriteFailed'; export interface BGridCellSelectionCopyError { reason: BGridCellSelectionCopyErrorReason; actual?: number; limit?: number; selectedCellCount: number; maxClipboardCells: number; maxClipboardTextLength: number; error?: unknown; } export type BGridCellSelectionPasteErrorReason = 'maxClipboardCells' | 'maxClipboardTextLength' | 'parseValueFailed' | 'createRowFailed' | 'unsupportedClipboardData' | 'mergedCellConflict'; export interface BGridCellSelectionPasteError { reason: BGridCellSelectionPasteErrorReason; actual?: number; limit?: number; rowIndex?: number; columnIndex?: number; clipboardTypes?: string[]; clipboardTextLength: number; clipboardCellCount: number; maxClipboardCells: number; maxClipboardTextLength: number; error?: unknown; } export interface BGridCellSelectionPasteRowContext { rowIndex: number; clipboardRow: string[]; columns: BGridColumn[]; } export type BGridColumnWithOptionalWidth = Partial, 'width'>> & Omit, 'width'>; export type BGridScrollbarVariant = 'native' | 'classic' | 'modern'; export interface BGridStatusContext { totalItems: number; visibleItems: number; page?: BGridPage; } export type BGridStatusContent = React.ReactNode | ((context: BGridStatusContext) => React.ReactNode); export interface BGridViewStyleProps { className?: string; style?: React.CSSProperties; } export interface BGridStatusOptions extends BGridViewStyleProps { visible?: boolean; content?: BGridStatusContent; } export interface BGridPaginationViewOptions extends BGridViewStyleProps { visible?: boolean; } export interface BGridHorizontalScrollbarOptions extends BGridViewStyleProps { visible?: boolean; } export interface BGridVerticalScrollbarOptions extends BGridViewStyleProps { visible?: boolean; } export interface BGridScrollbarOptions { variant?: BGridScrollbarVariant; horizontal?: BGridHorizontalScrollbarOptions; vertical?: BGridVerticalScrollbarOptions; } export interface BGridResolvedScrollbarOptions { variant: BGridScrollbarVariant; horizontal: Required> & Omit; vertical: Required> & Omit; } export interface BGridResolvedStatusOptions extends BGridStatusOptions { visible: boolean; configured: boolean; } export type BGridResolvedPaginationViewOptions = Required> & Omit; export interface BGridScrollToRowOptions { /** Defaults to nearest: scroll only as far as needed to reveal the row. */ align?: 'start' | 'center' | 'end' | 'nearest'; } export type BGridExportRowScope = 'displayed' | 'checked' | 'source'; export type BGridExportColumnScope = 'visible' | 'all' | readonly string[]; export interface BGridExportColumn { columnId: string; header: string; column: BGridColumn; columnIndex: number; } export interface BGridExportRow { visibleIndex?: number; sourceIndex: number; rowKey?: React.Key; item: BGridDataItem; values: T; cells: unknown[]; } export interface BGridExportData { columns: BGridExportColumn[]; rows: BGridExportRow[]; } export interface BGridExportDataOptions { rows?: BGridExportRowScope; columns?: BGridExportColumnScope; } export interface BGridCsvSerializeOptions { delimiter?: string; newline?: '\n' | '\r\n'; includeHeader?: boolean; bom?: boolean; preventFormulaInjection?: boolean; } export interface BGridCsvExportOptions extends BGridExportDataOptions { fileName?: string; delimiter?: string; newline?: '\n' | '\r\n'; includeHeader?: boolean; bom?: boolean; preventFormulaInjection?: boolean; } export interface BGridExcelSerializeOptions { sheetName?: string; includeHeader?: boolean; } export interface BGridExcelExportOptions extends BGridExportDataOptions, BGridExcelSerializeOptions { fileName?: string; } export interface BGridRef { /** * Reveal a zero-based row in the displayed (sorted/filtered) data on the current page. * Runs after pending data updates. Invalid indexes and frozen rows are ignored. * Preserves horizontal scroll, cell focus and selection; does not load other pages. */ scrollToRow: (rowIndex: number, options?: BGridScrollToRowOptions) => void; /** * Extract logical grid data for export without touching the DOM. * Supports displayed, checked, or source row scopes, and visible, all, or custom column scopes. */ getExportData: (options?: BGridExportDataOptions) => BGridExportData; /** * Serialize grid data and trigger a browser CSV file download. */ exportCsv: (options?: BGridCsvExportOptions) => void; /** * Serialize grid data and trigger a browser Excel (.xlsx) file download. */ exportExcel: (options?: BGridExcelExportOptions) => void; } export interface BGridToolboxMessages { sort?: string; sortAscending?: string; sortDescending?: string; clearSort?: string; filterApplied?: string; openColumnOptions?: string; filter?: string; textFilter?: string; valueFilter?: string; numberFilter?: string; contains?: string; equals?: string; notEquals?: string; numberEquals?: string; numberNotEquals?: string; greaterThan?: string; greaterThanOrEqual?: string; lessThan?: string; lessThanOrEqual?: string; between?: string; searchPlaceholder?: string; textPlaceholder?: string; numberPlaceholder?: string; minimumPlaceholder?: string; maximumPlaceholder?: string; invalidRange?: string; clear?: string; apply?: string; emptyValue?: string; selectAll?: string; noValues?: string; noResults?: string; extraMenu?: string; columns?: string; hiddenColumns?: string; showAllColumns?: string; hideThisColumn?: string; lastVisibleColumn?: string; hiddenColumnCount?: (count: number) => string; moreValues?: (count: number) => string; } export interface BGridMessages { emptyList?: string; toolbox?: BGridToolboxMessages; } export interface BGridProps { ref?: React.Ref>; width: number; height: number; headerHeight?: number; /** @deprecated Use bottomBarHeight instead. */ footerHeight?: number; bottomBarHeight?: number; summaryHeight?: number; summaryRowHeight?: number; itemHeight?: number; itemPadding?: number; /** * Returns the complete rendered height of a displayed row in pixels. * Invalid values fall back to itemHeight + itemPadding * 2. */ getRowHeight?: (row: T, index: number) => number; frozenColumnIndex?: number; /** Number of leading rows fixed below an optional top summary row. */ frozenRowCount?: number; columns: BGridColumnWithOptionalWidth[]; /** @deprecated Use columnGroups for nested column header groups. */ columnsGroup?: BGridColumnGroup[]; columnGroups?: BGridColumnGroupNode[]; onChangeColumns?: (columnIndex: number | null, info: BGridChangeColumnsInfo) => void; data?: BGridDataItem[]; onChangeData?: (index: number, columnIndex: number | null, item: T, column: BGridColumn | null, meta?: BGridChangeDataMeta) => void; page?: BGridPage; enableLoadMore?: boolean; onLoadMore?: (params: { scrollLeft: number; scrollTop: number; }) => void; endLoadMoreRender?: () => React.ReactNode; scrollbar?: BGridScrollbarOptions; status?: BGridStatusOptions; pagination?: BGridPaginationViewOptions; className?: string; style?: React.CSSProperties; loading?: boolean; spinning?: boolean; /** Disables every user interaction in the grid while keeping rendering and scrolling available. */ disabled?: boolean; scrollTop?: number; scrollLeft?: number; rowChecked?: BGridRowChecked; sort?: BGridSortInfo; onClick?: (params: BGridClickParams) => void; msg?: { emptyList?: string; toolbox?: { sort?: string; sortAscending?: string; sortDescending?: string; clearSort?: string; filterApplied?: string; openColumnOptions?: string; filter?: string; textFilter?: string; valueFilter?: string; numberFilter?: string; contains?: string; equals?: string; notEquals?: string; numberEquals?: string; numberNotEquals?: string; greaterThan?: string; greaterThanOrEqual?: string; lessThan?: string; lessThanOrEqual?: string; between?: string; searchPlaceholder?: string; textPlaceholder?: string; numberPlaceholder?: string; minimumPlaceholder?: string; maximumPlaceholder?: string; invalidRange?: string; clear?: string; apply?: string; emptyValue?: string; selectAll?: string; noValues?: string; noResults?: string; extraMenu?: string; columns?: string; hiddenColumns?: string; showAllColumns?: string; hideThisColumn?: string; lastVisibleColumn?: string; hiddenColumnCount?: (count: number) => string; moreValues?: (count: number) => string; }; }; rowKey?: React.Key | React.Key[]; selectedRowKey?: React.Key | React.Key[]; editable?: boolean; /** Event that starts cell editing. Defaults to `dblclick`. */ editTrigger?: BGridEditTrigger; showLineNumber?: boolean; getRowClassName?: (ri: number, item: BGridDataItem) => string | undefined; cellMergeOptions?: { columnsMap: Record; }; cellSelectionOptions?: { enabled?: boolean; /** Controls which cell remains active after a multi-cell selection. */ multiSelectFocusMode?: 'first' | 'last'; clearOnEscape?: boolean; clearOnOutsideClick?: boolean; maxClipboardCells?: number; maxClipboardTextLength?: number; onCopyError?: (error: BGridCellSelectionCopyError) => void; onPasteError?: (error: BGridCellSelectionPasteError) => void; /** Creates missing trailing rows while pasting. Returned rows are always marked as `new`. */ createRowOnPaste?: (context: BGridCellSelectionPasteRowContext) => BGridDataItem | undefined; }; cellNavigationOptions?: BGridCellNavigationOptions; variant?: 'default' | 'vertical-bordered'; summary?: BGridSummaryOptions; columnSortable?: boolean; reorder?: BGridReorderInfo; reorderingInfo?: BGridReorderingInfo; pivot?: BGridPivotOptions; dataControl?: BGridDataControl; icons?: BGridToolboxIcons; /** Enables the built-in hide and restore controls in each column toolbox. @since 1.0.6 */ columnVisibility?: boolean | BGridColumnVisibilityOptions; searchOptions?: BGridSearchOptions; contextMenuOptions?: BGridContextMenuOptions; /** Enables hierarchical rows from flat data related by rowKey and parentRowKey. */ tree?: BGridTreeOptions; /** Enables master-detail expandable rows with full-width detail panels or nested grids. */ masterDetail?: BGridMasterDetailOptions; } export interface BGridTreeIcons { expanded?: React.ReactNode; collapsed?: React.ReactNode; leaf?: React.ReactNode; } export interface BGridTreeRowMeta { rowKey: React.Key; parentRowKey?: React.Key; depth: number; hasChildren: boolean; expanded: boolean; sourceIndex: number; parentSourceIndex?: number; siblingIndex: number; siblingCount: number; } export interface BGridTreeOptions { enabled?: boolean; /** Field containing the parent row's rowKey value. */ parentRowKey: React.Key | React.Key[]; /** Column ID that renders indentation and the folding control. Defaults to the first visible column. */ treeColumnId?: string; expandedRowKeys?: readonly React.Key[]; defaultExpandedRowKeys?: readonly React.Key[]; onExpandedRowKeysChange?: (keys: React.Key[], event: { rowKey: React.Key; expanded: boolean; item: BGridDataItem; sourceIndex: number; }) => void; indentSize?: number; icons?: BGridTreeIcons; expandAriaLabel?: string; collapseAriaLabel?: string; } export type BGridMasterDetailExpandMode = 'multiple' | 'single'; export interface BGridMasterDetailRenderProps { item: BGridDataItem; rowKey: React.Key; sourceIndex: number; visibleIndex: number; expanded: true; collapse: () => void; } export interface BGridMasterDetailIcons { expanded?: React.ReactNode; collapsed?: React.ReactNode; } export interface BGridMasterDetailChangeEvent { rowKey: React.Key; expanded: boolean; item: BGridDataItem; sourceIndex: number; } export interface BGridMasterDetailOptions { /** Enables or disables master-detail row expansion. Defaults to true when masterDetail is provided. */ enabled?: boolean; /** Custom renderer for the expanded detail region. */ detailRender: (props: BGridMasterDetailRenderProps) => React.ReactNode; /** * Detail area total height in pixels, including padding and borders. * Accepts a fixed number or a function that returns the height for a given row. Defaults to 200. */ detailRowHeight?: number | ((item: BGridDataItem, sourceIndex: number) => number); /** Column ID that renders the toggle button. Defaults to the first visible column. */ expandColumnId?: string; /** Determines whether a given row provides an expandable detail area. Defaults to true for all rows. */ hasDetail?: (item: BGridDataItem, sourceIndex: number) => boolean; /** 'single' allows only one row expanded at a time (accordion). Defaults to 'multiple'. */ expandMode?: BGridMasterDetailExpandMode; /** Controlled expanded row keys. */ expandedRowKeys?: readonly React.Key[]; /** Initial expanded row keys for uncontrolled usage. */ defaultExpandedRowKeys?: readonly React.Key[]; /** Callback triggered when the expanded row keys change through user interaction. */ onExpandedRowKeysChange?: (keys: React.Key[], event: BGridMasterDetailChangeEvent) => void; /** Custom expand/collapse icons. */ icons?: BGridMasterDetailIcons; /** Accessibility label for the expand button. */ expandAriaLabel?: string; /** Accessibility label for the collapse button. */ collapseAriaLabel?: string; } export interface BGridTreeChangeDataMeta { rowKey: React.Key; parentRowKey?: React.Key; sourceIndex: number; depth: number; path: readonly React.Key[]; } export type CheckedAll = true | false | 'indeterminate'; export interface BGridChangeDataMeta { source: BGridEditSource; originColumn: BGridColumn; changes: readonly BGridCellValueChange[]; /** * The committed row including Grid-managed metadata such as `status` and * `editedColumnIds` and `changedKeys`. Controlled grids should store this * item to preserve cell and value change state after synchronizing `data`. */ dataItem: BGridDataItem; /** Tree identity for the edited row. Undefined in flat mode. */ tree?: BGridTreeChangeDataMeta; transaction: { merged: boolean; canonicalCell: BGridCellAddress; visibleIndexes: readonly number[]; sourceIndexes: readonly number[]; }; } export interface AppModelColumn extends BGridColumn { columnId: string; keyToken?: string; left: number; /** @internal Marks the single column that hosts tree indentation and folding controls. */ treeCell?: boolean; /** @internal Marks the single column that hosts master-detail expand/collapse toggle controls. */ masterDetailCell?: boolean; } export interface AppModel extends BGridProps { initialized: boolean; headerHeight: number; footerHeight: number; bottomBarHeight: number; summaryHeight: number; summaryRowHeight?: number; itemHeight: number; itemPadding: number; frozenColumnIndex: number; frozenRowCount: number; frozenRowsHeight: number; frozenColumnsWidth?: number; columns: AppModelColumn[]; columnsGroup: BGridColumnGroup[]; columnGroups: BGridColumnGroupNode[]; data: BGridDataItem[]; sourceData: BGridDataItem[]; sourceIndexByVisibleIndex?: number[]; visibleIndexBySourceIndex?: Map; columnResizing: boolean; containerBorderWidth: number; contentBodyHeight: number; displayItemCount: number; scrollTop: number; scrollLeft: number; checkedIndexesMap: Map; checkedAll: CheckedAll; sortParams?: Record; dataQuery?: BGridDataQuery; filterDrafts: Record; activeToolboxColumnId: string | null; columnVisibilityState?: BGridColumnVisibilityState; searchOptions?: BGridSearchOptions; contextMenuOptions?: BGridContextMenuOptions; searchOpen: boolean; searchQuery: string; searchStatus: 'idle' | 'searching' | 'ready'; searchMatches: BGridSearchMatch[]; activeSearchMatchIndex?: number; contextMenuState?: BGridContextMenuState; displayPaginationLength?: number; loading: boolean; disabled?: boolean; editItemIndex?: number; editItemColIndex?: number; cellInteractionSession?: BGridCellInteractionSession; editTrigger?: BGridEditTrigger; reorder?: BGridReorderInfo; reorderingInfo?: BGridReorderingInfo; activeCell?: BGridCellAddress; activeCellHost?: BGridCellAddress; cellNavigationOptions?: BGridCellNavigationOptions; cellSelectionRange?: BGridCellSelectionRange; cellSelectionRanges: BGridCellSelectionRange[]; cellSelecting: boolean; scrollbar: BGridResolvedScrollbarOptions; status: BGridResolvedStatusOptions; pagination: BGridResolvedPaginationViewOptions; } export interface AppActions { setInitialized: (initialized: boolean) => void; setScrollTop: (scrollTop: number) => void; setScrollLeft: (scrollLeft: number) => void; setScroll: (scrollTop: number, scrollLeft: number) => void; setColumns: (columns: AppModelColumn[]) => void; setColumnsGroup: (columnsGroup: BGridColumnGroup[]) => void; setColumnGroups: (columnGroups: BGridColumnGroupNode[]) => void; setData: (data: BGridDataItem[]) => void; setSourceData: (sourceData: BGridDataItem[]) => void; setProcessedData: (params: { data: BGridDataItem[]; sourceData: BGridDataItem[]; sourceIndexByVisibleIndex?: number[]; visibleIndexBySourceIndex?: Map; }) => void; setDataQuery: (dataQuery: BGridDataQuery) => void; setDataControl: (dataControl?: BGridDataControl) => void; setIcons: (icons?: BGridToolboxIcons) => void; setColumnSort: (columnId: string, order: 'asc' | 'desc' | null) => void; setFilterDraft: (columnId: string, filter: BGridFilterParam | undefined) => void; applyColumnFilter: (columnId: string) => void; clearColumnFilter: (columnId: string) => void; setActiveToolbox: (columnId: string | null) => void; setColumnVisibilityState: (state?: BGridColumnVisibilityState) => void; setSearchOptions: (options?: BGridSearchOptions) => void; setContextMenuOptions: (options?: BGridContextMenuOptions) => void; requestSearchOpen: (open: boolean, reason: BGridSearchOpenReason) => void; setSearchQuery: (query: string) => void; setSearchStatus: (status: AppModel['searchStatus']) => void; setSearchResults: (matches: BGridSearchMatch[]) => void; moveSearchMatch: (direction: 'previous' | 'next') => BGridSearchMatch | undefined; clearSearchResults: () => void; openContextMenu: (state: BGridContextMenuState) => void; closeContextMenu: () => void; closeTransientSurfaces: (except?: 'search' | 'toolbox' | 'contextMenu') => void; setCheckedIndexes: (ids: number[]) => void; setCheckedAll: (checkedAll: CheckedAll) => void; setColumnWidth: (columnIndex: number, options?: { width?: number; updateColumns?: boolean; }) => void; setColumnResizing: (columnResizing: boolean) => void; toggleColumnSort: (columnIndex: number) => void; setPage: (page: BGridPage) => void; handleClick: (index: number, columnIndex: number) => void; setWidth: (width: number) => void; setHeight: (height: number) => void; setContentBodyHeight: (contentBodyHeight: number) => void; setDisplayItemCount: (displayItemCount: number) => void; setLoading: (loading: boolean) => void; setSpinning: (spinning: boolean) => void; setDisabled: (disabled?: boolean) => void; setHeaderHeight: (headerHeight: number) => void; setFooterHeight: (footerHeight: number) => void; setBottomBarHeight: (bottomBarHeight: number) => void; setSummaryHeight: (summaryHeight: number) => void; setSummaryRowHeight: (summaryRowHeight?: number) => void; setItemHeight: (itemHeight: number) => void; setItemPadding: (itemPadding: number) => void; setFrozenColumnIndex: (frozenColumnIndex: number) => void; setFrozenRowCount: (frozenRowCount: number) => void; setFrozenRowsHeight: (frozenRowsHeight: number) => void; setCheckedIndexesMap: (checkedIndexesMap: Map) => void; setRowChecked: (rowChecked?: BGridRowChecked) => void; setSort: (sort?: BGridSortInfo) => void; setSortParams: (sortParams?: Record) => void; setFrozenColumnsWidth: (frozenColumnsWidth: number) => void; setRowKey: (rowKey?: React.Key | React.Key[]) => void; setSelectedRowKey: (rowKey?: React.Key | React.Key[]) => void; setEditable: (editable: boolean) => void; setEditItem: (index: number, columnIndex: number) => void; beginCellEdit: (cell: BGridCellAddress, mode?: BGridCellEditSession['mode'], activation?: BGridCellEditActivation) => void; beginEditorIconInteraction: (cell: BGridCellAddress) => BGridEditorIconSession | undefined; endCellEdit: (sessionId?: number) => void; isCellEditSessionActive: (sessionId: number) => boolean; isCellInteractionSessionActive: (sessionId: number) => boolean; requestCellCommit: (request: BGridCellCommitRequest) => Promise; commitCheckboxCell: (rowIndex: number, columnIndex: number, checked: boolean) => Promise; commitCheckboxColumn: (columnIndex: number, checked: boolean) => Promise; cancelCellInteraction: (sessionId?: number) => void; setOnClick: (onClick?: BGridProps['onClick']) => void; setOnChangeColumns: (onChangeColumns?: BGridProps['onChangeColumns']) => void; setOnChangeData: (onChangeData?: BGridProps['onChangeData']) => void; setOnLoadMore: (onLoadMore?: BGridProps['onLoadMore']) => void; setShowLineNumber: (showLineNumber?: boolean) => void; setMsg: (msg?: BGridProps['msg']) => void; setDisplayPaginationLength: (length: number) => void; setRowClassName: (getRowClassName?: BGridProps['getRowClassName']) => void; setEditTrigger: (editTrigger: BGridEditTrigger) => void; setCellMergeOptions: (cellMergeOptions: BGridProps['cellMergeOptions']) => void; setVariant: (variant: BGridProps['variant']) => void; setSummary: (summary?: BGridProps['summary']) => void; setColumnSortable: (columnSortable?: boolean) => void; sortColumn: (trLevel: number, oldColumn: SortedColumn, newColumn: SortedColumn) => void; setReorder: (reorder?: BGridReorderInfo) => void; setClassName: (className?: string) => void; setStyle: (style?: React.CSSProperties) => void; setReorderingInfo: (reorderingInfo?: BGridReorderingInfo) => void; setActiveCell: (activeCell?: BGridCellAddress, hostCell?: BGridCellAddress) => void; syncActiveCellToBounds: () => void; moveActiveCell: (direction: BGridCellMoveDirection, options?: BGridMoveActiveCellOptions) => BGridCellAddress | undefined; setCellNavigationOptions: (options?: BGridCellNavigationOptions) => void; setCellSelectionRange: (cellSelectionRange?: BGridCellSelectionRange) => void; setCellSelectionRanges: (cellSelectionRanges: BGridCellSelectionRange[]) => void; setCellSelecting: (cellSelecting: boolean) => void; clearCellSelection: () => void; setScrollbar: (scrollbar: BGridResolvedScrollbarOptions) => void; setStatus: (status: BGridResolvedStatusOptions) => void; setPagination: (pagination: BGridResolvedPaginationViewOptions) => void; } export interface SortedColumn { index: number; columnIndex: number; } export interface AppStore extends AppModel, AppActions { } export type ZustandSetter = (partial: Partial, replace?: boolean | undefined) => void; export type ZustandGetter = () => T; export type StoreActions = (set: ZustandSetter>, get: ZustandGetter>) => AppActions; export {};