Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,16 @@
'use client';
import * as React from 'react';
import { useDataGrid_unstable } from './useDataGrid';
import { renderDataGrid_unstable } from './renderDataGrid';
import { useDataGridStyles_unstable } from './useDataGridStyles.styles';
import { useDataGridContextValues_unstable } from './useDataGridContextValues';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGrid component
*/ export const DataGrid = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGrid_unstable(props, ref);
useDataGridStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridStyles_unstable')(state);
return renderDataGrid_unstable(state, useDataGridContextValues_unstable(state));
});
DataGrid.displayName = 'DataGrid';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGrid_unstable } from './useDataGrid';\nimport { renderDataGrid_unstable } from './renderDataGrid';\nimport { useDataGridStyles_unstable } from './useDataGridStyles.styles';\nimport type { DataGridProps } from './DataGrid.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDataGridContextValues_unstable } from './useDataGridContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGrid component\n */\nexport const DataGrid: ForwardRefComponent<DataGridProps> = React.forwardRef((props, ref) => {\n const state = useDataGrid_unstable(props, ref);\n\n useDataGridStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridStyles_unstable')(state);\n\n return renderDataGrid_unstable(state, useDataGridContextValues_unstable(state));\n});\n\nDataGrid.displayName = 'DataGrid';\n"],"names":["React","useDataGrid_unstable","renderDataGrid_unstable","useDataGridStyles_unstable","useDataGridContextValues_unstable","useCustomStyleHook_unstable","DataGrid","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAGxE,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,yBAA+CN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQT,qBAAqBO,OAAOC;IAE1CN,2BAA2BO;IAE3BL,4BAA4B,8BAA8BK;IAE1D,OAAOR,wBAAwBQ,OAAON,kCAAkCM;AAC1E,GAAG;AAEHJ,SAASK,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/DataGrid.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, SelectionMode } from '@fluentui/react-utilities';\nimport { TabsterDOMAttribute } from '@fluentui/react-tabster';\nimport type { TableContextValues, TableProps, TableSlots, TableState } from '../Table/Table.types';\nimport type {\n SortState,\n TableFeaturesState,\n UseTableSortOptions,\n OnSelectionChangeData,\n TableColumnSizingOptions,\n TableColumnId,\n} from '../../hooks';\nimport { TableRowProps } from '../TableRow/TableRow.types';\n\nexport type DataGridSlots = TableSlots;\n\nexport type DataGridFocusMode = 'none' | 'cell' | 'row_unstable' | 'composite';\n\nexport type DataGridContextValues = TableContextValues & {\n dataGrid: DataGridContextValue;\n};\n\n// Use any here since we can't know the user types\n// The user is responsible for narrowing the type downstream\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DataGridContextValue = TableFeaturesState<any> & {\n /**\n * How focus navigation will work in the datagrid\n * @default cell\n */\n focusMode: DataGridFocusMode;\n\n /**\n * Lets child components know if rows selection is enabled\n * @see selectionMode prop enables row selection on the component\n */\n selectableRows: boolean;\n\n /**\n * Enables subtle selection style\n * @default false\n */\n subtleSelection: boolean;\n\n /**\n * Row appearance when selected\n * @default brand\n */\n selectionAppearance: TableRowProps['appearance'];\n\n /**\n * Enables column resizing\n */\n resizableColumns?: boolean;\n\n compositeRowTabsterAttribute: TabsterDOMAttribute;\n};\n\n/**\n * DataGrid Props\n */\nexport type DataGridProps = TableProps &\n Pick<DataGridContextValue, 'items' | 'columns' | 'getRowId'> &\n Pick<Partial<DataGridContextValue>, 'focusMode' | 'subtleSelection' | 'selectionAppearance' | 'resizableColumns'> &\n Pick<UseTableSortOptions, 'sortState' | 'defaultSortState'> &\n Pick<SelectionHookParams, 'defaultSelectedItems' | 'selectedItems'> & {\n /* eslint-disable @nx/workspace-consistent-callback-type -- can't change type of existing callback */\n onSortChange?: (e: React.MouseEvent, sortState: SortState) => void;\n onSelectionChange?: (e: React.MouseEvent | React.KeyboardEvent, data: OnSelectionChangeData) => void;\n /* eslint-enable @nx/workspace-consistent-callback-type */\n\n /**\n * Enables row selection and sets the selection mode\n * @default false\n */\n selectionMode?: SelectionMode;\n /**\n * Options for column resizing, specific for each column\n */\n columnSizingOptions?: TableColumnSizingOptions;\n /**\n * A callback triggered when a column is resized.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onColumnResize?: (\n e: KeyboardEvent | TouchEvent | MouseEvent | undefined,\n data: { columnId: TableColumnId; width: number },\n ) => void;\n /**\n * For column resizing. Allows for a container size to be adjusted by a number of pixels, to make\n * sure the columns don't overflow the table.\n * By default, this value is calculated internally based on other props, but can be overriden.\n */\n containerWidthOffset?: number;\n\n /**\n * Custom options for column resizing.\n */\n resizableColumnsOptions?: {\n /**\n * If true, columns will be auto-fitted to the container width.\n * @default true\n * */\n autoFitColumns?: boolean;\n };\n };\n\n/**\n * State used in rendering DataGrid\n */\nexport type DataGridState = TableState & { tableState: TableFeaturesState<unknown> } & Pick<\n DataGridContextValue,\n | 'focusMode'\n | 'selectableRows'\n | 'subtleSelection'\n | 'selectionAppearance'\n | 'getRowId'\n | 'resizableColumns'\n | 'compositeRowTabsterAttribute'\n >;\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,5 @@
export { DataGrid } from './DataGrid';
export { renderDataGrid_unstable } from './renderDataGrid';
export { useDataGrid_unstable } from './useDataGrid';
export { dataGridClassNames, useDataGridStyles_unstable } from './useDataGridStyles.styles';
export { useDataGridContextValues_unstable } from './useDataGridContextValues';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/index.ts"],"sourcesContent":["export { DataGrid } from './DataGrid';\nexport type {\n DataGridContextValue,\n DataGridContextValues,\n DataGridFocusMode,\n DataGridProps,\n DataGridSlots,\n DataGridState,\n} from './DataGrid.types';\nexport { renderDataGrid_unstable } from './renderDataGrid';\nexport { useDataGrid_unstable } from './useDataGrid';\nexport { dataGridClassNames, useDataGridStyles_unstable } from './useDataGridStyles.styles';\nexport { useDataGridContextValues_unstable } from './useDataGridContextValues';\n"],"names":["DataGrid","renderDataGrid_unstable","useDataGrid_unstable","dataGridClassNames","useDataGridStyles_unstable","useDataGridContextValues_unstable"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,aAAa;AAStC,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,6BAA6B;AAC5F,SAASC,iCAAiC,QAAQ,6BAA6B"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
import { renderTable_unstable } from '../Table/renderTable';
import { DataGridContextProvider } from '../../contexts/dataGridContext';
/**
* Render the final JSX of DataGrid
*/ export const renderDataGrid_unstable = (state, contextValues)=>{
return /*#__PURE__*/ React.createElement(DataGridContextProvider, {
value: contextValues.dataGrid
}, renderTable_unstable(state, contextValues));
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/renderDataGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridContextValues, DataGridState } from './DataGrid.types';\nimport { renderTable_unstable } from '../Table/renderTable';\nimport { DataGridContextProvider } from '../../contexts/dataGridContext';\n\n/**\n * Render the final JSX of DataGrid\n */\n\nexport const renderDataGrid_unstable = (state: DataGridState, contextValues: DataGridContextValues): JSXElement => {\n return (\n <DataGridContextProvider value={contextValues.dataGrid}>\n {renderTable_unstable(state, contextValues)}\n </DataGridContextProvider>\n );\n};\n"],"names":["React","renderTable_unstable","DataGridContextProvider","renderDataGrid_unstable","state","contextValues","value","dataGrid"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,uBAAuB,QAAQ,iCAAiC;AAEzE;;CAEC,GAED,OAAO,MAAMC,0BAA0B,CAACC,OAAsBC;IAC5D,qBACE,oBAACH;QAAwBI,OAAOD,cAAcE,QAAQ;OACnDN,qBAAqBG,OAAOC;AAGnC,EAAE"}

View File

@@ -0,0 +1,98 @@
'use client';
import * as React from 'react';
import { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';
import { useTable_unstable } from '../Table/useTable';
import { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
import { End, Home } from '@fluentui/keyboard-keys';
import { useTableFeatures, useTableSort, useTableSelection, useTableColumnSizing_unstable, useTableCompositeNavigation } from '../../hooks';
import { CELL_WIDTH } from '../TableSelectionCell';
/**
* Create the state required to render DataGrid.
*
* The returned state can be modified with hooks such as useDataGridStyles_unstable,
* before being passed to renderDataGrid_unstable.
*
* @param props - props from this instance of DataGrid
* @param ref - reference to root HTMLElement of DataGrid
*/ export const useDataGrid_unstable = (props, ref)=>{
const { items, columns, focusMode = 'cell', selectionMode, onSortChange, onSelectionChange, defaultSortState, sortState, selectedItems, defaultSelectedItems, subtleSelection = false, selectionAppearance = 'brand', getRowId, resizableColumns, columnSizingOptions, onColumnResize, containerWidthOffset, resizableColumnsOptions = {} } = props;
const widthOffset = containerWidthOffset !== null && containerWidthOffset !== void 0 ? containerWidthOffset : selectionMode ? -CELL_WIDTH : 0;
const gridTabsterAttribute = useArrowNavigationGroup({
axis: 'grid'
});
const { onTableKeyDown: onCompositeKeyDown, tableTabsterAttribute: compositeTabsterAttribute, tableRowTabsterAttribute: compositeRowTabsterAttribute } = useTableCompositeNavigation();
var _resizableColumnsOptions_autoFitColumns;
const tableState = useTableFeatures({
items,
columns,
getRowId
}, [
useTableSort({
defaultSortState,
sortState,
onSortChange
}),
useTableSelection({
defaultSelectedItems,
selectedItems,
onSelectionChange,
selectionMode: selectionMode !== null && selectionMode !== void 0 ? selectionMode : 'multiselect'
}),
useTableColumnSizing_unstable({
onColumnResize,
columnSizingOptions,
// The selection cell is not part of the columns, therefore its width needs to be subtracted
// from the container to make sure the columns don't overflow the table.
containerWidthOffset: widthOffset,
// Disables automatic resizing of columns when the container overflows.
// This allows the sum of the columns to be larger than the container.
autoFitColumns: (_resizableColumnsOptions_autoFitColumns = resizableColumnsOptions.autoFitColumns) !== null && _resizableColumnsOptions_autoFitColumns !== void 0 ? _resizableColumnsOptions_autoFitColumns : true
})
]);
const innerRef = React.useRef(null);
const { findFirstFocusable, findLastFocusable } = useFocusFinders();
const onKeyDown = useEventCallback((e)=>{
var _props_onKeyDown;
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);
focusMode === 'composite' && onCompositeKeyDown(e);
// handle ctrl+home and ctrl+end
if (!innerRef.current || !e.ctrlKey || e.defaultPrevented) {
return;
}
if (e.key === Home) {
const firstRow = innerRef.current.querySelector('[role="row"]');
if (firstRow) {
var _findFirstFocusable;
(_findFirstFocusable = findFirstFocusable(firstRow)) === null || _findFirstFocusable === void 0 ? void 0 : _findFirstFocusable.focus();
}
}
if (e.key === End) {
const rows = innerRef.current.querySelectorAll('[role="row"]');
if (rows.length) {
var _findLastFocusable;
const lastRow = rows.item(rows.length - 1);
(_findLastFocusable = findLastFocusable(lastRow)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
}
}
});
const baseTableState = useTable_unstable({
role: 'grid',
as: 'div',
noNativeElements: true,
...focusMode === 'cell' && gridTabsterAttribute,
...focusMode === 'composite' && compositeTabsterAttribute,
...props,
onKeyDown,
...resizableColumns ? tableState.columnSizing_unstable.getTableProps(props) : {}
}, useMergedRefs(ref, tableState.tableRef, innerRef));
return {
...baseTableState,
focusMode,
tableState,
selectableRows: !!selectionMode,
subtleSelection,
selectionAppearance,
resizableColumns,
compositeRowTabsterAttribute
};
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
'use client';
import { useTableContextValues_unstable } from '../Table/useTableContextValues';
export function useDataGridContextValues_unstable(state) {
const tableContextValues = useTableContextValues_unstable(state);
const { tableState, focusMode, selectableRows, subtleSelection, selectionAppearance, resizableColumns, compositeRowTabsterAttribute } = state;
return {
...tableContextValues,
dataGrid: {
...tableState,
focusMode,
selectableRows,
subtleSelection,
selectionAppearance,
resizableColumns,
compositeRowTabsterAttribute
}
};
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/useDataGridContextValues.ts"],"sourcesContent":["'use client';\n\nimport { useTableContextValues_unstable } from '../Table/useTableContextValues';\nimport { DataGridContextValues, DataGridState } from './DataGrid.types';\n\nexport function useDataGridContextValues_unstable(state: DataGridState): DataGridContextValues {\n const tableContextValues = useTableContextValues_unstable(state);\n const {\n tableState,\n focusMode,\n selectableRows,\n subtleSelection,\n selectionAppearance,\n resizableColumns,\n compositeRowTabsterAttribute,\n } = state;\n return {\n ...tableContextValues,\n dataGrid: {\n ...tableState,\n focusMode,\n selectableRows,\n subtleSelection,\n selectionAppearance,\n resizableColumns,\n compositeRowTabsterAttribute,\n },\n };\n}\n"],"names":["useTableContextValues_unstable","useDataGridContextValues_unstable","state","tableContextValues","tableState","focusMode","selectableRows","subtleSelection","selectionAppearance","resizableColumns","compositeRowTabsterAttribute","dataGrid"],"mappings":"AAAA;AAEA,SAASA,8BAA8B,QAAQ,iCAAiC;AAGhF,OAAO,SAASC,kCAAkCC,KAAoB;IACpE,MAAMC,qBAAqBH,+BAA+BE;IAC1D,MAAM,EACJE,UAAU,EACVC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,mBAAmB,EACnBC,gBAAgB,EAChBC,4BAA4B,EAC7B,GAAGR;IACJ,OAAO;QACL,GAAGC,kBAAkB;QACrBQ,UAAU;YACR,GAAGP,UAAU;YACbC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;IACF;AACF"}

View File

@@ -0,0 +1,17 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableStyles_unstable } from '../Table/useTableStyles.styles';
export const dataGridClassNames = {
root: 'fui-DataGrid'
};
/**
* Apply styling to the DataGrid slots based on the state
*/
export const useDataGridStyles_unstable = state => {
'use no memo';
useTableStyles_unstable(state);
state.root.className = mergeClasses(dataGridClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableStyles_unstable","dataGridClassNames","root","useDataGridStyles_unstable","state","className"],"sources":["useDataGridStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableStyles_unstable } from '../Table/useTableStyles.styles';\nexport const dataGridClassNames = {\n root: 'fui-DataGrid'\n};\n/**\n * Apply styling to the DataGrid slots based on the state\n */ export const useDataGridStyles_unstable = (state)=>{\n 'use no memo';\n useTableStyles_unstable(state);\n state.root.className = mergeClasses(dataGridClassNames.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,0BAA0B,GAAIC,KAAK,IAAG;EACnD,aAAa;;EACbJ,uBAAuB,CAACI,KAAK,CAAC;EAC9BA,KAAK,CAACF,IAAI,CAACG,SAAS,GAAGN,YAAY,CAACE,kBAAkB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;EAClF,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableStyles_unstable } from '../Table/useTableStyles.styles';
export const dataGridClassNames = {
root: 'fui-DataGrid'
};
/**
* Apply styling to the DataGrid slots based on the state
*/ export const useDataGridStyles_unstable = (state)=>{
'use no memo';
useTableStyles_unstable(state);
state.root.className = mergeClasses(dataGridClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGrid/useDataGridStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridSlots, DataGridState } from './DataGrid.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableStyles_unstable } from '../Table/useTableStyles.styles';\n\nexport const dataGridClassNames: SlotClassNames<DataGridSlots> = {\n root: 'fui-DataGrid',\n};\n\n/**\n * Apply styling to the DataGrid slots based on the state\n */\nexport const useDataGridStyles_unstable = (state: DataGridState): DataGridState => {\n 'use no memo';\n\n useTableStyles_unstable(state);\n state.root.className = mergeClasses(dataGridClassNames.root, state.root.className);\n\n return state;\n};\n"],"names":["mergeClasses","useTableStyles_unstable","dataGridClassNames","root","useDataGridStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,uBAAuB,QAAQ,iCAAiC;AAEzE,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzC;IAEAJ,wBAAwBI;IACxBA,MAAMF,IAAI,CAACG,SAAS,GAAGN,aAAaE,mBAAmBC,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAEjF,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridBody_unstable } from './useDataGridBody';
import { renderDataGridBody_unstable } from './renderDataGridBody';
import { useDataGridBodyStyles_unstable } from './useDataGridBodyStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridBody component
*/ export const DataGridBody = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridBody_unstable(props, ref);
useDataGridBodyStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridBodyStyles_unstable')(state);
return renderDataGridBody_unstable(state);
});
DataGridBody.displayName = 'DataGridBody';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/DataGridBody.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridBody_unstable } from './useDataGridBody';\nimport { renderDataGridBody_unstable } from './renderDataGridBody';\nimport { useDataGridBodyStyles_unstable } from './useDataGridBodyStyles.styles';\nimport type { DataGridBodyProps } from './DataGridBody.types';\nimport type { ForwardRefComponent, JSXElement } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridBody component\n */\nexport const DataGridBody: ForwardRefComponent<DataGridBodyProps> &\n (<TItem>(props: DataGridBodyProps<TItem>) => JSXElement) = React.forwardRef<HTMLElement, DataGridBodyProps>(\n (props, ref) => {\n const state = useDataGridBody_unstable(props, ref);\n\n useDataGridBodyStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridBodyStyles_unstable')(state);\n\n return renderDataGridBody_unstable(state);\n },\n) as ForwardRefComponent<DataGridBodyProps> & (<TItem>(props: DataGridBodyProps<TItem>) => JSXElement);\n\nDataGridBody.displayName = 'DataGridBody';\n"],"names":["React","useDataGridBody_unstable","renderDataGridBody_unstable","useDataGridBodyStyles_unstable","useCustomStyleHook_unstable","DataGridBody","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,6BACgDL,MAAMM,UAAU,CAC3E,CAACC,OAAOC;IACN,MAAMC,QAAQR,yBAAyBM,OAAOC;IAE9CL,+BAA+BM;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAOP,4BAA4BO;AACrC,GACqG;AAEvGJ,aAAaK,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/DataGridBody.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TableRowData } from '../../hooks';\nimport type { TableBodySlots, TableBodyProps, TableBodyState } from '../TableBody/TableBody.types';\n\nexport type DataGridBodySlots = TableBodySlots;\n\nexport type RowRenderFunction<TItem = unknown> = (row: TableRowData<TItem>, ...rest: unknown[]) => React.ReactNode;\n\n/**\n * DataGridBody Props\n */\nexport type DataGridBodyProps<TItem = unknown> = Omit<TableBodyProps, 'children'> & {\n /**\n * Render function for rows\n */\n children: RowRenderFunction<TItem>;\n};\n\n/**\n * State used in rendering DataGridBody\n */\nexport type DataGridBodyState = TableBodyState & {\n rows: TableRowData<unknown>[];\n\n renderRow: RowRenderFunction;\n};\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,4 @@
export { DataGridBody } from './DataGridBody';
export { renderDataGridBody_unstable } from './renderDataGridBody';
export { useDataGridBody_unstable } from './useDataGridBody';
export { dataGridBodyClassNames, useDataGridBodyStyles_unstable } from './useDataGridBodyStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/index.ts"],"sourcesContent":["export { DataGridBody } from './DataGridBody';\nexport type { DataGridBodyProps, DataGridBodySlots, DataGridBodyState, RowRenderFunction } from './DataGridBody.types';\nexport { renderDataGridBody_unstable } from './renderDataGridBody';\nexport { useDataGridBody_unstable } from './useDataGridBody';\nexport { dataGridBodyClassNames, useDataGridBodyStyles_unstable } from './useDataGridBodyStyles.styles';\n"],"names":["DataGridBody","renderDataGridBody_unstable","useDataGridBody_unstable","dataGridBodyClassNames","useDataGridBodyStyles_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,sBAAsB,EAAEC,8BAA8B,QAAQ,iCAAiC"}

View File

@@ -0,0 +1,14 @@
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { TableRowIdContextProvider } from '../../contexts/rowIdContext';
/**
* Render the final JSX of DataGridBody
*/ export const renderDataGridBody_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsx(state.root, {
children: state.rows.map((row)=>/*#__PURE__*/ _jsx(TableRowIdContextProvider, {
value: row.rowId,
children: state.renderRow(row)
}, row.rowId))
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/renderDataGridBody.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridBodyState, DataGridBodySlots } from './DataGridBody.types';\nimport { TableRowIdContextProvider } from '../../contexts/rowIdContext';\n\n/**\n * Render the final JSX of DataGridBody\n */\nexport const renderDataGridBody_unstable = (state: DataGridBodyState): JSXElement => {\n assertSlots<DataGridBodySlots>(state);\n\n return (\n <state.root>\n {state.rows.map(row => (\n <TableRowIdContextProvider key={row.rowId} value={row.rowId}>\n {state.renderRow(row)}\n </TableRowIdContextProvider>\n ))}\n </state.root>\n );\n};\n"],"names":["assertSlots","TableRowIdContextProvider","renderDataGridBody_unstable","state","root","rows","map","row","value","rowId","renderRow"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1CH,YAA+BG;IAE/B,qBACE,KAACA,MAAMC,IAAI;kBACRD,MAAME,IAAI,CAACC,GAAG,CAACC,CAAAA,oBACd,KAACN;gBAA0CO,OAAOD,IAAIE,KAAK;0BACxDN,MAAMO,SAAS,CAACH;eADaA,IAAIE,KAAK;;AAMjD,EAAE"}

View File

@@ -0,0 +1,29 @@
'use client';
import * as React from 'react';
import { useTableBody_unstable } from '../TableBody/useTableBody';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { useTableContext } from '../../contexts/tableContext';
/**
* Create the state required to render DataGridBody.
*
* The returned state can be modified with hooks such as useDataGridBodyStyles_unstable,
* before being passed to renderDataGridBody_unstable.
*
* @param props - props from this instance of DataGridBody
* @param ref - reference to root HTMLElement of DataGridBody
*/ export const useDataGridBody_unstable = (props, ref)=>{
const { sortable } = useTableContext();
const getRows = useDataGridContext_unstable((ctx)=>ctx.getRows);
const sort = useDataGridContext_unstable((ctx)=>ctx.sort.sort);
const rows = sortable ? sort(getRows()) : getRows();
const baseState = useTableBody_unstable({
...props,
children: null,
as: 'div'
}, ref);
return {
...baseState,
rows,
renderRow: props.children
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/useDataGridBody.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { DataGridBodyProps, DataGridBodyState } from './DataGridBody.types';\nimport { useTableBody_unstable } from '../TableBody/useTableBody';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render DataGridBody.\n *\n * The returned state can be modified with hooks such as useDataGridBodyStyles_unstable,\n * before being passed to renderDataGridBody_unstable.\n *\n * @param props - props from this instance of DataGridBody\n * @param ref - reference to root HTMLElement of DataGridBody\n */\nexport const useDataGridBody_unstable = (props: DataGridBodyProps, ref: React.Ref<HTMLElement>): DataGridBodyState => {\n const { sortable } = useTableContext();\n const getRows = useDataGridContext_unstable(ctx => ctx.getRows);\n const sort = useDataGridContext_unstable(ctx => ctx.sort.sort);\n const rows = sortable ? sort(getRows()) : getRows();\n\n const baseState = useTableBody_unstable({ ...props, children: null, as: 'div' }, ref);\n return {\n ...baseState,\n rows,\n renderRow: props.children,\n };\n};\n"],"names":["React","useTableBody_unstable","useDataGridContext_unstable","useTableContext","useDataGridBody_unstable","props","ref","sortable","getRows","ctx","sort","rows","baseState","children","as","renderRow"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,eAAe,QAAQ,8BAA8B;AAE9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EAAEC,QAAQ,EAAE,GAAGJ;IACrB,MAAMK,UAAUN,4BAA4BO,CAAAA,MAAOA,IAAID,OAAO;IAC9D,MAAME,OAAOR,4BAA4BO,CAAAA,MAAOA,IAAIC,IAAI,CAACA,IAAI;IAC7D,MAAMC,OAAOJ,WAAWG,KAAKF,aAAaA;IAE1C,MAAMI,YAAYX,sBAAsB;QAAE,GAAGI,KAAK;QAAEQ,UAAU;QAAMC,IAAI;IAAM,GAAGR;IACjF,OAAO;QACL,GAAGM,SAAS;QACZD;QACAI,WAAWV,MAAMQ,QAAQ;IAC3B;AACF,EAAE"}

View File

@@ -0,0 +1,17 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableBodyStyles_unstable } from '../TableBody/useTableBodyStyles.styles';
export const dataGridBodyClassNames = {
root: 'fui-DataGridBody'
};
/**
* Apply styling to the DataGridBody slots based on the state
*/
export const useDataGridBodyStyles_unstable = state => {
'use no memo';
useTableBodyStyles_unstable(state);
state.root.className = mergeClasses(dataGridBodyClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableBodyStyles_unstable","dataGridBodyClassNames","root","useDataGridBodyStyles_unstable","state","className"],"sources":["useDataGridBodyStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableBodyStyles_unstable } from '../TableBody/useTableBodyStyles.styles';\nexport const dataGridBodyClassNames = {\n root: 'fui-DataGridBody'\n};\n/**\n * Apply styling to the DataGridBody slots based on the state\n */ export const useDataGridBodyStyles_unstable = (state)=>{\n 'use no memo';\n useTableBodyStyles_unstable(state);\n state.root.className = mergeClasses(dataGridBodyClassNames.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,aAAa;;EACbJ,2BAA2B,CAACI,KAAK,CAAC;EAClCA,KAAK,CAACF,IAAI,CAACG,SAAS,GAAGN,YAAY,CAACE,sBAAsB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;EACtF,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableBodyStyles_unstable } from '../TableBody/useTableBodyStyles.styles';
export const dataGridBodyClassNames = {
root: 'fui-DataGridBody'
};
/**
* Apply styling to the DataGridBody slots based on the state
*/ export const useDataGridBodyStyles_unstable = (state)=>{
'use no memo';
useTableBodyStyles_unstable(state);
state.root.className = mergeClasses(dataGridBodyClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridBody/useDataGridBodyStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridBodySlots, DataGridBodyState } from './DataGridBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableBodyStyles_unstable } from '../TableBody/useTableBodyStyles.styles';\n\nexport const dataGridBodyClassNames: SlotClassNames<DataGridBodySlots> = {\n root: 'fui-DataGridBody',\n};\n\n/**\n * Apply styling to the DataGridBody slots based on the state\n */\nexport const useDataGridBodyStyles_unstable = (state: DataGridBodyState): DataGridBodyState => {\n 'use no memo';\n\n useTableBodyStyles_unstable(state);\n state.root.className = mergeClasses(dataGridBodyClassNames.root, state.root.className);\n\n return state;\n};\n"],"names":["mergeClasses","useTableBodyStyles_unstable","dataGridBodyClassNames","root","useDataGridBodyStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,2BAA2B,QAAQ,yCAAyC;AAErF,OAAO,MAAMC,yBAA4D;IACvEC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7C;IAEAJ,4BAA4BI;IAC5BA,MAAMF,IAAI,CAACG,SAAS,GAAGN,aAAaE,uBAAuBC,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAErF,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridCell_unstable } from './useDataGridCell';
import { renderDataGridCell_unstable } from './renderDataGridCell';
import { useDataGridCellStyles_unstable } from './useDataGridCellStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridCell component
*/ export const DataGridCell = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridCell_unstable(props, ref);
useDataGridCellStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridCellStyles_unstable')(state);
return renderDataGridCell_unstable(state);
});
DataGridCell.displayName = 'DataGridCell';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/DataGridCell.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridCell_unstable } from './useDataGridCell';\nimport { renderDataGridCell_unstable } from './renderDataGridCell';\nimport { useDataGridCellStyles_unstable } from './useDataGridCellStyles.styles';\nimport type { DataGridCellProps } from './DataGridCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridCell component\n */\nexport const DataGridCell: ForwardRefComponent<DataGridCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridCell_unstable(props, ref);\n\n useDataGridCellStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridCellStyles_unstable')(state);\n\n return renderDataGridCell_unstable(state);\n});\n\nDataGridCell.displayName = 'DataGridCell';\n"],"names":["React","useDataGridCell_unstable","renderDataGridCell_unstable","useDataGridCellStyles_unstable","useCustomStyleHook_unstable","DataGridCell","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQR,yBAAyBM,OAAOC;IAE9CL,+BAA+BM;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAOP,4BAA4BO;AACrC,GAAG;AAEHJ,aAAaK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering DataGridCell
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/DataGridCell.types.ts"],"sourcesContent":["import { TableCellProps, TableCellSlots, TableCellState } from '../TableCell/TableCell.types';\n\nexport type DataGridCellSlots = TableCellSlots;\n\n/**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n */\nexport type DataGridCellFocusMode = 'group' | 'none' | 'cell';\n\n/**\n * DataGridCell Props\n */\nexport type DataGridCellProps = TableCellProps & {\n /**\n * Used when there are nested focusble elements inside a focusable cell\n * - `group`: Enter keypress moves focus inside the cell, focus is trapped inside the cell until Escape keypress\n * - `cell`: The cell is focusable - if there are focusable elements in the cell use `group`\n * - `none`: The cell is not focusable\n * @default cell\n */\n focusMode?: DataGridCellFocusMode;\n};\n\n/**\n * State used in rendering DataGridCell\n */\nexport type DataGridCellState = TableCellState;\n"],"names":[],"mappings":"AA0BA;;CAEC,GACD,WAA+C"}

View File

@@ -0,0 +1,4 @@
export { DataGridCell } from './DataGridCell';
export { renderDataGridCell_unstable } from './renderDataGridCell';
export { useDataGridCell_unstable } from './useDataGridCell';
export { dataGridCellClassNames, useDataGridCellStyles_unstable } from './useDataGridCellStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/index.ts"],"sourcesContent":["export { DataGridCell } from './DataGridCell';\nexport type {\n DataGridCellFocusMode,\n DataGridCellProps,\n DataGridCellSlots,\n DataGridCellState,\n} from './DataGridCell.types';\nexport { renderDataGridCell_unstable } from './renderDataGridCell';\nexport { useDataGridCell_unstable } from './useDataGridCell';\nexport { dataGridCellClassNames, useDataGridCellStyles_unstable } from './useDataGridCellStyles.styles';\n"],"names":["DataGridCell","renderDataGridCell_unstable","useDataGridCell_unstable","dataGridCellClassNames","useDataGridCellStyles_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAO9C,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,sBAAsB,EAAEC,8BAA8B,QAAQ,iCAAiC"}

View File

@@ -0,0 +1,6 @@
import { renderTableCell_unstable } from '../TableCell/renderTableCell';
/**
* Render the final JSX of DataGridCell
*/ export const renderDataGridCell_unstable = (state)=>{
return renderTableCell_unstable(state);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/renderDataGridCell.tsx"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridCellState } from './DataGridCell.types';\nimport { renderTableCell_unstable } from '../TableCell/renderTableCell';\n\n/**\n * Render the final JSX of DataGridCell\n */\nexport const renderDataGridCell_unstable = (state: DataGridCellState): JSXElement => {\n return renderTableCell_unstable(state);\n};\n"],"names":["renderTableCell_unstable","renderDataGridCell_unstable","state"],"mappings":"AAEA,SAASA,wBAAwB,QAAQ,+BAA+B;AAExE;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C,OAAOF,yBAAyBE;AAClC,EAAE"}

View File

@@ -0,0 +1,34 @@
'use client';
import * as React from 'react';
import { useFocusableGroup } from '@fluentui/react-tabster';
import { useTableCell_unstable } from '../TableCell/useTableCell';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { useColumnIdContext } from '../../contexts/columnIdContext';
/**
* Create the state required to render DataGridCell.
*
* The returned state can be modified with hooks such as useDataGridCellStyles_unstable,
* before being passed to renderDataGridCell_unstable.
*
* @param props - props from this instance of DataGridCell
* @param ref - reference to root HTMLElement of DataGridCell
*/ export const useDataGridCell_unstable = (props, ref)=>{
const { focusMode = 'cell' } = props;
const columnId = useColumnIdContext();
const tabbable = useDataGridContext_unstable((ctx)=>(ctx.focusMode === 'cell' || ctx.focusMode === 'composite') && focusMode !== 'none');
const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);
const getTableCellProps = useDataGridContext_unstable((ctx)=>{
return ctx.columnSizing_unstable.getTableCellProps;
});
const focusableGroupAttr = useFocusableGroup({
tabBehavior: 'limited-trap-focus'
});
return useTableCell_unstable({
as: 'div',
role: 'gridcell',
...focusMode === 'group' && focusableGroupAttr,
tabIndex: tabbable ? 0 : undefined,
...resizableColumns ? getTableCellProps(columnId) : {},
...props
}, ref);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/useDataGridCell.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport type { DataGridCellProps, DataGridCellState } from './DataGridCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\n\n/**\n * Create the state required to render DataGridCell.\n *\n * The returned state can be modified with hooks such as useDataGridCellStyles_unstable,\n * before being passed to renderDataGridCell_unstable.\n *\n * @param props - props from this instance of DataGridCell\n * @param ref - reference to root HTMLElement of DataGridCell\n */\nexport const useDataGridCell_unstable = (props: DataGridCellProps, ref: React.Ref<HTMLElement>): DataGridCellState => {\n const { focusMode = 'cell' } = props;\n const columnId = useColumnIdContext();\n const tabbable = useDataGridContext_unstable(\n ctx => (ctx.focusMode === 'cell' || ctx.focusMode === 'composite') && focusMode !== 'none',\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableCellProps;\n });\n const focusableGroupAttr = useFocusableGroup({ tabBehavior: 'limited-trap-focus' });\n return useTableCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n ...(focusMode === 'group' && focusableGroupAttr),\n tabIndex: tabbable ? 0 : undefined,\n ...(resizableColumns ? getTableCellProps(columnId) : {}),\n ...props,\n },\n ref,\n );\n};\n"],"names":["React","useFocusableGroup","useTableCell_unstable","useDataGridContext_unstable","useColumnIdContext","useDataGridCell_unstable","props","ref","focusMode","columnId","tabbable","ctx","resizableColumns","getTableCellProps","columnSizing_unstable","focusableGroupAttr","tabBehavior","as","role","tabIndex","undefined"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EAAEC,YAAY,MAAM,EAAE,GAAGF;IAC/B,MAAMG,WAAWL;IACjB,MAAMM,WAAWP,4BACfQ,CAAAA,MAAO,AAACA,CAAAA,IAAIH,SAAS,KAAK,UAAUG,IAAIH,SAAS,KAAK,WAAU,KAAMA,cAAc;IAEtF,MAAMI,mBAAmBT,4BAA4BQ,CAAAA,MAAOA,IAAIC,gBAAgB;IAChF,MAAMC,oBAAoBV,4BAA4BQ,CAAAA;QACpD,OAAOA,IAAIG,qBAAqB,CAACD,iBAAiB;IACpD;IACA,MAAME,qBAAqBd,kBAAkB;QAAEe,aAAa;IAAqB;IACjF,OAAOd,sBACL;QACEe,IAAI;QACJC,MAAM;QACN,GAAIV,cAAc,WAAWO,kBAAkB;QAC/CI,UAAUT,WAAW,IAAIU;QACzB,GAAIR,mBAAmBC,kBAAkBJ,YAAY,CAAC,CAAC;QACvD,GAAGH,KAAK;IACV,GACAC;AAEJ,EAAE"}

View File

@@ -0,0 +1,17 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableCellStyles_unstable } from '../TableCell/useTableCellStyles.styles';
export const dataGridCellClassNames = {
root: 'fui-DataGridCell'
};
/**
* Apply styling to the DataGridCell slots based on the state
*/
export const useDataGridCellStyles_unstable = state => {
'use no memo';
useTableCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridCellClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableCellStyles_unstable","dataGridCellClassNames","root","useDataGridCellStyles_unstable","state","className"],"sources":["useDataGridCellStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableCellStyles_unstable } from '../TableCell/useTableCellStyles.styles';\nexport const dataGridCellClassNames = {\n root: 'fui-DataGridCell'\n};\n/**\n * Apply styling to the DataGridCell slots based on the state\n */ export const useDataGridCellStyles_unstable = (state)=>{\n 'use no memo';\n useTableCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridCellClassNames.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,aAAa;;EACbJ,2BAA2B,CAACI,KAAK,CAAC;EAClCA,KAAK,CAACF,IAAI,CAACG,SAAS,GAAGN,YAAY,CAACE,sBAAsB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;EACtF,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableCellStyles_unstable } from '../TableCell/useTableCellStyles.styles';
export const dataGridCellClassNames = {
root: 'fui-DataGridCell'
};
/**
* Apply styling to the DataGridCell slots based on the state
*/ export const useDataGridCellStyles_unstable = (state)=>{
'use no memo';
useTableCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridCellClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridCell/useDataGridCellStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridCellSlots, DataGridCellState } from './DataGridCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableCellStyles_unstable } from '../TableCell/useTableCellStyles.styles';\n\nexport const dataGridCellClassNames: SlotClassNames<DataGridCellSlots> = {\n root: 'fui-DataGridCell',\n};\n\n/**\n * Apply styling to the DataGridCell slots based on the state\n */\nexport const useDataGridCellStyles_unstable = (state: DataGridCellState): DataGridCellState => {\n 'use no memo';\n\n useTableCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridCellClassNames.root, state.root.className);\n\n return state;\n};\n"],"names":["mergeClasses","useTableCellStyles_unstable","dataGridCellClassNames","root","useDataGridCellStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,2BAA2B,QAAQ,yCAAyC;AAErF,OAAO,MAAMC,yBAA4D;IACvEC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7C;IAEAJ,4BAA4BI;IAC5BA,MAAMF,IAAI,CAACG,SAAS,GAAGN,aAAaE,uBAAuBC,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAErF,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridHeader_unstable } from './useDataGridHeader';
import { renderDataGridHeader_unstable } from './renderDataGridHeader';
import { useDataGridHeaderStyles_unstable } from './useDataGridHeaderStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridHeader component
*/ export const DataGridHeader = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridHeader_unstable(props, ref);
useDataGridHeaderStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridHeaderStyles_unstable')(state);
return renderDataGridHeader_unstable(state);
});
DataGridHeader.displayName = 'DataGridHeader';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/DataGridHeader.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridHeader_unstable } from './useDataGridHeader';\nimport { renderDataGridHeader_unstable } from './renderDataGridHeader';\nimport { useDataGridHeaderStyles_unstable } from './useDataGridHeaderStyles.styles';\nimport type { DataGridHeaderProps } from './DataGridHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridHeader component\n */\nexport const DataGridHeader: ForwardRefComponent<DataGridHeaderProps> = React.forwardRef((props, ref) => {\n const state = useDataGridHeader_unstable(props, ref);\n\n useDataGridHeaderStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridHeaderStyles_unstable')(state);\n\n return renderDataGridHeader_unstable(state);\n});\n\nDataGridHeader.displayName = 'DataGridHeader';\n"],"names":["React","useDataGridHeader_unstable","renderDataGridHeader_unstable","useDataGridHeaderStyles_unstable","useCustomStyleHook_unstable","DataGridHeader","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAGpF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,8BAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering DataGridHeader
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/DataGridHeader.types.ts"],"sourcesContent":["import { TableHeaderProps, TableHeaderSlots, TableHeaderState } from '../TableHeader/TableHeader.types';\n\nexport type DataGridHeaderSlots = TableHeaderSlots;\n\n/**\n * DataGridHeader Props\n */\nexport type DataGridHeaderProps = TableHeaderProps;\n\n/**\n * State used in rendering DataGridHeader\n */\nexport type DataGridHeaderState = TableHeaderState;\n"],"names":[],"mappings":"AASA;;CAEC,GACD,WAAmD"}

View File

@@ -0,0 +1,4 @@
export { DataGridHeader } from './DataGridHeader';
export { renderDataGridHeader_unstable } from './renderDataGridHeader';
export { useDataGridHeader_unstable } from './useDataGridHeader';
export { dataGridHeaderClassNames, useDataGridHeaderStyles_unstable } from './useDataGridHeaderStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/index.ts"],"sourcesContent":["export { DataGridHeader } from './DataGridHeader';\nexport type { DataGridHeaderProps, DataGridHeaderSlots, DataGridHeaderState } from './DataGridHeader.types';\nexport { renderDataGridHeader_unstable } from './renderDataGridHeader';\nexport { useDataGridHeader_unstable } from './useDataGridHeader';\nexport { dataGridHeaderClassNames, useDataGridHeaderStyles_unstable } from './useDataGridHeaderStyles.styles';\n"],"names":["DataGridHeader","renderDataGridHeader_unstable","useDataGridHeader_unstable","dataGridHeaderClassNames","useDataGridHeaderStyles_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,mCAAmC"}

View File

@@ -0,0 +1,6 @@
import { renderTableHeader_unstable } from '../TableHeader/renderTableHeader';
/**
* Render the final JSX of DataGridHeader
*/ export const renderDataGridHeader_unstable = (state)=>{
return renderTableHeader_unstable(state);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/renderDataGridHeader.tsx"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport { renderTableHeader_unstable } from '../TableHeader/renderTableHeader';\nimport type { DataGridHeaderState } from './DataGridHeader.types';\n\n/**\n * Render the final JSX of DataGridHeader\n */\nexport const renderDataGridHeader_unstable = (state: DataGridHeaderState): JSXElement => {\n return renderTableHeader_unstable(state);\n};\n"],"names":["renderTableHeader_unstable","renderDataGridHeader_unstable","state"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,mCAAmC;AAG9E;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,OAAOF,2BAA2BE;AACpC,EAAE"}

View File

@@ -0,0 +1,17 @@
'use client';
import * as React from 'react';
import { useTableHeader_unstable } from '../TableHeader/useTableHeader';
/**
* Create the state required to render DataGridHeader.
*
* The returned state can be modified with hooks such as useDataGridHeaderStyles_unstable,
* before being passed to renderDataGridHeader_unstable.
*
* @param props - props from this instance of DataGridHeader
* @param ref - reference to root HTMLElement of DataGridHeader
*/ export const useDataGridHeader_unstable = (props, ref)=>{
return useTableHeader_unstable({
...props,
as: 'div'
}, ref);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/useDataGridHeader.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { DataGridHeaderProps, DataGridHeaderState } from './DataGridHeader.types';\nimport { useTableHeader_unstable } from '../TableHeader/useTableHeader';\n\n/**\n * Create the state required to render DataGridHeader.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderStyles_unstable,\n * before being passed to renderDataGridHeader_unstable.\n *\n * @param props - props from this instance of DataGridHeader\n * @param ref - reference to root HTMLElement of DataGridHeader\n */\nexport const useDataGridHeader_unstable = (\n props: DataGridHeaderProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderState => {\n return useTableHeader_unstable({ ...props, as: 'div' }, ref);\n};\n"],"names":["React","useTableHeader_unstable","useDataGridHeader_unstable","props","ref","as"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,gCAAgC;AAExE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,OAAOH,wBAAwB;QAAE,GAAGE,KAAK;QAAEE,IAAI;IAAM,GAAGD;AAC1D,EAAE"}

View File

@@ -0,0 +1,17 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableHeaderStyles_unstable } from '../TableHeader/useTableHeaderStyles.styles';
export const dataGridHeaderClassNames = {
root: 'fui-DataGridHeader'
};
/**
* Apply styling to the DataGridHeader slots based on the state
*/
export const useDataGridHeaderStyles_unstable = state => {
'use no memo';
useTableHeaderStyles_unstable(state);
state.root.className = mergeClasses(dataGridHeaderClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableHeaderStyles_unstable","dataGridHeaderClassNames","root","useDataGridHeaderStyles_unstable","state","className"],"sources":["useDataGridHeaderStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableHeaderStyles_unstable } from '../TableHeader/useTableHeaderStyles.styles';\nexport const dataGridHeaderClassNames = {\n root: 'fui-DataGridHeader'\n};\n/**\n * Apply styling to the DataGridHeader slots based on the state\n */ export const useDataGridHeaderStyles_unstable = (state)=>{\n 'use no memo';\n useTableHeaderStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderClassNames.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,6BAA6B,QAAQ,4CAA4C;AAC1F,OAAO,MAAMC,wBAAwB,GAAG;EACpCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,gCAAgC,GAAIC,KAAK,IAAG;EACzD,aAAa;;EACbJ,6BAA6B,CAACI,KAAK,CAAC;EACpCA,KAAK,CAACF,IAAI,CAACG,SAAS,GAAGN,YAAY,CAACE,wBAAwB,CAACC,IAAI,EAAEE,KAAK,CAACF,IAAI,CAACG,SAAS,CAAC;EACxF,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableHeaderStyles_unstable } from '../TableHeader/useTableHeaderStyles.styles';
export const dataGridHeaderClassNames = {
root: 'fui-DataGridHeader'
};
/**
* Apply styling to the DataGridHeader slots based on the state
*/ export const useDataGridHeaderStyles_unstable = (state)=>{
'use no memo';
useTableHeaderStyles_unstable(state);
state.root.className = mergeClasses(dataGridHeaderClassNames.root, state.root.className);
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeader/useDataGridHeaderStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridHeaderSlots, DataGridHeaderState } from './DataGridHeader.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableHeaderStyles_unstable } from '../TableHeader/useTableHeaderStyles.styles';\n\nexport const dataGridHeaderClassNames: SlotClassNames<DataGridHeaderSlots> = {\n root: 'fui-DataGridHeader',\n};\n\n/**\n * Apply styling to the DataGridHeader slots based on the state\n */\nexport const useDataGridHeaderStyles_unstable = (state: DataGridHeaderState): DataGridHeaderState => {\n 'use no memo';\n\n useTableHeaderStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderClassNames.root, state.root.className);\n\n return state;\n};\n"],"names":["mergeClasses","useTableHeaderStyles_unstable","dataGridHeaderClassNames","root","useDataGridHeaderStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,6BAA6B,QAAQ,6CAA6C;AAE3F,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C;IAEAJ,8BAA8BI;IAC9BA,MAAMF,IAAI,CAACG,SAAS,GAAGN,aAAaE,yBAAyBC,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IAEvF,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridHeaderCell_unstable } from './useDataGridHeaderCell';
import { renderDataGridHeaderCell_unstable } from './renderDataGridHeaderCell';
import { useDataGridHeaderCellStyles_unstable } from './useDataGridHeaderCellStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridHeaderCell component
*/ export const DataGridHeaderCell = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridHeaderCell_unstable(props, ref);
useDataGridHeaderCellStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridHeaderCellStyles_unstable')(state);
return renderDataGridHeaderCell_unstable(state);
});
DataGridHeaderCell.displayName = 'DataGridHeaderCell';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/DataGridHeaderCell.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridHeaderCell_unstable } from './useDataGridHeaderCell';\nimport { renderDataGridHeaderCell_unstable } from './renderDataGridHeaderCell';\nimport { useDataGridHeaderCellStyles_unstable } from './useDataGridHeaderCellStyles.styles';\nimport type { DataGridHeaderCellProps } from './DataGridHeaderCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridHeaderCell component\n */\nexport const DataGridHeaderCell: ForwardRefComponent<DataGridHeaderCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridHeaderCell_unstable(props, ref);\n\n useDataGridHeaderCellStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridHeaderCellStyles_unstable')(state);\n\n return renderDataGridHeaderCell_unstable(state);\n});\n\nDataGridHeaderCell.displayName = 'DataGridHeaderCell';\n"],"names":["React","useDataGridHeaderCell_unstable","renderDataGridHeaderCell_unstable","useDataGridHeaderCellStyles_unstable","useCustomStyleHook_unstable","DataGridHeaderCell","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,oCAAoC,QAAQ,uCAAuC;AAG5F,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,mCAAmEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvG,MAAMC,QAAQR,+BAA+BM,OAAOC;IAEpDL,qCAAqCM;IAErCL,4BAA4B,wCAAwCK;IAEpE,OAAOP,kCAAkCO;AAC3C,GAAG;AAEHJ,mBAAmBK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering DataGridHeaderCell
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/DataGridHeaderCell.types.ts"],"sourcesContent":["import {\n TableHeaderCellProps,\n TableHeaderCellSlots,\n TableHeaderCellState,\n} from '../TableHeaderCell/TableHeaderCell.types';\n\nimport { DataGridCellProps } from '../DataGridCell/DataGridCell.types';\n\nexport type DataGridHeaderCellSlots = TableHeaderCellSlots;\n\n/**\n * DataGridHeaderCell Props\n */\nexport type DataGridHeaderCellProps = Omit<TableHeaderCellProps, 'sortable'> & Pick<DataGridCellProps, 'focusMode'>;\n\n/**\n * State used in rendering DataGridHeaderCell\n */\nexport type DataGridHeaderCellState = TableHeaderCellState;\n"],"names":[],"mappings":"AAeA;;CAEC,GACD,WAA2D"}

View File

@@ -0,0 +1,4 @@
export { DataGridHeaderCell } from './DataGridHeaderCell';
export { renderDataGridHeaderCell_unstable } from './renderDataGridHeaderCell';
export { useDataGridHeaderCell_unstable } from './useDataGridHeaderCell';
export { dataGridHeaderCellClassNames, useDataGridHeaderCellStyles_unstable } from './useDataGridHeaderCellStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/index.ts"],"sourcesContent":["export { DataGridHeaderCell } from './DataGridHeaderCell';\nexport type {\n DataGridHeaderCellProps,\n DataGridHeaderCellSlots,\n DataGridHeaderCellState,\n} from './DataGridHeaderCell.types';\nexport { renderDataGridHeaderCell_unstable } from './renderDataGridHeaderCell';\nexport { useDataGridHeaderCell_unstable } from './useDataGridHeaderCell';\nexport {\n dataGridHeaderCellClassNames,\n useDataGridHeaderCellStyles_unstable,\n} from './useDataGridHeaderCellStyles.styles';\n"],"names":["DataGridHeaderCell","renderDataGridHeaderCell_unstable","useDataGridHeaderCell_unstable","dataGridHeaderCellClassNames","useDataGridHeaderCellStyles_unstable"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,uBAAuB;AAM1D,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SACEC,4BAA4B,EAC5BC,oCAAoC,QAC/B,uCAAuC"}

View File

@@ -0,0 +1,6 @@
import { renderTableHeaderCell_unstable } from '../TableHeaderCell/renderTableHeaderCell';
/**
* Render the final JSX of DataGridHeaderCell
*/ export const renderDataGridHeaderCell_unstable = (state)=>{
return renderTableHeaderCell_unstable(state);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/renderDataGridHeaderCell.tsx"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { renderTableHeaderCell_unstable } from '../TableHeaderCell/renderTableHeaderCell';\n\n/**\n * Render the final JSX of DataGridHeaderCell\n */\nexport const renderDataGridHeaderCell_unstable = (state: DataGridHeaderCellState): JSXElement => {\n return renderTableHeaderCell_unstable(state);\n};\n"],"names":["renderTableHeaderCell_unstable","renderDataGridHeaderCell_unstable","state"],"mappings":"AAEA,SAASA,8BAA8B,QAAQ,2CAA2C;AAE1F;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD,OAAOF,+BAA+BE;AACxC,EAAE"}

View File

@@ -0,0 +1,57 @@
'use client';
import * as React from 'react';
import { useFocusableGroup } from '@fluentui/react-tabster';
import { useEventCallback } from '@fluentui/react-utilities';
import { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { useColumnIdContext } from '../../contexts/columnIdContext';
import { useTableContext } from '../../contexts/tableContext';
import { isColumnSortable } from '../../utils/isColumnSortable';
/**
* Create the state required to render DataGridHeaderCell.
*
* The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,
* before being passed to renderDataGridHeaderCell_unstable.
*
* @param props - props from this instance of DataGridHeaderCell
* @param ref - reference to root HTMLElement of DataGridHeaderCell
*/ export const useDataGridHeaderCell_unstable = (props, ref)=>{
const columnId = useColumnIdContext();
const { sortable: gridSortable } = useTableContext();
const toggleColumnSort = useDataGridContext_unstable((ctx)=>ctx.sort.toggleColumnSort);
const sortable = useDataGridContext_unstable((ctx)=>{
const columnSortable = !!ctx.columns.find((c)=>c.columnId === columnId && isColumnSortable(c));
if (!gridSortable) {
// if the grid is not sortable - disable sorting on all columns
return false;
}
return columnSortable;
});
const sortDirection = useDataGridContext_unstable((ctx)=>sortable ? ctx.sort.getSortDirection(columnId) : undefined);
const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);
const getTableHeaderCellProps = useDataGridContext_unstable((ctx)=>{
return ctx.columnSizing_unstable.getTableHeaderCellProps;
});
const { focusMode = sortable ? 'none' : 'cell' } = props;
const focusableGroupAttr = useFocusableGroup({
tabBehavior: 'limited-trap-focus'
});
// eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement
const onClick = useEventCallback((e)=>{
var _props_onClick;
if (sortable) {
toggleColumnSort(e, columnId);
}
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
});
return useTableHeaderCell_unstable({
sortable,
sortDirection,
as: 'div',
tabIndex: focusMode !== 'none' ? 0 : undefined,
...focusMode === 'group' && focusableGroupAttr,
...resizableColumns ? getTableHeaderCellProps(columnId) : {},
...props,
onClick
}, ref);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFocusableGroup } from '@fluentui/react-tabster';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { isColumnSortable } from '../../utils/isColumnSortable';\n\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\n const sortable = useDataGridContext_unstable(ctx => {\n const columnSortable = !!ctx.columns.find(c => c.columnId === columnId && isColumnSortable(c));\n if (!gridSortable) {\n // if the grid is not sortable - disable sorting on all columns\n return false;\n }\n\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const getTableHeaderCellProps = useDataGridContext_unstable(ctx => {\n return ctx.columnSizing_unstable.getTableHeaderCellProps;\n });\n\n const { focusMode = sortable ? 'none' : 'cell' } = props;\n const focusableGroupAttr = useFocusableGroup({ tabBehavior: 'limited-trap-focus' });\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- prefer HTMLTableCellElement\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableHeaderCellElement>) => {\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n props.onClick?.(e);\n });\n\n return useTableHeaderCell_unstable(\n {\n sortable,\n sortDirection,\n as: 'div',\n tabIndex: focusMode !== 'none' ? 0 : undefined,\n ...(focusMode === 'group' && focusableGroupAttr),\n ...(resizableColumns ? getTableHeaderCellProps(columnId) : {}),\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useFocusableGroup","useEventCallback","useTableHeaderCell_unstable","useDataGridContext_unstable","useColumnIdContext","useTableContext","isColumnSortable","useDataGridHeaderCell_unstable","props","ref","columnId","sortable","gridSortable","toggleColumnSort","ctx","sort","columnSortable","columns","find","c","sortDirection","getSortDirection","undefined","resizableColumns","getTableHeaderCellProps","columnSizing_unstable","focusMode","focusableGroupAttr","tabBehavior","onClick","e","as","tabIndex"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,gBAAgB,QAAQ,+BAA+B;AAEhE;;;;;;;;CAQC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,WAAWN;IACjB,MAAM,EAAEO,UAAUC,YAAY,EAAE,GAAGP;IACnC,MAAMQ,mBAAmBV,4BAA4BW,CAAAA,MAAOA,IAAIC,IAAI,CAACF,gBAAgB;IAErF,MAAMF,WAAWR,4BAA4BW,CAAAA;QAC3C,MAAME,iBAAiB,CAAC,CAACF,IAAIG,OAAO,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAET,QAAQ,KAAKA,YAAYJ,iBAAiBa;QAC3F,IAAI,CAACP,cAAc;YACjB,+DAA+D;YAC/D,OAAO;QACT;QAEA,OAAOI;IACT;IAEA,MAAMI,gBAAgBjB,4BAA4BW,CAAAA,MAChDH,WAAWG,IAAIC,IAAI,CAACM,gBAAgB,CAACX,YAAYY;IAEnD,MAAMC,mBAAmBpB,4BAA4BW,CAAAA,MAAOA,IAAIS,gBAAgB;IAChF,MAAMC,0BAA0BrB,4BAA4BW,CAAAA;QAC1D,OAAOA,IAAIW,qBAAqB,CAACD,uBAAuB;IAC1D;IAEA,MAAM,EAAEE,YAAYf,WAAW,SAAS,MAAM,EAAE,GAAGH;IACnD,MAAMmB,qBAAqB3B,kBAAkB;QAAE4B,aAAa;IAAqB;IAEjF,2FAA2F;IAC3F,MAAMC,UAAU5B,iBAAiB,CAAC6B;YAIhCtB;QAHA,IAAIG,UAAU;YACZE,iBAAiBiB,GAAGpB;QACtB;SACAF,iBAAAA,MAAMqB,OAAO,cAAbrB,qCAAAA,oBAAAA,OAAgBsB;IAClB;IAEA,OAAO5B,4BACL;QACES;QACAS;QACAW,IAAI;QACJC,UAAUN,cAAc,SAAS,IAAIJ;QACrC,GAAII,cAAc,WAAWC,kBAAkB;QAC/C,GAAIJ,mBAAmBC,wBAAwBd,YAAY,CAAC,CAAC;QAC7D,GAAGF,KAAK;QACRqB;IACF,GACApB;AAEJ,EAAE"}

View File

@@ -0,0 +1,29 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles.styles';
export const dataGridHeaderCellClassNames = {
root: 'fui-DataGridHeaderCell',
button: 'fui-DataGridHeaderCell__button',
sortIcon: 'fui-DataGridHeaderCell__sortIcon',
aside: 'fui-DataGridHeaderCell__aside'
};
/**
* Apply styling to the DataGridHeaderCell slots based on the state
*/
export const useDataGridHeaderCellStyles_unstable = state => {
'use no memo';
useTableHeaderCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);
if (state.button) {
state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);
}
if (state.sortIcon) {
state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);
}
if (state.aside) {
state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableHeaderCellStyles_unstable","dataGridHeaderCellClassNames","root","button","sortIcon","aside","useDataGridHeaderCellStyles_unstable","state","className"],"sources":["useDataGridHeaderCellStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles.styles';\nexport const dataGridHeaderCellClassNames = {\n root: 'fui-DataGridHeaderCell',\n button: 'fui-DataGridHeaderCell__button',\n sortIcon: 'fui-DataGridHeaderCell__sortIcon',\n aside: 'fui-DataGridHeaderCell__aside'\n};\n/**\n * Apply styling to the DataGridHeaderCell slots based on the state\n */ export const useDataGridHeaderCellStyles_unstable = (state)=>{\n 'use no memo';\n useTableHeaderCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);\n if (state.button) {\n state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);\n }\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);\n }\n if (state.aside) {\n state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,iCAAiC,QAAQ,oDAAoD;AACtG,OAAO,MAAMC,4BAA4B,GAAG;EACxCC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE,gCAAgC;EACxCC,QAAQ,EAAE,kCAAkC;EAC5CC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,oCAAoC,GAAIC,KAAK,IAAG;EAC7D,aAAa;;EACbP,iCAAiC,CAACO,KAAK,CAAC;EACxCA,KAAK,CAACL,IAAI,CAACM,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACC,IAAI,EAAEK,KAAK,CAACL,IAAI,CAACM,SAAS,CAAC;EAC5F,IAAID,KAAK,CAACJ,MAAM,EAAE;IACdI,KAAK,CAACJ,MAAM,CAACK,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACE,MAAM,EAAEI,KAAK,CAACJ,MAAM,CAACK,SAAS,CAAC;EACtG;EACA,IAAID,KAAK,CAACH,QAAQ,EAAE;IAChBG,KAAK,CAACH,QAAQ,CAACI,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACG,QAAQ,EAAEG,KAAK,CAACH,QAAQ,CAACI,SAAS,CAAC;EAC5G;EACA,IAAID,KAAK,CAACF,KAAK,EAAE;IACbE,KAAK,CAACF,KAAK,CAACG,SAAS,GAAGT,YAAY,CAACE,4BAA4B,CAACI,KAAK,EAAEE,KAAK,CAACF,KAAK,CAACG,SAAS,CAAC;EACnG;EACA,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,26 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles.styles';
export const dataGridHeaderCellClassNames = {
root: 'fui-DataGridHeaderCell',
button: 'fui-DataGridHeaderCell__button',
sortIcon: 'fui-DataGridHeaderCell__sortIcon',
aside: 'fui-DataGridHeaderCell__aside'
};
/**
* Apply styling to the DataGridHeaderCell slots based on the state
*/ export const useDataGridHeaderCellStyles_unstable = (state)=>{
'use no memo';
useTableHeaderCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);
if (state.button) {
state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);
}
if (state.sortIcon) {
state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);
}
if (state.aside) {
state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridHeaderCell/useDataGridHeaderCellStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridHeaderCellSlots, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles.styles';\n\nexport const dataGridHeaderCellClassNames: SlotClassNames<DataGridHeaderCellSlots> = {\n root: 'fui-DataGridHeaderCell',\n button: 'fui-DataGridHeaderCell__button',\n sortIcon: 'fui-DataGridHeaderCell__sortIcon',\n aside: 'fui-DataGridHeaderCell__aside',\n};\n\n/**\n * Apply styling to the DataGridHeaderCell slots based on the state\n */\nexport const useDataGridHeaderCellStyles_unstable = (state: DataGridHeaderCellState): DataGridHeaderCellState => {\n 'use no memo';\n\n useTableHeaderCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);\n\n if (state.button) {\n state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);\n }\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);\n }\n\n if (state.aside) {\n state.aside.className = mergeClasses(dataGridHeaderCellClassNames.aside, state.aside.className);\n }\n\n return state;\n};\n"],"names":["mergeClasses","useTableHeaderCellStyles_unstable","dataGridHeaderCellClassNames","root","button","sortIcon","aside","useDataGridHeaderCellStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,iCAAiC,QAAQ,qDAAqD;AAEvG,OAAO,MAAMC,+BAAwE;IACnFC,MAAM;IACNC,QAAQ;IACRC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,uCAAuC,CAACC;IACnD;IAEAP,kCAAkCO;IAClCA,MAAML,IAAI,CAACM,SAAS,GAAGT,aAAaE,6BAA6BC,IAAI,EAAEK,MAAML,IAAI,CAACM,SAAS;IAE3F,IAAID,MAAMJ,MAAM,EAAE;QAChBI,MAAMJ,MAAM,CAACK,SAAS,GAAGT,aAAaE,6BAA6BE,MAAM,EAAEI,MAAMJ,MAAM,CAACK,SAAS;IACnG;IAEA,IAAID,MAAMH,QAAQ,EAAE;QAClBG,MAAMH,QAAQ,CAACI,SAAS,GAAGT,aAAaE,6BAA6BG,QAAQ,EAAEG,MAAMH,QAAQ,CAACI,SAAS;IACzG;IAEA,IAAID,MAAMF,KAAK,EAAE;QACfE,MAAMF,KAAK,CAACG,SAAS,GAAGT,aAAaE,6BAA6BI,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IAChG;IAEA,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridRow_unstable } from './useDataGridRow';
import { renderDataGridRow_unstable } from './renderDataGridRow';
import { useDataGridRowStyles_unstable } from './useDataGridRowStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridRow component
*/ export const DataGridRow = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridRow_unstable(props, ref);
useDataGridRowStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridRowStyles_unstable')(state);
return renderDataGridRow_unstable(state);
});
DataGridRow.displayName = 'DataGridRow';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridRow/DataGridRow.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridRow_unstable } from './useDataGridRow';\nimport { renderDataGridRow_unstable } from './renderDataGridRow';\nimport { useDataGridRowStyles_unstable } from './useDataGridRowStyles.styles';\nimport type { DataGridRowProps } from './DataGridRow.types';\nimport type { ForwardRefComponent, JSXElement } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridRow component\n */\nexport const DataGridRow: ForwardRefComponent<DataGridRowProps> &\n (<TItem>(props: DataGridRowProps<TItem>) => JSXElement) = React.forwardRef<HTMLElement, DataGridRowProps>(\n (props, ref) => {\n const state = useDataGridRow_unstable(props, ref);\n\n useDataGridRowStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridRowStyles_unstable')(state);\n\n return renderDataGridRow_unstable(state);\n },\n) as ForwardRefComponent<DataGridRowProps> & (<TItem>(props: DataGridRowProps<TItem>) => JSXElement);\n\nDataGridRow.displayName = 'DataGridRow';\n"],"names":["React","useDataGridRow_unstable","renderDataGridRow_unstable","useDataGridRowStyles_unstable","useCustomStyleHook_unstable","DataGridRow","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,gCAAgC;AAG9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAC+CL,MAAMM,UAAU,CAC1E,CAACC,OAAOC;IACN,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAE9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GACmG;AAErGJ,YAAYK,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridRow/DataGridRow.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { TableColumnDefinition } from '../../hooks';\nimport { DataGridContextValue } from '../DataGrid/DataGrid.types';\nimport type { TableRowProps, TableRowSlots, TableRowState } from '../TableRow/TableRow.types';\nimport type { TableSelectionCell } from '../TableSelectionCell/TableSelectionCell';\n\nexport type DataGridRowSlots = TableRowSlots & {\n /**\n * When selection is enabled on the @see DataGrid, all rows\n * will render the selection cell.\n */\n selectionCell?: Slot<typeof TableSelectionCell>;\n};\n\nexport type CellRenderFunction<TItem = unknown> = (\n column: TableColumnDefinition<TItem>,\n dataGridContextValue: DataGridContextValue,\n) => React.ReactNode;\n\n/**\n * DataGridRow Props\n */\nexport type DataGridRowProps<TItem = unknown> = Omit<TableRowProps, 'children'> &\n Omit<ComponentProps<DataGridRowSlots>, 'children'> & {\n children: CellRenderFunction<TItem>;\n };\n\n/**\n * State used in rendering DataGridRow\n */\nexport type DataGridRowState = TableRowState &\n ComponentState<DataGridRowSlots> & {\n renderCell: CellRenderFunction;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columnDefs: TableColumnDefinition<any>[];\n dataGridContextValue: DataGridContextValue;\n };\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,4 @@
export { DataGridRow } from './DataGridRow';
export { renderDataGridRow_unstable } from './renderDataGridRow';
export { useDataGridRow_unstable } from './useDataGridRow';
export { dataGridRowClassNames, useDataGridRowStyles_unstable } from './useDataGridRowStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridRow/index.ts"],"sourcesContent":["export { DataGridRow } from './DataGridRow';\nexport type { CellRenderFunction, DataGridRowProps, DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nexport { renderDataGridRow_unstable } from './renderDataGridRow';\nexport { useDataGridRow_unstable } from './useDataGridRow';\nexport { dataGridRowClassNames, useDataGridRowStyles_unstable } from './useDataGridRowStyles.styles';\n"],"names":["DataGridRow","renderDataGridRow_unstable","useDataGridRow_unstable","dataGridRowClassNames","useDataGridRowStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,gCAAgC"}

View File

@@ -0,0 +1,17 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { ColumnIdContextProvider } from '../../contexts/columnIdContext';
/**
* Render the final JSX of DataGridRow
*/ export const renderDataGridRow_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.selectionCell && /*#__PURE__*/ _jsx(state.selectionCell, {}),
state.columnDefs.map((columnDef)=>/*#__PURE__*/ _jsx(ColumnIdContextProvider, {
value: columnDef.columnId,
children: state.renderCell(columnDef, state.dataGridContextValue)
}, columnDef.columnId))
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridRow/renderDataGridRow.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridRowState, DataGridRowSlots } from './DataGridRow.types';\nimport { ColumnIdContextProvider } from '../../contexts/columnIdContext';\n\n/**\n * Render the final JSX of DataGridRow\n */\nexport const renderDataGridRow_unstable = (state: DataGridRowState): JSXElement => {\n assertSlots<DataGridRowSlots>(state);\n\n return (\n <state.root>\n {state.selectionCell && <state.selectionCell />}\n {state.columnDefs.map(columnDef => (\n <ColumnIdContextProvider value={columnDef.columnId} key={columnDef.columnId}>\n {state.renderCell(columnDef, state.dataGridContextValue)}\n </ColumnIdContextProvider>\n ))}\n </state.root>\n );\n};\n"],"names":["assertSlots","ColumnIdContextProvider","renderDataGridRow_unstable","state","root","selectionCell","columnDefs","map","columnDef","value","columnId","renderCell","dataGridContextValue"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,uBAAuB,QAAQ,iCAAiC;AAEzE;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCH,YAA8BG;IAE9B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;YAC3CF,MAAMG,UAAU,CAACC,GAAG,CAACC,CAAAA,0BACpB,KAACP;oBAAwBQ,OAAOD,UAAUE,QAAQ;8BAC/CP,MAAMQ,UAAU,CAACH,WAAWL,MAAMS,oBAAoB;mBADAJ,UAAUE,QAAQ;;;AAMnF,EAAE"}

View File

@@ -0,0 +1,93 @@
'use client';
import * as React from 'react';
import { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';
import { Space } from '@fluentui/keyboard-keys';
import { useTableRow_unstable } from '../TableRow/useTableRow';
import { dataGridContextDefaultValue, useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';
import { useTableRowIdContext } from '../../contexts/rowIdContext';
import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
/**
* Create the state required to render DataGridRow.
*
* The returned state can be modified with hooks such as useDataGridRowStyles_unstable,
* before being passed to renderDataGridRow_unstable.
*
* @param props - props from this instance of DataGridRow
* @param ref - reference to root HTMLElement of DataGridRow
*/ export const useDataGridRow_unstable = (props, ref)=>{
const rowId = useTableRowIdContext();
const isHeader = useIsInTableHeader();
const columnDefs = useDataGridContext_unstable((ctx)=>ctx.columns);
const selectable = useDataGridContext_unstable((ctx)=>ctx.selectableRows);
const selected = useDataGridContext_unstable((ctx)=>ctx.selection.isRowSelected(rowId));
const focusMode = useDataGridContext_unstable((ctx)=>ctx.focusMode);
const compositeRowTabsterAttribute = useDataGridContext_unstable((ctx)=>ctx.compositeRowTabsterAttribute);
const tabbable = focusMode === 'row_unstable' || focusMode === 'composite';
const appearance = useDataGridContext_unstable((ctx)=>{
if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {
return ctx.selectionAppearance;
}
return 'none';
});
const toggleRow = useDataGridContext_unstable((ctx)=>ctx.selection.toggleRow);
const onClick = useEventCallback((e)=>{
var _props_onClick;
if (selectable && !isHeader) {
toggleRow(e, rowId);
}
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
});
const onKeyDown = useEventCallback((e)=>{
var _props_onKeyDown;
if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target)) {
// stop scrolling
e.preventDefault();
toggleRow(e, rowId);
}
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);
});
const baseState = useTableRow_unstable({
appearance,
'aria-selected': selectable ? selected : undefined,
tabIndex: tabbable && !isHeader ? 0 : undefined,
...focusMode === 'composite' && !isHeader && compositeRowTabsterAttribute,
...props,
onClick,
onKeyDown,
children: null,
as: 'div'
}, ref);
return {
...baseState,
components: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
...baseState.components,
selectionCell: DataGridSelectionCell
},
selectionCell: slot.optional(props.selectionCell, {
renderByDefault: selectable,
elementType: DataGridSelectionCell
}),
renderCell: props.children,
columnDefs,
// This context value should not be used internally
// It's intended to help power user render functions
dataGridContextValue: useStableDataGridContextValue()
};
};
function useStableDataGridContextValue() {
const ref = React.useRef(dataGridContextDefaultValue);
// Heads up!
// We will not re-render when the context value changes, but we will have the latest value of the context when we do
// render for other reasons.
//
// This relies on a context selector that always returns the same value:
// - we will not re-render when the context value changes
// - we will store the context value in a ref
useDataGridContext_unstable((ctx)=>{
ref.current = ctx;
return null;
});
return ref.current;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
'use client';
import { __styles, mergeClasses } from '@griffel/react';
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
import { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';
export const dataGridRowClassNames = {
root: 'fui-DataGridRow',
selectionCell: 'fui-DataGridRow__selectionCell'
};
const useStyles = /*#__PURE__*/__styles({
subtleSelection: {
Bconypa: "f1jazu75",
ff6mpl: "fw60kww"
}
}, {
d: [".f1jazu75[data-fui-focus-within]:focus-within .fui-TableSelectionCell{opacity:1;}"],
h: [".fw60kww:hover .fui-TableSelectionCell{opacity:1;}"]
});
/**
* Apply styling to the DataGridRow slots based on the state
*/
export const useDataGridRowStyles_unstable = state => {
'use no memo';
const isSubtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);
const styles = useStyles();
useTableRowStyles_unstable(state);
state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection);
if (state.selectionCell) {
state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","createCustomFocusIndicatorStyle","useTableRowStyles_unstable","useDataGridContext_unstable","tableSelectionCellClassNames","dataGridRowClassNames","root","selectionCell","useStyles","subtleSelection","Bconypa","ff6mpl","d","h","useDataGridRowStyles_unstable","state","isSubtle","ctx","styles","className"],"sources":["useDataGridRowStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nexport const dataGridRowClassNames = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell'\n};\nconst useStyles = makeStyles({\n subtleSelection: {\n ...createCustomFocusIndicatorStyle({\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }, {\n selector: 'focus-within'\n }),\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1\n }\n }\n }\n});\n/**\n * Apply styling to the DataGridRow slots based on the state\n */ export const useDataGridRowStyles_unstable = (state)=>{\n 'use no memo';\n const isSubtle = useDataGridContext_unstable((ctx)=>ctx.subtleSelection);\n const styles = useStyles();\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,0BAA0B,QAAQ,sCAAsC;AACjF,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,4BAA4B,QAAQ,0DAA0D;AACvG,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,SAAS,gBAAGT,QAAA;EAAAU,eAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,CAejB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,aAAa;;EACb,MAAMC,QAAQ,GAAGb,2BAA2B,CAAEc,GAAG,IAAGA,GAAG,CAACR,eAAe,CAAC;EACxE,MAAMS,MAAM,GAAGV,SAAS,CAAC,CAAC;EAC1BN,0BAA0B,CAACa,KAAK,CAAC;EACjCA,KAAK,CAACT,IAAI,CAACa,SAAS,GAAGnB,YAAY,CAACK,qBAAqB,CAACC,IAAI,EAAES,KAAK,CAACT,IAAI,CAACa,SAAS,EAAEH,QAAQ,IAAIE,MAAM,CAACT,eAAe,CAAC;EACzH,IAAIM,KAAK,CAACR,aAAa,EAAE;IACrBQ,KAAK,CAACR,aAAa,CAACY,SAAS,GAAGnB,YAAY,CAACK,qBAAqB,CAACE,aAAa,EAAEQ,KAAK,CAACR,aAAa,CAACY,SAAS,CAAC;EACpH;EACA,OAAOJ,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,39 @@
'use client';
import { makeStyles, mergeClasses } from '@griffel/react';
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
import { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';
export const dataGridRowClassNames = {
root: 'fui-DataGridRow',
selectionCell: 'fui-DataGridRow__selectionCell'
};
const useStyles = makeStyles({
subtleSelection: {
...createCustomFocusIndicatorStyle({
[`& .${tableSelectionCellClassNames.root}`]: {
opacity: 1
}
}, {
selector: 'focus-within'
}),
':hover': {
[`& .${tableSelectionCellClassNames.root}`]: {
opacity: 1
}
}
}
});
/**
* Apply styling to the DataGridRow slots based on the state
*/ export const useDataGridRowStyles_unstable = (state)=>{
'use no memo';
const isSubtle = useDataGridContext_unstable((ctx)=>ctx.subtleSelection);
const styles = useStyles();
useTableRowStyles_unstable(state);
state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className, isSubtle && styles.subtleSelection);
if (state.selectionCell) {
state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridRow/useDataGridRowStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles.styles';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell',\n};\n\nconst useStyles = makeStyles({\n subtleSelection: {\n ...createCustomFocusIndicatorStyle(\n {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n { selector: 'focus-within' },\n ),\n\n ':hover': {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n },\n});\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n 'use no memo';\n\n const isSubtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const styles = useStyles();\n\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(\n dataGridRowClassNames.root,\n state.root.className,\n isSubtle && styles.subtleSelection,\n );\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","createCustomFocusIndicatorStyle","useTableRowStyles_unstable","useDataGridContext_unstable","tableSelectionCellClassNames","dataGridRowClassNames","root","selectionCell","useStyles","subtleSelection","opacity","selector","useDataGridRowStyles_unstable","state","isSubtle","ctx","styles","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,+BAA+B,QAAQ,0BAA0B;AAG1E,SAASC,0BAA0B,QAAQ,uCAAuC;AAClF,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,4BAA4B,QAAQ,2DAA2D;AAExG,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,eAAe;AACjB,EAAE;AAEF,MAAMC,YAAYT,WAAW;IAC3BU,iBAAiB;QACf,GAAGR,gCACD;YACE,CAAC,CAAC,GAAG,EAAEG,6BAA6BE,IAAI,EAAE,CAAC,EAAE;gBAC3CI,SAAS;YACX;QACF,GACA;YAAEC,UAAU;QAAe,EAC5B;QAED,UAAU;YACR,CAAC,CAAC,GAAG,EAAEP,6BAA6BE,IAAI,EAAE,CAAC,EAAE;gBAC3CI,SAAS;YACX;QACF;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,gCAAgC,CAACC;IAC5C;IAEA,MAAMC,WAAWX,4BAA4BY,CAAAA,MAAOA,IAAIN,eAAe;IACvE,MAAMO,SAASR;IAEfN,2BAA2BW;IAC3BA,MAAMP,IAAI,CAACW,SAAS,GAAGjB,aACrBK,sBAAsBC,IAAI,EAC1BO,MAAMP,IAAI,CAACW,SAAS,EACpBH,YAAYE,OAAOP,eAAe;IAEpC,IAAII,MAAMN,aAAa,EAAE;QACvBM,MAAMN,aAAa,CAACU,SAAS,GAAGjB,aAAaK,sBAAsBE,aAAa,EAAEM,MAAMN,aAAa,CAACU,SAAS;IACjH;IAEA,OAAOJ;AACT,EAAE"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';
import { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';
import { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* DataGridSelectionCell component
*/ export const DataGridSelectionCell = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useDataGridSelectionCell_unstable(props, ref);
useDataGridSelectionCellStyles_unstable(state);
useCustomStyleHook_unstable('useDataGridSelectionCellStyles_unstable')(state);
return renderDataGridSelectionCell_unstable(state);
});
DataGridSelectionCell.displayName = 'DataGridSelectionCell';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/DataGridSelectionCell.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';\nimport { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';\nimport { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles.styles';\nimport type { DataGridSelectionCellProps } from './DataGridSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGridSelectionCell component\n */\nexport const DataGridSelectionCell: ForwardRefComponent<DataGridSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridSelectionCell_unstable(props, ref);\n\n useDataGridSelectionCellStyles_unstable(state);\n\n useCustomStyleHook_unstable('useDataGridSelectionCellStyles_unstable')(state);\n\n return renderDataGridSelectionCell_unstable(state);\n});\n\nDataGridSelectionCell.displayName = 'DataGridSelectionCell';\n"],"names":["React","useDataGridSelectionCell_unstable","renderDataGridSelectionCell_unstable","useDataGridSelectionCellStyles_unstable","useCustomStyleHook_unstable","DataGridSelectionCell","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,uCAAuC,QAAQ,0CAA0C;AAGlG,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sCAAyEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7G,MAAMC,QAAQR,kCAAkCM,OAAOC;IAEvDL,wCAAwCM;IAExCL,4BAA4B,2CAA2CK;IAEvE,OAAOP,qCAAqCO;AAC9C,GAAG;AAEHJ,sBAAsBK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering DataGridSelectionCell
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/DataGridSelectionCell.types.ts"],"sourcesContent":["import {\n TableSelectionCellProps,\n TableSelectionCellSlots,\n TableSelectionCellState,\n} from '../TableSelectionCell/TableSelectionCell.types';\n\nexport type DataGridSelectionCellSlots = TableSelectionCellSlots;\n\n/**\n * DataGridSelectionCell Props\n */\nexport type DataGridSelectionCellProps = TableSelectionCellProps;\n\n/**\n * State used in rendering DataGridSelectionCell\n */\nexport type DataGridSelectionCellState = TableSelectionCellState;\n"],"names":[],"mappings":"AAaA;;CAEC,GACD,WAAiE"}

View File

@@ -0,0 +1,4 @@
export { DataGridSelectionCell } from './DataGridSelectionCell';
export { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';
export { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';
export { dataGridSelectionCellClassNames, useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/index.ts"],"sourcesContent":["export { DataGridSelectionCell } from './DataGridSelectionCell';\nexport type {\n DataGridSelectionCellProps,\n DataGridSelectionCellSlots,\n DataGridSelectionCellState,\n} from './DataGridSelectionCell.types';\nexport { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';\nexport { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';\nexport {\n dataGridSelectionCellClassNames,\n useDataGridSelectionCellStyles_unstable,\n} from './useDataGridSelectionCellStyles.styles';\n"],"names":["DataGridSelectionCell","renderDataGridSelectionCell_unstable","useDataGridSelectionCell_unstable","dataGridSelectionCellClassNames","useDataGridSelectionCellStyles_unstable"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,0BAA0B;AAMhE,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SACEC,+BAA+B,EAC/BC,uCAAuC,QAClC,0CAA0C"}

View File

@@ -0,0 +1,6 @@
import { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderTableSelectionCell';
/**
* Render the final JSX of DataGridSelectionCell
*/ export const renderDataGridSelectionCell_unstable = (state)=>{
return renderTableSelectionCell_unstable(state);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/renderDataGridSelectionCell.tsx"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport type { DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderTableSelectionCell';\n\n/**\n * Render the final JSX of DataGridSelectionCell\n */\nexport const renderDataGridSelectionCell_unstable = (state: DataGridSelectionCellState): JSXElement => {\n return renderTableSelectionCell_unstable(state);\n};\n"],"names":["renderTableSelectionCell_unstable","renderDataGridSelectionCell_unstable","state"],"mappings":"AAEA,SAASA,iCAAiC,QAAQ,iDAAiD;AAEnG;;CAEC,GACD,OAAO,MAAMC,uCAAuC,CAACC;IACnD,OAAOF,kCAAkCE;AAC3C,EAAE"}

View File

@@ -0,0 +1,47 @@
'use client';
import * as React from 'react';
import { useEventCallback } from '@fluentui/react-utilities';
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
import { useTableRowIdContext } from '../../contexts/rowIdContext';
import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
import { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';
/**
* Create the state required to render DataGridSelectionCell.
*
* The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,
* before being passed to renderDataGridSelectionCell_unstable.
*
* @param props - props from this instance of DataGridSelectionCell
* @param ref - reference to root HTMLElement of DataGridSelectionCell
*/ export const useDataGridSelectionCell_unstable = (props, ref)=>{
const isHeader = useIsInTableHeader();
const rowId = useTableRowIdContext();
const subtle = useDataGridContext_unstable((ctx)=>ctx.subtleSelection);
const checked = useDataGridContext_unstable((ctx)=>{
if (isHeader && ctx.selection.selectionMode === 'multiselect') {
return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;
}
return ctx.selection.isRowSelected(rowId);
});
const toggleAllRows = useDataGridContext_unstable((ctx)=>ctx.selection.toggleAllRows);
const type = useDataGridContext_unstable((ctx)=>ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio');
const onClick = useEventCallback((e)=>{
var _props_onClick;
if (isHeader) {
toggleAllRows(e);
}
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
});
return useTableSelectionCell_unstable({
as: 'div',
role: 'gridcell',
checked,
type,
invisible: isHeader && type === 'radio',
'aria-selected': checked === 'mixed' ? undefined : checked,
subtle,
radioIndicator: isHeader ? null : undefined,
...props,
onClick
}, ref);
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n invisible: isHeader && type === 'radio',\n 'aria-selected': checked === 'mixed' ? undefined : checked,\n subtle,\n radioIndicator: isHeader ? null : undefined,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useDataGridContext_unstable","useTableRowIdContext","useIsInTableHeader","useTableSelectionCell_unstable","useDataGridSelectionCell_unstable","props","ref","isHeader","rowId","subtle","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","e","as","role","invisible","undefined","radioIndicator"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,8BAA8B,QAAQ,8CAA8C;AAG7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC,OACAC;IAEA,MAAMC,WAAWL;IACjB,MAAMM,QAAQP;IACd,MAAMQ,SAAST,4BAA4BU,CAAAA,MAAOA,IAAIC,eAAe;IACrE,MAAMC,UAAUZ,4BAA4BU,CAAAA;QAC1C,IAAIH,YAAYG,IAAIG,SAAS,CAACC,aAAa,KAAK,eAAe;YAC7D,OAAOJ,IAAIG,SAAS,CAACE,eAAe,GAAG,OAAOL,IAAIG,SAAS,CAACG,gBAAgB,GAAG,UAAU;QAC3F;QAEA,OAAON,IAAIG,SAAS,CAACI,aAAa,CAACT;IACrC;IAEA,MAAMU,gBAAgBlB,4BAA4BU,CAAAA,MAAOA,IAAIG,SAAS,CAACK,aAAa;IACpF,MAAMC,OAAOnB,4BAA4BU,CAAAA,MACvCA,IAAIG,SAAS,CAACC,aAAa,KAAK,gBAAgB,aAAa;IAG/D,MAAMM,UAAUrB,iBAAiB,CAACsB;YAKhChB;QAJA,IAAIE,UAAU;YACZW,cAAcG;QAChB;SAEAhB,iBAAAA,MAAMe,OAAO,cAAbf,qCAAAA,oBAAAA,OAAgBgB;IAClB;IAEA,OAAOlB,+BACL;QACEmB,IAAI;QACJC,MAAM;QACNX;QACAO;QACAK,WAAWjB,YAAYY,SAAS;QAChC,iBAAiBP,YAAY,UAAUa,YAAYb;QACnDH;QACAiB,gBAAgBnB,WAAW,OAAOkB;QAClC,GAAGpB,KAAK;QACRe;IACF,GACAd;AAEJ,EAAE"}

View File

@@ -0,0 +1,25 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles.styles';
export const dataGridSelectionCellClassNames = {
root: 'fui-DataGridSelectionCell',
checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',
radioIndicator: 'fui-DataGridSelectionCell__radioIndicator'
};
/**
* Apply styling to the DataGridSelectionCell slots based on the state
*/
export const useDataGridSelectionCellStyles_unstable = state => {
'use no memo';
useTableSelectionCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);
if (state.checkboxIndicator) {
state.checkboxIndicator.className = mergeClasses(dataGridSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
}
if (state.radioIndicator) {
state.radioIndicator.className = mergeClasses(dataGridSelectionCellClassNames.radioIndicator, state.radioIndicator.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["mergeClasses","useTableSelectionCellStyles_unstable","dataGridSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useDataGridSelectionCellStyles_unstable","state","className"],"sources":["useDataGridSelectionCellStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\nexport const dataGridSelectionCellClassNames = {\n root: 'fui-DataGridSelectionCell',\n checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-DataGridSelectionCell__radioIndicator'\n};\n/**\n * Apply styling to the DataGridSelectionCell slots based on the state\n */ export const useDataGridSelectionCellStyles_unstable = (state)=>{\n 'use no memo';\n useTableSelectionCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(dataGridSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);\n }\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(dataGridSelectionCellClassNames.radioIndicator, state.radioIndicator.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,oCAAoC,QAAQ,0DAA0D;AAC/G,OAAO,MAAMC,+BAA+B,GAAG;EAC3CC,IAAI,EAAE,2BAA2B;EACjCC,iBAAiB,EAAE,8CAA8C;EACjEC,cAAc,EAAE;AACpB,CAAC;AACD;AACA;AACA;AAAI,OAAO,MAAMC,uCAAuC,GAAIC,KAAK,IAAG;EAChE,aAAa;;EACbN,oCAAoC,CAACM,KAAK,CAAC;EAC3CA,KAAK,CAACJ,IAAI,CAACK,SAAS,GAAGR,YAAY,CAACE,+BAA+B,CAACC,IAAI,EAAEI,KAAK,CAACJ,IAAI,CAACK,SAAS,CAAC;EAC/F,IAAID,KAAK,CAACH,iBAAiB,EAAE;IACzBG,KAAK,CAACH,iBAAiB,CAACI,SAAS,GAAGR,YAAY,CAACE,+BAA+B,CAACE,iBAAiB,EAAEG,KAAK,CAACH,iBAAiB,CAACI,SAAS,CAAC;EAC1I;EACA,IAAID,KAAK,CAACF,cAAc,EAAE;IACtBE,KAAK,CAACF,cAAc,CAACG,SAAS,GAAGR,YAAY,CAACE,+BAA+B,CAACG,cAAc,EAAEE,KAAK,CAACF,cAAc,CAACG,SAAS,CAAC;EACjI;EACA,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,22 @@
'use client';
import { mergeClasses } from '@griffel/react';
import { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles.styles';
export const dataGridSelectionCellClassNames = {
root: 'fui-DataGridSelectionCell',
checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',
radioIndicator: 'fui-DataGridSelectionCell__radioIndicator'
};
/**
* Apply styling to the DataGridSelectionCell slots based on the state
*/ export const useDataGridSelectionCellStyles_unstable = (state)=>{
'use no memo';
useTableSelectionCellStyles_unstable(state);
state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);
if (state.checkboxIndicator) {
state.checkboxIndicator.className = mergeClasses(dataGridSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
}
if (state.radioIndicator) {
state.radioIndicator.className = mergeClasses(dataGridSelectionCellClassNames.radioIndicator, state.radioIndicator.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/DataGridSelectionCell/useDataGridSelectionCellStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { DataGridSelectionCellSlots, DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles.styles';\n\nexport const dataGridSelectionCellClassNames: SlotClassNames<DataGridSelectionCellSlots> = {\n root: 'fui-DataGridSelectionCell',\n checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-DataGridSelectionCell__radioIndicator',\n};\n\n/**\n * Apply styling to the DataGridSelectionCell slots based on the state\n */\nexport const useDataGridSelectionCellStyles_unstable = (\n state: DataGridSelectionCellState,\n): DataGridSelectionCellState => {\n 'use no memo';\n\n useTableSelectionCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);\n\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"],"names":["mergeClasses","useTableSelectionCellStyles_unstable","dataGridSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useDataGridSelectionCellStyles_unstable","state","className"],"mappings":"AAAA;AAEA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,oCAAoC,QAAQ,2DAA2D;AAEhH,OAAO,MAAMC,kCAA8E;IACzFC,MAAM;IACNC,mBAAmB;IACnBC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,0CAA0C,CACrDC;IAEA;IAEAN,qCAAqCM;IACrCA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,aAAaE,gCAAgCC,IAAI,EAAEI,MAAMJ,IAAI,CAACK,SAAS;IAE9F,IAAID,MAAMH,iBAAiB,EAAE;QAC3BG,MAAMH,iBAAiB,CAACI,SAAS,GAAGR,aAClCE,gCAAgCE,iBAAiB,EACjDG,MAAMH,iBAAiB,CAACI,SAAS;IAErC;IAEA,IAAID,MAAMF,cAAc,EAAE;QACxBE,MAAMF,cAAc,CAACG,SAAS,GAAGR,aAC/BE,gCAAgCG,cAAc,EAC9CE,MAAMF,cAAc,CAACG,SAAS;IAElC;IAEA,OAAOD;AACT,EAAE"}

Some files were not shown because too many files have changed in this diff Show More