@fluentui/react-table 9.0.0-alpha.14 → 9.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +129 -1
- package/CHANGELOG.md +34 -2
- package/dist/index.d.ts +8 -2
- package/lib/components/DataGrid/DataGrid.js +0 -1
- package/lib/components/DataGrid/DataGrid.js.map +1 -1
- package/lib/components/DataGrid/renderDataGrid.js +0 -1
- package/lib/components/DataGrid/renderDataGrid.js.map +1 -1
- package/lib/components/DataGrid/useDataGrid.js +2 -2
- package/lib/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib/components/DataGrid/useDataGridContextValues.js +4 -2
- package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
- package/lib/components/DataGrid/useDataGridStyles.js +0 -1
- package/lib/components/DataGrid/useDataGridStyles.js.map +1 -1
- package/lib/components/DataGridBody/DataGridBody.js +0 -1
- package/lib/components/DataGridBody/DataGridBody.js.map +1 -1
- package/lib/components/DataGridBody/DataGridBody.types.js.map +1 -1
- package/lib/components/DataGridBody/renderDataGridBody.js +13 -3
- package/lib/components/DataGridBody/renderDataGridBody.js.map +1 -1
- package/lib/components/DataGridBody/useDataGridBody.js +8 -12
- package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
- package/lib/components/DataGridBody/useDataGridBodyStyles.js +0 -1
- package/lib/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
- package/lib/components/DataGridCell/DataGridCell.js +0 -1
- package/lib/components/DataGridCell/DataGridCell.js.map +1 -1
- package/lib/components/DataGridCell/renderDataGridCell.js +0 -1
- package/lib/components/DataGridCell/renderDataGridCell.js.map +1 -1
- package/lib/components/DataGridCell/useDataGridCell.js +0 -1
- package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib/components/DataGridCell/useDataGridCellStyles.js +0 -1
- package/lib/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
- package/lib/components/DataGridHeader/DataGridHeader.js +0 -1
- package/lib/components/DataGridHeader/DataGridHeader.js.map +1 -1
- package/lib/components/DataGridHeader/renderDataGridHeader.js +0 -1
- package/lib/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
- package/lib/components/DataGridHeader/useDataGridHeader.js +2 -2
- package/lib/components/DataGridHeader/useDataGridHeader.js.map +1 -1
- package/lib/components/DataGridHeader/useDataGridHeaderStyles.js +0 -1
- package/lib/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
- package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js +0 -1
- package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -1
- package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +0 -3
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -4
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib/components/DataGridRow/DataGridRow.js +0 -1
- package/lib/components/DataGridRow/DataGridRow.js.map +1 -1
- package/lib/components/DataGridRow/DataGridRow.types.js.map +1 -1
- package/lib/components/DataGridRow/renderDataGridRow.js +9 -4
- package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
- package/lib/components/DataGridRow/useDataGridRow.js +8 -19
- package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib/components/DataGridRow/useDataGridRowStyles.js +0 -3
- package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
- package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js +0 -1
- package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
- package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -1
- package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +0 -8
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -4
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
- package/lib/components/Table/Table.js +0 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/renderTable.js +2 -2
- package/lib/components/Table/renderTable.js.map +1 -1
- package/lib/components/Table/useTable.js +0 -2
- package/lib/components/Table/useTable.js.map +1 -1
- package/lib/components/Table/useTableContextValues.js.map +1 -1
- package/lib/components/Table/useTableStyles.js +13 -19
- package/lib/components/Table/useTableStyles.js.map +1 -1
- package/lib/components/TableBody/TableBody.js +0 -1
- package/lib/components/TableBody/TableBody.js.map +1 -1
- package/lib/components/TableBody/renderTableBody.js +4 -4
- package/lib/components/TableBody/renderTableBody.js.map +1 -1
- package/lib/components/TableBody/useTableBody.js +0 -2
- package/lib/components/TableBody/useTableBody.js.map +1 -1
- package/lib/components/TableBody/useTableBodyStyles.js +6 -10
- package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
- package/lib/components/TableCell/TableCell.js +0 -1
- package/lib/components/TableCell/TableCell.js.map +1 -1
- package/lib/components/TableCell/renderTableCell.js +2 -2
- package/lib/components/TableCell/renderTableCell.js.map +1 -1
- package/lib/components/TableCell/useTableCell.js +0 -2
- package/lib/components/TableCell/useTableCell.js.map +1 -1
- package/lib/components/TableCell/useTableCellStyles.js +36 -42
- package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
- package/lib/components/TableCellActions/TableCellActions.js +0 -1
- package/lib/components/TableCellActions/TableCellActions.js.map +1 -1
- package/lib/components/TableCellActions/renderTableCellActions.js +4 -4
- package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -1
- package/lib/components/TableCellActions/useTableCellActions.js +0 -2
- package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
- package/lib/components/TableCellActions/useTableCellActionsStyles.js +10 -13
- package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
- package/lib/components/TableCellLayout/TableCellLayout.js +0 -1
- package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -1
- package/lib/components/TableCellLayout/renderTableCellLayout.js +10 -6
- package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
- package/lib/components/TableCellLayout/useTableCellLayout.js +0 -1
- package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
- package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +29 -37
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
- package/lib/components/TableHeader/TableHeader.js +0 -1
- package/lib/components/TableHeader/TableHeader.js.map +1 -1
- package/lib/components/TableHeader/renderTableHeader.js +2 -2
- package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
- package/lib/components/TableHeader/useTableHeader.js +0 -2
- package/lib/components/TableHeader/useTableHeader.js.map +1 -1
- package/lib/components/TableHeader/useTableHeaderStyles.js +10 -14
- package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.js +0 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js +6 -4
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +0 -2
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +68 -76
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib/components/TableRow/TableRow.js +0 -1
- package/lib/components/TableRow/TableRow.js.map +1 -1
- package/lib/components/TableRow/renderTableRow.js +4 -4
- package/lib/components/TableRow/renderTableRow.js.map +1 -1
- package/lib/components/TableRow/useTableRow.js +0 -2
- package/lib/components/TableRow/useTableRow.js.map +1 -1
- package/lib/components/TableRow/useTableRowStyles.js +136 -142
- package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
- package/lib/components/TableSelectionCell/TableSelectionCell.js +0 -1
- package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
- package/lib/components/TableSelectionCell/renderTableSelectionCell.js +6 -4
- package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCell.js +4 -3
- package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +42 -51
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib/contexts/columnIdContext.js +0 -1
- package/lib/contexts/columnIdContext.js.map +1 -1
- package/lib/contexts/dataGridContext.js +2 -1
- package/lib/contexts/dataGridContext.js.map +1 -1
- package/lib/contexts/rowIdContext.js +0 -1
- package/lib/contexts/rowIdContext.js.map +1 -1
- package/lib/contexts/tableContext.js +0 -1
- package/lib/contexts/tableContext.js.map +1 -1
- package/lib/contexts/tableHeaderContext.js.map +1 -1
- package/lib/hooks/createColumn.js +0 -6
- package/lib/hooks/createColumn.js.map +1 -1
- package/lib/hooks/selectionManager.js +0 -16
- package/lib/hooks/selectionManager.js.map +1 -1
- package/lib/hooks/useTableFeatures.js +0 -5
- package/lib/hooks/useTableFeatures.js.map +1 -1
- package/lib/hooks/useTableSelection.js +2 -6
- package/lib/hooks/useTableSelection.js.map +1 -1
- package/lib/hooks/useTableSort.js +4 -13
- package/lib/hooks/useTableSort.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/DataGrid.js +0 -2
- package/lib-commonjs/DataGrid.js.map +1 -1
- package/lib-commonjs/DataGridBody.js +0 -2
- package/lib-commonjs/DataGridBody.js.map +1 -1
- package/lib-commonjs/DataGridCell.js +0 -2
- package/lib-commonjs/DataGridCell.js.map +1 -1
- package/lib-commonjs/DataGridHeader.js +0 -2
- package/lib-commonjs/DataGridHeader.js.map +1 -1
- package/lib-commonjs/DataGridHeaderCell.js +0 -2
- package/lib-commonjs/DataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/DataGridRow.js +0 -2
- package/lib-commonjs/DataGridRow.js.map +1 -1
- package/lib-commonjs/DataGridSelectionCell.js +0 -2
- package/lib-commonjs/DataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/Table.js +0 -2
- package/lib-commonjs/Table.js.map +1 -1
- package/lib-commonjs/TableBody.js +0 -2
- package/lib-commonjs/TableBody.js.map +1 -1
- package/lib-commonjs/TableCell.js +0 -2
- package/lib-commonjs/TableCell.js.map +1 -1
- package/lib-commonjs/TableCellActions.js +0 -2
- package/lib-commonjs/TableCellActions.js.map +1 -1
- package/lib-commonjs/TableCellLayout.js +0 -2
- package/lib-commonjs/TableCellLayout.js.map +1 -1
- package/lib-commonjs/TableCellPrimaryLayout.js +0 -2
- package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -1
- package/lib-commonjs/TableHeader.js +0 -2
- package/lib-commonjs/TableHeader.js.map +1 -1
- package/lib-commonjs/TableHeaderCell.js +0 -2
- package/lib-commonjs/TableHeaderCell.js.map +1 -1
- package/lib-commonjs/TableRow.js +0 -2
- package/lib-commonjs/TableRow.js.map +1 -1
- package/lib-commonjs/TableSelectionCell.js +0 -2
- package/lib-commonjs/TableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/DataGrid/DataGrid.js +0 -7
- package/lib-commonjs/components/DataGrid/DataGrid.js.map +1 -1
- package/lib-commonjs/components/DataGrid/DataGrid.types.js.map +1 -1
- package/lib-commonjs/components/DataGrid/index.js +0 -6
- package/lib-commonjs/components/DataGrid/index.js.map +1 -1
- package/lib-commonjs/components/DataGrid/renderDataGrid.js +0 -6
- package/lib-commonjs/components/DataGrid/renderDataGrid.js.map +1 -1
- package/lib-commonjs/components/DataGrid/useDataGrid.js +2 -7
- package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +4 -5
- package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
- package/lib-commonjs/components/DataGrid/useDataGridStyles.js +0 -5
- package/lib-commonjs/components/DataGrid/useDataGridStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/DataGridBody.js +0 -6
- package/lib-commonjs/components/DataGridBody/DataGridBody.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/DataGridBody.types.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/index.js +0 -6
- package/lib-commonjs/components/DataGridBody/index.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/renderDataGridBody.js +13 -6
- package/lib-commonjs/components/DataGridBody/renderDataGridBody.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/useDataGridBody.js +8 -19
- package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
- package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js +0 -5
- package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/DataGridCell.js +0 -6
- package/lib-commonjs/components/DataGridCell/DataGridCell.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/index.js +0 -6
- package/lib-commonjs/components/DataGridCell/index.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/renderDataGridCell.js +0 -4
- package/lib-commonjs/components/DataGridCell/renderDataGridCell.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js +0 -5
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js +0 -5
- package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/DataGridHeader.js +0 -6
- package/lib-commonjs/components/DataGridHeader/DataGridHeader.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/index.js +0 -6
- package/lib-commonjs/components/DataGridHeader/index.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js +0 -4
- package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js +2 -5
- package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js.map +1 -1
- package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js +0 -5
- package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js +0 -6
- package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/index.js +0 -6
- package/lib-commonjs/components/DataGridHeaderCell/index.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -4
- package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +0 -10
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -8
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/DataGridRow.js +0 -6
- package/lib-commonjs/components/DataGridRow/DataGridRow.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/DataGridRow.types.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/index.js +0 -6
- package/lib-commonjs/components/DataGridRow/index.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/renderDataGridRow.js +9 -8
- package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js +8 -30
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js +0 -7
- package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js +0 -6
- package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/index.js +0 -6
- package/lib-commonjs/components/DataGridSelectionCell/index.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -4
- package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +0 -15
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -8
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
- package/lib-commonjs/components/Table/Table.js +0 -7
- package/lib-commonjs/components/Table/Table.js.map +1 -1
- package/lib-commonjs/components/Table/Table.types.js.map +1 -1
- package/lib-commonjs/components/Table/index.js +0 -6
- package/lib-commonjs/components/Table/index.js.map +1 -1
- package/lib-commonjs/components/Table/renderTable.js +2 -7
- package/lib-commonjs/components/Table/renderTable.js.map +1 -1
- package/lib-commonjs/components/Table/useTable.js +0 -5
- package/lib-commonjs/components/Table/useTable.js.map +1 -1
- package/lib-commonjs/components/Table/useTableContextValues.js +0 -3
- package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
- package/lib-commonjs/components/Table/useTableStyles.js +13 -23
- package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
- package/lib-commonjs/components/TableBody/TableBody.js +0 -6
- package/lib-commonjs/components/TableBody/TableBody.js.map +1 -1
- package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
- package/lib-commonjs/components/TableBody/index.js +0 -6
- package/lib-commonjs/components/TableBody/index.js.map +1 -1
- package/lib-commonjs/components/TableBody/renderTableBody.js +4 -8
- package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -1
- package/lib-commonjs/components/TableBody/useTableBody.js +0 -6
- package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js +6 -12
- package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
- package/lib-commonjs/components/TableCell/TableCell.js +0 -6
- package/lib-commonjs/components/TableCell/TableCell.js.map +1 -1
- package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
- package/lib-commonjs/components/TableCell/index.js +0 -6
- package/lib-commonjs/components/TableCell/index.js.map +1 -1
- package/lib-commonjs/components/TableCell/renderTableCell.js +2 -6
- package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
- package/lib-commonjs/components/TableCell/useTableCell.js +0 -6
- package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
- package/lib-commonjs/components/TableCell/useTableCellStyles.js +36 -47
- package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/TableCellActions.js +0 -6
- package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/index.js +0 -6
- package/lib-commonjs/components/TableCellActions/index.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/renderTableCellActions.js +4 -8
- package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/useTableCellActions.js +0 -5
- package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
- package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +10 -16
- package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +0 -7
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/index.js +0 -6
- package/lib-commonjs/components/TableCellLayout/index.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js +10 -11
- package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +0 -5
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js +0 -3
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +29 -42
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeader/TableHeader.js +0 -6
- package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -1
- package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
- package/lib-commonjs/components/TableHeader/index.js +0 -6
- package/lib-commonjs/components/TableHeader/index.js.map +1 -1
- package/lib-commonjs/components/TableHeader/renderTableHeader.js +2 -7
- package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
- package/lib-commonjs/components/TableHeader/useTableHeader.js +0 -6
- package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +10 -17
- package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +0 -6
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/index.js +0 -6
- package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +6 -8
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +0 -10
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +68 -81
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableRow/TableRow.js +0 -6
- package/lib-commonjs/components/TableRow/TableRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
- package/lib-commonjs/components/TableRow/index.js +0 -6
- package/lib-commonjs/components/TableRow/index.js.map +1 -1
- package/lib-commonjs/components/TableRow/renderTableRow.js +4 -8
- package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRow.js +0 -7
- package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
- package/lib-commonjs/components/TableRow/useTableRowStyles.js +136 -150
- package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +0 -6
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/index.js +0 -6
- package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js +6 -8
- package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +4 -10
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +42 -56
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib-commonjs/contexts/columnIdContext.js +0 -5
- package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
- package/lib-commonjs/contexts/dataGridContext.js +2 -6
- package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
- package/lib-commonjs/contexts/rowIdContext.js +0 -5
- package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
- package/lib-commonjs/contexts/tableContext.js +0 -5
- package/lib-commonjs/contexts/tableContext.js.map +1 -1
- package/lib-commonjs/contexts/tableHeaderContext.js +0 -4
- package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -1
- package/lib-commonjs/hooks/createColumn.js +0 -8
- package/lib-commonjs/hooks/createColumn.js.map +1 -1
- package/lib-commonjs/hooks/index.js +0 -6
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/selectionManager.js +0 -18
- package/lib-commonjs/hooks/selectionManager.js.map +1 -1
- package/lib-commonjs/hooks/types.js.map +1 -1
- package/lib-commonjs/hooks/useTableFeatures.js +0 -9
- package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
- package/lib-commonjs/hooks/useTableSelection.js +2 -13
- package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
- package/lib-commonjs/hooks/useTableSort.js +4 -18
- package/lib-commonjs/hooks/useTableSort.js.map +1 -1
- package/lib-commonjs/index.js +0 -36
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +12 -12
|
@@ -6,75 +6,69 @@ export const tableSelectionCellClassNames = {
|
|
|
6
6
|
checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',
|
|
7
7
|
radioIndicator: 'fui-TableSelectionCell__radioIndicator'
|
|
8
8
|
};
|
|
9
|
-
|
|
10
9
|
const useTableLayoutStyles = /*#__PURE__*/__styles({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
root: {
|
|
11
|
+
mc9l5x: "f15pt5es",
|
|
12
|
+
a9b677: "fksc0bp"
|
|
14
13
|
}
|
|
15
14
|
}, {
|
|
16
|
-
|
|
15
|
+
d: [".f15pt5es{display:table-cell;}", ".fksc0bp{width:44px;}"]
|
|
17
16
|
});
|
|
18
|
-
|
|
19
17
|
const useFlexLayoutStyles = /*#__PURE__*/__styles({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
root: {
|
|
19
|
+
mc9l5x: "f22iagw",
|
|
20
|
+
Bh6795r: "fqerorx",
|
|
21
|
+
Bnnss6s: "f1neuvcm",
|
|
22
|
+
xawz: "fkjuxzh",
|
|
23
|
+
Bf4jedk: "fvrlu0f",
|
|
24
|
+
B2u0y6b: "f1c71y05",
|
|
25
|
+
Brf1p80: "f4d9j23"
|
|
28
26
|
}
|
|
29
27
|
}, {
|
|
30
|
-
|
|
28
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".fvrlu0f{min-width:44px;}", ".f1c71y05{max-width:44px;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}"]
|
|
31
29
|
});
|
|
32
30
|
/**
|
|
33
31
|
* Styles for the root slot
|
|
34
32
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
33
|
const useStyles = /*#__PURE__*/__styles({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
root: {
|
|
35
|
+
fsow6f: "f17mccla",
|
|
36
|
+
Huce71: "fz5stix",
|
|
37
|
+
z8tnut: "f1g0x7ka",
|
|
38
|
+
z189sj: ["fhxju0i", "f1cnd47f"],
|
|
39
|
+
Byoj8tv: "f1qch9an",
|
|
40
|
+
uwmqm3: ["f1cnd47f", "fhxju0i"],
|
|
41
|
+
Bn4voq9: "fz36nt7",
|
|
42
|
+
g9k6zt: "f9znhxp",
|
|
43
|
+
Bfpq7zp: "fqrak0z",
|
|
44
|
+
kdpuga: ["f1o2ludy", "f1kjnpwc"],
|
|
45
|
+
Bw81rd7: ["f1kjnpwc", "f1o2ludy"],
|
|
46
|
+
B6xbmo0: ["fxmnebo", "f1witrsb"],
|
|
47
|
+
dm238s: ["f1witrsb", "fxmnebo"]
|
|
52
48
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
radioIndicator: {
|
|
50
|
+
mc9l5x: "f22iagw",
|
|
51
|
+
Bh6795r: "fqerorx",
|
|
52
|
+
Bt984gj: "f122n59",
|
|
53
|
+
Brf1p80: "f4d9j23"
|
|
58
54
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
subtle: {
|
|
56
|
+
abs64n: "fk73vx1",
|
|
57
|
+
Brovlpu: "ftqa4ok",
|
|
58
|
+
B486eqv: "f2hkw1w",
|
|
59
|
+
B8a84jv: "f1y7ij6c"
|
|
64
60
|
},
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
hidden: {
|
|
62
|
+
Bcdw1i0: "fd7fpy0"
|
|
67
63
|
}
|
|
68
64
|
}, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
d: [".f17mccla{text-align:center;}", ".fz5stix{white-space:nowrap;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fz36nt7[data-fui-focus-visible]{outline-width:2px;}", ".f9znhxp[data-fui-focus-visible]{outline-style:solid;}", ".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}", ".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}", ".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fk73vx1{opacity:0;}", ".f1y7ij6c[data-fui-focus-within]:focus-within{opacity:1;}", ".fd7fpy0{visibility:hidden;}"],
|
|
66
|
+
f: [".ftqa4ok:focus{outline-style:none;}"],
|
|
67
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"]
|
|
72
68
|
});
|
|
73
69
|
/**
|
|
74
70
|
* Apply styling to the TableSelectionCell slots based on the state
|
|
75
71
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
72
|
export const useTableSelectionCellStyles_unstable = state => {
|
|
79
73
|
const styles = useStyles();
|
|
80
74
|
const layoutStyles = {
|
|
@@ -82,15 +76,12 @@ export const useTableSelectionCellStyles_unstable = state => {
|
|
|
82
76
|
flex: useFlexLayoutStyles()
|
|
83
77
|
};
|
|
84
78
|
state.root.className = mergeClasses(tableSelectionCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.subtle && state.checked === false && styles.subtle, state.hidden && styles.hidden, state.root.className);
|
|
85
|
-
|
|
86
79
|
if (state.checkboxIndicator) {
|
|
87
80
|
state.checkboxIndicator.className = mergeClasses(tableSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
|
|
88
81
|
}
|
|
89
|
-
|
|
90
82
|
if (state.radioIndicator) {
|
|
91
83
|
state.radioIndicator.className = mergeClasses(tableSelectionCellClassNames.radioIndicator, styles.radioIndicator, state.radioIndicator.className);
|
|
92
84
|
}
|
|
93
|
-
|
|
94
85
|
return state;
|
|
95
86
|
};
|
|
96
87
|
//# sourceMappingURL=useTableSelectionCellStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,iBAAiB,EAAE,2CAA2C;EAC9DC,cAAc,EAAE;CACjB;AAED,MAAMC,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAK3B;AAEF,MAAMC,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAQ1B;AAEF;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAkChB;AAEF;;;AAGA,OAAO,MAAMC,oCAAoC,GAAIC,KAA8B,IAA6B;EAC9G,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAEP,oBAAoB,EAAE;IAC7BQ,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACP,IAAI,CAACY,SAAS,GAAGjB,YAAY,CACjCI,4BAA4B,CAACC,IAAI,EACjCQ,MAAM,CAACR,IAAI,EACXO,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACX,IAAI,GAAGS,YAAY,CAACC,KAAK,CAACV,IAAI,EACzEO,KAAK,CAACO,MAAM,IAAIP,KAAK,CAACQ,OAAO,KAAK,KAAK,IAAIP,MAAM,CAACM,MAAM,EACxDP,KAAK,CAACS,MAAM,IAAIR,MAAM,CAACQ,MAAM,EAC7BT,KAAK,CAACP,IAAI,CAACY,SAAS,CACrB;EACD,IAAIL,KAAK,CAACN,iBAAiB,EAAE;IAC3BM,KAAK,CAACN,iBAAiB,CAACW,SAAS,GAAGjB,YAAY,CAC9CI,4BAA4B,CAACE,iBAAiB,EAC9CM,KAAK,CAACN,iBAAiB,CAACW,SAAS,CAClC;;EAGH,IAAIL,KAAK,CAACL,cAAc,EAAE;IACxBK,KAAK,CAACL,cAAc,CAACU,SAAS,GAAGjB,YAAY,CAC3CI,4BAA4B,CAACG,cAAc,EAC3CM,MAAM,CAACN,cAAc,EACrBK,KAAK,CAACL,cAAc,CAACU,SAAS,CAC/B;;EAGH,OAAOL,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","createCustomFocusIndicatorStyle","tokens","tableSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useTableLayoutStyles","useFlexLayoutStyles","useStyles","useTableSelectionCellStyles_unstable","state","styles","layoutStyles","table","flex","className","noNativeElements","subtle","checked","hidden"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableSelectionCell/useTableSelectionCellStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableSelectionCellSlots, TableSelectionCellState } from './TableSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableSelectionCellClassNames: SlotClassNames<TableSelectionCellSlots> = {\n root: 'fui-TableSelectionCell',\n checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-TableSelectionCell__radioIndicator',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n width: '44px',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: '44px',\n maxWidth: '44px',\n justifyContent: 'center',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n textAlign: 'center',\n whiteSpace: 'nowrap',\n ...shorthands.padding(0),\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus', enableOutline: true },\n ),\n },\n\n radioIndicator: {\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n subtle: {\n opacity: 0,\n ...createCustomFocusIndicatorStyle(\n {\n opacity: 1,\n },\n { selector: 'focus-within' },\n ),\n },\n\n hidden: {\n visibility: 'hidden',\n },\n});\n\n/**\n * Apply styling to the TableSelectionCell slots based on the state\n */\nexport const useTableSelectionCellStyles_unstable = (state: TableSelectionCellState): TableSelectionCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableSelectionCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.subtle && state.checked === false && styles.subtle,\n state.hidden && styles.hidden,\n state.root.className,\n );\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n tableSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n tableSelectionCellClassNames.radioIndicator,\n styles.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -3,7 +3,6 @@ const columnIdContext = /*#__PURE__*/React.createContext(undefined);
|
|
|
3
3
|
export const columnIdContextDefaultValue = '';
|
|
4
4
|
export const useColumnIdContext = () => {
|
|
5
5
|
var _a;
|
|
6
|
-
|
|
7
6
|
return (_a = React.useContext(columnIdContext)) !== null && _a !== void 0 ? _a : columnIdContextDefaultValue;
|
|
8
7
|
};
|
|
9
8
|
export const ColumnIdContextProvider = columnIdContext.Provider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,eAAe,gBAAGD,KAAK,CAACE,aAAa,CAAuBC,SAAS,CAAC;AAE5E,OAAO,MAAMC,2BAA2B,GAAG,EAAE;AAE7C,OAAO,MAAMC,kBAAkB,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACL,eAAe,CAAC,mCAAIG,2BAA2B;AAAA;AAExG,OAAO,MAAMG,uBAAuB,GAAGN,eAAe,CAACO,QAAQ","names":["React","columnIdContext","createContext","undefined","columnIdContextDefaultValue","useColumnIdContext","useContext","ColumnIdContextProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/columnIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ColumnId } from '../hooks/';\n\nconst columnIdContext = React.createContext<ColumnId | undefined>(undefined);\n\nexport const columnIdContextDefaultValue = '';\n\nexport const useColumnIdContext = () => React.useContext(columnIdContext) ?? columnIdContextDefaultValue;\n\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
2
|
import { defaultTableState } from '../hooks';
|
|
3
3
|
const dataGridContext = /*#__PURE__*/createContext(undefined);
|
|
4
|
-
const dataGridContextDefaultValue = {
|
|
4
|
+
const dataGridContextDefaultValue = {
|
|
5
|
+
...defaultTableState,
|
|
5
6
|
subtleSelection: false,
|
|
6
7
|
selectableRows: false,
|
|
7
8
|
selectionAppearance: 'brand',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,kCAAkC;AAGpF,SAASC,iBAAiB,QAAQ,UAAU;AAE5C,MAAMC,eAAe,gBAAGH,aAAa,CAAmCI,SAAS,CAAC;AAElF,MAAMC,2BAA2B,GAAyB;EACxD,GAAGH,iBAAiB;EACpBI,eAAe,EAAE,KAAK;EACtBC,cAAc,EAAE,KAAK;EACrBC,mBAAmB,EAAE,OAAO;EAC5BC,SAAS,EAAE;CACZ;AAED,OAAO,MAAMC,uBAAuB,GAAGP,eAAe,CAACQ,QAAQ;AAE/D,OAAO,MAAMC,2BAA2B,GAAOC,QAAkD,IAC/FZ,kBAAkB,CAACE,eAAe,EAAE,CAACW,GAAG,GAAGT,2BAA2B,KAAKQ,QAAQ,CAACC,GAAG,CAAC,CAAC","names":["createContext","useContextSelector","defaultTableState","dataGridContext","undefined","dataGridContextDefaultValue","subtleSelection","selectableRows","selectionAppearance","focusMode","DataGridContextProvider","Provider","useDataGridContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/dataGridContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport { DataGridContextValue } from '../components/DataGrid/DataGrid.types';\nimport { defaultTableState } from '../hooks';\n\nconst dataGridContext = createContext<DataGridContextValue | undefined>(undefined);\n\nconst dataGridContextDefaultValue: DataGridContextValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n};\n\nexport const DataGridContextProvider = dataGridContext.Provider;\n\nexport const useDataGridContext_unstable = <T>(selector: ContextSelector<DataGridContextValue, T>) =>\n useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue) => selector(ctx));\n"]}
|
|
@@ -3,7 +3,6 @@ const rowIdContext = /*#__PURE__*/React.createContext(undefined);
|
|
|
3
3
|
export const rowIdContextDefaultValue = '';
|
|
4
4
|
export const useRowIdContext = () => {
|
|
5
5
|
var _a;
|
|
6
|
-
|
|
7
6
|
return (_a = React.useContext(rowIdContext)) !== null && _a !== void 0 ? _a : rowIdContextDefaultValue;
|
|
8
7
|
};
|
|
9
8
|
export const RowIdContextProvider = rowIdContext.Provider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAoBC,SAAS,CAAC;AAEtE,OAAO,MAAMC,wBAAwB,GAAG,EAAE;AAE1C,OAAO,MAAMC,eAAe,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACL,YAAY,CAAC,mCAAIG,wBAAwB;AAAA;AAE/F,OAAO,MAAMG,oBAAoB,GAAGN,YAAY,CAACO,QAAQ","names":["React","rowIdContext","createContext","undefined","rowIdContextDefaultValue","useRowIdContext","useContext","RowIdContextProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/rowIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { RowId } from '../hooks/';\n\nconst rowIdContext = React.createContext<RowId | undefined>(undefined);\n\nexport const rowIdContextDefaultValue = '';\n\nexport const useRowIdContext = () => React.useContext(rowIdContext) ?? rowIdContextDefaultValue;\n\nexport const RowIdContextProvider = rowIdContext.Provider;\n"]}
|
|
@@ -8,7 +8,6 @@ export const tableContextDefaultValue = {
|
|
|
8
8
|
export const TableContextProvider = tableContext.Provider;
|
|
9
9
|
export const useTableContext = () => {
|
|
10
10
|
var _a;
|
|
11
|
-
|
|
12
11
|
return (_a = React.useContext(tableContext)) !== null && _a !== void 0 ? _a : tableContextDefaultValue;
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=tableContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAgCC,SAAS,CAAC;AAElF,OAAO,MAAMC,wBAAwB,GAAsB;EACzDC,IAAI,EAAE,QAAQ;EACdC,gBAAgB,EAAE,KAAK;EACvBC,QAAQ,EAAE;CACX;AAED,OAAO,MAAMC,oBAAoB,GAAGP,YAAY,CAACQ,QAAQ;AACzD,OAAO,MAAMC,eAAe,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACV,YAAY,CAAC,mCAAIG,wBAAwB;AAAA","names":["React","tableContext","createContext","undefined","tableContextDefaultValue","size","noNativeElements","sortable","TableContextProvider","Provider","useTableContext","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/tableContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { TableContextValue } from '../components/Table/Table.types';\n\nconst tableContext = React.createContext<TableContextValue | undefined>(undefined);\n\nexport const tableContextDefaultValue: TableContextValue = {\n size: 'medium',\n noNativeElements: false,\n sortable: false,\n};\n\nexport const TableContextProvider = tableContext.Provider;\nexport const useTableContext = () => React.useContext(tableContext) ?? tableContextDefaultValue;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,MAAMC,kBAAkB,gBAAGD,KAAK,CAACE,aAAa,CAAqBC,SAAS,CAAC;AAE7E,MAAMC,8BAA8B,GAAG,EAAE;AAEzC,OAAO,MAAMC,0BAA0B,GAAGJ,kBAAkB,CAACK,QAAQ;AACrE,OAAO,MAAMC,kBAAkB,GAAG,MAAMP,KAAK,CAACQ,UAAU,CAACP,kBAAkB,CAAC,KAAKG,8BAA8B","names":["React","tableHeaderContext","createContext","undefined","tableHeaderContextDefaultValue","TableHeaderContextProvider","Provider","useIsInTableHeader","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/tableHeaderContext.ts"],"sourcesContent":["import * as React from 'react';\n\nconst tableHeaderContext = React.createContext<string | undefined>(undefined);\n\nconst tableHeaderContextDefaultValue = '';\n\nexport const TableHeaderContextProvider = tableHeaderContext.Provider;\nexport const useIsInTableHeader = () => React.useContext(tableHeaderContext) === tableHeaderContextDefaultValue;\n"]}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
const defaultCompare = () => 0;
|
|
2
|
-
|
|
3
2
|
const defaultRenderCell = () => {
|
|
4
3
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
4
|
// eslint-disable-next-line no-console
|
|
6
5
|
console.warn('@fluentui/react-table: You are using the default column renderCell function that renders null');
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
return null;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
const defaultRenderHeaderCell = () => {
|
|
13
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
11
|
// eslint-disable-next-line no-console
|
|
15
12
|
console.warn('@fluentui/react-table: You are using the default column renderHeaderCell function that renders null');
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
return null;
|
|
19
15
|
};
|
|
20
16
|
/**
|
|
@@ -22,8 +18,6 @@ const defaultRenderHeaderCell = () => {
|
|
|
22
18
|
* @param options - column definition options
|
|
23
19
|
* @returns - column definition with defaults
|
|
24
20
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
21
|
export function createColumn(options) {
|
|
28
22
|
const {
|
|
29
23
|
columnId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAEA,MAAMA,cAAc,GAAG,MAAM,CAAC;AAE9B,MAAMC,iBAAiB,GAAG,MAAK;EAC7B,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC;IACAC,OAAO,CAACC,IAAI,CAAC,+FAA+F,CAAC;;EAG/G,OAAO,IAAI;AACb,CAAC;AAED,MAAMC,uBAAuB,GAAG,MAAK;EACnC,IAAIL,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC;IACAC,OAAO,CAACC,IAAI,CAAC,qGAAqG,CAAC;;EAGrH,OAAO,IAAI;AACb,CAAC;AAED;;;;;AAKA,OAAM,SAAUE,YAAY,CAAQC,OAAmC;EACrE,MAAM;IACJC,QAAQ;IACRC,UAAU,GAAGV,iBAAiB;IAC9BW,gBAAgB,GAAGL,uBAAuB;IAC1CM,OAAO,GAAGb;EAAc,CACzB,GAAGS,OAAO;EAEX,OAAO;IACLC,QAAQ;IACRC,UAAU;IACVC,gBAAgB;IAChBC;GACD;AACH","names":["defaultCompare","defaultRenderCell","process","env","NODE_ENV","console","warn","defaultRenderHeaderCell","createColumn","options","columnId","renderCell","renderHeaderCell","compare"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/createColumn.ts"],"sourcesContent":["import { CreateColumnOptions } from './types';\n\nconst defaultCompare = () => 0;\n\nconst defaultRenderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderCell function that renders null');\n }\n\n return null;\n};\n\nconst defaultRenderHeaderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderHeaderCell function that renders null');\n }\n\n return null;\n};\n\n/**\n * Helper function to create column definition with defaults\n * @param options - column definition options\n * @returns - column definition with defaults\n */\nexport function createColumn<TItem>(options: CreateColumnOptions<TItem>) {\n const {\n columnId,\n renderCell = defaultRenderCell,\n renderHeaderCell = defaultRenderHeaderCell,\n compare = defaultCompare,\n } = options;\n\n return {\n columnId,\n renderCell,\n renderHeaderCell,\n compare,\n };\n}\n"]}
|
|
@@ -2,48 +2,38 @@ export function createSelectionManager(mode, onSelectionChange = () => undefined
|
|
|
2
2
|
const managerFactory = mode === 'multiselect' ? createMultipleSelectionManager : createSingleSelectionManager;
|
|
3
3
|
return managerFactory(onSelectionChange);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
function createMultipleSelectionManager(onSelectionChange) {
|
|
7
6
|
const toggleAllItems = (e, itemIds, selectedItems) => {
|
|
8
7
|
const allItemsSelected = itemIds.every(itemId => selectedItems.has(itemId));
|
|
9
|
-
|
|
10
8
|
if (allItemsSelected) {
|
|
11
9
|
selectedItems.clear();
|
|
12
10
|
} else {
|
|
13
11
|
itemIds.forEach(itemId => selectedItems.add(itemId));
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
onSelectionChange(e, new Set(selectedItems));
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
const toggleItem = (e, itemId, selectedItems) => {
|
|
20
16
|
if (selectedItems.has(itemId)) {
|
|
21
17
|
selectedItems.delete(itemId);
|
|
22
18
|
} else {
|
|
23
19
|
selectedItems.add(itemId);
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
onSelectionChange(e, new Set(selectedItems));
|
|
27
22
|
};
|
|
28
|
-
|
|
29
23
|
const selectItem = (e, itemId, selectedItems) => {
|
|
30
24
|
selectedItems.add(itemId);
|
|
31
25
|
onSelectionChange(e, new Set(selectedItems));
|
|
32
26
|
};
|
|
33
|
-
|
|
34
27
|
const deselectItem = (e, itemId, selectedItems) => {
|
|
35
28
|
selectedItems.delete(itemId);
|
|
36
29
|
onSelectionChange(e, new Set(selectedItems));
|
|
37
30
|
};
|
|
38
|
-
|
|
39
31
|
const clearItems = e => {
|
|
40
32
|
onSelectionChange(e, new Set());
|
|
41
33
|
};
|
|
42
|
-
|
|
43
34
|
const isSelected = (itemId, selectedItems) => {
|
|
44
35
|
return selectedItems.has(itemId);
|
|
45
36
|
};
|
|
46
|
-
|
|
47
37
|
return {
|
|
48
38
|
toggleItem,
|
|
49
39
|
selectItem,
|
|
@@ -53,24 +43,19 @@ function createMultipleSelectionManager(onSelectionChange) {
|
|
|
53
43
|
toggleAllItems
|
|
54
44
|
};
|
|
55
45
|
}
|
|
56
|
-
|
|
57
46
|
function createSingleSelectionManager(onSelectionChange) {
|
|
58
47
|
const toggleItem = (e, itemId) => {
|
|
59
48
|
onSelectionChange(e, new Set([itemId]));
|
|
60
49
|
};
|
|
61
|
-
|
|
62
50
|
const clearItems = e => {
|
|
63
51
|
onSelectionChange(e, new Set());
|
|
64
52
|
};
|
|
65
|
-
|
|
66
53
|
const isSelected = (itemId, selectedItems) => {
|
|
67
54
|
return selectedItems.has(itemId);
|
|
68
55
|
};
|
|
69
|
-
|
|
70
56
|
const selectItem = (e, itemId) => {
|
|
71
57
|
onSelectionChange(e, new Set([itemId]));
|
|
72
58
|
};
|
|
73
|
-
|
|
74
59
|
return {
|
|
75
60
|
deselectItem: clearItems,
|
|
76
61
|
selectItem,
|
|
@@ -78,7 +63,6 @@ function createSingleSelectionManager(onSelectionChange) {
|
|
|
78
63
|
if (process.env.NODE_ENV !== 'production') {
|
|
79
64
|
throw new Error('[react-table]: `toggleAllItems` should not be used in single selection mode');
|
|
80
65
|
}
|
|
81
|
-
|
|
82
66
|
return undefined;
|
|
83
67
|
},
|
|
84
68
|
toggleItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"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","names":["createSelectionManager","mode","onSelectionChange","undefined","managerFactory","createMultipleSelectionManager","createSingleSelectionManager","toggleAllItems","e","itemIds","selectedItems","allItemsSelected","every","itemId","has","clear","forEach","add","Set","toggleItem","delete","selectItem","deselectItem","clearItems","isSelected","process","env","NODE_ENV","Error"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/selectionManager.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionMode } from './types';\n\ntype OnSelectionChangeCallback = (e: React.SyntheticEvent | Event, selectedItems: Set<SelectionItemId>) => void;\n\nexport interface SelectionManager {\n toggleItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n selectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n deselectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n clearItems(e: React.SyntheticEvent | Event): void;\n isSelected(id: SelectionItemId, selectedItems: Set<SelectionItemId>): boolean;\n toggleAllItems(\n e: React.SyntheticEvent | Event,\n itemIds: SelectionItemId[],\n selectedItems: Set<SelectionItemId>,\n ): void;\n}\n\nexport type SelectionItemId = string | number;\n\nexport function createSelectionManager(\n mode: SelectionMode,\n onSelectionChange: OnSelectionChangeCallback = () => undefined,\n): SelectionManager {\n const managerFactory = mode === 'multiselect' ? createMultipleSelectionManager : createSingleSelectionManager;\n\n return managerFactory(onSelectionChange);\n}\n\nfunction createMultipleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleAllItems: SelectionManager['toggleAllItems'] = (e, itemIds, selectedItems) => {\n const allItemsSelected = itemIds.every(itemId => selectedItems.has(itemId));\n\n if (allItemsSelected) {\n selectedItems.clear();\n } else {\n itemIds.forEach(itemId => selectedItems.add(itemId));\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId, selectedItems) => {\n if (selectedItems.has(itemId)) {\n selectedItems.delete(itemId);\n } else {\n selectedItems.add(itemId);\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId, selectedItems) => {\n selectedItems.add(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const deselectItem: SelectionManager['deselectItem'] = (e, itemId, selectedItems) => {\n selectedItems.delete(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n return {\n toggleItem,\n selectItem,\n deselectItem,\n clearItems,\n isSelected,\n toggleAllItems,\n };\n}\n\nfunction createSingleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set<SelectionItemId>());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n return {\n deselectItem: clearItems,\n selectItem,\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-table]: `toggleAllItems` should not be used in single selection mode');\n }\n\n return undefined;\n },\n toggleItem,\n clearItems,\n isSelected,\n };\n}\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { defaultTableSelectionState } from './useTableSelection';
|
|
2
2
|
import { defaultTableSortState } from './useTableSort';
|
|
3
|
-
|
|
4
3
|
const defaultRowEnhancer = row => row;
|
|
5
|
-
|
|
6
4
|
export const defaultTableState = {
|
|
7
5
|
selection: defaultTableSelectionState,
|
|
8
6
|
sort: defaultTableSortState,
|
|
@@ -17,16 +15,13 @@ export function useTableFeatures(options, plugins = []) {
|
|
|
17
15
|
getRowId,
|
|
18
16
|
columns
|
|
19
17
|
} = options;
|
|
20
|
-
|
|
21
18
|
const getRows = (rowEnhancer = defaultRowEnhancer) => items.map((item, i) => {
|
|
22
19
|
var _a;
|
|
23
|
-
|
|
24
20
|
return rowEnhancer({
|
|
25
21
|
item,
|
|
26
22
|
rowId: (_a = getRowId === null || getRowId === void 0 ? void 0 : getRowId(item)) !== null && _a !== void 0 ? _a : i
|
|
27
23
|
});
|
|
28
24
|
});
|
|
29
|
-
|
|
30
25
|
const initialState = {
|
|
31
26
|
getRowId,
|
|
32
27
|
items,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AACA,SAASA,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,qBAAqB,QAAQ,gBAAgB;AAEtD,MAAMC,kBAAkB,GAA4CC,GAAG,IAAIA,GAAG;AAE9E,OAAO,MAAMC,iBAAiB,GAAwB;EACpDC,SAAS,EAAEL,0BAA0B;EACrCM,IAAI,EAAEL,qBAAqB;EAC3BM,OAAO,EAAE,MAAM,EAAE;EACjBC,QAAQ,EAAE,MAAM,EAAE;EAClBC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE;CACV;AAED,OAAM,SAAUC,gBAAgB,CAC9BC,OAA+B,EAC/BC,UAA8B,EAAE;EAEhC,MAAM;IAAEJ,KAAK;IAAED,QAAQ;IAAEE;EAAO,CAAE,GAAGE,OAAO;EAE5C,MAAML,OAAO,GAAG,CACdO,cAAcZ,kBAAmD,KAC9DO,KAAK,CAACM,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KAAI;IAAA;IAAC,kBAAW,CAAC;MAAED,IAAI;MAAEE,KAAK,EAAE,cAAQ,aAARV,QAAQ,uBAARA,QAAQ,CAAGQ,IAAI,CAAC,mCAAIC;IAAC,CAAE,CAAC;EAAA,EAAC;EAEhF,MAAME,YAAY,GAAsB;IACtCX,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPH,OAAO;IACPF,SAAS,EAAEL,0BAA0B;IACrCM,IAAI,EAAEL;GACP;EAED,OAAOY,OAAO,CAACO,MAAM,CAAC,CAACC,KAAK,EAAEC,MAAM,KAAKA,MAAM,CAACD,KAAK,CAAC,EAAEF,YAAY,CAAC;AACvE","names":["defaultTableSelectionState","defaultTableSortState","defaultRowEnhancer","row","defaultTableState","selection","sort","getRows","getRowId","items","columns","useTableFeatures","options","plugins","rowEnhancer","map","item","i","rowId","initialState","reduce","state","plugin"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableFeatures.ts"],"sourcesContent":["import type { UseTableOptions, TableState, RowState, RowEnhancer, TableStatePlugin, TableSortState } from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, RowState<unknown>> = row => row;\n\nexport const defaultTableState: TableState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableOptions<TItem>,\n plugins: TableStatePlugin[] = [],\n): TableState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends RowState<TItem>>(\n rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>,\n ) => items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n\n const initialState: TableState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n };\n\n return plugins.reduce((state, plugin) => plugin(state), initialState);\n}\n"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useControllableState, useEventCallback } from '@fluentui/react-utilities';
|
|
3
3
|
import { createSelectionManager } from './selectionManager';
|
|
4
|
-
|
|
5
4
|
const noop = () => undefined;
|
|
6
|
-
|
|
7
5
|
export const defaultTableSelectionState = {
|
|
8
6
|
allRowsSelected: false,
|
|
9
7
|
clearRows: noop,
|
|
@@ -50,17 +48,15 @@ export function useTableSelectionState(tableState, options) {
|
|
|
50
48
|
const toggleAllRows = useEventCallback(e => {
|
|
51
49
|
selectionManager.toggleAllItems(e, items.map((item, i) => {
|
|
52
50
|
var _a;
|
|
53
|
-
|
|
54
51
|
return (_a = getRowId === null || getRowId === void 0 ? void 0 : getRowId(item)) !== null && _a !== void 0 ? _a : i;
|
|
55
52
|
}), selected);
|
|
56
53
|
});
|
|
57
54
|
const toggleRow = useEventCallback((e, rowId) => selectionManager.toggleItem(e, rowId, selected));
|
|
58
55
|
const deselectRow = useEventCallback((e, rowId) => selectionManager.deselectItem(e, rowId, selected));
|
|
59
56
|
const selectRow = useEventCallback((e, rowId) => selectionManager.selectItem(e, rowId, selected));
|
|
60
|
-
|
|
61
57
|
const isRowSelected = rowId => selectionManager.isSelected(rowId, selected);
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
return {
|
|
59
|
+
...tableState,
|
|
64
60
|
selection: {
|
|
65
61
|
selectionMode,
|
|
66
62
|
someRowsSelected: selected.size > 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"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","names":["React","useControllableState","useEventCallback","createSelectionManager","noop","undefined","defaultTableSelectionState","allRowsSelected","clearRows","deselectRow","isRowSelected","selectRow","selectedRows","Set","someRowsSelected","toggleAllRows","toggleRow","selectionMode","useTableSelection","options","tableState","useTableSelectionState","items","getRowId","defaultSelectedItems","selectedItems","onSelectionChange","selected","setSelected","initialState","defaultState","state","selectionManager","useMemo","e","newSelectedItems","toggleAllItems","map","item","i","rowId","toggleItem","deselectItem","selectItem","isSelected","selection","size","length","clearItems"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport { createSelectionManager } from './selectionManager';\nimport type { RowId, TableSelectionState, TableState, UseTableSelectionOptions } from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSelectionState: TableSelectionState = {\n allRowsSelected: false,\n clearRows: noop,\n deselectRow: noop,\n isRowSelected: () => false,\n selectRow: noop,\n selectedRows: new Set(),\n someRowsSelected: false,\n toggleAllRows: noop,\n toggleRow: noop,\n selectionMode: 'multiselect',\n};\n\nexport function useTableSelection<TItem>(options: UseTableSelectionOptions) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableState<TItem>) => useTableSelectionState(tableState, options);\n}\n\nexport function useTableSelectionState<TItem>(\n tableState: TableState<TItem>,\n options: UseTableSelectionOptions,\n): TableState<TItem> {\n const { items, getRowId } = tableState;\n const { selectionMode, defaultSelectedItems, selectedItems, onSelectionChange } = options;\n\n const [selected, setSelected] = useControllableState({\n initialState: new Set<RowId>(),\n defaultState: defaultSelectedItems,\n state: selectedItems,\n });\n\n const selectionManager = React.useMemo(() => {\n return createSelectionManager(selectionMode, (e, newSelectedItems) => {\n setSelected(() => {\n onSelectionChange?.(e as React.SyntheticEvent, { selectedItems: newSelectedItems });\n return newSelectedItems;\n });\n });\n }, [onSelectionChange, selectionMode, setSelected]);\n\n const toggleAllRows: TableSelectionState['toggleAllRows'] = useEventCallback(e => {\n selectionManager.toggleAllItems(\n e,\n items.map((item, i) => getRowId?.(item) ?? i),\n selected,\n );\n });\n\n const toggleRow: TableSelectionState['toggleRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.toggleItem(e, rowId, selected),\n );\n\n const deselectRow: TableSelectionState['deselectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.deselectItem(e, rowId, selected),\n );\n\n const selectRow: TableSelectionState['selectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.selectItem(e, rowId, selected),\n );\n\n const isRowSelected: TableSelectionState['isRowSelected'] = (rowId: RowId) =>\n selectionManager.isSelected(rowId, selected);\n\n return {\n ...tableState,\n selection: {\n selectionMode,\n someRowsSelected: selected.size > 0,\n allRowsSelected: selectionMode === 'single' ? selected.size > 0 : selected.size === items.length,\n selectedRows: selected,\n toggleRow,\n toggleAllRows,\n clearRows: selectionManager.clearItems,\n deselectRow,\n selectRow,\n isRowSelected,\n },\n };\n}\n"]}
|