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
7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ updates:
patterns:
- 'react'
- 'react-dom'
babel:
patterns:
- '@babel/*'
linaria:
patterns:
- '@linaria/*'
- '@wyw-in-js/*'
typescript-eslint:
patterns:
- '@typescript-eslint/*'
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
package.json
/website/routeTree.gen.ts
2 changes: 1 addition & 1 deletion .prettierrc.json → .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"^react-dom",
"^react",
"<THIRD_PARTY_MODULES>",
"^@linaria/core$",
"^ecij$",
"^clsx$",
"",
"./src",
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript][json][jsonc][css]": {
"editor.defaultFormatter": "biomejs.biome"
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"files.readonlyInclude": {
Expand Down
3 changes: 0 additions & 3 deletions babel.config.json

This file was deleted.

13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,24 @@
"postpublish": "git push --follow-tags origin HEAD"
},
"devDependencies": {
"@babel/preset-typescript": "^7.27.1",
"@biomejs/biome": "2.3.5",
"@eslint-react/eslint-plugin": "^2.0.2",
"@eslint/markdown": "^7.3.0",
"@faker-js/faker": "^10.0.0",
"@ianvs/prettier-plugin-sort-imports": "^4.6.2",
"@linaria/core": "^6.3.0",
"@tanstack/react-router": "^1.132.31",
"@tanstack/router-plugin": "^1.132.31",
"@types/node": "^24.8.0",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@typescript-eslint/eslint-plugin": "^8.39.1",
"@typescript-eslint/parser": "^8.39.1",
"@vitejs/plugin-react": "5.0.2",
"@vitejs/plugin-react": "^5.1.1",
"@vitest/browser-playwright": "^4.0.1",
"@vitest/coverage-istanbul": "^4.0.1",
"@vitest/eslint-plugin": "^1.3.4",
"@wyw-in-js/rollup": "^0.8.0",
"@wyw-in-js/vite": "^0.8.0",
"clsx": "^2.1.1",
"ecij": "^0.1.1",
"eslint": "^9.36.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-react": "^7.37.5",
Expand All @@ -85,10 +82,10 @@
"prettier": "3.6.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"rolldown": "^1.0.0-beta.33",
"rolldown-plugin-dts": "^0.17.1",
"rolldown": "^1.0.0-beta.50",
"rolldown-plugin-dts": "^0.17.7",
"typescript": "~5.9.2",
"vite": "npm:rolldown-vite@^7.1.3",
"vite": "npm:rolldown-vite@^7.2.5",
"vitest": "^4.0.1",
"vitest-browser-react": "^2.0.2"
},
Expand Down
19 changes: 8 additions & 11 deletions rolldown.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isAbsolute } from 'node:path';
import wyw from '@wyw-in-js/rollup';
import { ecij } from 'ecij/plugin';
import { defineConfig } from 'rolldown';
import { dts } from 'rolldown-plugin-dts';

Expand All @@ -10,22 +10,19 @@ export default defineConfig({
output: {
dir: 'lib',
cssEntryFileNames: 'styles.css',
sourcemap: true
sourcemap: true,
cleanDir: true
},
platform: 'browser',
external: (id) => !id.startsWith('.') && !isAbsolute(id),
plugins: [
ecij({
// We add the package version as prefix to avoid style conflicts
// between multiple versions of RDG on the same page
classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-`
}),
dts({
tsconfig: './tsconfig.lib.json'
}),
wyw({
exclude: ['**/*.d.ts'],
preprocessor: 'none',
classNameSlug(hash) {
// We add the package version as suffix to avoid style conflicts
// between multiple versions of RDG on the same page.
return `${hash}${pkg.version.replaceAll('.', '-')}`;
}
})
]
});
2 changes: 1 addition & 1 deletion src/Cell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, type MouseEvent } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { useRovingTabIndex } from './hooks';
import { createCellEvent, getCellClassname, getCellStyle, isCellEditableUtil } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion src/EditCell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffectEvent, useLayoutEffect, useRef } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { createCellEvent, getCellClassname, getCellStyle, onEditorNavigation } from './utils';
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/GroupRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, useMemo } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { RowSelectionContext, type RowSelectionContextValue } from './hooks';
import { classnames, getRowStyle } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion src/HeaderCell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRef, useState } from 'react';
import { flushSync } from 'react-dom';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { useRovingTabIndex } from './hooks';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/HeaderRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { classnames, getColSpan } from './utils';
import type { CalculatedColumn, Direction, Maybe, Position, ResizedWidth } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/SummaryCell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { useRovingTabIndex } from './hooks';
import { getCellClassname, getCellStyle } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion src/SummaryRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { classnames, getColSpan, getRowStyle } from './utils';
import type { RenderRowProps } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/cellRenderers/renderCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { RenderCheckboxProps } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/cellRenderers/renderToggleGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { RenderGroupCellProps } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/editors/renderTextEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { RenderEditCellProps } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/renderHeaderCell.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { RenderHeaderCellProps } from './types';
import { useDefaultRenderers } from './DataGridDefaultRenderersContext';
Expand Down
2 changes: 1 addition & 1 deletion src/sortStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { RenderSortIconProps, RenderSortPriorityProps, RenderSortStatusProps } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/style/cell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

export const cell = css`
@layer rdg.Cell {
Expand Down
2 changes: 1 addition & 1 deletion src/style/core.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import { cell } from './cell';
import { bottomSummaryRowClassname, row, topSummaryRowClassname } from './row';
Expand Down
2 changes: 1 addition & 1 deletion src/style/row.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

export const row = css`
@layer rdg.Row {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/renderMeasuringCells.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { CalculatedColumn } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion test/browser/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { page, userEvent, type Locator } from 'vitest/browser';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid } from '../../src';
import type { DataGridProps } from '../../src';
Expand Down
12 changes: 4 additions & 8 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tanstackRouter } from '@tanstack/router-plugin/vite';
import react from '@vitejs/plugin-react';
import { playwright } from '@vitest/browser-playwright';
import wyw from '@wyw-in-js/vite';
import { ecij } from 'ecij/plugin';
import { defineConfig, type ViteUserConfig } from 'vitest/config';
import type { BrowserCommand } from 'vitest/node';

Expand Down Expand Up @@ -64,7 +64,7 @@ const scrollGrid: BrowserCommand<[{ scrollLeft?: number; scrollTop?: number }]>
const viewport = { width: 1920, height: 1080 } as const;

export default defineConfig(
({ command, isPreview }): ViteUserConfig => ({
({ isPreview }): ViteUserConfig => ({
base: '/react-data-grid/',
cacheDir: '.cache/vite',
clearScreen: false,
Expand All @@ -76,6 +76,7 @@ export default defineConfig(
cssMinify: 'esbuild'
},
plugins: [
ecij(),
(!isTest || isPreview) &&
tanstackRouter({
target: 'react',
Expand All @@ -85,12 +86,7 @@ export default defineConfig(
verboseFileRoutes: false
}),
react({
exclude: ['./.cache/**/*']
}),
wyw({
exclude: ['./.cache/**/*', '**/*.d.ts', '**/*.gen.ts'],
preprocessor: 'none',
displayName: command === 'serve'
exclude: ['./.cache/**/*', './node_modules/**/*', './website/routeTree.gen.ts']
})
],
server: {
Expand Down
2 changes: 1 addition & 1 deletion website/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useId, useState } from 'react';
import { Link } from '@tanstack/react-router';
import { css } from '@linaria/core';
import { css } from 'ecij';

import type { Direction } from '../src/types';
import { startViewTransition } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion website/components/CellExpanderFormatter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

const cellExpandClassname = css`
block-size: 100%;
Expand Down
2 changes: 1 addition & 1 deletion website/components/ChildRowDeleteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

const childRowActionCrossClassname = css`
block-size: 100%;
Expand Down
2 changes: 1 addition & 1 deletion website/components/DraggableCellRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';
import clsx from 'clsx';

import { Cell, type CellRendererProps } from '../../src';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/AllFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';
import clsx from 'clsx';

import { DataGrid, renderTextEditor, SelectColumn } from '../../src';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/Animation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column } from '../../src';
import { useDirection } from '../directionContext';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/ColumnSpanning.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column } from '../../src';
import { renderCoordinates } from '../renderers';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/CommonFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo, useRef, useState } from 'react';
import { createPortal, flushSync } from 'react-dom';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import {
DataGrid,
Expand Down
2 changes: 1 addition & 1 deletion website/routes/ContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useLayoutEffect, useReducer, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column } from '../../src';
import { useDirection } from '../directionContext';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/CustomizableRenderers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { Row as BaseRow, Cell, DataGrid, renderTextEditor, SelectColumn } from '../../src';
import type {
Expand Down
2 changes: 1 addition & 1 deletion website/routes/HeaderFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useContext, useMemo, useState } from 'react';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column, type RenderHeaderCellProps } from '../../src';
import type { Omit } from '../../src/types';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/InfiniteScrolling.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column } from '../../src';
import { useDirection } from '../directionContext';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/MasterDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useState } from 'react';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column, type Direction, type RowsChangeData } from '../../src';
import { CellExpanderFormatter } from '../components';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/NoRows.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, SelectColumn, type Column } from '../../src';
import { useDirection } from '../directionContext';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/RowGrouping.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { faker } from '@faker-js/faker';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { SelectColumn, TreeDataGrid, type Column } from '../../src';
import { useDirection } from '../directionContext';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/ScrollToCell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef, useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';
import clsx from 'clsx';

import { DataGrid, type Column, type DataGridHandle } from '../../src';
Expand Down
2 changes: 1 addition & 1 deletion website/routes/TreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useReducer, useState } from 'react';
import { css } from '@linaria/core';
import { css } from 'ecij';

import { DataGrid, type Column } from '../../src';
import { CellExpanderFormatter, ChildRowDeleteButton } from '../components';
Expand Down
Loading