Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ea622a5
Init demo.
sebastianbochan Jun 22, 2026
70e0846
Options attrib as optional.
sebastianbochan Jun 29, 2026
360a72f
Added children support in Grid.
sebastianbochan Jun 29, 2026
651d8ae
Created Caption.jsx component.
sebastianbochan Jun 30, 2026
dd9055a
Fixed overloads.
sebastianbochan Jun 30, 2026
380c878
Added description component.
sebastianbochan Jun 30, 2026
ad721bb
Added Data component.
sebastianbochan Jun 30, 2026
88fe92a
Added Data, Columns and Column components.
sebastianbochan Jul 1, 2026
0f7b4bb
Merge pull request #14 from highcharts/components/description
sebastianbochan Jul 1, 2026
3a46471
Merge grid/jsx-components into components/columns-column.
sebastianbochan Jul 1, 2026
fa3e1fa
Added ColumnDefaults compomnent.
sebastianbochan Jul 2, 2026
c4e962d
Refactored Columsn and Data options.
sebastianbochan Jul 6, 2026
18ff179
Fixed conflicts.
sebastianbochan Jul 6, 2026
dc2402b
Added basic pagination component.
sebastianbochan Jul 6, 2026
5841659
Cleaned up.
sebastianbochan Jul 6, 2026
c6ad53e
Added header component.
sebastianbochan Jul 6, 2026
170162f
Merge pull request #15 from highcharts/components/columns-column
sebastianbochan Jul 7, 2026
68bed84
Merge branch 'components/header' into grid/jsx-components
sebastianbochan Jul 8, 2026
605ce6c
Added pagination position.
sebastianbochan Jul 8, 2026
9486a21
Merge pull request #19 from highcharts/components/pagination-position
sebastianbochan Jul 8, 2026
76f09c9
Optymized pagination position.
sebastianbochan Jul 8, 2026
6d16a75
Added components tests.
sebastianbochan Jul 8, 2026
3796a7e
Added linter to PR runner.
sebastianbochan Jul 8, 2026
aa121c8
Rephrased rules in linter.
sebastianbochan Jul 8, 2026
0e1a909
Added husky precommit action.
sebastianbochan Jul 9, 2026
7b50a33
Linted.
sebastianbochan Jul 9, 2026
108a85a
Linted useGrid hook.
sebastianbochan Jul 9, 2026
bfc063a
Fixed packages.
sebastianbochan Jul 9, 2026
9dd5e0e
Linted Grid.
sebastianbochan Jul 9, 2026
2ade77e
Cleaned up.
sebastianbochan Jul 9, 2026
8bcf49e
Added Caption test.
sebastianbochan Jul 9, 2026
41c7bf5
Added Description test.
sebastianbochan Jul 9, 2026
0c97316
Added tests for Coolumns and ColumnDefaults.
sebastianbochan Jul 10, 2026
2390f54
Merge pull request #20 from highcharts/grid/tests
sebastianbochan Jul 10, 2026
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
24 changes: 23 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
name: Tests
name: CI

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run linter
run: pnpm lint

test:
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint
pnpm test
11 changes: 10 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ export default defineConfig(
},
rules: {
'curly': ['error', 'all'],
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_'
}],
'@stylistic/semi': ['error', 'always'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'@stylistic/eol-last': ['error', 'always'],
'@stylistic/no-trailing-spaces': ['error']
'@stylistic/no-trailing-spaces': ['error'],
'@stylistic/max-len': ['error', {
code: 80,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}]
},
},
{
Expand Down
13 changes: 13 additions & 0 deletions examples/grid-lite/components-react/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Highcharts Grid Lite - React Example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

26 changes: 26 additions & 0 deletions examples/grid-lite/components-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "grid-lite-minimal-react",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"clean": "rimraf dist node_modules"
},
"dependencies": {
"@highcharts/grid-lite": ">=3.0.0",
"@highcharts/grid-lite-react": "workspace:*",
"react": ">=18",
"react-dom": ">=18"
},
"devDependencies": {
"@types/react": ">=18",
"@types/react-dom": ">=18",
"@vitejs/plugin-react": "^4.2.0",
"typescript": "^5.0.0",
"vite": "^5.0.0"
}
}

186 changes: 186 additions & 0 deletions examples/grid-lite/components-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
import { useState, useRef } from 'react';
import {
type GridInstance,
type GridRefHandle,
type GridOptions,
Grid,
Caption,
Data,
DataTable,
ColumnDefaults,
Column,
Description,
Pagination,
Header
} from '@highcharts/grid-lite-react';

function App() {
const grid = useRef<GridRefHandle<GridOptions> | null>(null);

// ==== OPTIONS ====
// const [options] = useState<GridOptions>({
// dataTable: {
// columns: {
// name: ['1111Alice', 'Bob', 'Charlie', 'David', 'Eve'],
// age: [23, 34, 45, 56, 67],
// city: ['New York', 'Oslo', 'Paris', 'Tokyo', 'London'],
// salary: [50000, 60000, 70000, 80000, 90000]
// }
// }
// });

// ==== DATA ====
// Data Columns
const [dataSource, setDataSource] = useState({
name: ['COLUMNS', 'Bob', 'Charlie', 'David', 'Eve'],
age: [23, 34, 45, 56, 67],
city: ['New York', 'Oslo', 'Paris', 'Tokyo', 'London'],
salary: [50000, 60000, 70000, 80000, 90000]
});

// Data Table
// const dataTable = new DataTable({
// columns: {
// name: ['DATATABLE', 'Bob', 'Charlie', 'David', 'Eve'],
// age: [23, 34, 45, 56, 67],
// city: ['New York', 'Oslo', 'Paris', 'Tokyo', 'London'],
// salary: [50000, 60000, 70000, 80000, 90000]
// }
// });

// ==== ACTIONS ====
const onButtonClick = () => {
// console.info('(ref) grid:', grid.current?.grid);
setDataSource({
name: ['John', 'Jane', 'Jim', 'Jill', 'Jack'],
age: [30, 25, 35, 40, 45],
city: ['New York', 'Los Angeles', 'Chicago', 'Houston', 'Miami'],
salary: [40000, 35000, 45000, 50000, 55000]
});
};

const onGridCallback = (grid: GridInstance<GridOptions>) => {
console.info('(callback) grid:', grid);
};

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

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

return (
<>
<Grid
// options={options}
// gridRef={grid}
callback={onGridCallback}
>
{/* <Pagination
// enabled={paginationEnabled}
page={1}
pageSize={3}
align="right"
// pageInfo
// pageSizeSelector
pageSizeOptions={[3, 5, 10, 25]}
// pageButtons
pageButtonsCount={5}
// firstLast
// previousNext
/> */}
<Data
// dataTable={dataTable}
columns={dataSource}
/>
<ColumnDefaults
dataType="string"
width="auto"
exportable
style={{ fontWeight: '400' }}
sortingEnabled
sortingOrderSequence={['asc', 'desc', null]}
filteringEnabled
filteringInline={true}
filteringCondition="contains"
filteringValue=""
headerClassName="hcg-default-header"
headerFormat="{id}"
cellClassName="hcg-default-cell"
cellFormat="{value}"
cellRowHeader={false}
/>
<Caption>Grid Caption v2.1</Caption>
<Header header={[
'name',
{
format: 'Details',
columns: ['age', 'city', 'salary']
}
]} />
<Column
headerFormat="#"
width={40}
cellValueGetter={function (this: { row: { index: number } }) {
return String(this.row.index + 1);
}}
/>
<Column
columnId="name"
className="hcg-name-column"
enabled
sortingEnabled
sortingOrder="asc"
sortingPriority={0}
// filteringEnabled
// filteringInline
// filteringCondition="contains"
headerClassName="hcg-name-header"
headerFormat="Name"
cellClassName="hcg-name-cell"
cellFormat="{value}"
/>
<Column
columnId="age"
dataType="number"
headerFormat="Age ({id})"
cellFormat="{value}"
/>
<Column
columnId="city"
width="20%"
headerFormatter={function () {
return `City: ${(this as { id?: string }).id ?? ''}`;
}}
/>
<Column
columnId="salary"
dataType="number"
headerFormat="Salary (USD)"
cellFormat="${value}"
/>
<Description>Grid Description</Description>
<Pagination
// enabled={paginationEnabled}
page={1}
pageSize={3}
align="right"
// pageInfo
// pageSizeSelector
pageSizeOptions={[3, 5, 10, 25]}
// pageButtons
pageButtonsCount={5}
// firstLast
// previousNext
/>
</Grid>
<div id="controls">
<button onClick={onButtonClick}>Data state</button>
{/* <button onClick={onPaginationClick}>Pagination</button> */}
</div>
</>
);
}

export default App;
33 changes: 33 additions & 0 deletions examples/grid-lite/components-react/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

#root {
width: 100%;
min-height: 100vh;
padding: 20px;
}

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

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

11 changes: 11 additions & 0 deletions examples/grid-lite/components-react/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);

28 changes: 28 additions & 0 deletions examples/grid-lite/components-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "ES2020",
"lib": [
"DOM",
"ES2016",
"ES2017.Object"
],
"jsx": "react-jsx",
"module": "ES6",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"ignoreDeprecations": "5.0",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

12 changes: 12 additions & 0 deletions examples/grid-lite/components-react/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"types": ["node"]
},
"include": ["vite.config.ts"]
}

Loading
Loading