@alaarab/ogrid-react 2.3.0 → 2.4.1
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/esm/index.js +2501 -173
- package/dist/types/components/ColumnChooserContent.d.ts +53 -0
- package/dist/types/components/ColumnHeaderFilterRenderers.d.ts +15 -1
- package/dist/types/components/FormulaBar.d.ts +25 -0
- package/dist/types/components/FormulaRefOverlay.d.ts +19 -0
- package/dist/types/components/OGridLayout.d.ts +4 -0
- package/dist/types/components/PaginationControlsBase.d.ts +71 -0
- package/dist/types/components/SheetTabs.d.ts +14 -0
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/hooks/useColumnHeaderMenuState.d.ts +23 -0
- package/dist/types/hooks/useFormulaBar.d.ts +43 -0
- package/dist/types/hooks/useOGrid.d.ts +4 -0
- package/dist/types/index.d.ts +15 -5
- package/dist/types/types/dataGridTypes.d.ts +14 -2
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared inner content for ColumnChooser dropdowns across all React UI packages.
|
|
3
|
+
* Each UI package provides its own popover/dropdown wrapper and CheckboxItem slot.
|
|
4
|
+
* Optional Header, OptionsListContainer, OptionItemContainer, and Actions slots
|
|
5
|
+
* allow framework-specific wrappers (e.g. MUI Box/Typography) for Material.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import type { IColumnDefinition } from '../types/columnTypes';
|
|
9
|
+
export interface IColumnChooserCheckboxItemProps {
|
|
10
|
+
columnId: string;
|
|
11
|
+
columnName: string;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
onChange: (checked: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface IColumnChooserActionsProps {
|
|
17
|
+
onClearAll: () => void;
|
|
18
|
+
onSelectAll: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface IColumnChooserHeaderProps {
|
|
21
|
+
visibleCount: number;
|
|
22
|
+
totalCount: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ColumnChooserContentClassNames {
|
|
25
|
+
header?: string;
|
|
26
|
+
optionsList?: string;
|
|
27
|
+
optionItem?: string;
|
|
28
|
+
actions?: string;
|
|
29
|
+
clearButton?: string;
|
|
30
|
+
selectAllButton?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ColumnChooserContentProps {
|
|
33
|
+
columns: IColumnDefinition[];
|
|
34
|
+
visibleColumns: Set<string>;
|
|
35
|
+
visibleCount: number;
|
|
36
|
+
totalCount: number;
|
|
37
|
+
handleSelectAll: () => void;
|
|
38
|
+
handleClearAll: () => void;
|
|
39
|
+
/** Curried handler: (columnId) => (checked: boolean) => void */
|
|
40
|
+
handleCheckboxChange: (columnId: string) => (checked: boolean) => void;
|
|
41
|
+
CheckboxItem: React.ComponentType<IColumnChooserCheckboxItemProps>;
|
|
42
|
+
classNames?: ColumnChooserContentClassNames;
|
|
43
|
+
Header?: React.ComponentType<IColumnChooserHeaderProps>;
|
|
44
|
+
OptionsListContainer?: React.ComponentType<{
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
}>;
|
|
47
|
+
OptionItemContainer?: React.ComponentType<{
|
|
48
|
+
columnId: string;
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}>;
|
|
51
|
+
Actions?: React.ComponentType<IColumnChooserActionsProps>;
|
|
52
|
+
}
|
|
53
|
+
export declare const ColumnChooserContent: React.FC<ColumnChooserContentProps>;
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* to the correct renderer based on filterType, eliminating the duplicated if/switch chain
|
|
7
7
|
* that was previously in each UI package's ColumnHeaderFilter component.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import * as React from 'react';
|
|
10
10
|
import type { ColumnFilterType } from '../types/columnTypes';
|
|
11
11
|
import type { UserLike } from '../types/dataGridTypes';
|
|
12
12
|
import type { UseColumnHeaderFilterStateResult } from '../hooks/useColumnHeaderFilterState';
|
|
13
|
+
import { type DateFilterClassNames } from './ColumnHeaderFilterContent';
|
|
13
14
|
/**
|
|
14
15
|
* Framework-specific renderers for each filter type.
|
|
15
16
|
* Each UI package maps its own sub-filter components to these slots.
|
|
@@ -69,3 +70,16 @@ export interface DateRendererProps {
|
|
|
69
70
|
* @returns The rendered filter content, or null for unsupported filter types
|
|
70
71
|
*/
|
|
71
72
|
export declare function renderFilterContent(filterType: ColumnFilterType, state: UseColumnHeaderFilterStateResult, options: string[], isLoadingOptions: boolean, selectedUser: UserLike | undefined, renderers: FilterContentRenderers): React.ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Factory that creates the standard FilterContentRenderers for packages that use
|
|
75
|
+
* the default prop-passthrough pattern (Radix, Material). Fluent keeps its own
|
|
76
|
+
* memoized renderers because it adds extra event-propagation handlers.
|
|
77
|
+
*
|
|
78
|
+
* @param components - The framework-specific sub-filter popover components
|
|
79
|
+
* @param dateClassNames - Optional CSS class names for the date filter buttons (used by packages with CSS modules)
|
|
80
|
+
*/
|
|
81
|
+
export declare function createBaseFilterRenderers(components: {
|
|
82
|
+
MultiSelectFilterPopover: React.ComponentType<MultiSelectRendererProps>;
|
|
83
|
+
TextFilterPopover: React.ComponentType<TextRendererProps>;
|
|
84
|
+
PeopleFilterPopover: React.ComponentType<PeopleRendererProps>;
|
|
85
|
+
}, dateClassNames?: DateFilterClassNames): FilterContentRenderers;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormulaBar — Headless Excel-style formula bar component.
|
|
3
|
+
*
|
|
4
|
+
* Layout: [Name Box] [fx] [Formula Input]
|
|
5
|
+
*
|
|
6
|
+
* Uses --ogrid-* CSS variables for theming.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
export interface FormulaBarProps {
|
|
10
|
+
/** Active cell reference (e.g. "A1"). */
|
|
11
|
+
cellRef: string | null;
|
|
12
|
+
/** Text displayed/edited in the formula input. */
|
|
13
|
+
formulaText: string;
|
|
14
|
+
/** Whether the input is in editing mode. */
|
|
15
|
+
isEditing: boolean;
|
|
16
|
+
/** Called when the user changes the input text. */
|
|
17
|
+
onInputChange: (text: string) => void;
|
|
18
|
+
/** Commit the formula bar value. */
|
|
19
|
+
onCommit: () => void;
|
|
20
|
+
/** Cancel editing. */
|
|
21
|
+
onCancel: () => void;
|
|
22
|
+
/** Start editing the formula bar. */
|
|
23
|
+
startEditing: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function FormulaBar({ cellRef, formulaText, isEditing, onInputChange, onCommit, onCancel, startEditing, }: FormulaBarProps): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormulaRefOverlay — Renders colored border overlays on cells referenced by
|
|
3
|
+
* the active formula, like Excel's reference highlighting.
|
|
4
|
+
*
|
|
5
|
+
* Uses the same container measurement pattern as MarchingAntsOverlay.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { type FormulaReference } from '@alaarab/ogrid-core';
|
|
9
|
+
export interface FormulaRefOverlayProps {
|
|
10
|
+
/** Ref to the positioned container that wraps the table. */
|
|
11
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
12
|
+
/** References to highlight. */
|
|
13
|
+
references: FormulaReference[];
|
|
14
|
+
/** Column offset (1 when checkbox/row-number columns are present). */
|
|
15
|
+
colOffset: number;
|
|
16
|
+
}
|
|
17
|
+
declare function FormulaRefOverlayInner({ containerRef, references, colOffset, }: FormulaRefOverlayProps): React.ReactElement | null;
|
|
18
|
+
export declare const FormulaRefOverlay: React.MemoExoticComponent<typeof FormulaRefOverlayInner>;
|
|
19
|
+
export {};
|
|
@@ -25,6 +25,10 @@ export interface OGridLayoutProps {
|
|
|
25
25
|
sideBar?: SideBarProps | null;
|
|
26
26
|
/** When true, render a fullscreen toggle button in the toolbar. */
|
|
27
27
|
fullScreen?: boolean;
|
|
28
|
+
/** Formula bar element (rendered between toolbar and grid). */
|
|
29
|
+
formulaBar?: React.ReactNode;
|
|
30
|
+
/** Sheet tabs element (rendered between grid and footer). */
|
|
31
|
+
sheetTabs?: React.ReactNode;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Renders OGrid layout as a unified bordered container:
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared base component for PaginationControls across all React UI packages.
|
|
3
|
+
* Handles hook call, null guard, vm destructure, and renders the full layout structure.
|
|
4
|
+
* Each UI package provides slots for framework-specific interactive elements.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import type { IPaginationControlsProps } from './PaginationControlsProps';
|
|
8
|
+
export interface INavButtonSlotProps {
|
|
9
|
+
variant: 'first' | 'prev' | 'next' | 'last';
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
'aria-label': string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IPageButtonSlotProps {
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
active: boolean;
|
|
18
|
+
'aria-label': string;
|
|
19
|
+
'aria-current'?: 'page';
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface IPageSizeSelectSlotProps {
|
|
24
|
+
value: number;
|
|
25
|
+
options: readonly number[];
|
|
26
|
+
onChange: (value: number) => void;
|
|
27
|
+
'aria-label': string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IOuterContainerSlotProps {
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
role: string;
|
|
34
|
+
'aria-label': string;
|
|
35
|
+
}
|
|
36
|
+
export interface IPaginationControlsSlots {
|
|
37
|
+
NavButton: React.ComponentType<INavButtonSlotProps>;
|
|
38
|
+
PageButton: React.ComponentType<IPageButtonSlotProps>;
|
|
39
|
+
PageSizeSelect: React.ComponentType<IPageSizeSelectSlotProps>;
|
|
40
|
+
OuterContainer?: React.ComponentType<IOuterContainerSlotProps>;
|
|
41
|
+
InfoText?: React.ComponentType<{
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}>;
|
|
44
|
+
NavButtonsContainer?: React.ComponentType<{
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
}>;
|
|
48
|
+
PageSizeContainer?: React.ComponentType<{
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}>;
|
|
52
|
+
PageSizeLabel?: React.ComponentType<Record<string, never>>;
|
|
53
|
+
Ellipsis?: React.ComponentType<Record<string, never>>;
|
|
54
|
+
}
|
|
55
|
+
export interface PaginationControlsBaseClassNames {
|
|
56
|
+
pagination?: string;
|
|
57
|
+
paginationInfo?: string;
|
|
58
|
+
paginationControls?: string;
|
|
59
|
+
pageNumbers?: string;
|
|
60
|
+
ellipsis?: string;
|
|
61
|
+
navBtn?: string;
|
|
62
|
+
pageBtn?: string;
|
|
63
|
+
pageSizeSelector?: string;
|
|
64
|
+
pageSizeLabel?: string;
|
|
65
|
+
pageSizeSelect?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface PaginationControlsBaseProps extends IPaginationControlsProps {
|
|
68
|
+
slots: IPaginationControlsSlots;
|
|
69
|
+
classNames?: PaginationControlsBaseClassNames;
|
|
70
|
+
}
|
|
71
|
+
export declare const PaginationControlsBase: React.FC<PaginationControlsBaseProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SheetTabs — Excel-style sheet tab bar at the bottom of the grid.
|
|
3
|
+
*
|
|
4
|
+
* Layout: [+] [Sheet1] [Sheet2] [Sheet3]
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import type { ISheetDef } from '@alaarab/ogrid-core';
|
|
8
|
+
export interface SheetTabsProps {
|
|
9
|
+
sheets: ISheetDef[];
|
|
10
|
+
activeSheet: string;
|
|
11
|
+
onSheetChange: (sheetId: string) => void;
|
|
12
|
+
onSheetAdd?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function SheetTabs({ sheets, activeSheet, onSheetChange, onSheetAdd, }: SheetTabsProps): React.ReactElement;
|
|
@@ -57,7 +57,7 @@ export { useColumnResize } from './useColumnResize';
|
|
|
57
57
|
export type { UseColumnResizeParams, UseColumnResizeResult, } from './useColumnResize';
|
|
58
58
|
export { useColumnPinning } from './useColumnPinning';
|
|
59
59
|
export type { UseColumnPinningParams, UseColumnPinningResult, } from './useColumnPinning';
|
|
60
|
-
export { useColumnHeaderMenuState } from './useColumnHeaderMenuState';
|
|
60
|
+
export { useColumnHeaderMenuState, getColumnHeaderMenuProps } from './useColumnHeaderMenuState';
|
|
61
61
|
export type { UseColumnHeaderMenuStateParams, UseColumnHeaderMenuStateResult, } from './useColumnHeaderMenuState';
|
|
62
62
|
export { useRichSelectState } from './useRichSelectState';
|
|
63
63
|
export type { UseRichSelectStateParams, UseRichSelectStateResult } from './useRichSelectState';
|
|
@@ -83,3 +83,5 @@ export { useColumnMeta } from './useColumnMeta';
|
|
|
83
83
|
export type { UseColumnMetaParams, ColumnMetaResult } from './useColumnMeta';
|
|
84
84
|
export { useFormulaEngine } from './useFormulaEngine';
|
|
85
85
|
export type { UseFormulaEngineParams, UseFormulaEngineResult } from './useFormulaEngine';
|
|
86
|
+
export { useFormulaBar } from './useFormulaBar';
|
|
87
|
+
export type { UseFormulaBarParams, UseFormulaBarResult } from './useFormulaBar';
|
|
@@ -41,3 +41,26 @@ export interface UseColumnHeaderMenuStateResult {
|
|
|
41
41
|
* Tracks which column's menu is open, anchor element, and action handlers.
|
|
42
42
|
*/
|
|
43
43
|
export declare function useColumnHeaderMenuState(params: UseColumnHeaderMenuStateParams): UseColumnHeaderMenuStateResult;
|
|
44
|
+
/**
|
|
45
|
+
* Maps a UseColumnHeaderMenuStateResult to the flat ColumnHeaderMenuProps shape.
|
|
46
|
+
* Eliminates the 18-prop spread that each DataGridTable package repeats.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getColumnHeaderMenuProps(headerMenu: UseColumnHeaderMenuStateResult): {
|
|
49
|
+
isOpen: boolean;
|
|
50
|
+
anchorElement: HTMLElement | null;
|
|
51
|
+
onClose: () => void;
|
|
52
|
+
onPinLeft: () => void;
|
|
53
|
+
onPinRight: () => void;
|
|
54
|
+
onUnpin: () => void;
|
|
55
|
+
onSortAsc: () => void;
|
|
56
|
+
onSortDesc: () => void;
|
|
57
|
+
onClearSort: () => void;
|
|
58
|
+
onAutosizeThis: () => void;
|
|
59
|
+
onAutosizeAll: () => void;
|
|
60
|
+
canPinLeft: boolean;
|
|
61
|
+
canPinRight: boolean;
|
|
62
|
+
canUnpin: boolean;
|
|
63
|
+
currentSort: "asc" | "desc" | null;
|
|
64
|
+
isSortable: boolean;
|
|
65
|
+
isResizable: boolean;
|
|
66
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFormulaBar — React hook for formula bar state.
|
|
3
|
+
*
|
|
4
|
+
* Manages the formula bar text, editing mode, and reference extraction.
|
|
5
|
+
*/
|
|
6
|
+
import { type FormulaReference } from '@alaarab/ogrid-core';
|
|
7
|
+
export interface UseFormulaBarParams {
|
|
8
|
+
/** Active cell column index (0-based). */
|
|
9
|
+
activeCol: number | null;
|
|
10
|
+
/** Active cell row index (0-based). */
|
|
11
|
+
activeRow: number | null;
|
|
12
|
+
/** Active cell reference string (e.g. "A1"). */
|
|
13
|
+
activeCellRef: string | null;
|
|
14
|
+
/** Get formula string for a cell. */
|
|
15
|
+
getFormula?: (col: number, row: number) => string | undefined;
|
|
16
|
+
/** Get raw display value for a cell. */
|
|
17
|
+
getRawValue?: (col: number, row: number) => unknown;
|
|
18
|
+
/** Set formula for a cell. */
|
|
19
|
+
setFormula?: (col: number, row: number, formula: string | null) => void;
|
|
20
|
+
/** Commit a non-formula value change. */
|
|
21
|
+
onCellValueChanged?: (col: number, row: number, value: unknown) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface UseFormulaBarResult {
|
|
24
|
+
/** Cell reference string (e.g. "A1"). */
|
|
25
|
+
cellRef: string | null;
|
|
26
|
+
/** Text shown in the formula bar input. */
|
|
27
|
+
formulaText: string;
|
|
28
|
+
/** Whether the formula bar input is being edited. */
|
|
29
|
+
isEditing: boolean;
|
|
30
|
+
/** Update the formula bar input text. */
|
|
31
|
+
onInputChange: (text: string) => void;
|
|
32
|
+
/** Commit the current edit. */
|
|
33
|
+
onCommit: () => void;
|
|
34
|
+
/** Cancel the current edit. */
|
|
35
|
+
onCancel: () => void;
|
|
36
|
+
/** Start editing the formula bar. */
|
|
37
|
+
startEditing: () => void;
|
|
38
|
+
/** References extracted from the current formula text (for highlighting). */
|
|
39
|
+
referencedCells: FormulaReference[];
|
|
40
|
+
/** Whether the formula bar is actively being edited (for click-to-insert-ref guards). */
|
|
41
|
+
isFormulaBarEditing: React.MutableRefObject<boolean>;
|
|
42
|
+
}
|
|
43
|
+
export declare function useFormulaBar(params: UseFormulaBarParams): UseFormulaBarResult;
|
|
@@ -32,6 +32,10 @@ export interface UseOGridLayout {
|
|
|
32
32
|
};
|
|
33
33
|
sideBarProps: SideBarProps | null;
|
|
34
34
|
fullScreen?: boolean;
|
|
35
|
+
/** Formula bar element (rendered between toolbar and grid when formulas are enabled). */
|
|
36
|
+
formulaBar?: React.ReactNode;
|
|
37
|
+
/** Sheet tabs element (rendered between grid and footer when sheetDefs are provided). */
|
|
38
|
+
sheetTabs?: React.ReactNode;
|
|
35
39
|
}
|
|
36
40
|
/** Filter state. */
|
|
37
41
|
export interface UseOGridFilters {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, GRID_BORDER_RADIUS, } from '@alaarab/ogrid-core';
|
|
2
|
-
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnDef, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IValueParserParams, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridDataGridProps, RowSelectionMode, RowId, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, HeaderCell, HeaderRow, SideBarPanelId, ISideBarDef, IDateFilterValue, IVirtualScrollConfig, IColumnReorderConfig, } from './types';
|
|
1
|
+
export { CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, ROW_NUMBER_COLUMN_MIN_WIDTH, ROW_NUMBER_COLUMN_ID, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, GRID_BORDER_RADIUS, } from '@alaarab/ogrid-core';
|
|
2
|
+
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnDef, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IValueParserParams, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridDataGridProps, RowSelectionMode, RowId, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, HeaderCell, HeaderRow, SideBarPanelId, ISideBarDef, IDateFilterValue, IVirtualScrollConfig, IColumnReorderConfig, ISheetDef, } from './types';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from './types';
|
|
4
|
-
export { useFilterOptions, useOGrid, useActiveCell, useCellEditing, useContextMenu, useCellSelection, useClipboard, useRowSelection, useKeyboardNavigation, useUndoRedo, useDebounce, useFillHandle, useDataGridState, useColumnHeaderFilterState, useTextFilterState, useMultiSelectFilterState, usePeopleFilterState, useDateFilterState, useColumnChooserState, useInlineCellEditorState, useColumnResize, useRichSelectState, useSelectState, useSideBarState, useTableLayout, useColumnReorder, useVirtualScroll, useListVirtualizer, useLatestRef, usePaginationControls, useDataGridTableOrchestration, useColumnMeta, useFormulaEngine, } from './hooks';
|
|
5
|
-
export type { UseFilterOptionsResult, UseOGridResult, UseOGridPagination, UseOGridColumnChooser, UseOGridLayout, UseOGridFilters, ColumnChooserPlacement, UseActiveCellResult, UseCellEditingResult, EditingCell, UseContextMenuResult, ContextMenuPosition, UseCellSelectionResult, UseCellSelectionParams, UseClipboardResult, UseClipboardParams, UseRowSelectionResult, UseRowSelectionParams, UseKeyboardNavigationResult, UseKeyboardNavigationParams, UseUndoRedoResult, UseUndoRedoParams, UseFillHandleResult, UseFillHandleParams, UseDataGridStateParams, UseDataGridStateResult, DataGridLayoutState, DataGridRowSelectionState, DataGridEditingState, DataGridCellInteractionState, DataGridContextMenuState, DataGridViewModelState, DataGridPinningState, UseColumnHeaderFilterStateParams, UseColumnHeaderFilterStateResult, UseTextFilterStateParams, UseTextFilterStateResult, UseMultiSelectFilterStateParams, UseMultiSelectFilterStateResult, UsePeopleFilterStateParams, UsePeopleFilterStateResult, UseDateFilterStateParams, UseDateFilterStateResult, UseColumnChooserStateParams, UseColumnChooserStateResult, UseInlineCellEditorStateParams, UseInlineCellEditorStateResult, InlineCellEditorType, UseColumnResizeParams, UseColumnResizeResult, UseRichSelectStateParams, UseRichSelectStateResult, UseSelectStateParams, UseSelectStateResult, UseSideBarStateParams, UseSideBarStateResult, UseTableLayoutParams, UseTableLayoutResult, UseColumnReorderParams, UseColumnReorderResult, UseVirtualScrollParams, UseVirtualScrollResult, UsePaginationControlsProps, UsePaginationControlsResult, UseDataGridTableOrchestrationParams, UseDataGridTableOrchestrationResult, UseColumnMetaParams, ColumnMetaResult, UseFormulaEngineParams, UseFormulaEngineResult, } from './hooks';
|
|
4
|
+
export { useFilterOptions, useOGrid, useActiveCell, useCellEditing, useContextMenu, useCellSelection, useClipboard, useRowSelection, useKeyboardNavigation, useUndoRedo, useDebounce, useFillHandle, useDataGridState, useColumnHeaderFilterState, useTextFilterState, useMultiSelectFilterState, usePeopleFilterState, useDateFilterState, useColumnChooserState, useInlineCellEditorState, useColumnResize, useRichSelectState, useSelectState, useSideBarState, useTableLayout, useColumnReorder, useVirtualScroll, useListVirtualizer, useLatestRef, usePaginationControls, useDataGridTableOrchestration, useColumnMeta, useFormulaEngine, useFormulaBar, getColumnHeaderMenuProps, } from './hooks';
|
|
5
|
+
export type { UseFilterOptionsResult, UseOGridResult, UseOGridPagination, UseOGridColumnChooser, UseOGridLayout, UseOGridFilters, ColumnChooserPlacement, UseActiveCellResult, UseCellEditingResult, EditingCell, UseContextMenuResult, ContextMenuPosition, UseCellSelectionResult, UseCellSelectionParams, UseClipboardResult, UseClipboardParams, UseRowSelectionResult, UseRowSelectionParams, UseKeyboardNavigationResult, UseKeyboardNavigationParams, UseUndoRedoResult, UseUndoRedoParams, UseFillHandleResult, UseFillHandleParams, UseDataGridStateParams, UseDataGridStateResult, DataGridLayoutState, DataGridRowSelectionState, DataGridEditingState, DataGridCellInteractionState, DataGridContextMenuState, DataGridViewModelState, DataGridPinningState, UseColumnHeaderFilterStateParams, UseColumnHeaderFilterStateResult, UseTextFilterStateParams, UseTextFilterStateResult, UseMultiSelectFilterStateParams, UseMultiSelectFilterStateResult, UsePeopleFilterStateParams, UsePeopleFilterStateResult, UseDateFilterStateParams, UseDateFilterStateResult, UseColumnChooserStateParams, UseColumnChooserStateResult, UseInlineCellEditorStateParams, UseInlineCellEditorStateResult, InlineCellEditorType, UseColumnResizeParams, UseColumnResizeResult, UseRichSelectStateParams, UseRichSelectStateResult, UseSelectStateParams, UseSelectStateResult, UseSideBarStateParams, UseSideBarStateResult, UseTableLayoutParams, UseTableLayoutResult, UseColumnReorderParams, UseColumnReorderResult, UseVirtualScrollParams, UseVirtualScrollResult, UsePaginationControlsProps, UsePaginationControlsResult, UseDataGridTableOrchestrationParams, UseDataGridTableOrchestrationResult, UseColumnMetaParams, ColumnMetaResult, UseFormulaEngineParams, UseFormulaEngineResult, UseFormulaBarParams, UseFormulaBarResult, } from './hooks';
|
|
6
6
|
export { GRID_ROOT_STYLE, CURSOR_CELL_STYLE, POPOVER_ANCHOR_STYLE, PREVENT_DEFAULT, NOOP, STOP_PROPAGATION, } from './constants/domHelpers';
|
|
7
7
|
export { OGridLayout } from './components/OGridLayout';
|
|
8
8
|
export type { OGridLayoutProps } from './components/OGridLayout';
|
|
@@ -14,10 +14,20 @@ export { GridContextMenu } from './components/GridContextMenu';
|
|
|
14
14
|
export type { GridContextMenuProps, GridContextMenuClassNames } from './components/GridContextMenu';
|
|
15
15
|
export { MarchingAntsOverlay } from './components/MarchingAntsOverlay';
|
|
16
16
|
export type { MarchingAntsOverlayProps } from './components/MarchingAntsOverlay';
|
|
17
|
+
export { FormulaBar } from './components/FormulaBar';
|
|
18
|
+
export type { FormulaBarProps } from './components/FormulaBar';
|
|
19
|
+
export { FormulaRefOverlay } from './components/FormulaRefOverlay';
|
|
20
|
+
export type { FormulaRefOverlayProps } from './components/FormulaRefOverlay';
|
|
21
|
+
export { SheetTabs } from './components/SheetTabs';
|
|
22
|
+
export type { SheetTabsProps } from './components/SheetTabs';
|
|
17
23
|
export { SideBar } from './components/SideBar';
|
|
18
24
|
export type { SideBarProps, SideBarFilterColumn } from './components/SideBar';
|
|
19
25
|
export { BaseColumnHeaderMenu } from './components/BaseColumnHeaderMenu';
|
|
20
26
|
export type { BaseColumnHeaderMenuProps, ColumnHeaderMenuClassNames } from './components/BaseColumnHeaderMenu';
|
|
27
|
+
export { PaginationControlsBase } from './components/PaginationControlsBase';
|
|
28
|
+
export type { PaginationControlsBaseProps, PaginationControlsBaseClassNames, IPaginationControlsSlots, INavButtonSlotProps, IPageButtonSlotProps, IPageSizeSelectSlotProps, IOuterContainerSlotProps, } from './components/PaginationControlsBase';
|
|
29
|
+
export { ColumnChooserContent } from './components/ColumnChooserContent';
|
|
30
|
+
export type { ColumnChooserContentProps, ColumnChooserContentClassNames, IColumnChooserCheckboxItemProps, IColumnChooserActionsProps, IColumnChooserHeaderProps, } from './components/ColumnChooserContent';
|
|
21
31
|
export { createOGrid } from './components/createOGrid';
|
|
22
32
|
export type { CreateOGridComponents, GridRowProps, InlineCellEditorProps } from './components/createOGrid';
|
|
23
33
|
export { CellErrorBoundary } from './components/CellErrorBoundary';
|
|
@@ -34,7 +44,7 @@ export { DateFilterContent, getColumnHeaderFilterStateParams, getDateFilterConte
|
|
|
34
44
|
export type { IColumnHeaderFilterProps, DateFilterContentProps, DateFilterClassNames, } from './components/ColumnHeaderFilterContent';
|
|
35
45
|
export { escapeCsvValue, buildCsvHeader, buildCsvRows, exportToCsv, triggerCsvDownload, getCellValue, flattenColumns, buildHeaderRows, getFilterField, mergeFilter, deriveFilterOptionsFromData, getMultiSelectFilterFields, getStatusBarParts, getDataGridStatusBarConfig, GRID_CONTEXT_MENU_ITEMS, COLUMN_HEADER_MENU_ITEMS, getContextMenuHandlers, getColumnHeaderMenuItems, formatShortcut, getPaginationViewModel, PAGE_SIZE_OPTIONS, MAX_PAGE_BUTTONS, getHeaderFilterConfig, getCellRenderDescriptor, CellDescriptorCache, isRowInRange, resolveCellDisplayContent, resolveCellStyle, buildInlineEditorProps, buildPopoverEditorProps, getCellInteractionProps, parseValue, numberParser, currencyParser, dateParser, emailParser, booleanParser, computeAggregations, processClientSideData, partitionColumnsForVirtualization, areGridRowPropsEqual, findCtrlArrowTarget, computeTabNavigation, rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, UndoRedoStack, indexToColumnLetter, formatCellReference, } from './utils';
|
|
36
46
|
export type { CsvColumn, StatusBarPart, StatusBarPartsInput, GridContextMenuItem, GridContextMenuHandlerProps, PaginationViewModel, HeaderFilterConfigInput, HeaderFilterConfig, CellRenderDescriptorInput, CellRenderDescriptor, CellRenderMode, CellInteractionHandlers, ParseValueResult, AggregationResult, GridRowComparatorProps, IColumnHeaderMenuItem, ColumnHeaderMenuInput, ColumnHeaderMenuHandlers, } from './utils';
|
|
37
|
-
export { renderFilterContent } from './components/ColumnHeaderFilterRenderers';
|
|
47
|
+
export { renderFilterContent, createBaseFilterRenderers } from './components/ColumnHeaderFilterRenderers';
|
|
38
48
|
export type { FilterContentRenderers, MultiSelectRendererProps, TextRendererProps, PeopleRendererProps, DateRendererProps, } from './components/ColumnHeaderFilterRenderers';
|
|
39
49
|
export type { IColumnChooserProps } from './components/ColumnChooserProps';
|
|
40
50
|
export type { IPaginationControlsProps } from './components/PaginationControlsProps';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IColumnDef, IColumnGroupDef, ICellValueChangedEvent } from './columnTypes';
|
|
3
3
|
import type { IFormulaFunction, IRecalcResult, IGridDataAccessor, IAuditEntry, IAuditTrail } from '@alaarab/ogrid-core';
|
|
4
|
-
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IColumnReorderConfig, IOGridApi, } from '@alaarab/ogrid-core';
|
|
4
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, ISheetDef, IVirtualScrollConfig, IColumnReorderConfig, IOGridApi, } from '@alaarab/ogrid-core';
|
|
5
5
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from '@alaarab/ogrid-core';
|
|
6
|
-
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef, IVirtualScrollConfig } from '@alaarab/ogrid-core';
|
|
6
|
+
import type { RowId, UserLike, IFilters, FilterValue, RowSelectionMode, IRowSelectionChangeEvent, IStatusBarProps, IDataSource, ISideBarDef, ISheetDef, IVirtualScrollConfig } from '@alaarab/ogrid-core';
|
|
7
7
|
/** Base props shared by both client-side and server-side OGrid modes. */
|
|
8
8
|
interface IOGridBaseProps<T> {
|
|
9
9
|
columns: (IColumnDef<T> | IColumnGroupDef<T>)[];
|
|
@@ -113,6 +113,14 @@ interface IOGridBaseProps<T> {
|
|
|
113
113
|
namedRanges?: Record<string, string>;
|
|
114
114
|
/** Sheet accessors for cross-sheet formula references (e.g. { Sheet2: accessor }). */
|
|
115
115
|
sheets?: Record<string, IGridDataAccessor>;
|
|
116
|
+
/** Sheet definitions for bottom tab bar. When set, renders Excel-style sheet tabs. */
|
|
117
|
+
sheetDefs?: ISheetDef[];
|
|
118
|
+
/** Currently active sheet id. */
|
|
119
|
+
activeSheet?: string;
|
|
120
|
+
/** Called when the user switches sheets. */
|
|
121
|
+
onSheetChange?: (sheetId: string) => void;
|
|
122
|
+
/** Called when the user clicks the add-sheet button. */
|
|
123
|
+
onSheetAdd?: () => void;
|
|
116
124
|
'aria-label'?: string;
|
|
117
125
|
'aria-labelledby'?: string;
|
|
118
126
|
}
|
|
@@ -228,4 +236,8 @@ export interface IOGridDataGridProps<T> {
|
|
|
228
236
|
getDependents?: (col: number, row: number) => IAuditEntry[];
|
|
229
237
|
/** Get full audit trail for a cell. */
|
|
230
238
|
getAuditTrail?: (col: number, row: number) => IAuditTrail | null;
|
|
239
|
+
/** Monotonic counter incremented on each formula recalculation — used for cache invalidation. */
|
|
240
|
+
formulaVersion?: number;
|
|
241
|
+
/** Cell references to highlight (from active formula in formula bar). */
|
|
242
|
+
formulaReferences?: import('@alaarab/ogrid-core').FormulaReference[];
|
|
231
243
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { ColumnFilterType, IColumnFilterDef, IColumnMeta, IColumnDef, IColumnGroupDef, IColumnDefinition, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IValueParserParams, IDateFilterValue, HeaderCell, HeaderRow, } from './columnTypes';
|
|
2
|
-
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IColumnReorderConfig, } from './dataGridTypes';
|
|
2
|
+
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, IOGridApi, IOGridProps, IOGridClientProps, IOGridServerProps, IOGridDataGridProps, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, IVirtualScrollConfig, IColumnReorderConfig, ISheetDef, } from './dataGridTypes';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange } from './dataGridTypes';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "OGrid React – React hooks, headless components, and utilities for OGrid data grids.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"node": ">=18"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@alaarab/ogrid-core": "2.
|
|
42
|
+
"@alaarab/ogrid-core": "2.4.1",
|
|
43
43
|
"@tanstack/react-virtual": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|