From 3ee6956b0686d9cea74ee8efb69eccba4ef98066 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 16 Feb 2026 20:09:18 +0000 Subject: [PATCH 1/2] Migrate from prettier to oxfmt --- .github/workflows/ci.yml | 4 +- .github/workflows/publish.yml | 4 +- .oxfmtrc.json | 67 ++++++++++++++++++++ .prettierignore | 1 - .prettierrc | 25 -------- .vscode/extensions.json | 2 +- .vscode/settings.json | 3 +- package.json | 8 +-- rolldown.config.ts | 1 - src/Cell.tsx | 1 - src/Columns.tsx | 2 +- src/DataGrid.tsx | 1 - src/DataGridDefaultRenderersContext.ts | 1 - src/EditCell.tsx | 1 - src/GroupCell.tsx | 1 - src/GroupRow.tsx | 1 - src/GroupedColumnHeaderRow.tsx | 1 - src/HeaderCell.tsx | 1 - src/HeaderRow.tsx | 1 - src/Row.tsx | 1 - src/ScrollToCell.tsx | 1 - src/SummaryCell.tsx | 1 - src/SummaryRow.tsx | 1 - src/TreeDataGrid.tsx | 1 - src/cellRenderers/renderCheckbox.tsx | 1 - src/cellRenderers/renderToggleGroup.tsx | 1 - src/editors/renderTextEditor.tsx | 1 - src/hooks/useCalculatedColumns.ts | 1 - src/hooks/useColumnWidths.ts | 1 - src/hooks/useLatestFunc.ts | 1 - src/hooks/useRowSelection.ts | 1 - src/hooks/useViewportColumns.ts | 1 - src/hooks/useViewportRows.ts | 1 - src/renderHeaderCell.tsx | 1 - src/sortStatus.tsx | 1 - src/style/core.ts | 1 - src/types.ts | 1 - src/utils/renderMeasuringCells.tsx | 1 - src/utils/styleUtils.ts | 1 - test/browser/TreeDataGrid.test.tsx | 1 - test/browser/column/colSpan.test.ts | 1 - test/browser/column/draggable.test.ts | 1 - test/browser/column/frozen.test.ts | 1 - test/browser/column/grouping.test.ts | 1 - test/browser/column/renderCell.test.tsx | 1 - test/browser/column/renderEditCell.test.tsx | 1 - test/browser/column/resizable.test.tsx | 1 - test/browser/columnOrder.test.tsx | 1 - test/browser/copyPaste.test.tsx | 1 - test/browser/direction.test.ts | 1 - test/browser/dragFill.test.tsx | 1 - test/browser/events.test.tsx | 1 - test/browser/headerRowClass.test.ts | 1 - test/browser/keyboardNavigation.test.tsx | 1 - test/browser/renderTextEditor.test.tsx | 1 - test/browser/renderers.test.tsx | 1 - test/browser/rowHeight.test.ts | 1 - test/browser/rowSelection.test.tsx | 1 - test/browser/scrollToCell.test.tsx | 1 - test/browser/sorting.test.tsx | 1 - test/browser/utils.tsx | 1 - test/node/ssr.test.tsx | 1 - test/setupBrowser.ts | 5 +- test/visual/basicGrid.test.tsx | 1 - test/visual/treeGrid.test.tsx | 1 - website/Nav.tsx | 1 - website/components/DraggableCellRenderer.tsx | 1 - website/directionContext.ts | 1 - website/root.tsx | 2 - website/routes/AllFeatures.tsx | 1 - website/routes/Animation.tsx | 1 - website/routes/CellNavigation.tsx | 1 - website/routes/ColumnSpanning.tsx | 1 - website/routes/ColumnsReordering.tsx | 1 - website/routes/CommonFeatures.tsx | 1 - website/routes/ContextMenu.tsx | 1 - website/routes/CustomizableRenderers.tsx | 1 - website/routes/HeaderFilters.tsx | 1 - website/routes/InfiniteScrolling.tsx | 1 - website/routes/MasterDetail.tsx | 1 - website/routes/NoRows.tsx | 1 - website/routes/RowGrouping.tsx | 1 - website/routes/RowsReordering.tsx | 1 - website/routes/ScrollToCell.tsx | 1 - website/routes/TreeView.tsx | 1 - website/routes/__root.tsx | 1 - 86 files changed, 80 insertions(+), 118 deletions(-) create mode 100644 .oxfmtrc.json delete mode 100644 .prettierignore delete mode 100644 .prettierrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a755ee0a9..13458f53b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,8 @@ jobs: - name: ESLint run: node --run eslint - - name: Prettier - run: node --run prettier:check + - name: Oxfmt + run: node --run format:check - name: Bundle run: node --run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4c075a3d94..fe4d4c1f53 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,8 +39,8 @@ jobs: - name: ESLint run: node --run eslint - - name: Prettier - run: node --run prettier:check + - name: Oxfmt + run: node --run format:check - name: Bundle run: node --run build diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000000..fd4340f5bc --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,67 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "ignorePatterns": ["/website/routeTree.gen.ts"], + "singleQuote": true, + "trailingComma": "none", + "experimentalSortImports": { + "customGroups": [ + { + "groupName": "react", + "elementNamePattern": ["react", "react/**", "react-dom", "react-dom/**"] + }, + { + "groupName": "ecij", + "elementNamePattern": ["ecij"] + }, + { + "groupName": "clsx", + "elementNamePattern": ["clsx"] + }, + { + "groupName": "./src", + "elementNamePattern": ["**/src", "**/src/**"] + }, + { + "groupName": "./renderers", + "elementNamePattern": ["**/renderers", "**/renderers/**"] + }, + { + "groupName": "./components", + "elementNamePattern": ["**/components", "**/components/**"] + }, + { + "groupName": "./hooks", + "elementNamePattern": ["**/hooks", "**/hooks/**"] + }, + { + "groupName": "./utils", + "elementNamePattern": ["**/utils", "**/utils/**"] + }, + { + "groupName": "./types", + "elementNamePattern": ["**/types", "**/types/**"] + } + ], + "groups": [ + "side_effect_style", + "side_effect", + "builtin", + "react", + "external", + "ecij", + "clsx", + "./src", + "./renderers", + "./components", + "./hooks", + "./utils", + "./types", + "index", + "sibling", + "parent", + "unknown" + ], + "newlinesBetween": false + }, + "experimentalSortPackageJson": false +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 2dfabd2544..0000000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -/website/routeTree.gen.ts diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 3ff9ca6132..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["@ianvs/prettier-plugin-sort-imports"], - "importOrder": [ - "", - "^react$", - "^react-dom", - "^react", - "", - "^ecij$", - "^clsx$", - "", - "./src", - "./renderers", - "./components", - "./hooks", - "./utils", - "./types", - "^\\.$", - "^\\./", - "^\\.\\./" - ] -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f05755bcdb..d1bb4a7e2b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "biomejs.biome"] + "recommendations": ["dbaeumer.vscode-eslint", "oxc.oxc-vscode", "biomejs.biome"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index c60cc479e1..4a985060fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,8 +2,9 @@ "editor.codeActionsOnSave": { "source.fixAll": "explicit" }, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", "typescript.enablePromptUseWorkspaceTsdk": true, "typescript.tsdk": "node_modules/typescript/lib", "files.readonlyInclude": { diff --git a/package.json b/package.json index 38a185167b..bd307861c4 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,12 @@ "test:watch": "vitest watch --project browser --project node", "visual": "vitest run --project visual --coverage.reportsDirectory='./coverage/visual'", "visual:update": "vitest run --project visual --update", - "format": "biome format --write", + "format": "oxfmt", + "format:check": "oxfmt --check", "check": "biome check --error-on-warnings", "biome:ci": "biome ci --error-on-warnings", "eslint": "eslint --max-warnings 0 --cache --cache-location .cache/eslint --cache-strategy content", "eslint:fix": "node --run eslint -- --fix", - "prettier:check": "prettier --check .", - "prettier:format": "prettier --write .", "typecheck": "tsc --build" }, "devDependencies": { @@ -54,7 +53,6 @@ "@eslint-react/eslint-plugin": "^2.3.12", "@eslint/markdown": "^7.5.1", "@faker-js/faker": "^10.0.0", - "@ianvs/prettier-plugin-sort-imports": "^4.6.2", "@tanstack/react-router": "^1.132.31", "@tanstack/router-plugin": "^1.132.31", "@types/node": "^25.0.2", @@ -76,9 +74,9 @@ "eslint-plugin-testing-library": "^7.13.5", "jspdf": "^4.0.0", "jspdf-autotable": "^5.0.2", + "oxfmt": "0.33.0", "playwright": "~1.58.0", "postcss": "^8.5.2", - "prettier": "3.8.1", "react": "^19.2.1", "react-dom": "^19.2.1", "rolldown": "^1.0.0-rc.3", diff --git a/rolldown.config.ts b/rolldown.config.ts index d3080f556b..7d42fcb86e 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -2,7 +2,6 @@ import { isAbsolute } from 'node:path'; import { ecij } from 'ecij/plugin'; import { defineConfig } from 'rolldown'; import { dts } from 'rolldown-plugin-dts'; - import pkg from './package.json' with { type: 'json' }; export default defineConfig({ diff --git a/src/Cell.tsx b/src/Cell.tsx index 253d4bbd1a..42bee356d2 100644 --- a/src/Cell.tsx +++ b/src/Cell.tsx @@ -1,6 +1,5 @@ import { memo, type MouseEvent } from 'react'; import { css } from 'ecij'; - import { useRovingTabIndex } from './hooks'; import { createCellEvent, getCellClassname, getCellStyle, isCellEditableUtil } from './utils'; import type { CellMouseEventHandler, CellRendererProps } from './types'; diff --git a/src/Columns.tsx b/src/Columns.tsx index 9121359d4a..19e1533238 100644 --- a/src/Columns.tsx +++ b/src/Columns.tsx @@ -1,4 +1,4 @@ -import { useHeaderRowSelection, useRowSelection } from './hooks/useRowSelection'; +import { useHeaderRowSelection, useRowSelection } from './hooks'; import type { Column, RenderCellProps, RenderGroupCellProps, RenderHeaderCellProps } from './types'; import { SelectCellFormatter } from './cellRenderers'; diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index b8532c13fd..6e6896c0fe 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -8,7 +8,6 @@ import { } from 'react'; import type { Key, KeyboardEvent } from 'react'; import { flushSync } from 'react-dom'; - import { HeaderRowSelectionChangeContext, HeaderRowSelectionContext, diff --git a/src/DataGridDefaultRenderersContext.ts b/src/DataGridDefaultRenderersContext.ts index 5cf1bcbe10..1cb2dca545 100644 --- a/src/DataGridDefaultRenderersContext.ts +++ b/src/DataGridDefaultRenderersContext.ts @@ -1,5 +1,4 @@ import { createContext, useContext } from 'react'; - import type { Maybe, Renderers } from './types'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/EditCell.tsx b/src/EditCell.tsx index 1138192035..18d919d289 100644 --- a/src/EditCell.tsx +++ b/src/EditCell.tsx @@ -1,6 +1,5 @@ import { useEffectEvent, useLayoutEffect, useRef } from 'react'; import { css } from 'ecij'; - import { createCellEvent, getCellClassname, getCellStyle, onEditorNavigation } from './utils'; import type { CellKeyboardEvent, diff --git a/src/GroupCell.tsx b/src/GroupCell.tsx index 95db0fab34..f1d1750867 100644 --- a/src/GroupCell.tsx +++ b/src/GroupCell.tsx @@ -1,5 +1,4 @@ import { memo } from 'react'; - import { useRovingTabIndex } from './hooks'; import { getCellClassname, getCellStyle } from './utils'; import type { CalculatedColumn, GroupRow } from './types'; diff --git a/src/GroupRow.tsx b/src/GroupRow.tsx index abc356682e..e1034db64d 100644 --- a/src/GroupRow.tsx +++ b/src/GroupRow.tsx @@ -1,6 +1,5 @@ import { memo, useMemo } from 'react'; import { css } from 'ecij'; - import { RowSelectionContext, type RowSelectionContextValue } from './hooks'; import { classnames, getRowStyle } from './utils'; import type { BaseRenderRowProps, GroupRow } from './types'; diff --git a/src/GroupedColumnHeaderRow.tsx b/src/GroupedColumnHeaderRow.tsx index fc0ae064b5..2e0367a29a 100644 --- a/src/GroupedColumnHeaderRow.tsx +++ b/src/GroupedColumnHeaderRow.tsx @@ -1,5 +1,4 @@ import { memo } from 'react'; - import type { CalculatedColumn, CalculatedColumnParent, Position } from './types'; import GroupedColumnHeaderCell from './GroupedColumnHeaderCell'; import { headerRowClassname } from './HeaderRow'; diff --git a/src/HeaderCell.tsx b/src/HeaderCell.tsx index 8da9ed3e90..51aada9b9f 100644 --- a/src/HeaderCell.tsx +++ b/src/HeaderCell.tsx @@ -1,7 +1,6 @@ import { useRef, useState } from 'react'; import { flushSync } from 'react-dom'; import { css } from 'ecij'; - import { useRovingTabIndex } from './hooks'; import { clampColumnWidth, diff --git a/src/HeaderRow.tsx b/src/HeaderRow.tsx index dea30c9fe9..194f6a6f81 100644 --- a/src/HeaderRow.tsx +++ b/src/HeaderRow.tsx @@ -1,6 +1,5 @@ import { memo, useState } from 'react'; import { css } from 'ecij'; - import { classnames, getColSpan } from './utils'; import type { CalculatedColumn, Direction, Maybe, Position, ResizedWidth } from './types'; import type { DataGridProps } from './DataGrid'; diff --git a/src/Row.tsx b/src/Row.tsx index e758c107b6..e75b77c884 100644 --- a/src/Row.tsx +++ b/src/Row.tsx @@ -1,5 +1,4 @@ import { memo, useMemo } from 'react'; - import { RowSelectionContext, useLatestFunc, type RowSelectionContextValue } from './hooks'; import { classnames, getColSpan, getRowStyle } from './utils'; import type { CalculatedColumn, RenderRowProps } from './types'; diff --git a/src/ScrollToCell.tsx b/src/ScrollToCell.tsx index 86794f1662..206bd1945d 100644 --- a/src/ScrollToCell.tsx +++ b/src/ScrollToCell.tsx @@ -1,5 +1,4 @@ import { useLayoutEffect, useRef } from 'react'; - import { scrollIntoView } from './utils'; export interface PartialPosition { diff --git a/src/SummaryCell.tsx b/src/SummaryCell.tsx index cb1e5fdab3..31f7dcb3d3 100644 --- a/src/SummaryCell.tsx +++ b/src/SummaryCell.tsx @@ -1,6 +1,5 @@ import { memo } from 'react'; import { css } from 'ecij'; - import { useRovingTabIndex } from './hooks'; import { getCellClassname, getCellStyle } from './utils'; import type { CellRendererProps } from './types'; diff --git a/src/SummaryRow.tsx b/src/SummaryRow.tsx index 3e66c2c41b..04e56a0a81 100644 --- a/src/SummaryRow.tsx +++ b/src/SummaryRow.tsx @@ -1,6 +1,5 @@ import { memo } from 'react'; import { css } from 'ecij'; - import { classnames, getColSpan, getRowStyle } from './utils'; import type { RenderRowProps } from './types'; import { cell, cellFrozen } from './style/cell'; diff --git a/src/TreeDataGrid.tsx b/src/TreeDataGrid.tsx index 5194d770a8..55b57e93c1 100644 --- a/src/TreeDataGrid.tsx +++ b/src/TreeDataGrid.tsx @@ -1,6 +1,5 @@ import { useCallback, useMemo } from 'react'; import type { Key } from 'react'; - import { useLatestFunc } from './hooks'; import { assertIsValidKeyGetter, getLeftRightKey } from './utils'; import type { diff --git a/src/cellRenderers/renderCheckbox.tsx b/src/cellRenderers/renderCheckbox.tsx index 9920c08157..700a5dd09c 100644 --- a/src/cellRenderers/renderCheckbox.tsx +++ b/src/cellRenderers/renderCheckbox.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { RenderCheckboxProps } from '../types'; const checkbox = css` diff --git a/src/cellRenderers/renderToggleGroup.tsx b/src/cellRenderers/renderToggleGroup.tsx index ba7884dd7e..41c1b32b9b 100644 --- a/src/cellRenderers/renderToggleGroup.tsx +++ b/src/cellRenderers/renderToggleGroup.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { RenderGroupCellProps } from '../types'; const groupCellContent = css` diff --git a/src/editors/renderTextEditor.tsx b/src/editors/renderTextEditor.tsx index 47ccb36c0b..3d65b7ef99 100644 --- a/src/editors/renderTextEditor.tsx +++ b/src/editors/renderTextEditor.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { RenderEditCellProps } from '../types'; const textEditorInternalClassname = css` diff --git a/src/hooks/useCalculatedColumns.ts b/src/hooks/useCalculatedColumns.ts index 0bbc33d0c9..6de789f34b 100644 --- a/src/hooks/useCalculatedColumns.ts +++ b/src/hooks/useCalculatedColumns.ts @@ -1,5 +1,4 @@ import { useMemo } from 'react'; - import { clampColumnWidth, max, min } from '../utils'; import type { CalculatedColumn, CalculatedColumnParent, ColumnOrColumnGroup, Omit } from '../types'; import { renderValue } from '../cellRenderers'; diff --git a/src/hooks/useColumnWidths.ts b/src/hooks/useColumnWidths.ts index 7a9183cfce..acbe543cee 100644 --- a/src/hooks/useColumnWidths.ts +++ b/src/hooks/useColumnWidths.ts @@ -1,6 +1,5 @@ import { useLayoutEffect, useState } from 'react'; import { flushSync } from 'react-dom'; - import type { CalculatedColumn, ColumnWidths, ResizedWidth } from '../types'; import type { DataGridProps } from '../DataGrid'; diff --git a/src/hooks/useLatestFunc.ts b/src/hooks/useLatestFunc.ts index 634694f3bb..499cdd21bf 100644 --- a/src/hooks/useLatestFunc.ts +++ b/src/hooks/useLatestFunc.ts @@ -1,5 +1,4 @@ import { useCallback, useLayoutEffect, useRef } from 'react'; - import type { Maybe } from '../types'; // https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often diff --git a/src/hooks/useRowSelection.ts b/src/hooks/useRowSelection.ts index a70438d811..252cb26670 100644 --- a/src/hooks/useRowSelection.ts +++ b/src/hooks/useRowSelection.ts @@ -1,5 +1,4 @@ import { createContext, useContext } from 'react'; - import type { SelectHeaderRowEvent, SelectRowEvent } from '../types'; export interface RowSelectionContextValue { diff --git a/src/hooks/useViewportColumns.ts b/src/hooks/useViewportColumns.ts index c79d085399..8220be15fa 100644 --- a/src/hooks/useViewportColumns.ts +++ b/src/hooks/useViewportColumns.ts @@ -1,5 +1,4 @@ import { useMemo } from 'react'; - import { getColSpan } from '../utils'; import type { CalculatedColumn, Maybe } from '../types'; diff --git a/src/hooks/useViewportRows.ts b/src/hooks/useViewportRows.ts index 13b8502302..44cfa06819 100644 --- a/src/hooks/useViewportRows.ts +++ b/src/hooks/useViewportRows.ts @@ -1,5 +1,4 @@ import { useMemo } from 'react'; - import { floor, max, min } from '../utils'; interface ViewportRowsArgs { diff --git a/src/renderHeaderCell.tsx b/src/renderHeaderCell.tsx index eb14ee48f4..a03a25916d 100644 --- a/src/renderHeaderCell.tsx +++ b/src/renderHeaderCell.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { RenderHeaderCellProps } from './types'; import { useDefaultRenderers } from './DataGridDefaultRenderersContext'; diff --git a/src/sortStatus.tsx b/src/sortStatus.tsx index 752f22f576..b49984cbe3 100644 --- a/src/sortStatus.tsx +++ b/src/sortStatus.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { RenderSortIconProps, RenderSortPriorityProps, RenderSortStatusProps } from './types'; const arrow = css` diff --git a/src/style/core.ts b/src/style/core.ts index a2bbf2022b..d98d688da5 100644 --- a/src/style/core.ts +++ b/src/style/core.ts @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import { cell } from './cell'; import { bottomSummaryRowClassname, row, topSummaryRowClassname } from './row'; diff --git a/src/types.ts b/src/types.ts index f635ed2d0e..79f434d39c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,4 @@ import type { Key, ReactElement, ReactNode } from 'react'; - import type { DataGridProps } from './DataGrid'; export type Omit = Pick>; diff --git a/src/utils/renderMeasuringCells.tsx b/src/utils/renderMeasuringCells.tsx index e26a0807f5..f8db08461f 100644 --- a/src/utils/renderMeasuringCells.tsx +++ b/src/utils/renderMeasuringCells.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import type { CalculatedColumn } from '../types'; const measuringCellClassname = css` diff --git a/src/utils/styleUtils.ts b/src/utils/styleUtils.ts index 3de29e06e0..d6c64ec826 100644 --- a/src/utils/styleUtils.ts +++ b/src/utils/styleUtils.ts @@ -1,5 +1,4 @@ import type { CSSProperties } from 'react'; - import type { CalculatedColumn, CalculatedColumnOrColumnGroup, Maybe } from '../types'; import { cellClassname, cellFrozenClassname } from '../style/cell'; diff --git a/test/browser/TreeDataGrid.test.tsx b/test/browser/TreeDataGrid.test.tsx index 2afc7bbef6..27ed1eb7c0 100644 --- a/test/browser/TreeDataGrid.test.tsx +++ b/test/browser/TreeDataGrid.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import type { Column } from '../../src'; import { renderTextEditor, SelectColumn, TreeDataGrid } from '../../src'; import { focusSinkClassname } from '../../src/style/core'; diff --git a/test/browser/column/colSpan.test.ts b/test/browser/column/colSpan.test.ts index 8eb4447f9a..acd5b714aa 100644 --- a/test/browser/column/colSpan.test.ts +++ b/test/browser/column/colSpan.test.ts @@ -1,5 +1,4 @@ import { userEvent } from 'vitest/browser'; - import type { Column } from '../../../src'; import { getCellsAtRowIndex, getHeaderCells, setup, validateCellPosition } from '../utils'; diff --git a/test/browser/column/draggable.test.ts b/test/browser/column/draggable.test.ts index 0c8cf43eed..de311c36d1 100644 --- a/test/browser/column/draggable.test.ts +++ b/test/browser/column/draggable.test.ts @@ -1,5 +1,4 @@ import { userEvent } from 'vitest/browser'; - import type { Column } from '../../../src'; import { getHeaderCellsNew, setup } from '../utils'; diff --git a/test/browser/column/frozen.test.ts b/test/browser/column/frozen.test.ts index 7776be7ce1..f990475437 100644 --- a/test/browser/column/frozen.test.ts +++ b/test/browser/column/frozen.test.ts @@ -1,5 +1,4 @@ import { page } from 'vitest/browser'; - import type { Column } from '../../../src'; import { cellClassname, cellFrozenClassname } from '../../../src/style/cell'; import { getHeaderCellsNew, setup } from '../utils'; diff --git a/test/browser/column/grouping.test.ts b/test/browser/column/grouping.test.ts index cb0b3fb9d2..b03cedf561 100644 --- a/test/browser/column/grouping.test.ts +++ b/test/browser/column/grouping.test.ts @@ -1,5 +1,4 @@ import { page, userEvent } from 'vitest/browser'; - import type { ColumnOrColumnGroup } from '../../../src'; import { getGrid, diff --git a/test/browser/column/renderCell.test.tsx b/test/browser/column/renderCell.test.tsx index 90ae4af3e2..2c7443843a 100644 --- a/test/browser/column/renderCell.test.tsx +++ b/test/browser/column/renderCell.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../../src'; import type { Column } from '../../../src'; import defaultRenderHeaderCell from '../../../src/renderHeaderCell'; diff --git a/test/browser/column/renderEditCell.test.tsx b/test/browser/column/renderEditCell.test.tsx index 01b12d6f0c..55d517ca15 100644 --- a/test/browser/column/renderEditCell.test.tsx +++ b/test/browser/column/renderEditCell.test.tsx @@ -1,7 +1,6 @@ import { useMemo, useState } from 'react'; import { createPortal } from 'react-dom'; import { commands, page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../../src'; import type { Column, DataGridProps } from '../../../src'; import { getCell, getCellsAtRowIndex, getGrid, getSelectedCell, testCount } from '../utils'; diff --git a/test/browser/column/resizable.test.tsx b/test/browser/column/resizable.test.tsx index 914e8be388..371b2c05bb 100644 --- a/test/browser/column/resizable.test.tsx +++ b/test/browser/column/resizable.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { commands, page, userEvent } from 'vitest/browser'; - import { DataGrid, type Column, type ColumnWidth, type ColumnWidths } from '../../../src'; import { getGrid, getHeaderCell, setup } from '../utils'; diff --git a/test/browser/columnOrder.test.tsx b/test/browser/columnOrder.test.tsx index 2e58efe31d..239fa77a44 100644 --- a/test/browser/columnOrder.test.tsx +++ b/test/browser/columnOrder.test.tsx @@ -1,5 +1,4 @@ import { page } from 'vitest/browser'; - import { DataGrid, SelectColumn, TreeDataGrid } from '../../src'; import type { Column } from '../../src'; import { testCount } from './utils'; diff --git a/test/browser/copyPaste.test.tsx b/test/browser/copyPaste.test.tsx index c0fe2c30b6..892accaf63 100644 --- a/test/browser/copyPaste.test.tsx +++ b/test/browser/copyPaste.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../src'; import type { CellPasteArgs, Column } from '../../src'; import { getCellsAtRowIndex, getSelectedCell } from './utils'; diff --git a/test/browser/direction.test.ts b/test/browser/direction.test.ts index b6c57b491a..14cb6ba496 100644 --- a/test/browser/direction.test.ts +++ b/test/browser/direction.test.ts @@ -1,5 +1,4 @@ import { userEvent } from 'vitest/browser'; - import type { Column } from '../../src'; import { getGrid, getSelectedCell, setup, tabIntoGrid } from './utils'; diff --git a/test/browser/dragFill.test.tsx b/test/browser/dragFill.test.tsx index 20bc601816..616b02201a 100644 --- a/test/browser/dragFill.test.tsx +++ b/test/browser/dragFill.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { commands, page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../src'; import type { Column, FillEvent } from '../../src'; import { getCellsAtRowIndex } from './utils'; diff --git a/test/browser/events.test.tsx b/test/browser/events.test.tsx index cb99f34f67..3a915327ab 100644 --- a/test/browser/events.test.tsx +++ b/test/browser/events.test.tsx @@ -1,5 +1,4 @@ import { page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../src'; import type { Column, DataGridProps } from '../../src'; import { getCell } from './utils'; diff --git a/test/browser/headerRowClass.test.ts b/test/browser/headerRowClass.test.ts index 9c88e9508a..db156e3deb 100644 --- a/test/browser/headerRowClass.test.ts +++ b/test/browser/headerRowClass.test.ts @@ -1,5 +1,4 @@ import { page } from 'vitest/browser'; - import type { Column } from '../../src'; import { headerRowClassname } from '../../src/HeaderRow'; import { setup } from './utils'; diff --git a/test/browser/keyboardNavigation.test.tsx b/test/browser/keyboardNavigation.test.tsx index 437d3327fa..dfef3bae7c 100644 --- a/test/browser/keyboardNavigation.test.tsx +++ b/test/browser/keyboardNavigation.test.tsx @@ -1,5 +1,4 @@ import { commands, page, userEvent } from 'vitest/browser'; - import { DataGrid, SelectColumn } from '../../src'; import type { Column } from '../../src'; import { getSelectedCell, setup, tabIntoGrid, testCount, validateCellPosition } from './utils'; diff --git a/test/browser/renderTextEditor.test.tsx b/test/browser/renderTextEditor.test.tsx index 8638f1dc90..915b2c4190 100644 --- a/test/browser/renderTextEditor.test.tsx +++ b/test/browser/renderTextEditor.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid, renderTextEditor } from '../../src'; import type { Column } from '../../src'; diff --git a/test/browser/renderers.test.tsx b/test/browser/renderers.test.tsx index aa6b200a41..454cc40ce8 100644 --- a/test/browser/renderers.test.tsx +++ b/test/browser/renderers.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { Cell, DataGrid, diff --git a/test/browser/rowHeight.test.ts b/test/browser/rowHeight.test.ts index 829e25d07e..6006f275c9 100644 --- a/test/browser/rowHeight.test.ts +++ b/test/browser/rowHeight.test.ts @@ -1,5 +1,4 @@ import { userEvent } from 'vitest/browser'; - import type { Column, DataGridProps } from '../../src'; import { getGrid, setup, tabIntoGrid, testRowCount } from './utils'; diff --git a/test/browser/rowSelection.test.tsx b/test/browser/rowSelection.test.tsx index 6065c47e50..018f93abb6 100644 --- a/test/browser/rowSelection.test.tsx +++ b/test/browser/rowSelection.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid, SelectColumn } from '../../src'; import type { Column } from '../../src'; import { getCell, getRowByCell, getSelectAllCheckbox } from './utils'; diff --git a/test/browser/scrollToCell.test.tsx b/test/browser/scrollToCell.test.tsx index 192266fdc4..8548f91511 100644 --- a/test/browser/scrollToCell.test.tsx +++ b/test/browser/scrollToCell.test.tsx @@ -1,6 +1,5 @@ import { useRef } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../src'; import type { Column, DataGridHandle } from '../../src'; import type { PartialPosition } from '../../src/ScrollToCell'; diff --git a/test/browser/sorting.test.tsx b/test/browser/sorting.test.tsx index 31eb775a3d..1904b0e504 100644 --- a/test/browser/sorting.test.tsx +++ b/test/browser/sorting.test.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; - import { DataGrid } from '../../src'; import type { Column, SortColumn } from '../../src/types'; import { getHeaderCell, getHeaderCellsNew } from './utils'; diff --git a/test/browser/utils.tsx b/test/browser/utils.tsx index a2ce698997..1013eb96a8 100644 --- a/test/browser/utils.tsx +++ b/test/browser/utils.tsx @@ -1,6 +1,5 @@ import { page, userEvent, type Locator } from 'vitest/browser'; import { css } from 'ecij'; - import { DataGrid } from '../../src'; import type { DataGridProps } from '../../src'; diff --git a/test/node/ssr.test.tsx b/test/node/ssr.test.tsx index 91483b1ed8..ca7cfae15b 100644 --- a/test/node/ssr.test.tsx +++ b/test/node/ssr.test.tsx @@ -1,5 +1,4 @@ import { renderToString } from 'react-dom/server'; - import { DataGrid } from '../../src'; import type { Column } from '../../src'; diff --git a/test/setupBrowser.ts b/test/setupBrowser.ts index 5218c269a8..63ce466150 100644 --- a/test/setupBrowser.ts +++ b/test/setupBrowser.ts @@ -1,9 +1,8 @@ -import { configure } from 'vitest-browser-react/pure'; -import { locators } from 'vitest/browser'; - // vitest-browser-react also automatically injects render method on the page // need to import it so TypeScript can pick up types import 'vitest-browser-react'; +import { configure } from 'vitest-browser-react/pure'; +import { locators } from 'vitest/browser'; configure({ reactStrictMode: true diff --git a/test/visual/basicGrid.test.tsx b/test/visual/basicGrid.test.tsx index 5ecedcf1bf..41f6aa9ef0 100644 --- a/test/visual/basicGrid.test.tsx +++ b/test/visual/basicGrid.test.tsx @@ -1,5 +1,4 @@ import { page } from 'vitest/browser'; - import { DataGrid, SelectColumn, type Column } from '../../src'; import { getGrid } from '../browser/utils'; diff --git a/test/visual/treeGrid.test.tsx b/test/visual/treeGrid.test.tsx index 3b59b5893c..6bafe094c4 100644 --- a/test/visual/treeGrid.test.tsx +++ b/test/visual/treeGrid.test.tsx @@ -1,5 +1,4 @@ import { page } from 'vitest/browser'; - import { SelectColumn, TreeDataGrid, type Column } from '../../src'; import { getTreeGrid } from '../browser/utils'; diff --git a/website/Nav.tsx b/website/Nav.tsx index b1ad6508a8..e3c906e0a5 100644 --- a/website/Nav.tsx +++ b/website/Nav.tsx @@ -1,7 +1,6 @@ import { useId, useState } from 'react'; import { Link } from '@tanstack/react-router'; import { css } from 'ecij'; - import type { Direction } from '../src/types'; import { startViewTransition } from './utils'; diff --git a/website/components/DraggableCellRenderer.tsx b/website/components/DraggableCellRenderer.tsx index 80f68a735d..cc4f1a9e26 100644 --- a/website/components/DraggableCellRenderer.tsx +++ b/website/components/DraggableCellRenderer.tsx @@ -1,7 +1,6 @@ import { useState } from 'react'; import { css } from 'ecij'; import clsx from 'clsx'; - import { Cell, type CellRendererProps } from '../../src'; const rowDraggingClassname = css` diff --git a/website/directionContext.ts b/website/directionContext.ts index 03d01540ad..85bdb7c9af 100644 --- a/website/directionContext.ts +++ b/website/directionContext.ts @@ -1,5 +1,4 @@ import { createContext, useContext } from 'react'; - import type { Direction } from '../src/types'; export const DirectionContext = createContext('ltr'); diff --git a/website/root.tsx b/website/root.tsx index 1f1d9d7e8a..a8f13ee7f8 100644 --- a/website/root.tsx +++ b/website/root.tsx @@ -1,5 +1,4 @@ import './root.css'; - import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { @@ -8,7 +7,6 @@ import { ErrorComponent, RouterProvider } from '@tanstack/react-router'; - import { routeTree } from './routeTree.gen'; const router = createRouter({ diff --git a/website/routes/AllFeatures.tsx b/website/routes/AllFeatures.tsx index a603269e59..6723e71164 100644 --- a/website/routes/AllFeatures.tsx +++ b/website/routes/AllFeatures.tsx @@ -2,7 +2,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; import clsx from 'clsx'; - import { DataGrid, renderTextEditor, SelectColumn } from '../../src'; import type { CalculatedColumn, CellCopyArgs, CellPasteArgs, Column, FillEvent } from '../../src'; import { textEditorClassname } from '../../src/editors/renderTextEditor'; diff --git a/website/routes/Animation.tsx b/website/routes/Animation.tsx index 7532f160fa..7a92c2bc99 100644 --- a/website/routes/Animation.tsx +++ b/website/routes/Animation.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { css } from 'ecij'; - import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CellNavigation.tsx b/website/routes/CellNavigation.tsx index ffc391329f..691b45d23d 100644 --- a/website/routes/CellNavigation.tsx +++ b/website/routes/CellNavigation.tsx @@ -1,5 +1,4 @@ import { useId, useState } from 'react'; - import { DataGrid } from '../../src'; import type { CellKeyboardEvent, CellKeyDownArgs, Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ColumnSpanning.tsx b/website/routes/ColumnSpanning.tsx index 35339790b2..d34e95f05d 100644 --- a/website/routes/ColumnSpanning.tsx +++ b/website/routes/ColumnSpanning.tsx @@ -1,5 +1,4 @@ import { css } from 'ecij'; - import { DataGrid, type Column } from '../../src'; import { renderCoordinates } from '../renderers'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ColumnsReordering.tsx b/website/routes/ColumnsReordering.tsx index 17004ec25f..15ec87bc61 100644 --- a/website/routes/ColumnsReordering.tsx +++ b/website/routes/ColumnsReordering.tsx @@ -1,5 +1,4 @@ import { useCallback, useMemo, useState } from 'react'; - import { DataGrid, type Column, type ColumnWidths, type SortColumn } from '../../src'; import { startViewTransition } from '../utils'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CommonFeatures.tsx b/website/routes/CommonFeatures.tsx index 0d934a526c..5f6a67d1e5 100644 --- a/website/routes/CommonFeatures.tsx +++ b/website/routes/CommonFeatures.tsx @@ -2,7 +2,6 @@ import { useMemo, useRef, useState } from 'react'; import { createPortal, flushSync } from 'react-dom'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { DataGrid, renderTextEditor, diff --git a/website/routes/ContextMenu.tsx b/website/routes/ContextMenu.tsx index 58655488e1..3237d65cb0 100644 --- a/website/routes/ContextMenu.tsx +++ b/website/routes/ContextMenu.tsx @@ -2,7 +2,6 @@ import { useLayoutEffect, useReducer, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CustomizableRenderers.tsx b/website/routes/CustomizableRenderers.tsx index ec4a2aa47d..42d87c1b4e 100644 --- a/website/routes/CustomizableRenderers.tsx +++ b/website/routes/CustomizableRenderers.tsx @@ -1,6 +1,5 @@ import { useMemo, useState } from 'react'; import { css } from 'ecij'; - import { Row as BaseRow, Cell, DataGrid, renderTextEditor, SelectColumn } from '../../src'; import type { CellRendererProps, diff --git a/website/routes/HeaderFilters.tsx b/website/routes/HeaderFilters.tsx index f4b26fd95b..c6516965df 100644 --- a/website/routes/HeaderFilters.tsx +++ b/website/routes/HeaderFilters.tsx @@ -1,7 +1,6 @@ import { createContext, useContext, useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { DataGrid, type Column, type RenderHeaderCellProps } from '../../src'; import type { Omit } from '../../src/types'; import { useDirection } from '../directionContext'; diff --git a/website/routes/InfiniteScrolling.tsx b/website/routes/InfiniteScrolling.tsx index 2b7ec28646..1c98f40620 100644 --- a/website/routes/InfiniteScrolling.tsx +++ b/website/routes/InfiniteScrolling.tsx @@ -1,7 +1,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/MasterDetail.tsx b/website/routes/MasterDetail.tsx index b5d41d0945..91d12070d0 100644 --- a/website/routes/MasterDetail.tsx +++ b/website/routes/MasterDetail.tsx @@ -1,7 +1,6 @@ import { useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { DataGrid, type Column, type Direction, type RowsChangeData } from '../../src'; import { CellExpanderFormatter } from '../components'; import { useDirection } from '../directionContext'; diff --git a/website/routes/NoRows.tsx b/website/routes/NoRows.tsx index ccc9c3c61c..af667f7b48 100644 --- a/website/routes/NoRows.tsx +++ b/website/routes/NoRows.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { css } from 'ecij'; - import { DataGrid, SelectColumn, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/RowGrouping.tsx b/website/routes/RowGrouping.tsx index d260902718..5c946b84a9 100644 --- a/website/routes/RowGrouping.tsx +++ b/website/routes/RowGrouping.tsx @@ -1,7 +1,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; - import { SelectColumn, TreeDataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/RowsReordering.tsx b/website/routes/RowsReordering.tsx index 1ebb52d481..e2d5494e8c 100644 --- a/website/routes/RowsReordering.tsx +++ b/website/routes/RowsReordering.tsx @@ -1,5 +1,4 @@ import { useCallback, useState } from 'react'; - import { DataGrid, renderTextEditor, type CellRendererProps, type Column } from '../../src'; import { DraggableCellRenderer } from '../components'; import { startViewTransition } from '../utils'; diff --git a/website/routes/ScrollToCell.tsx b/website/routes/ScrollToCell.tsx index b442f37333..d7530ce0de 100644 --- a/website/routes/ScrollToCell.tsx +++ b/website/routes/ScrollToCell.tsx @@ -1,7 +1,6 @@ import { useRef, useState } from 'react'; import { css } from 'ecij'; import clsx from 'clsx'; - import { DataGrid, type Column, type DataGridHandle } from '../../src'; import { renderCoordinates } from '../renderers'; import { useDirection } from '../directionContext'; diff --git a/website/routes/TreeView.tsx b/website/routes/TreeView.tsx index 47fd20fa4d..30b93fbd1a 100644 --- a/website/routes/TreeView.tsx +++ b/website/routes/TreeView.tsx @@ -1,6 +1,5 @@ import { useMemo, useReducer, useState } from 'react'; import { css } from 'ecij'; - import { DataGrid, type Column } from '../../src'; import { CellExpanderFormatter, ChildRowDeleteButton } from '../components'; import { useDirection } from '../directionContext'; diff --git a/website/routes/__root.tsx b/website/routes/__root.tsx index 892d74f21b..9bd5e9d0b1 100644 --- a/website/routes/__root.tsx +++ b/website/routes/__root.tsx @@ -1,7 +1,6 @@ import { useState } from 'react'; import { createRootRoute, Outlet } from '@tanstack/react-router'; import { css } from 'ecij'; - import type { Direction } from '../../src/types'; import { DirectionContext } from '../directionContext'; import Nav from '../Nav'; From f34d2abcc725c656a6054a85e07437c4b4549247 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 17 Feb 2026 12:54:34 +0000 Subject: [PATCH 2/2] add back newlines --- .oxfmtrc.json | 2 ++ rolldown.config.ts | 1 + src/Cell.tsx | 1 + src/DataGrid.tsx | 1 + src/DataGridDefaultRenderersContext.ts | 1 + src/EditCell.tsx | 1 + src/GroupCell.tsx | 1 + src/GroupRow.tsx | 1 + src/GroupedColumnHeaderRow.tsx | 1 + src/HeaderCell.tsx | 1 + src/HeaderRow.tsx | 1 + src/Row.tsx | 1 + src/ScrollToCell.tsx | 1 + src/SummaryCell.tsx | 1 + src/SummaryRow.tsx | 1 + src/TreeDataGrid.tsx | 1 + src/cellRenderers/renderCheckbox.tsx | 1 + src/cellRenderers/renderToggleGroup.tsx | 1 + src/editors/renderTextEditor.tsx | 1 + src/hooks/useCalculatedColumns.ts | 1 + src/hooks/useColumnWidths.ts | 1 + src/hooks/useLatestFunc.ts | 1 + src/hooks/useRowSelection.ts | 1 + src/hooks/useViewportColumns.ts | 1 + src/hooks/useViewportRows.ts | 1 + src/renderHeaderCell.tsx | 1 + src/sortStatus.tsx | 1 + src/style/core.ts | 1 + src/types.ts | 1 + src/utils/renderMeasuringCells.tsx | 1 + src/utils/styleUtils.ts | 1 + test/browser/TreeDataGrid.test.tsx | 1 + test/browser/column/colSpan.test.ts | 1 + test/browser/column/draggable.test.ts | 1 + test/browser/column/frozen.test.ts | 1 + test/browser/column/grouping.test.ts | 1 + test/browser/column/renderCell.test.tsx | 1 + test/browser/column/renderEditCell.test.tsx | 1 + test/browser/column/resizable.test.tsx | 1 + test/browser/columnOrder.test.tsx | 1 + test/browser/copyPaste.test.tsx | 1 + test/browser/direction.test.ts | 1 + test/browser/dragFill.test.tsx | 1 + test/browser/events.test.tsx | 1 + test/browser/headerRowClass.test.ts | 1 + test/browser/keyboardNavigation.test.tsx | 1 + test/browser/renderTextEditor.test.tsx | 1 + test/browser/renderers.test.tsx | 1 + test/browser/rowHeight.test.ts | 1 + test/browser/rowSelection.test.tsx | 1 + test/browser/scrollToCell.test.tsx | 1 + test/browser/sorting.test.tsx | 1 + test/browser/utils.tsx | 1 + test/node/ssr.test.tsx | 1 + test/setupBrowser.ts | 1 + test/visual/basicGrid.test.tsx | 1 + test/visual/treeGrid.test.tsx | 1 + website/Nav.tsx | 1 + website/components/DraggableCellRenderer.tsx | 1 + website/directionContext.ts | 1 + website/root.tsx | 2 ++ website/routes/AllFeatures.tsx | 1 + website/routes/Animation.tsx | 1 + website/routes/CellNavigation.tsx | 1 + website/routes/ColumnSpanning.tsx | 1 + website/routes/ColumnsReordering.tsx | 1 + website/routes/CommonFeatures.tsx | 1 + website/routes/ContextMenu.tsx | 1 + website/routes/CustomizableRenderers.tsx | 1 + website/routes/HeaderFilters.tsx | 1 + website/routes/InfiniteScrolling.tsx | 1 + website/routes/MasterDetail.tsx | 1 + website/routes/NoRows.tsx | 1 + website/routes/RowGrouping.tsx | 1 + website/routes/RowsReordering.tsx | 1 + website/routes/ScrollToCell.tsx | 1 + website/routes/TreeView.tsx | 1 + website/routes/__root.tsx | 1 + 78 files changed, 80 insertions(+) diff --git a/.oxfmtrc.json b/.oxfmtrc.json index fd4340f5bc..cfba423805 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -45,11 +45,13 @@ "groups": [ "side_effect_style", "side_effect", + { "newlinesBetween": true }, "builtin", "react", "external", "ecij", "clsx", + { "newlinesBetween": true }, "./src", "./renderers", "./components", diff --git a/rolldown.config.ts b/rolldown.config.ts index 7d42fcb86e..d3080f556b 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -2,6 +2,7 @@ import { isAbsolute } from 'node:path'; import { ecij } from 'ecij/plugin'; import { defineConfig } from 'rolldown'; import { dts } from 'rolldown-plugin-dts'; + import pkg from './package.json' with { type: 'json' }; export default defineConfig({ diff --git a/src/Cell.tsx b/src/Cell.tsx index 42bee356d2..253d4bbd1a 100644 --- a/src/Cell.tsx +++ b/src/Cell.tsx @@ -1,5 +1,6 @@ import { memo, type MouseEvent } from 'react'; import { css } from 'ecij'; + import { useRovingTabIndex } from './hooks'; import { createCellEvent, getCellClassname, getCellStyle, isCellEditableUtil } from './utils'; import type { CellMouseEventHandler, CellRendererProps } from './types'; diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index 6e6896c0fe..b8532c13fd 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -8,6 +8,7 @@ import { } from 'react'; import type { Key, KeyboardEvent } from 'react'; import { flushSync } from 'react-dom'; + import { HeaderRowSelectionChangeContext, HeaderRowSelectionContext, diff --git a/src/DataGridDefaultRenderersContext.ts b/src/DataGridDefaultRenderersContext.ts index 1cb2dca545..5cf1bcbe10 100644 --- a/src/DataGridDefaultRenderersContext.ts +++ b/src/DataGridDefaultRenderersContext.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import type { Maybe, Renderers } from './types'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/EditCell.tsx b/src/EditCell.tsx index 18d919d289..1138192035 100644 --- a/src/EditCell.tsx +++ b/src/EditCell.tsx @@ -1,5 +1,6 @@ import { useEffectEvent, useLayoutEffect, useRef } from 'react'; import { css } from 'ecij'; + import { createCellEvent, getCellClassname, getCellStyle, onEditorNavigation } from './utils'; import type { CellKeyboardEvent, diff --git a/src/GroupCell.tsx b/src/GroupCell.tsx index f1d1750867..95db0fab34 100644 --- a/src/GroupCell.tsx +++ b/src/GroupCell.tsx @@ -1,4 +1,5 @@ import { memo } from 'react'; + import { useRovingTabIndex } from './hooks'; import { getCellClassname, getCellStyle } from './utils'; import type { CalculatedColumn, GroupRow } from './types'; diff --git a/src/GroupRow.tsx b/src/GroupRow.tsx index e1034db64d..abc356682e 100644 --- a/src/GroupRow.tsx +++ b/src/GroupRow.tsx @@ -1,5 +1,6 @@ import { memo, useMemo } from 'react'; import { css } from 'ecij'; + import { RowSelectionContext, type RowSelectionContextValue } from './hooks'; import { classnames, getRowStyle } from './utils'; import type { BaseRenderRowProps, GroupRow } from './types'; diff --git a/src/GroupedColumnHeaderRow.tsx b/src/GroupedColumnHeaderRow.tsx index 2e0367a29a..fc0ae064b5 100644 --- a/src/GroupedColumnHeaderRow.tsx +++ b/src/GroupedColumnHeaderRow.tsx @@ -1,4 +1,5 @@ import { memo } from 'react'; + import type { CalculatedColumn, CalculatedColumnParent, Position } from './types'; import GroupedColumnHeaderCell from './GroupedColumnHeaderCell'; import { headerRowClassname } from './HeaderRow'; diff --git a/src/HeaderCell.tsx b/src/HeaderCell.tsx index 51aada9b9f..8da9ed3e90 100644 --- a/src/HeaderCell.tsx +++ b/src/HeaderCell.tsx @@ -1,6 +1,7 @@ import { useRef, useState } from 'react'; import { flushSync } from 'react-dom'; import { css } from 'ecij'; + import { useRovingTabIndex } from './hooks'; import { clampColumnWidth, diff --git a/src/HeaderRow.tsx b/src/HeaderRow.tsx index 194f6a6f81..dea30c9fe9 100644 --- a/src/HeaderRow.tsx +++ b/src/HeaderRow.tsx @@ -1,5 +1,6 @@ import { memo, useState } from 'react'; import { css } from 'ecij'; + import { classnames, getColSpan } from './utils'; import type { CalculatedColumn, Direction, Maybe, Position, ResizedWidth } from './types'; import type { DataGridProps } from './DataGrid'; diff --git a/src/Row.tsx b/src/Row.tsx index e75b77c884..e758c107b6 100644 --- a/src/Row.tsx +++ b/src/Row.tsx @@ -1,4 +1,5 @@ import { memo, useMemo } from 'react'; + import { RowSelectionContext, useLatestFunc, type RowSelectionContextValue } from './hooks'; import { classnames, getColSpan, getRowStyle } from './utils'; import type { CalculatedColumn, RenderRowProps } from './types'; diff --git a/src/ScrollToCell.tsx b/src/ScrollToCell.tsx index 206bd1945d..86794f1662 100644 --- a/src/ScrollToCell.tsx +++ b/src/ScrollToCell.tsx @@ -1,4 +1,5 @@ import { useLayoutEffect, useRef } from 'react'; + import { scrollIntoView } from './utils'; export interface PartialPosition { diff --git a/src/SummaryCell.tsx b/src/SummaryCell.tsx index 31f7dcb3d3..cb1e5fdab3 100644 --- a/src/SummaryCell.tsx +++ b/src/SummaryCell.tsx @@ -1,5 +1,6 @@ import { memo } from 'react'; import { css } from 'ecij'; + import { useRovingTabIndex } from './hooks'; import { getCellClassname, getCellStyle } from './utils'; import type { CellRendererProps } from './types'; diff --git a/src/SummaryRow.tsx b/src/SummaryRow.tsx index 04e56a0a81..3e66c2c41b 100644 --- a/src/SummaryRow.tsx +++ b/src/SummaryRow.tsx @@ -1,5 +1,6 @@ import { memo } from 'react'; import { css } from 'ecij'; + import { classnames, getColSpan, getRowStyle } from './utils'; import type { RenderRowProps } from './types'; import { cell, cellFrozen } from './style/cell'; diff --git a/src/TreeDataGrid.tsx b/src/TreeDataGrid.tsx index 55b57e93c1..5194d770a8 100644 --- a/src/TreeDataGrid.tsx +++ b/src/TreeDataGrid.tsx @@ -1,5 +1,6 @@ import { useCallback, useMemo } from 'react'; import type { Key } from 'react'; + import { useLatestFunc } from './hooks'; import { assertIsValidKeyGetter, getLeftRightKey } from './utils'; import type { diff --git a/src/cellRenderers/renderCheckbox.tsx b/src/cellRenderers/renderCheckbox.tsx index 700a5dd09c..9920c08157 100644 --- a/src/cellRenderers/renderCheckbox.tsx +++ b/src/cellRenderers/renderCheckbox.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { RenderCheckboxProps } from '../types'; const checkbox = css` diff --git a/src/cellRenderers/renderToggleGroup.tsx b/src/cellRenderers/renderToggleGroup.tsx index 41c1b32b9b..ba7884dd7e 100644 --- a/src/cellRenderers/renderToggleGroup.tsx +++ b/src/cellRenderers/renderToggleGroup.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { RenderGroupCellProps } from '../types'; const groupCellContent = css` diff --git a/src/editors/renderTextEditor.tsx b/src/editors/renderTextEditor.tsx index 3d65b7ef99..47ccb36c0b 100644 --- a/src/editors/renderTextEditor.tsx +++ b/src/editors/renderTextEditor.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { RenderEditCellProps } from '../types'; const textEditorInternalClassname = css` diff --git a/src/hooks/useCalculatedColumns.ts b/src/hooks/useCalculatedColumns.ts index 6de789f34b..0bbc33d0c9 100644 --- a/src/hooks/useCalculatedColumns.ts +++ b/src/hooks/useCalculatedColumns.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { clampColumnWidth, max, min } from '../utils'; import type { CalculatedColumn, CalculatedColumnParent, ColumnOrColumnGroup, Omit } from '../types'; import { renderValue } from '../cellRenderers'; diff --git a/src/hooks/useColumnWidths.ts b/src/hooks/useColumnWidths.ts index acbe543cee..7a9183cfce 100644 --- a/src/hooks/useColumnWidths.ts +++ b/src/hooks/useColumnWidths.ts @@ -1,5 +1,6 @@ import { useLayoutEffect, useState } from 'react'; import { flushSync } from 'react-dom'; + import type { CalculatedColumn, ColumnWidths, ResizedWidth } from '../types'; import type { DataGridProps } from '../DataGrid'; diff --git a/src/hooks/useLatestFunc.ts b/src/hooks/useLatestFunc.ts index 499cdd21bf..634694f3bb 100644 --- a/src/hooks/useLatestFunc.ts +++ b/src/hooks/useLatestFunc.ts @@ -1,4 +1,5 @@ import { useCallback, useLayoutEffect, useRef } from 'react'; + import type { Maybe } from '../types'; // https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often diff --git a/src/hooks/useRowSelection.ts b/src/hooks/useRowSelection.ts index 252cb26670..a70438d811 100644 --- a/src/hooks/useRowSelection.ts +++ b/src/hooks/useRowSelection.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import type { SelectHeaderRowEvent, SelectRowEvent } from '../types'; export interface RowSelectionContextValue { diff --git a/src/hooks/useViewportColumns.ts b/src/hooks/useViewportColumns.ts index 8220be15fa..c79d085399 100644 --- a/src/hooks/useViewportColumns.ts +++ b/src/hooks/useViewportColumns.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { getColSpan } from '../utils'; import type { CalculatedColumn, Maybe } from '../types'; diff --git a/src/hooks/useViewportRows.ts b/src/hooks/useViewportRows.ts index 44cfa06819..13b8502302 100644 --- a/src/hooks/useViewportRows.ts +++ b/src/hooks/useViewportRows.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { floor, max, min } from '../utils'; interface ViewportRowsArgs { diff --git a/src/renderHeaderCell.tsx b/src/renderHeaderCell.tsx index a03a25916d..eb14ee48f4 100644 --- a/src/renderHeaderCell.tsx +++ b/src/renderHeaderCell.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { RenderHeaderCellProps } from './types'; import { useDefaultRenderers } from './DataGridDefaultRenderersContext'; diff --git a/src/sortStatus.tsx b/src/sortStatus.tsx index b49984cbe3..752f22f576 100644 --- a/src/sortStatus.tsx +++ b/src/sortStatus.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { RenderSortIconProps, RenderSortPriorityProps, RenderSortStatusProps } from './types'; const arrow = css` diff --git a/src/style/core.ts b/src/style/core.ts index d98d688da5..a2bbf2022b 100644 --- a/src/style/core.ts +++ b/src/style/core.ts @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import { cell } from './cell'; import { bottomSummaryRowClassname, row, topSummaryRowClassname } from './row'; diff --git a/src/types.ts b/src/types.ts index 79f434d39c..f635ed2d0e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,5 @@ import type { Key, ReactElement, ReactNode } from 'react'; + import type { DataGridProps } from './DataGrid'; export type Omit = Pick>; diff --git a/src/utils/renderMeasuringCells.tsx b/src/utils/renderMeasuringCells.tsx index f8db08461f..e26a0807f5 100644 --- a/src/utils/renderMeasuringCells.tsx +++ b/src/utils/renderMeasuringCells.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import type { CalculatedColumn } from '../types'; const measuringCellClassname = css` diff --git a/src/utils/styleUtils.ts b/src/utils/styleUtils.ts index d6c64ec826..3de29e06e0 100644 --- a/src/utils/styleUtils.ts +++ b/src/utils/styleUtils.ts @@ -1,4 +1,5 @@ import type { CSSProperties } from 'react'; + import type { CalculatedColumn, CalculatedColumnOrColumnGroup, Maybe } from '../types'; import { cellClassname, cellFrozenClassname } from '../style/cell'; diff --git a/test/browser/TreeDataGrid.test.tsx b/test/browser/TreeDataGrid.test.tsx index 27ed1eb7c0..2afc7bbef6 100644 --- a/test/browser/TreeDataGrid.test.tsx +++ b/test/browser/TreeDataGrid.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import type { Column } from '../../src'; import { renderTextEditor, SelectColumn, TreeDataGrid } from '../../src'; import { focusSinkClassname } from '../../src/style/core'; diff --git a/test/browser/column/colSpan.test.ts b/test/browser/column/colSpan.test.ts index acd5b714aa..8eb4447f9a 100644 --- a/test/browser/column/colSpan.test.ts +++ b/test/browser/column/colSpan.test.ts @@ -1,4 +1,5 @@ import { userEvent } from 'vitest/browser'; + import type { Column } from '../../../src'; import { getCellsAtRowIndex, getHeaderCells, setup, validateCellPosition } from '../utils'; diff --git a/test/browser/column/draggable.test.ts b/test/browser/column/draggable.test.ts index de311c36d1..0c8cf43eed 100644 --- a/test/browser/column/draggable.test.ts +++ b/test/browser/column/draggable.test.ts @@ -1,4 +1,5 @@ import { userEvent } from 'vitest/browser'; + import type { Column } from '../../../src'; import { getHeaderCellsNew, setup } from '../utils'; diff --git a/test/browser/column/frozen.test.ts b/test/browser/column/frozen.test.ts index f990475437..7776be7ce1 100644 --- a/test/browser/column/frozen.test.ts +++ b/test/browser/column/frozen.test.ts @@ -1,4 +1,5 @@ import { page } from 'vitest/browser'; + import type { Column } from '../../../src'; import { cellClassname, cellFrozenClassname } from '../../../src/style/cell'; import { getHeaderCellsNew, setup } from '../utils'; diff --git a/test/browser/column/grouping.test.ts b/test/browser/column/grouping.test.ts index b03cedf561..cb0b3fb9d2 100644 --- a/test/browser/column/grouping.test.ts +++ b/test/browser/column/grouping.test.ts @@ -1,4 +1,5 @@ import { page, userEvent } from 'vitest/browser'; + import type { ColumnOrColumnGroup } from '../../../src'; import { getGrid, diff --git a/test/browser/column/renderCell.test.tsx b/test/browser/column/renderCell.test.tsx index 2c7443843a..90ae4af3e2 100644 --- a/test/browser/column/renderCell.test.tsx +++ b/test/browser/column/renderCell.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../../src'; import type { Column } from '../../../src'; import defaultRenderHeaderCell from '../../../src/renderHeaderCell'; diff --git a/test/browser/column/renderEditCell.test.tsx b/test/browser/column/renderEditCell.test.tsx index 55d517ca15..01b12d6f0c 100644 --- a/test/browser/column/renderEditCell.test.tsx +++ b/test/browser/column/renderEditCell.test.tsx @@ -1,6 +1,7 @@ import { useMemo, useState } from 'react'; import { createPortal } from 'react-dom'; import { commands, page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../../src'; import type { Column, DataGridProps } from '../../../src'; import { getCell, getCellsAtRowIndex, getGrid, getSelectedCell, testCount } from '../utils'; diff --git a/test/browser/column/resizable.test.tsx b/test/browser/column/resizable.test.tsx index 371b2c05bb..914e8be388 100644 --- a/test/browser/column/resizable.test.tsx +++ b/test/browser/column/resizable.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { commands, page, userEvent } from 'vitest/browser'; + import { DataGrid, type Column, type ColumnWidth, type ColumnWidths } from '../../../src'; import { getGrid, getHeaderCell, setup } from '../utils'; diff --git a/test/browser/columnOrder.test.tsx b/test/browser/columnOrder.test.tsx index 239fa77a44..2e58efe31d 100644 --- a/test/browser/columnOrder.test.tsx +++ b/test/browser/columnOrder.test.tsx @@ -1,4 +1,5 @@ import { page } from 'vitest/browser'; + import { DataGrid, SelectColumn, TreeDataGrid } from '../../src'; import type { Column } from '../../src'; import { testCount } from './utils'; diff --git a/test/browser/copyPaste.test.tsx b/test/browser/copyPaste.test.tsx index 892accaf63..c0fe2c30b6 100644 --- a/test/browser/copyPaste.test.tsx +++ b/test/browser/copyPaste.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../src'; import type { CellPasteArgs, Column } from '../../src'; import { getCellsAtRowIndex, getSelectedCell } from './utils'; diff --git a/test/browser/direction.test.ts b/test/browser/direction.test.ts index 14cb6ba496..b6c57b491a 100644 --- a/test/browser/direction.test.ts +++ b/test/browser/direction.test.ts @@ -1,4 +1,5 @@ import { userEvent } from 'vitest/browser'; + import type { Column } from '../../src'; import { getGrid, getSelectedCell, setup, tabIntoGrid } from './utils'; diff --git a/test/browser/dragFill.test.tsx b/test/browser/dragFill.test.tsx index 616b02201a..20bc601816 100644 --- a/test/browser/dragFill.test.tsx +++ b/test/browser/dragFill.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { commands, page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../src'; import type { Column, FillEvent } from '../../src'; import { getCellsAtRowIndex } from './utils'; diff --git a/test/browser/events.test.tsx b/test/browser/events.test.tsx index 3a915327ab..cb99f34f67 100644 --- a/test/browser/events.test.tsx +++ b/test/browser/events.test.tsx @@ -1,4 +1,5 @@ import { page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../src'; import type { Column, DataGridProps } from '../../src'; import { getCell } from './utils'; diff --git a/test/browser/headerRowClass.test.ts b/test/browser/headerRowClass.test.ts index db156e3deb..9c88e9508a 100644 --- a/test/browser/headerRowClass.test.ts +++ b/test/browser/headerRowClass.test.ts @@ -1,4 +1,5 @@ import { page } from 'vitest/browser'; + import type { Column } from '../../src'; import { headerRowClassname } from '../../src/HeaderRow'; import { setup } from './utils'; diff --git a/test/browser/keyboardNavigation.test.tsx b/test/browser/keyboardNavigation.test.tsx index dfef3bae7c..437d3327fa 100644 --- a/test/browser/keyboardNavigation.test.tsx +++ b/test/browser/keyboardNavigation.test.tsx @@ -1,4 +1,5 @@ import { commands, page, userEvent } from 'vitest/browser'; + import { DataGrid, SelectColumn } from '../../src'; import type { Column } from '../../src'; import { getSelectedCell, setup, tabIntoGrid, testCount, validateCellPosition } from './utils'; diff --git a/test/browser/renderTextEditor.test.tsx b/test/browser/renderTextEditor.test.tsx index 915b2c4190..8638f1dc90 100644 --- a/test/browser/renderTextEditor.test.tsx +++ b/test/browser/renderTextEditor.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid, renderTextEditor } from '../../src'; import type { Column } from '../../src'; diff --git a/test/browser/renderers.test.tsx b/test/browser/renderers.test.tsx index 454cc40ce8..aa6b200a41 100644 --- a/test/browser/renderers.test.tsx +++ b/test/browser/renderers.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { Cell, DataGrid, diff --git a/test/browser/rowHeight.test.ts b/test/browser/rowHeight.test.ts index 6006f275c9..829e25d07e 100644 --- a/test/browser/rowHeight.test.ts +++ b/test/browser/rowHeight.test.ts @@ -1,4 +1,5 @@ import { userEvent } from 'vitest/browser'; + import type { Column, DataGridProps } from '../../src'; import { getGrid, setup, tabIntoGrid, testRowCount } from './utils'; diff --git a/test/browser/rowSelection.test.tsx b/test/browser/rowSelection.test.tsx index 018f93abb6..6065c47e50 100644 --- a/test/browser/rowSelection.test.tsx +++ b/test/browser/rowSelection.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid, SelectColumn } from '../../src'; import type { Column } from '../../src'; import { getCell, getRowByCell, getSelectAllCheckbox } from './utils'; diff --git a/test/browser/scrollToCell.test.tsx b/test/browser/scrollToCell.test.tsx index 8548f91511..192266fdc4 100644 --- a/test/browser/scrollToCell.test.tsx +++ b/test/browser/scrollToCell.test.tsx @@ -1,5 +1,6 @@ import { useRef } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../src'; import type { Column, DataGridHandle } from '../../src'; import type { PartialPosition } from '../../src/ScrollToCell'; diff --git a/test/browser/sorting.test.tsx b/test/browser/sorting.test.tsx index 1904b0e504..31eb775a3d 100644 --- a/test/browser/sorting.test.tsx +++ b/test/browser/sorting.test.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { page, userEvent } from 'vitest/browser'; + import { DataGrid } from '../../src'; import type { Column, SortColumn } from '../../src/types'; import { getHeaderCell, getHeaderCellsNew } from './utils'; diff --git a/test/browser/utils.tsx b/test/browser/utils.tsx index 1013eb96a8..a2ce698997 100644 --- a/test/browser/utils.tsx +++ b/test/browser/utils.tsx @@ -1,5 +1,6 @@ import { page, userEvent, type Locator } from 'vitest/browser'; import { css } from 'ecij'; + import { DataGrid } from '../../src'; import type { DataGridProps } from '../../src'; diff --git a/test/node/ssr.test.tsx b/test/node/ssr.test.tsx index ca7cfae15b..91483b1ed8 100644 --- a/test/node/ssr.test.tsx +++ b/test/node/ssr.test.tsx @@ -1,4 +1,5 @@ import { renderToString } from 'react-dom/server'; + import { DataGrid } from '../../src'; import type { Column } from '../../src'; diff --git a/test/setupBrowser.ts b/test/setupBrowser.ts index 63ce466150..c2f462d1c4 100644 --- a/test/setupBrowser.ts +++ b/test/setupBrowser.ts @@ -1,6 +1,7 @@ // vitest-browser-react also automatically injects render method on the page // need to import it so TypeScript can pick up types import 'vitest-browser-react'; + import { configure } from 'vitest-browser-react/pure'; import { locators } from 'vitest/browser'; diff --git a/test/visual/basicGrid.test.tsx b/test/visual/basicGrid.test.tsx index 41f6aa9ef0..5ecedcf1bf 100644 --- a/test/visual/basicGrid.test.tsx +++ b/test/visual/basicGrid.test.tsx @@ -1,4 +1,5 @@ import { page } from 'vitest/browser'; + import { DataGrid, SelectColumn, type Column } from '../../src'; import { getGrid } from '../browser/utils'; diff --git a/test/visual/treeGrid.test.tsx b/test/visual/treeGrid.test.tsx index 6bafe094c4..3b59b5893c 100644 --- a/test/visual/treeGrid.test.tsx +++ b/test/visual/treeGrid.test.tsx @@ -1,4 +1,5 @@ import { page } from 'vitest/browser'; + import { SelectColumn, TreeDataGrid, type Column } from '../../src'; import { getTreeGrid } from '../browser/utils'; diff --git a/website/Nav.tsx b/website/Nav.tsx index e3c906e0a5..b1ad6508a8 100644 --- a/website/Nav.tsx +++ b/website/Nav.tsx @@ -1,6 +1,7 @@ import { useId, useState } from 'react'; import { Link } from '@tanstack/react-router'; import { css } from 'ecij'; + import type { Direction } from '../src/types'; import { startViewTransition } from './utils'; diff --git a/website/components/DraggableCellRenderer.tsx b/website/components/DraggableCellRenderer.tsx index cc4f1a9e26..80f68a735d 100644 --- a/website/components/DraggableCellRenderer.tsx +++ b/website/components/DraggableCellRenderer.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { css } from 'ecij'; import clsx from 'clsx'; + import { Cell, type CellRendererProps } from '../../src'; const rowDraggingClassname = css` diff --git a/website/directionContext.ts b/website/directionContext.ts index 85bdb7c9af..03d01540ad 100644 --- a/website/directionContext.ts +++ b/website/directionContext.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import type { Direction } from '../src/types'; export const DirectionContext = createContext('ltr'); diff --git a/website/root.tsx b/website/root.tsx index a8f13ee7f8..1f1d9d7e8a 100644 --- a/website/root.tsx +++ b/website/root.tsx @@ -1,4 +1,5 @@ import './root.css'; + import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import { @@ -7,6 +8,7 @@ import { ErrorComponent, RouterProvider } from '@tanstack/react-router'; + import { routeTree } from './routeTree.gen'; const router = createRouter({ diff --git a/website/routes/AllFeatures.tsx b/website/routes/AllFeatures.tsx index 6723e71164..a603269e59 100644 --- a/website/routes/AllFeatures.tsx +++ b/website/routes/AllFeatures.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; import clsx from 'clsx'; + import { DataGrid, renderTextEditor, SelectColumn } from '../../src'; import type { CalculatedColumn, CellCopyArgs, CellPasteArgs, Column, FillEvent } from '../../src'; import { textEditorClassname } from '../../src/editors/renderTextEditor'; diff --git a/website/routes/Animation.tsx b/website/routes/Animation.tsx index 7a92c2bc99..7532f160fa 100644 --- a/website/routes/Animation.tsx +++ b/website/routes/Animation.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { css } from 'ecij'; + import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CellNavigation.tsx b/website/routes/CellNavigation.tsx index 691b45d23d..ffc391329f 100644 --- a/website/routes/CellNavigation.tsx +++ b/website/routes/CellNavigation.tsx @@ -1,4 +1,5 @@ import { useId, useState } from 'react'; + import { DataGrid } from '../../src'; import type { CellKeyboardEvent, CellKeyDownArgs, Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ColumnSpanning.tsx b/website/routes/ColumnSpanning.tsx index d34e95f05d..35339790b2 100644 --- a/website/routes/ColumnSpanning.tsx +++ b/website/routes/ColumnSpanning.tsx @@ -1,4 +1,5 @@ import { css } from 'ecij'; + import { DataGrid, type Column } from '../../src'; import { renderCoordinates } from '../renderers'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ColumnsReordering.tsx b/website/routes/ColumnsReordering.tsx index 15ec87bc61..17004ec25f 100644 --- a/website/routes/ColumnsReordering.tsx +++ b/website/routes/ColumnsReordering.tsx @@ -1,4 +1,5 @@ import { useCallback, useMemo, useState } from 'react'; + import { DataGrid, type Column, type ColumnWidths, type SortColumn } from '../../src'; import { startViewTransition } from '../utils'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CommonFeatures.tsx b/website/routes/CommonFeatures.tsx index 5f6a67d1e5..0d934a526c 100644 --- a/website/routes/CommonFeatures.tsx +++ b/website/routes/CommonFeatures.tsx @@ -2,6 +2,7 @@ import { useMemo, useRef, useState } from 'react'; import { createPortal, flushSync } from 'react-dom'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { DataGrid, renderTextEditor, diff --git a/website/routes/ContextMenu.tsx b/website/routes/ContextMenu.tsx index 3237d65cb0..58655488e1 100644 --- a/website/routes/ContextMenu.tsx +++ b/website/routes/ContextMenu.tsx @@ -2,6 +2,7 @@ import { useLayoutEffect, useReducer, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CustomizableRenderers.tsx b/website/routes/CustomizableRenderers.tsx index 42d87c1b4e..ec4a2aa47d 100644 --- a/website/routes/CustomizableRenderers.tsx +++ b/website/routes/CustomizableRenderers.tsx @@ -1,5 +1,6 @@ import { useMemo, useState } from 'react'; import { css } from 'ecij'; + import { Row as BaseRow, Cell, DataGrid, renderTextEditor, SelectColumn } from '../../src'; import type { CellRendererProps, diff --git a/website/routes/HeaderFilters.tsx b/website/routes/HeaderFilters.tsx index c6516965df..f4b26fd95b 100644 --- a/website/routes/HeaderFilters.tsx +++ b/website/routes/HeaderFilters.tsx @@ -1,6 +1,7 @@ import { createContext, useContext, useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { DataGrid, type Column, type RenderHeaderCellProps } from '../../src'; import type { Omit } from '../../src/types'; import { useDirection } from '../directionContext'; diff --git a/website/routes/InfiniteScrolling.tsx b/website/routes/InfiniteScrolling.tsx index 1c98f40620..2b7ec28646 100644 --- a/website/routes/InfiniteScrolling.tsx +++ b/website/routes/InfiniteScrolling.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/MasterDetail.tsx b/website/routes/MasterDetail.tsx index 91d12070d0..b5d41d0945 100644 --- a/website/routes/MasterDetail.tsx +++ b/website/routes/MasterDetail.tsx @@ -1,6 +1,7 @@ import { useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { DataGrid, type Column, type Direction, type RowsChangeData } from '../../src'; import { CellExpanderFormatter } from '../components'; import { useDirection } from '../directionContext'; diff --git a/website/routes/NoRows.tsx b/website/routes/NoRows.tsx index af667f7b48..ccc9c3c61c 100644 --- a/website/routes/NoRows.tsx +++ b/website/routes/NoRows.tsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { css } from 'ecij'; + import { DataGrid, SelectColumn, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/RowGrouping.tsx b/website/routes/RowGrouping.tsx index 5c946b84a9..d260902718 100644 --- a/website/routes/RowGrouping.tsx +++ b/website/routes/RowGrouping.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; import { css } from 'ecij'; + import { SelectColumn, TreeDataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/RowsReordering.tsx b/website/routes/RowsReordering.tsx index e2d5494e8c..1ebb52d481 100644 --- a/website/routes/RowsReordering.tsx +++ b/website/routes/RowsReordering.tsx @@ -1,4 +1,5 @@ import { useCallback, useState } from 'react'; + import { DataGrid, renderTextEditor, type CellRendererProps, type Column } from '../../src'; import { DraggableCellRenderer } from '../components'; import { startViewTransition } from '../utils'; diff --git a/website/routes/ScrollToCell.tsx b/website/routes/ScrollToCell.tsx index d7530ce0de..b442f37333 100644 --- a/website/routes/ScrollToCell.tsx +++ b/website/routes/ScrollToCell.tsx @@ -1,6 +1,7 @@ import { useRef, useState } from 'react'; import { css } from 'ecij'; import clsx from 'clsx'; + import { DataGrid, type Column, type DataGridHandle } from '../../src'; import { renderCoordinates } from '../renderers'; import { useDirection } from '../directionContext'; diff --git a/website/routes/TreeView.tsx b/website/routes/TreeView.tsx index 30b93fbd1a..47fd20fa4d 100644 --- a/website/routes/TreeView.tsx +++ b/website/routes/TreeView.tsx @@ -1,5 +1,6 @@ import { useMemo, useReducer, useState } from 'react'; import { css } from 'ecij'; + import { DataGrid, type Column } from '../../src'; import { CellExpanderFormatter, ChildRowDeleteButton } from '../components'; import { useDirection } from '../directionContext'; diff --git a/website/routes/__root.tsx b/website/routes/__root.tsx index 9bd5e9d0b1..892d74f21b 100644 --- a/website/routes/__root.tsx +++ b/website/routes/__root.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { createRootRoute, Outlet } from '@tanstack/react-router'; import { css } from 'ecij'; + import type { Direction } from '../../src/types'; import { DirectionContext } from '../directionContext'; import Nav from '../Nav';