Fix format

This commit is contained in:
Laurent Nguyen 2024-08-06 18:28:52 +02:00
parent 4e71e340e3
commit 7a179ff34a

View File

@ -23,7 +23,7 @@ import {
useTableColumnSizing_unstable,
useTableFeatures,
useTableSelection,
useTableSort
useTableSort,
} from "@fluentui/react-components";
import {
ArrowClockwise16Regular,
@ -164,9 +164,21 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
<MenuItem key="refresh" icon={<ArrowClockwise16Regular />} onClick={onRefreshTable}>
Refresh
</MenuItem>
<MenuItem icon={<TextSortAscendingRegular />} onClick={(e) => setColumnSort(e, column.id, "ascending")}>Sort ascending</MenuItem>
<MenuItem icon={<TextSortDescendingRegular />} onClick={(e) => setColumnSort(e, column.id, "descending")}>Sort descending</MenuItem>
<MenuItem icon={<ArrowResetRegular />} onClick={(e) => setColumnSort(e, undefined, undefined)}>Reset sorting</MenuItem>
<MenuItem
icon={<TextSortAscendingRegular />}
onClick={(e) => setColumnSort(e, column.id, "ascending")}
>
Sort ascending
</MenuItem>
<MenuItem
icon={<TextSortDescendingRegular />}
onClick={(e) => setColumnSort(e, column.id, "descending")}
>
Sort descending
</MenuItem>
<MenuItem icon={<ArrowResetRegular />} onClick={(e) => setColumnSort(e, undefined, undefined)}>
Reset sorting
</MenuItem>
<MenuItem key="editcolumns" icon={<EditRegular />} onClick={openColumnSelectionPane}>
Edit columns
</MenuItem>
@ -316,7 +328,8 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
sortDirection: getSortDirection(columnId),
});
const rows: TableRowData[] = sort(getRows((row) => {
const rows: TableRowData[] = sort(
getRows((row) => {
const selected = isRowSelected(row.rowId);
return {
...row,
@ -330,7 +343,8 @@ export const DocumentsTableComponent: React.FC<IDocumentsTableComponentProps> =
selected,
appearance: selected ? ("brand" as const) : ("none" as const),
};
}));
}),
);
const toggleAllKeydown = React.useCallback(
(e: React.KeyboardEvent<HTMLDivElement>) => {