@alaarab/ogrid-react-radix 2.0.0-beta
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/README.md +78 -0
- package/dist/esm/ColumnChooser/ColumnChooser.js +22 -0
- package/dist/esm/ColumnChooser/ColumnChooser.module.css +140 -0
- package/dist/esm/ColumnHeaderFilter/ColumnHeaderFilter.js +55 -0
- package/dist/esm/ColumnHeaderFilter/ColumnHeaderFilter.module.css +332 -0
- package/dist/esm/ColumnHeaderFilter/MultiSelectFilterPopover.js +5 -0
- package/dist/esm/ColumnHeaderFilter/PeopleFilterPopover.js +19 -0
- package/dist/esm/ColumnHeaderFilter/TextFilterPopover.js +4 -0
- package/dist/esm/ColumnHeaderFilter/index.js +1 -0
- package/dist/esm/DataGridTable/DataGridTable.js +155 -0
- package/dist/esm/DataGridTable/DataGridTable.module.css +493 -0
- package/dist/esm/DataGridTable/GridContextMenu.js +35 -0
- package/dist/esm/DataGridTable/InlineCellEditor.js +9 -0
- package/dist/esm/DataGridTable/StatusBar.js +7 -0
- package/dist/esm/OGrid/OGrid.js +16 -0
- package/dist/esm/PaginationControls/PaginationControls.js +31 -0
- package/dist/esm/PaginationControls/PaginationControls.module.css +110 -0
- package/dist/esm/index.js +8 -0
- package/dist/types/ColumnChooser/ColumnChooser.d.ts +10 -0
- package/dist/types/ColumnHeaderFilter/ColumnHeaderFilter.d.ts +22 -0
- package/dist/types/ColumnHeaderFilter/MultiSelectFilterPopover.d.ts +14 -0
- package/dist/types/ColumnHeaderFilter/PeopleFilterPopover.d.ts +13 -0
- package/dist/types/ColumnHeaderFilter/TextFilterPopover.d.ts +8 -0
- package/dist/types/ColumnHeaderFilter/index.d.ts +1 -0
- package/dist/types/DataGridTable/DataGridTable.d.ts +5 -0
- package/dist/types/DataGridTable/GridContextMenu.d.ts +10 -0
- package/dist/types/DataGridTable/InlineCellEditor.d.ts +12 -0
- package/dist/types/DataGridTable/StatusBar.d.ts +16 -0
- package/dist/types/OGrid/OGrid.d.ts +5 -0
- package/dist/types/PaginationControls/PaginationControls.d.ts +12 -0
- package/dist/types/index.d.ts +6 -0
- package/package.json +62 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Checkbox from '@radix-ui/react-checkbox';
|
|
3
|
+
import { BaseInlineCellEditor, selectEditorStyle } from '@alaarab/ogrid-react';
|
|
4
|
+
const selectWrapperStyle = { width: '100%', height: '100%', display: 'flex', alignItems: 'center', padding: '6px 10px', boxSizing: 'border-box', overflow: 'hidden', minWidth: 0 };
|
|
5
|
+
export function InlineCellEditor(props) {
|
|
6
|
+
return (_jsx(BaseInlineCellEditor, { ...props, renderCheckbox: (checked, onCommit, onCancel) => (_jsx(Checkbox.Root, { checked: checked, onCheckedChange: (c) => onCommit(c === true), onKeyDown: (e) => e.key === 'Escape' && (e.preventDefault(), onCancel()), children: _jsx(Checkbox.Indicator, { children: "\u2713" }) })), renderSelect: (value, values, onCommit, onCancel) => {
|
|
7
|
+
return (_jsx("div", { style: selectWrapperStyle, children: _jsx("select", { value: value !== null && value !== undefined ? String(value) : '', onChange: (e) => onCommit(e.target.value), onKeyDown: (e) => e.key === 'Escape' && (e.preventDefault(), onCancel()), autoFocus: true, style: selectEditorStyle, children: values.map((v) => (_jsx("option", { value: String(v), children: String(v) }, String(v)))) }) }));
|
|
8
|
+
} }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getStatusBarParts } from '@alaarab/ogrid-react';
|
|
3
|
+
import styles from './DataGridTable.module.css';
|
|
4
|
+
export function StatusBar(props) {
|
|
5
|
+
const parts = getStatusBarParts(props);
|
|
6
|
+
return (_jsx("div", { className: styles.statusBar, role: "status", "aria-live": "polite", children: parts.map((p) => (_jsxs("span", { className: styles.statusBarItem, children: [_jsx("span", { className: styles.statusBarLabel, children: p.label }), _jsx("span", { className: styles.statusBarValue, children: p.value.toLocaleString() })] }, p.key))) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { DataGridTable } from '../DataGridTable/DataGridTable';
|
|
5
|
+
import { ColumnChooser } from '../ColumnChooser/ColumnChooser';
|
|
6
|
+
import { PaginationControls } from '../PaginationControls/PaginationControls';
|
|
7
|
+
import { useOGrid, OGridLayout, } from '@alaarab/ogrid-react';
|
|
8
|
+
const OGridInner = forwardRef(function OGridInner(props, ref) {
|
|
9
|
+
const { dataGridProps, pagination, columnChooser, layout } = useOGrid(props, ref);
|
|
10
|
+
return (_jsx(OGridLayout, { className: layout.className, sideBar: layout.sideBarProps, toolbar: layout.toolbar, toolbarBelow: layout.toolbarBelow, toolbarEnd: columnChooser.placement === 'toolbar' ? (_jsx(ColumnChooser, { columns: columnChooser.columns, visibleColumns: columnChooser.visibleColumns, onVisibilityChange: columnChooser.onVisibilityChange })) : undefined, pagination: _jsx(PaginationControls, { currentPage: pagination.page, pageSize: pagination.pageSize, totalCount: pagination.displayTotalCount, onPageChange: pagination.setPage, onPageSizeChange: (size) => {
|
|
11
|
+
pagination.setPageSize(size);
|
|
12
|
+
pagination.setPage(1);
|
|
13
|
+
}, pageSizeOptions: pagination.pageSizeOptions, entityLabelPlural: pagination.entityLabelPlural }), children: _jsx(DataGridTable, { ...dataGridProps }) }));
|
|
14
|
+
});
|
|
15
|
+
OGridInner.displayName = 'OGrid';
|
|
16
|
+
export const OGrid = React.memo(OGridInner);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useMemo, useCallback } from 'react';
|
|
4
|
+
import { getPaginationViewModel } from '@alaarab/ogrid-react';
|
|
5
|
+
import styles from './PaginationControls.module.css';
|
|
6
|
+
function ChevronLeft() {
|
|
7
|
+
return _jsx("span", { "aria-hidden": true, children: "\u2039" });
|
|
8
|
+
}
|
|
9
|
+
function ChevronRight() {
|
|
10
|
+
return _jsx("span", { "aria-hidden": true, children: "\u203A" });
|
|
11
|
+
}
|
|
12
|
+
function ChevronDoubleLeft() {
|
|
13
|
+
return _jsx("span", { "aria-hidden": true, children: "\u00AB" });
|
|
14
|
+
}
|
|
15
|
+
function ChevronDoubleRight() {
|
|
16
|
+
return _jsx("span", { "aria-hidden": true, children: "\u00BB" });
|
|
17
|
+
}
|
|
18
|
+
export const PaginationControls = React.memo((props) => {
|
|
19
|
+
const { currentPage, pageSize, totalCount, onPageChange, onPageSizeChange, pageSizeOptions, entityLabelPlural, className } = props;
|
|
20
|
+
const labelPlural = entityLabelPlural ?? 'items';
|
|
21
|
+
const vm = useMemo(() => getPaginationViewModel(currentPage, pageSize, totalCount, pageSizeOptions ? { pageSizeOptions } : undefined), [currentPage, pageSize, totalCount, pageSizeOptions]);
|
|
22
|
+
const handlePageSizeChange = useCallback((e) => {
|
|
23
|
+
onPageSizeChange(Number(e.target.value));
|
|
24
|
+
}, [onPageSizeChange]);
|
|
25
|
+
if (!vm) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const { pageNumbers, showStartEllipsis, showEndEllipsis, totalPages, startItem, endItem } = vm;
|
|
29
|
+
return (_jsxs("div", { className: `${styles.pagination} ${className || ''}`, role: "navigation", "aria-label": "Pagination", children: [_jsxs("div", { className: styles.paginationInfo, children: ["Showing ", startItem, " to ", endItem, " of ", totalCount.toLocaleString(), " ", labelPlural] }), _jsxs("div", { className: styles.paginationControls, children: [_jsx("button", { type: "button", className: styles.navBtn, onClick: () => onPageChange(1), disabled: currentPage === 1, "aria-label": "First page", children: _jsx(ChevronDoubleLeft, {}) }), _jsx("button", { type: "button", className: styles.navBtn, onClick: () => onPageChange(currentPage - 1), disabled: currentPage === 1, "aria-label": "Previous page", children: _jsx(ChevronLeft, {}) }), _jsxs("div", { className: styles.pageNumbers, children: [showStartEllipsis && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: styles.pageBtn, onClick: () => onPageChange(1), "aria-label": "Page 1", children: "1" }), _jsx("span", { className: styles.ellipsis, "aria-hidden": true, children: "\u2026" })] })), pageNumbers.map((pageNum) => (_jsx("button", { type: "button", className: `${styles.pageBtn} ${currentPage === pageNum ? styles.active : ''}`, onClick: () => onPageChange(pageNum), "aria-label": `Page ${pageNum}`, "aria-current": currentPage === pageNum ? 'page' : undefined, children: pageNum }, pageNum))), showEndEllipsis && (_jsxs(_Fragment, { children: [_jsx("span", { className: styles.ellipsis, "aria-hidden": true, children: "\u2026" }), _jsx("button", { type: "button", className: styles.pageBtn, onClick: () => onPageChange(totalPages), "aria-label": `Page ${totalPages}`, children: totalPages })] }))] }), _jsx("button", { type: "button", className: styles.navBtn, onClick: () => onPageChange(currentPage + 1), disabled: currentPage >= totalPages, "aria-label": "Next page", children: _jsx(ChevronRight, {}) }), _jsx("button", { type: "button", className: styles.navBtn, onClick: () => onPageChange(totalPages), disabled: currentPage >= totalPages, "aria-label": "Last page", children: _jsx(ChevronDoubleRight, {}) })] }), _jsxs("div", { className: styles.pageSizeSelector, children: [_jsx("span", { className: styles.pageSizeLabel, children: "Rows" }), _jsx("select", { className: styles.pageSizeSelect, value: String(pageSize), onChange: handlePageSizeChange, "aria-label": "Rows per page", children: vm.pageSizeOptions.map((n) => (_jsx("option", { value: n, children: n }, n))) })] })] }));
|
|
30
|
+
});
|
|
31
|
+
PaginationControls.displayName = 'PaginationControls';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
.pagination {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
gap: 14px 24px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.paginationInfo {
|
|
14
|
+
font-size: 13px;
|
|
15
|
+
color: var(--ogrid-muted, #606060);
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
font-variant-numeric: tabular-nums;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.paginationControls {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 4px;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.navBtn {
|
|
31
|
+
min-width: 28px;
|
|
32
|
+
min-height: 28px;
|
|
33
|
+
padding: 4px;
|
|
34
|
+
border: 1px solid var(--ogrid-border, #ccc);
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
background: var(--ogrid-bg, #fff);
|
|
37
|
+
color: var(--ogrid-fg, #333);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
}
|
|
44
|
+
.navBtn:hover:not(:disabled) {
|
|
45
|
+
background: var(--ogrid-bg-hover, #f5f5f5);
|
|
46
|
+
border-color: var(--ogrid-border-hover, #999);
|
|
47
|
+
}
|
|
48
|
+
.navBtn:disabled {
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
cursor: not-allowed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pageNumbers {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 4px;
|
|
57
|
+
margin: 0 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pageBtn {
|
|
61
|
+
min-width: 28px;
|
|
62
|
+
min-height: 28px;
|
|
63
|
+
padding: 4px 8px;
|
|
64
|
+
border: 1px solid var(--ogrid-border, #ccc);
|
|
65
|
+
border-radius: 4px;
|
|
66
|
+
background: var(--ogrid-bg, #fff);
|
|
67
|
+
color: var(--ogrid-fg, #333);
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
font-size: 13px;
|
|
70
|
+
font-variant-numeric: tabular-nums;
|
|
71
|
+
}
|
|
72
|
+
.pageBtn:hover {
|
|
73
|
+
background: var(--ogrid-bg-hover, #f5f5f5);
|
|
74
|
+
}
|
|
75
|
+
.pageBtn.active {
|
|
76
|
+
background: var(--ogrid-primary, #0066cc);
|
|
77
|
+
border-color: var(--ogrid-primary, #0066cc);
|
|
78
|
+
color: var(--ogrid-primary-fg, #fff);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ellipsis {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
min-width: 24px;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
color: var(--ogrid-muted, #888);
|
|
88
|
+
user-select: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.pageSizeSelector {
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
}
|
|
97
|
+
.pageSizeSelector .pageSizeLabel {
|
|
98
|
+
font-size: 13px;
|
|
99
|
+
color: var(--ogrid-muted, #606060);
|
|
100
|
+
user-select: none;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
}
|
|
103
|
+
.pageSizeSelector .pageSizeSelect {
|
|
104
|
+
min-width: 72px;
|
|
105
|
+
padding: 4px 8px;
|
|
106
|
+
border: 1px solid var(--ogrid-border, #ccc);
|
|
107
|
+
border-radius: 4px;
|
|
108
|
+
background: var(--ogrid-bg, #fff);
|
|
109
|
+
font-size: 13px;
|
|
110
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Components
|
|
2
|
+
export { OGrid } from './OGrid/OGrid';
|
|
3
|
+
export { DataGridTable } from './DataGridTable/DataGridTable';
|
|
4
|
+
export { ColumnChooser } from './ColumnChooser/ColumnChooser';
|
|
5
|
+
export { ColumnHeaderFilter } from './ColumnHeaderFilter/ColumnHeaderFilter';
|
|
6
|
+
export { PaginationControls } from './PaginationControls/PaginationControls';
|
|
7
|
+
// Re-export everything from core
|
|
8
|
+
export * from '@alaarab/ogrid-react';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { IColumnDefinition } from '@alaarab/ogrid-react';
|
|
3
|
+
export type { IColumnDefinition };
|
|
4
|
+
export interface IColumnChooserProps {
|
|
5
|
+
columns: IColumnDefinition[];
|
|
6
|
+
visibleColumns: Set<string>;
|
|
7
|
+
onVisibilityChange: (columnKey: string, visible: boolean) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ColumnChooser: React.FC<IColumnChooserProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { UserLike, ColumnFilterType, IDateFilterValue } from '@alaarab/ogrid-react';
|
|
3
|
+
export interface IColumnHeaderFilterProps {
|
|
4
|
+
columnKey: string;
|
|
5
|
+
columnName: string;
|
|
6
|
+
filterType: ColumnFilterType;
|
|
7
|
+
isSorted?: boolean;
|
|
8
|
+
isSortedDescending?: boolean;
|
|
9
|
+
onSort?: () => void;
|
|
10
|
+
selectedValues?: string[];
|
|
11
|
+
onFilterChange?: (values: string[]) => void;
|
|
12
|
+
options?: string[];
|
|
13
|
+
isLoadingOptions?: boolean;
|
|
14
|
+
textValue?: string;
|
|
15
|
+
onTextChange?: (value: string) => void;
|
|
16
|
+
selectedUser?: UserLike;
|
|
17
|
+
onUserChange?: (user: UserLike | undefined) => void;
|
|
18
|
+
peopleSearch?: (query: string) => Promise<UserLike[]>;
|
|
19
|
+
dateValue?: IDateFilterValue;
|
|
20
|
+
onDateChange?: (value: IDateFilterValue | undefined) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const ColumnHeaderFilter: React.FC<IColumnHeaderFilterProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MultiSelectFilterPopoverProps {
|
|
3
|
+
searchText: string;
|
|
4
|
+
onSearchChange: (value: string) => void;
|
|
5
|
+
options: string[];
|
|
6
|
+
filteredOptions: string[];
|
|
7
|
+
selected: Set<string>;
|
|
8
|
+
onOptionToggle: (option: string, checked: boolean) => void;
|
|
9
|
+
onSelectAll: () => void;
|
|
10
|
+
onClearSelection: () => void;
|
|
11
|
+
onApply: () => void;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const MultiSelectFilterPopover: React.FC<MultiSelectFilterPopoverProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { UserLike } from '@alaarab/ogrid-react';
|
|
3
|
+
export interface PeopleFilterPopoverProps {
|
|
4
|
+
selectedUser: UserLike | undefined;
|
|
5
|
+
searchText: string;
|
|
6
|
+
onSearchChange: (value: string) => void;
|
|
7
|
+
suggestions: UserLike[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
onUserSelect: (user: UserLike) => void;
|
|
10
|
+
onClearUser: () => void;
|
|
11
|
+
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
12
|
+
}
|
|
13
|
+
export declare const PeopleFilterPopover: React.FC<PeopleFilterPopoverProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColumnHeaderFilter, type IColumnHeaderFilterProps } from './ColumnHeaderFilter';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GridContextMenuHandlerProps } from '@alaarab/ogrid-react';
|
|
3
|
+
export interface GridContextMenuProps extends GridContextMenuHandlerProps {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
hasSelection: boolean;
|
|
7
|
+
canUndo: boolean;
|
|
8
|
+
canRedo: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function GridContextMenu(props: GridContextMenuProps): React.ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { IColumnDef } from '@alaarab/ogrid-react';
|
|
3
|
+
export interface InlineCellEditorProps<T> {
|
|
4
|
+
value: unknown;
|
|
5
|
+
item: T;
|
|
6
|
+
column: IColumnDef<T>;
|
|
7
|
+
rowIndex: number;
|
|
8
|
+
editorType: 'text' | 'select' | 'checkbox' | 'richSelect' | 'date';
|
|
9
|
+
onCommit: (value: unknown) => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function InlineCellEditor<T>(props: InlineCellEditorProps<T>): React.ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface StatusBarProps {
|
|
3
|
+
totalCount: number;
|
|
4
|
+
filteredCount?: number;
|
|
5
|
+
selectedCount?: number;
|
|
6
|
+
selectedCellCount?: number;
|
|
7
|
+
aggregation?: {
|
|
8
|
+
sum: number;
|
|
9
|
+
avg: number;
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
count: number;
|
|
13
|
+
} | null;
|
|
14
|
+
suppressRowCount?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function StatusBar(props: StatusBarProps): React.ReactElement;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type IOGridProps, type IOGridApi } from '@alaarab/ogrid-react';
|
|
3
|
+
export type { IOGridProps } from '@alaarab/ogrid-react';
|
|
4
|
+
declare const OGridInner: React.ForwardRefExoticComponent<IOGridProps<unknown> & React.RefAttributes<IOGridApi<unknown>>>;
|
|
5
|
+
export declare const OGrid: typeof OGridInner;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface IPaginationControlsProps {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
totalCount: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
8
|
+
pageSizeOptions?: number[];
|
|
9
|
+
entityLabelPlural?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const PaginationControls: React.FC<IPaginationControlsProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { OGrid, type IOGridProps } from './OGrid/OGrid';
|
|
2
|
+
export { DataGridTable } from './DataGridTable/DataGridTable';
|
|
3
|
+
export { ColumnChooser, type IColumnChooserProps } from './ColumnChooser/ColumnChooser';
|
|
4
|
+
export { ColumnHeaderFilter, type IColumnHeaderFilterProps } from './ColumnHeaderFilter/ColumnHeaderFilter';
|
|
5
|
+
export { PaginationControls, type IPaginationControlsProps } from './PaginationControls/PaginationControls';
|
|
6
|
+
export * from '@alaarab/ogrid-react';
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alaarab/ogrid-react-radix",
|
|
3
|
+
"version": "2.0.0-beta",
|
|
4
|
+
"description": "OGrid default (Radix) – Data grid with sorting, filtering, pagination, column chooser, and CSV export. Packed with Radix UI; no Fluent or Material required.",
|
|
5
|
+
"main": "dist/esm/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"require": "./dist/esm/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json && node scripts/compile-styles.js",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"storybook": "storybook dev -p 6008 --no-open",
|
|
19
|
+
"build-storybook": "storybook build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"ogrid",
|
|
23
|
+
"radix",
|
|
24
|
+
"datatable",
|
|
25
|
+
"react",
|
|
26
|
+
"typescript",
|
|
27
|
+
"grid",
|
|
28
|
+
"headless"
|
|
29
|
+
],
|
|
30
|
+
"author": "Ala Arab",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": [
|
|
38
|
+
"**/*.css"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@alaarab/ogrid-react": "2.0.0-beta",
|
|
45
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
|
46
|
+
"@radix-ui/react-popover": "^1.1.2"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
50
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@storybook/react-vite": "10.2.8",
|
|
54
|
+
"eslint-plugin-storybook": "10.2.8",
|
|
55
|
+
"sass": "^1.83.4",
|
|
56
|
+
"storybook": "10.2.8",
|
|
57
|
+
"vite": "^7.0.0"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|