Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions examples/grid-lite/components-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
DataTable,
ColumnDefaults,
Column,
Description
Description,
Pagination,
Header
} from '@highcharts/grid-lite-react';

function App() {
Expand Down Expand Up @@ -61,6 +63,13 @@ function App() {
console.info('(callback) grid:', grid);
};

// Pagination
// const [paginationEnabled, setPaginationEnabled] = useState(false);

// const onPaginationClick = () => {
// setPaginationEnabled(true);
// };

return (
<>
<Grid
Expand Down Expand Up @@ -90,6 +99,13 @@ function App() {
cellRowHeader={false}
/>
<Caption>Grid Caption v2.1</Caption>
<Header header={[
'name',
{
format: 'Details',
columns: ['age', 'city', 'salary']
}
]} />
<Column
headerFormat="#"
width={40}
Expand Down Expand Up @@ -132,9 +148,24 @@ function App() {
cellFormat="${value}"
/>
<Description>Grid Description</Description>
{/* <Pagination>Grid Pagination</Pagination> */}
<Pagination
// enabled={paginationEnabled}
page={1}
pageSize={3}
align="right"
// pageInfo
// pageSizeSelector
pageSizeOptions={[3, 5, 10, 25]}
// pageButtons
pageButtonsCount={5}
// firstLast
// previousNext
/>
</Grid>
<button onClick={onButtonClick}>Click me</button>
<div id="controls">
<button onClick={onButtonClick}>Data state</button>
{/* <button onClick={onPaginationClick}>Pagination</button> */}
</div>
</>
);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/grid-lite/components-react/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ body {
padding: 20px;
}

#controls {
margin-top: 20px;
display: flex;
gap: 10px;
}

@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
color: #ffffff;
}
}

16 changes: 14 additions & 2 deletions packages/grid-lite-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import GridLite from '@highcharts/grid-lite';

export { default as Grid } from './Grid';
export { default as GridLite } from './Grid';
export { Caption, Data, ColumnDefaults, Column, Description } from '@highcharts/grid-shared-react';
export {
Caption,
Data,
ColumnDefaults,
Column,
Description,
Pagination,
Header
} from '@highcharts/grid-shared-react';
export { DataTable, DataConnector } from '@highcharts/grid-lite';
export { merge } from '@highcharts/grid-lite/es-modules/Shared/Utilities.js';
export type {
Expand All @@ -26,6 +34,10 @@ export type {
ColumnOptionsProps,
ColumnDataType,
ColumnSortingOrder,
CellValueGetterContext
CellValueGetterContext,
PaginationProps,
HeaderProps,
GroupedHeaderOptions,
HeaderCellAccessibilityProps
} from '@highcharts/grid-shared-react';
export type GridOptions = GridLite.Options;
16 changes: 14 additions & 2 deletions packages/grid-pro-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import GridPro from '@highcharts/grid-pro';

export { default as Grid } from './Grid';
export { default as GridPro } from './Grid';
export { Caption, Data, ColumnDefaults, Column, Description } from '@highcharts/grid-shared-react';
export {
Caption,
Data,
ColumnDefaults,
Column,
Description,
Pagination,
Header
} from '@highcharts/grid-shared-react';
export { DataTable, DataConnector } from '@highcharts/grid-pro';
export { merge } from '@highcharts/grid-pro/es-modules/Shared/Utilities.js';
export type {
Expand All @@ -26,6 +34,10 @@ export type {
ColumnOptionsProps,
ColumnDataType,
ColumnSortingOrder,
CellValueGetterContext
CellValueGetterContext,
PaginationProps,
HeaderProps,
GroupedHeaderOptions,
HeaderCellAccessibilityProps
} from '@highcharts/grid-shared-react';
export type GridOptions = GridPro.Options;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

import type { HeaderProps } from './headerProps';

export function Header(_props: HeaderProps) {
return null;
}

Header._GridReact = {
type: 'Grid_Option',
gridOption: 'header'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

/**
* Accessibility options for a header cell in the header tree.
*/
export interface HeaderCellAccessibilityProps {
description?: string;
}

/**
* Header node in the `header` tree. A group (with `columns`) or a leaf
* (with `columnId`). Mirrors Grid Core `GroupedHeaderOptions`.
*/
export interface GroupedHeaderOptions {
accessibility?: HeaderCellAccessibilityProps;
format?: string;
className?: string;
columnId?: string;
columns?: Array<GroupedHeaderOptions | string>;
}

export interface HeaderProps {
/**
* Header tree: column order, inclusion, and grouping.
* Each entry is a column id (`string`) or a {@link GroupedHeaderOptions}
* object. Maps to Grid Core `options.header`.
*/
header?: Array<GroupedHeaderOptions | string>;
}
15 changes: 15 additions & 0 deletions packages/grid-shared-react/src/components/options/header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

export { Header } from './Header';
export type {
HeaderProps,
GroupedHeaderOptions,
HeaderCellAccessibilityProps
} from './headerProps';
8 changes: 8 additions & 0 deletions packages/grid-shared-react/src/components/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ export type {
} from './columns/columnProps';
export { Description } from './description';
export type { DescriptionProps } from './description';
export { Pagination } from './pagination';
export type { PaginationProps } from './pagination';
export { Header } from './header';
export type {
HeaderProps,
GroupedHeaderOptions,
HeaderCellAccessibilityProps
} from './header';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

import type { PaginationProps } from './paginationProps';

export function Pagination(_props: PaginationProps) {
return null;
}

Pagination._GridReact = {
type: 'Grid_Option',
gridOption: 'pagination'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

export { Pagination } from './Pagination';
export type { PaginationProps } from './paginationProps';
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Grid React integration.
* Copyright (c) 2025, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
*/

export interface PaginationProps {
/**
* Whether pagination should be rendered.
* Defaults to `true` when the `<Pagination>` component is used.
* Pass `false` to disable pagination while keeping other options.
*/
enabled?: boolean;
/**
* The current page number.
*/
page?: number;
/**
* Number of rows per page.
*/
pageSize?: number;
/**
* Alignment of pagination elements within the wrapper.
*/
align?: 'left' | 'center' | 'right' | 'distributed';
/**
* Whether to show the page information text.
*/
pageInfo?: boolean;
/**
* Whether to show the page size selector.
*/
pageSizeSelector?: boolean;
/**
* Available options for the page size selector dropdown.
*/
pageSizeOptions?: number[];
/**
* Whether to show numbered page buttons.
*/
pageButtons?: boolean;
/**
* Maximum number of page number buttons to show before using ellipsis.
*/
pageButtonsCount?: number;
/**
* Whether to show the first and last page navigation buttons.
*/
firstLast?: boolean;
/**
* Whether to show the previous and next page navigation buttons.
*/
previousNext?: boolean;
}
16 changes: 14 additions & 2 deletions packages/grid-shared-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ import { GridType, GridInstance } from './hooks/useGrid';
import type { GridProps, GridRefHandle } from './components/BaseGrid';

export { BaseGrid };
export { Caption, Data, ColumnDefaults, Column, Description } from './components/options';
export {
Caption,
Data,
ColumnDefaults,
Column,
Description,
Pagination,
Header
} from './components/options';
export { getChildProps } from './utils/getChildProps';
export type {
CaptionProps,
Expand All @@ -24,6 +32,10 @@ export type {
ColumnOptionsProps,
ColumnDataType,
ColumnSortingOrder,
CellValueGetterContext
CellValueGetterContext,
PaginationProps,
HeaderProps,
GroupedHeaderOptions,
HeaderCellAccessibilityProps
} from './components/options';
export type { GridType, GridInstance, GridProps, GridRefHandle };
50 changes: 0 additions & 50 deletions packages/grid-shared-react/src/utils/getChildProps.test.tsx

This file was deleted.

Loading
Loading