@kanunilabs/datagrid-react 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +2 -2
- package/dist/styles.css +91 -0
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -804,6 +804,8 @@ interface GridHeaderProps<TRow = GridRowData> {
|
|
|
804
804
|
rowNumberHeader?: React.ReactNode;
|
|
805
805
|
/** 'all' | 'some' | 'none' — drives the tri-state select-all box. */
|
|
806
806
|
selectAllState?: 'all' | 'some' | 'none';
|
|
807
|
+
/** No row in the result can be selected (`selection.isRowSelectable`). */
|
|
808
|
+
selectAllDisabled?: boolean;
|
|
807
809
|
onToggleSelectAll?: () => void;
|
|
808
810
|
/** Make headers draggable onto the group panel. */
|
|
809
811
|
draggable?: boolean;
|
|
@@ -829,8 +831,13 @@ interface GridHeaderProps<TRow = GridRowData> {
|
|
|
829
831
|
onAutoFit?: (columnId: string) => void;
|
|
830
832
|
/** Right-click on a header cell (Enterprise header menu). */
|
|
831
833
|
onHeaderContextMenu?: (columnId: string, event: React.MouseEvent) => void;
|
|
834
|
+
/**
|
|
835
|
+
* The grouping levels: the group column (`grouping.display: 'column'`)
|
|
836
|
+
* shows the direction of the first one, since its click sorts them all.
|
|
837
|
+
*/
|
|
838
|
+
groupLevels?: readonly string[];
|
|
832
839
|
}
|
|
833
|
-
declare function GridHeaderImpl<TRow = GridRowData>({ bandOffset, stickyInsets, layout, centerColumns, leadingSpacer, trailingSpacer, sort, sortable, onSort, headerFilter, filteredColumns, onOpenFilter, filterIconMode, checkboxColumn, detailColumn, rowNumberColumn, rowNumberHeader, selectAllState, onToggleSelectAll, draggable, reorderable, onReorder, resizable, onResize, onAutoFit, onHeaderContextMenu, }: GridHeaderProps<TRow>): react.JSX.Element;
|
|
840
|
+
declare function GridHeaderImpl<TRow = GridRowData>({ bandOffset, stickyInsets, layout, centerColumns, leadingSpacer, trailingSpacer, sort, sortable, onSort, headerFilter, filteredColumns, onOpenFilter, filterIconMode, checkboxColumn, detailColumn, rowNumberColumn, rowNumberHeader, selectAllState, selectAllDisabled, onToggleSelectAll, draggable, reorderable, onReorder, resizable, onResize, onAutoFit, onHeaderContextMenu, groupLevels, }: GridHeaderProps<TRow>): react.JSX.Element;
|
|
834
841
|
declare const GridHeader: typeof GridHeaderImpl;
|
|
835
842
|
|
|
836
843
|
/**
|
|
@@ -900,6 +907,18 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
900
907
|
trailingSpacer: number;
|
|
901
908
|
striped: boolean;
|
|
902
909
|
selected: boolean;
|
|
910
|
+
/**
|
|
911
|
+
* Whether the row tells a screen reader its selection state
|
|
912
|
+
* (`aria-selected`). Off where rows cannot be selected — a grid without
|
|
913
|
+
* selection, a pinned row — so the reader does not say "not selected" on
|
|
914
|
+
* every one. Default true.
|
|
915
|
+
*/
|
|
916
|
+
ariaSelectable?: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* False when `selection.isRowSelectable` refuses this row: its checkbox is
|
|
919
|
+
* drawn disabled. Default true.
|
|
920
|
+
*/
|
|
921
|
+
selectable?: boolean;
|
|
903
922
|
/**
|
|
904
923
|
* A group header's checkbox state — its rows all, some or none selected.
|
|
905
924
|
* Absent: no checkbox (single selection, or no checkbox column).
|
|
@@ -911,7 +930,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
911
930
|
* `grouping.display`: `'aligned'` draws a group row as cells, its name in
|
|
912
931
|
* the first visible column and each summary under its own column.
|
|
913
932
|
*/
|
|
914
|
-
groupDisplay?: 'fullWidth' | 'aligned';
|
|
933
|
+
groupDisplay?: 'fullWidth' | 'aligned' | 'column';
|
|
915
934
|
/** Column id holding keyboard focus in this row, or null. */
|
|
916
935
|
focusedColumnId: string | null;
|
|
917
936
|
/** Highlight this row as the focused one (`focusedRow` is on). */
|
|
@@ -1046,7 +1065,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1046
1065
|
onCellPointerEnter?: (ctx: CellSlotContext<TRow>, event: React.MouseEvent) => void;
|
|
1047
1066
|
onCellDoubleClick?: (ctx: CellSlotContext<TRow>) => void;
|
|
1048
1067
|
}
|
|
1049
|
-
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, rowNumberColumn, rowNumber, getNote, getSpan, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1068
|
+
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, rowNumberColumn, rowNumber, getNote, getSpan, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1050
1069
|
declare const GridRow: typeof GridRowImpl;
|
|
1051
1070
|
|
|
1052
1071
|
interface GridFilterRowProps<TRow = GridRowData> {
|
|
@@ -1389,7 +1408,7 @@ interface GridPagerProps {
|
|
|
1389
1408
|
pageSizes?: number[];
|
|
1390
1409
|
/** Rows after filtering (the thing being paged through). */
|
|
1391
1410
|
totalRows: number;
|
|
1392
|
-
/** Absolute jump (first/last). */
|
|
1411
|
+
/** Absolute jump (first/last, and a numbered page button). */
|
|
1393
1412
|
onPage: (page: number) => void;
|
|
1394
1413
|
/**
|
|
1395
1414
|
* RELATIVE moves go through their own callbacks so they read the controller's
|
|
@@ -1400,9 +1419,22 @@ interface GridPagerProps {
|
|
|
1400
1419
|
onNext: () => void;
|
|
1401
1420
|
onPrevious: () => void;
|
|
1402
1421
|
onPageSize: (size: number) => void;
|
|
1403
|
-
|
|
1422
|
+
/**
|
|
1423
|
+
* Numbered page buttons — `1 2 3 … 40` — in place of "Page 3 of 40"
|
|
1424
|
+
* (`pagination.pageButtons`). The current page's button carries
|
|
1425
|
+
* `aria-current="page"`.
|
|
1426
|
+
*/
|
|
1427
|
+
pageButtons?: boolean;
|
|
1428
|
+
/** Most slots the numbered buttons take, ellipses included. Default 7, at least 5. */
|
|
1429
|
+
maxPageButtons?: number;
|
|
1430
|
+
/**
|
|
1431
|
+
* Overrides for the pager's words. `pageButton` is a numbered button's
|
|
1432
|
+
* accessible name, with `{n}` for the page; `navigation` names the pager
|
|
1433
|
+
* itself.
|
|
1434
|
+
*/
|
|
1435
|
+
labels?: Partial<Record<'first' | 'previous' | 'next' | 'last' | 'page' | 'of' | 'rowsPerPage' | 'pageButton' | 'navigation', string>>;
|
|
1404
1436
|
}
|
|
1405
|
-
declare function GridPagerImpl({ page, pageCount, pageSize, pageSizes, totalRows, onPage, onNext, onPrevious, onPageSize, labels, }: GridPagerProps): react.JSX.Element;
|
|
1437
|
+
declare function GridPagerImpl({ page, pageCount, pageSize, pageSizes, totalRows, onPage, onNext, onPrevious, onPageSize, pageButtons, maxPageButtons, labels, }: GridPagerProps): react.JSX.Element;
|
|
1406
1438
|
declare const GridPager: react.MemoExoticComponent<typeof GridPagerImpl>;
|
|
1407
1439
|
|
|
1408
1440
|
/** Labels, so the menu can be localized without rebuilding the item list. */
|
package/dist/index.d.ts
CHANGED
|
@@ -804,6 +804,8 @@ interface GridHeaderProps<TRow = GridRowData> {
|
|
|
804
804
|
rowNumberHeader?: React.ReactNode;
|
|
805
805
|
/** 'all' | 'some' | 'none' — drives the tri-state select-all box. */
|
|
806
806
|
selectAllState?: 'all' | 'some' | 'none';
|
|
807
|
+
/** No row in the result can be selected (`selection.isRowSelectable`). */
|
|
808
|
+
selectAllDisabled?: boolean;
|
|
807
809
|
onToggleSelectAll?: () => void;
|
|
808
810
|
/** Make headers draggable onto the group panel. */
|
|
809
811
|
draggable?: boolean;
|
|
@@ -829,8 +831,13 @@ interface GridHeaderProps<TRow = GridRowData> {
|
|
|
829
831
|
onAutoFit?: (columnId: string) => void;
|
|
830
832
|
/** Right-click on a header cell (Enterprise header menu). */
|
|
831
833
|
onHeaderContextMenu?: (columnId: string, event: React.MouseEvent) => void;
|
|
834
|
+
/**
|
|
835
|
+
* The grouping levels: the group column (`grouping.display: 'column'`)
|
|
836
|
+
* shows the direction of the first one, since its click sorts them all.
|
|
837
|
+
*/
|
|
838
|
+
groupLevels?: readonly string[];
|
|
832
839
|
}
|
|
833
|
-
declare function GridHeaderImpl<TRow = GridRowData>({ bandOffset, stickyInsets, layout, centerColumns, leadingSpacer, trailingSpacer, sort, sortable, onSort, headerFilter, filteredColumns, onOpenFilter, filterIconMode, checkboxColumn, detailColumn, rowNumberColumn, rowNumberHeader, selectAllState, onToggleSelectAll, draggable, reorderable, onReorder, resizable, onResize, onAutoFit, onHeaderContextMenu, }: GridHeaderProps<TRow>): react.JSX.Element;
|
|
840
|
+
declare function GridHeaderImpl<TRow = GridRowData>({ bandOffset, stickyInsets, layout, centerColumns, leadingSpacer, trailingSpacer, sort, sortable, onSort, headerFilter, filteredColumns, onOpenFilter, filterIconMode, checkboxColumn, detailColumn, rowNumberColumn, rowNumberHeader, selectAllState, selectAllDisabled, onToggleSelectAll, draggable, reorderable, onReorder, resizable, onResize, onAutoFit, onHeaderContextMenu, groupLevels, }: GridHeaderProps<TRow>): react.JSX.Element;
|
|
834
841
|
declare const GridHeader: typeof GridHeaderImpl;
|
|
835
842
|
|
|
836
843
|
/**
|
|
@@ -900,6 +907,18 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
900
907
|
trailingSpacer: number;
|
|
901
908
|
striped: boolean;
|
|
902
909
|
selected: boolean;
|
|
910
|
+
/**
|
|
911
|
+
* Whether the row tells a screen reader its selection state
|
|
912
|
+
* (`aria-selected`). Off where rows cannot be selected — a grid without
|
|
913
|
+
* selection, a pinned row — so the reader does not say "not selected" on
|
|
914
|
+
* every one. Default true.
|
|
915
|
+
*/
|
|
916
|
+
ariaSelectable?: boolean;
|
|
917
|
+
/**
|
|
918
|
+
* False when `selection.isRowSelectable` refuses this row: its checkbox is
|
|
919
|
+
* drawn disabled. Default true.
|
|
920
|
+
*/
|
|
921
|
+
selectable?: boolean;
|
|
903
922
|
/**
|
|
904
923
|
* A group header's checkbox state — its rows all, some or none selected.
|
|
905
924
|
* Absent: no checkbox (single selection, or no checkbox column).
|
|
@@ -911,7 +930,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
911
930
|
* `grouping.display`: `'aligned'` draws a group row as cells, its name in
|
|
912
931
|
* the first visible column and each summary under its own column.
|
|
913
932
|
*/
|
|
914
|
-
groupDisplay?: 'fullWidth' | 'aligned';
|
|
933
|
+
groupDisplay?: 'fullWidth' | 'aligned' | 'column';
|
|
915
934
|
/** Column id holding keyboard focus in this row, or null. */
|
|
916
935
|
focusedColumnId: string | null;
|
|
917
936
|
/** Highlight this row as the focused one (`focusedRow` is on). */
|
|
@@ -1046,7 +1065,7 @@ interface GridRowProps<TRow = GridRowData> {
|
|
|
1046
1065
|
onCellPointerEnter?: (ctx: CellSlotContext<TRow>, event: React.MouseEvent) => void;
|
|
1047
1066
|
onCellDoubleClick?: (ctx: CellSlotContext<TRow>) => void;
|
|
1048
1067
|
}
|
|
1049
|
-
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, rowNumberColumn, rowNumber, getNote, getSpan, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1068
|
+
declare function GridRowImpl<TRow = GridRowData>({ gridId, node, index, layout, columnModel, centerColumns, centerIndices, stickyInsets, leadingSpacer, trailingSpacer, striped, selected, ariaSelectable, selectable, groupSelection, onToggleGroupSelect, groupDisplay, focusedColumnId, rowFocused, renderRow, checkboxColumn, rowNumberColumn, rowNumber, getNote, getSpan, headerRowCount, onRowClick, onRowMouseDown, onRowDoubleClick, onToggleSelect, onCellMouseDown, onRowContextMenu, searchNeedle, onToggleGroup, summaryDefs, detailColumn, detailExpanded, onToggleDetail, onToggleTreeRow, renderDetail, renderEditForm, renderCellContent, getCellClassName, onCellPointerDown, onCellPointerEnter, onCellDoubleClick, rowDrag, dropSide, height, }: GridRowProps<TRow>): react.JSX.Element | null;
|
|
1050
1069
|
declare const GridRow: typeof GridRowImpl;
|
|
1051
1070
|
|
|
1052
1071
|
interface GridFilterRowProps<TRow = GridRowData> {
|
|
@@ -1389,7 +1408,7 @@ interface GridPagerProps {
|
|
|
1389
1408
|
pageSizes?: number[];
|
|
1390
1409
|
/** Rows after filtering (the thing being paged through). */
|
|
1391
1410
|
totalRows: number;
|
|
1392
|
-
/** Absolute jump (first/last). */
|
|
1411
|
+
/** Absolute jump (first/last, and a numbered page button). */
|
|
1393
1412
|
onPage: (page: number) => void;
|
|
1394
1413
|
/**
|
|
1395
1414
|
* RELATIVE moves go through their own callbacks so they read the controller's
|
|
@@ -1400,9 +1419,22 @@ interface GridPagerProps {
|
|
|
1400
1419
|
onNext: () => void;
|
|
1401
1420
|
onPrevious: () => void;
|
|
1402
1421
|
onPageSize: (size: number) => void;
|
|
1403
|
-
|
|
1422
|
+
/**
|
|
1423
|
+
* Numbered page buttons — `1 2 3 … 40` — in place of "Page 3 of 40"
|
|
1424
|
+
* (`pagination.pageButtons`). The current page's button carries
|
|
1425
|
+
* `aria-current="page"`.
|
|
1426
|
+
*/
|
|
1427
|
+
pageButtons?: boolean;
|
|
1428
|
+
/** Most slots the numbered buttons take, ellipses included. Default 7, at least 5. */
|
|
1429
|
+
maxPageButtons?: number;
|
|
1430
|
+
/**
|
|
1431
|
+
* Overrides for the pager's words. `pageButton` is a numbered button's
|
|
1432
|
+
* accessible name, with `{n}` for the page; `navigation` names the pager
|
|
1433
|
+
* itself.
|
|
1434
|
+
*/
|
|
1435
|
+
labels?: Partial<Record<'first' | 'previous' | 'next' | 'last' | 'page' | 'of' | 'rowsPerPage' | 'pageButton' | 'navigation', string>>;
|
|
1404
1436
|
}
|
|
1405
|
-
declare function GridPagerImpl({ page, pageCount, pageSize, pageSizes, totalRows, onPage, onNext, onPrevious, onPageSize, labels, }: GridPagerProps): react.JSX.Element;
|
|
1437
|
+
declare function GridPagerImpl({ page, pageCount, pageSize, pageSizes, totalRows, onPage, onNext, onPrevious, onPageSize, pageButtons, maxPageButtons, labels, }: GridPagerProps): react.JSX.Element;
|
|
1406
1438
|
declare const GridPager: react.MemoExoticComponent<typeof GridPagerImpl>;
|
|
1407
1439
|
|
|
1408
1440
|
/** Labels, so the menu can be localized without rebuilding the item list. */
|