From 5dc70fc95ccc6fa87dcf29b6d29bab24bbafdbcb Mon Sep 17 00:00:00 2001 From: Alvin Tong Date: Tue, 10 Dec 2024 14:01:47 -0800 Subject: [PATCH 1/3] refactor (react-data-grid-react-window): export all types and hooks --- ...ataGridBody.types.ts => DataGrid.types.ts} | 0 .../src/components/DataGrid/index.ts | 2 ++ .../components/DataGrid/renderDataGrid.tsx | 2 +- .../src/components/DataGrid/useDataGrid.ts | 2 +- .../src/components/DataGridBody/index.ts | 1 + .../src/components/DataGridHeader/index.ts | 1 + .../src/components/DataGridRow/index.ts | 1 + .../react-data-grid-react-window/src/index.ts | 28 +++++++++++++++---- 8 files changed, 30 insertions(+), 7 deletions(-) rename packages/react-data-grid-react-window/src/components/DataGrid/{DataGridBody.types.ts => DataGrid.types.ts} (100%) diff --git a/packages/react-data-grid-react-window/src/components/DataGrid/DataGridBody.types.ts b/packages/react-data-grid-react-window/src/components/DataGrid/DataGrid.types.ts similarity index 100% rename from packages/react-data-grid-react-window/src/components/DataGrid/DataGridBody.types.ts rename to packages/react-data-grid-react-window/src/components/DataGrid/DataGrid.types.ts diff --git a/packages/react-data-grid-react-window/src/components/DataGrid/index.ts b/packages/react-data-grid-react-window/src/components/DataGrid/index.ts index 0b3589e2..6709620e 100644 --- a/packages/react-data-grid-react-window/src/components/DataGrid/index.ts +++ b/packages/react-data-grid-react-window/src/components/DataGrid/index.ts @@ -1,2 +1,4 @@ export * from './DataGrid'; +export * from './DataGrid.types'; +export * from './renderDataGrid'; export * from './useDataGrid'; diff --git a/packages/react-data-grid-react-window/src/components/DataGrid/renderDataGrid.tsx b/packages/react-data-grid-react-window/src/components/DataGrid/renderDataGrid.tsx index 3cf9d469..b1c2af78 100644 --- a/packages/react-data-grid-react-window/src/components/DataGrid/renderDataGrid.tsx +++ b/packages/react-data-grid-react-window/src/components/DataGrid/renderDataGrid.tsx @@ -5,7 +5,7 @@ import { } from '@fluentui/react-components'; import { HeaderRefContextProvider } from '../../contexts/headerRefContext'; import { BodyRefContextProvider } from '../../contexts/bodyRefContext'; -import { DataGridState } from './DataGridBody.types'; +import { DataGridState } from './DataGrid.types'; /** * Render the final JSX of DataGrid diff --git a/packages/react-data-grid-react-window/src/components/DataGrid/useDataGrid.ts b/packages/react-data-grid-react-window/src/components/DataGrid/useDataGrid.ts index 9d8fd7c6..af280c86 100644 --- a/packages/react-data-grid-react-window/src/components/DataGrid/useDataGrid.ts +++ b/packages/react-data-grid-react-window/src/components/DataGrid/useDataGrid.ts @@ -4,7 +4,7 @@ import { DataGridProps, } from '@fluentui/react-components'; import { useFluent, useScrollbarWidth } from '@fluentui/react-components'; -import { DataGridState } from './DataGridBody.types'; +import { DataGridState } from './DataGrid.types'; const TABLE_SELECTION_CELL_WIDTH = 44; diff --git a/packages/react-data-grid-react-window/src/components/DataGridBody/index.ts b/packages/react-data-grid-react-window/src/components/DataGridBody/index.ts index 5c9c471c..70d2bbda 100644 --- a/packages/react-data-grid-react-window/src/components/DataGridBody/index.ts +++ b/packages/react-data-grid-react-window/src/components/DataGridBody/index.ts @@ -2,3 +2,4 @@ export * from './DataGridBody'; export * from './DataGridBody.types'; export * from './renderDataGridBody'; export * from './useDataGridBody'; +export * from './useDataGridBodyStyles.styles'; diff --git a/packages/react-data-grid-react-window/src/components/DataGridHeader/index.ts b/packages/react-data-grid-react-window/src/components/DataGridHeader/index.ts index 60c0cdb1..f7b4d637 100644 --- a/packages/react-data-grid-react-window/src/components/DataGridHeader/index.ts +++ b/packages/react-data-grid-react-window/src/components/DataGridHeader/index.ts @@ -1,2 +1,3 @@ export * from './DataGridHeader'; export * from './useDataGridHeader'; +export * from './useDataGridHeaderStyles.styles'; diff --git a/packages/react-data-grid-react-window/src/components/DataGridRow/index.ts b/packages/react-data-grid-react-window/src/components/DataGridRow/index.ts index a5ab3d0a..1a44164b 100644 --- a/packages/react-data-grid-react-window/src/components/DataGridRow/index.ts +++ b/packages/react-data-grid-react-window/src/components/DataGridRow/index.ts @@ -1,2 +1,3 @@ export * from './DataGridRow'; +export * from './useDataGridRow'; export * from './useDataGridRow.styles'; diff --git a/packages/react-data-grid-react-window/src/index.ts b/packages/react-data-grid-react-window/src/index.ts index 4b654fe3..5156bacd 100644 --- a/packages/react-data-grid-react-window/src/index.ts +++ b/packages/react-data-grid-react-window/src/index.ts @@ -1,7 +1,24 @@ -export { DataGridBody } from './components/DataGridBody'; -export { DataGrid } from './components/DataGrid'; -export { DataGridRow } from './components/DataGridRow'; -export { DataGridHeader } from './components/DataGridHeader'; +export { + DataGridBody, + renderDataGridBody_unstable, + useDataGridBody_unstable, + useDataGridBodyStyles_unstable +} from './components/DataGridBody'; +export { + DataGrid, + renderDataGrid_unstable, + useDataGrid_unstable +} from './components/DataGrid'; +export { + DataGridRow, + useDataGridRow_unstable, + useDataGridRowStyles_unstable +} from './components/DataGridRow'; +export { + DataGridHeader, + useDataGridHeader_unstable, + useDataGridHeaderStyles_unstable +} from './components/DataGridHeader'; export { DataGridCell, @@ -18,4 +35,5 @@ export type { DataGridProps, } from '@fluentui/react-components'; -export type { DataGridBodyProps, RowRenderer } from './components/DataGridBody'; +export type { DataGridBodyProps, DataGridBodyState, RowRenderer } from './components/DataGridBody'; +export type { DataGridState } from './components/DataGrid'; From ce516487a7301be75b9cae34036809931e27f9b9 Mon Sep 17 00:00:00 2001 From: Alvin Tong Date: Tue, 10 Dec 2024 14:36:11 -0800 Subject: [PATCH 2/3] Change files --- ...-react-window-5186ddeb-b4cd-4968-9823-1e0171f60b9d.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-contrib-react-data-grid-react-window-5186ddeb-b4cd-4968-9823-1e0171f60b9d.json diff --git a/change/@fluentui-contrib-react-data-grid-react-window-5186ddeb-b4cd-4968-9823-1e0171f60b9d.json b/change/@fluentui-contrib-react-data-grid-react-window-5186ddeb-b4cd-4968-9823-1e0171f60b9d.json new file mode 100644 index 00000000..ae531851 --- /dev/null +++ b/change/@fluentui-contrib-react-data-grid-react-window-5186ddeb-b4cd-4968-9823-1e0171f60b9d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "refactor (react-data-grid-react-window): export all types and hooks", + "packageName": "@fluentui-contrib/react-data-grid-react-window", + "email": "alton@microsoft.com", + "dependentChangeType": "patch" +} From a47e7317224cebc8b0c1c41474f9c7738b8f05c4 Mon Sep 17 00:00:00 2001 From: Alvin Tong Date: Wed, 11 Dec 2024 09:33:39 -0800 Subject: [PATCH 3/3] fix formatting --- packages/react-data-grid-react-window/src/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/react-data-grid-react-window/src/index.ts b/packages/react-data-grid-react-window/src/index.ts index 5156bacd..e2ae741e 100644 --- a/packages/react-data-grid-react-window/src/index.ts +++ b/packages/react-data-grid-react-window/src/index.ts @@ -2,22 +2,22 @@ export { DataGridBody, renderDataGridBody_unstable, useDataGridBody_unstable, - useDataGridBodyStyles_unstable + useDataGridBodyStyles_unstable, } from './components/DataGridBody'; export { DataGrid, renderDataGrid_unstable, - useDataGrid_unstable + useDataGrid_unstable, } from './components/DataGrid'; export { DataGridRow, useDataGridRow_unstable, - useDataGridRowStyles_unstable + useDataGridRowStyles_unstable, } from './components/DataGridRow'; export { DataGridHeader, useDataGridHeader_unstable, - useDataGridHeaderStyles_unstable + useDataGridHeaderStyles_unstable, } from './components/DataGridHeader'; export { @@ -35,5 +35,9 @@ export type { DataGridProps, } from '@fluentui/react-components'; -export type { DataGridBodyProps, DataGridBodyState, RowRenderer } from './components/DataGridBody'; +export type { + DataGridBodyProps, + DataGridBodyState, + RowRenderer, +} from './components/DataGridBody'; export type { DataGridState } from './components/DataGrid';