@fluentui/react-table 9.0.0-rc.4 → 9.0.0
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 +124 -8
- package/CHANGELOG.md +44 -9
- package/dist/index.d.ts +114 -3
- package/lib/TableResizeHandle.js +2 -0
- package/lib/TableResizeHandle.js.map +1 -0
- package/lib/components/DataGrid/DataGrid.types.js.map +1 -1
- package/lib/components/DataGrid/index.js +1 -0
- package/lib/components/DataGrid/index.js.map +1 -1
- package/lib/components/DataGrid/useDataGrid.js +16 -4
- package/lib/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib/components/DataGrid/useDataGridContextValues.js +2 -1
- package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
- package/lib/components/DataGridCell/useDataGridCell.js +5 -0
- package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +3 -0
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +5 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
- package/lib/components/TableCellLayout/useTableCellLayout.js +1 -0
- package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +18 -4
- package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js +3 -1
- package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +3 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -4
- package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib/components/TableResizeHandle/TableResizeHandle.js +14 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js +2 -0
- package/lib/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -0
- package/lib/components/TableResizeHandle/index.js +6 -0
- package/lib/components/TableResizeHandle/index.js.map +1 -0
- package/lib/components/TableResizeHandle/renderTableResizeHandle.js +15 -0
- package/lib/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/useTableResizeHandle.js +28 -0
- package/lib/components/TableResizeHandle/useTableResizeHandle.js.map +1 -0
- package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js +49 -0
- package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +1 -0
- package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/types.js.map +1 -1
- package/lib/hooks/useMeasureElement.js +48 -0
- package/lib/hooks/useMeasureElement.js.map +1 -0
- package/lib/hooks/useTableColumnResizeMouseHandler.js +50 -0
- package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -0
- package/lib/hooks/useTableColumnResizeState.js +112 -0
- package/lib/hooks/useTableColumnResizeState.js.map +1 -0
- package/lib/hooks/useTableColumnSizing.js +77 -0
- package/lib/hooks/useTableColumnSizing.js.map +1 -0
- package/lib/hooks/useTableFeatures.js +10 -2
- package/lib/hooks/useTableFeatures.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/columnResizeUtils.js +158 -0
- package/lib/utils/columnResizeUtils.js.map +1 -0
- package/lib-amd/DataGrid.js +6 -0
- package/lib-amd/DataGrid.js.map +1 -0
- package/lib-amd/DataGridBody.js +6 -0
- package/lib-amd/DataGridBody.js.map +1 -0
- package/lib-amd/DataGridCell.js +6 -0
- package/lib-amd/DataGridCell.js.map +1 -0
- package/lib-amd/DataGridHeader.js +6 -0
- package/lib-amd/DataGridHeader.js.map +1 -0
- package/lib-amd/DataGridHeaderCell.js +6 -0
- package/lib-amd/DataGridHeaderCell.js.map +1 -0
- package/lib-amd/DataGridRow.js +6 -0
- package/lib-amd/DataGridRow.js.map +1 -0
- package/lib-amd/DataGridSelectionCell.js +6 -0
- package/lib-amd/DataGridSelectionCell.js.map +1 -0
- package/lib-amd/Table.js +6 -0
- package/lib-amd/Table.js.map +1 -0
- package/lib-amd/TableBody.js +6 -0
- package/lib-amd/TableBody.js.map +1 -0
- package/lib-amd/TableCell.js +6 -0
- package/lib-amd/TableCell.js.map +1 -0
- package/lib-amd/TableCellActions.js +6 -0
- package/lib-amd/TableCellActions.js.map +1 -0
- package/lib-amd/TableCellLayout.js +6 -0
- package/lib-amd/TableCellLayout.js.map +1 -0
- package/lib-amd/TableHeader.js +6 -0
- package/lib-amd/TableHeader.js.map +1 -0
- package/lib-amd/TableHeaderCell.js +6 -0
- package/lib-amd/TableHeaderCell.js.map +1 -0
- package/lib-amd/TableResizeHandle.js +6 -0
- package/lib-amd/TableResizeHandle.js.map +1 -0
- package/lib-amd/TableRow.js +6 -0
- package/lib-amd/TableRow.js.map +1 -0
- package/lib-amd/TableSelectionCell.js +6 -0
- package/lib-amd/TableSelectionCell.js.map +1 -0
- package/lib-amd/components/DataGrid/DataGrid.js +15 -0
- package/lib-amd/components/DataGrid/DataGrid.js.map +1 -0
- package/lib-amd/components/DataGrid/DataGrid.types.js +5 -0
- package/lib-amd/components/DataGrid/DataGrid.types.js.map +1 -0
- package/lib-amd/components/DataGrid/index.js +11 -0
- package/lib-amd/components/DataGrid/index.js.map +1 -0
- package/lib-amd/components/DataGrid/renderDataGrid.js +13 -0
- package/lib-amd/components/DataGrid/renderDataGrid.js.map +1 -0
- package/lib-amd/components/DataGrid/useDataGrid.js +43 -0
- package/lib-amd/components/DataGrid/useDataGrid.js.map +1 -0
- package/lib-amd/components/DataGrid/useDataGridContextValues.js +11 -0
- package/lib-amd/components/DataGrid/useDataGridContextValues.js.map +1 -0
- package/lib-amd/components/DataGrid/useDataGridStyles.js +18 -0
- package/lib-amd/components/DataGrid/useDataGridStyles.js.map +1 -0
- package/lib-amd/components/DataGridBody/DataGridBody.js +15 -0
- package/lib-amd/components/DataGridBody/DataGridBody.js.map +1 -0
- package/lib-amd/components/DataGridBody/DataGridBody.types.js +5 -0
- package/lib-amd/components/DataGridBody/DataGridBody.types.js.map +1 -0
- package/lib-amd/components/DataGridBody/index.js +10 -0
- package/lib-amd/components/DataGridBody/index.js.map +1 -0
- package/lib-amd/components/DataGridBody/renderDataGridBody.js +14 -0
- package/lib-amd/components/DataGridBody/renderDataGridBody.js.map +1 -0
- package/lib-amd/components/DataGridBody/useDataGridBody.js +24 -0
- package/lib-amd/components/DataGridBody/useDataGridBody.js.map +1 -0
- package/lib-amd/components/DataGridBody/useDataGridBodyStyles.js +18 -0
- package/lib-amd/components/DataGridBody/useDataGridBodyStyles.js.map +1 -0
- package/lib-amd/components/DataGridCell/DataGridCell.js +15 -0
- package/lib-amd/components/DataGridCell/DataGridCell.js.map +1 -0
- package/lib-amd/components/DataGridCell/DataGridCell.types.js +5 -0
- package/lib-amd/components/DataGridCell/DataGridCell.types.js.map +1 -0
- package/lib-amd/components/DataGridCell/index.js +10 -0
- package/lib-amd/components/DataGridCell/index.js.map +1 -0
- package/lib-amd/components/DataGridCell/renderDataGridCell.js +13 -0
- package/lib-amd/components/DataGridCell/renderDataGridCell.js.map +1 -0
- package/lib-amd/components/DataGridCell/useDataGridCell.js +23 -0
- package/lib-amd/components/DataGridCell/useDataGridCell.js.map +1 -0
- package/lib-amd/components/DataGridCell/useDataGridCellStyles.js +18 -0
- package/lib-amd/components/DataGridCell/useDataGridCellStyles.js.map +1 -0
- package/lib-amd/components/DataGridHeader/DataGridHeader.js +15 -0
- package/lib-amd/components/DataGridHeader/DataGridHeader.js.map +1 -0
- package/lib-amd/components/DataGridHeader/DataGridHeader.types.js +5 -0
- package/lib-amd/components/DataGridHeader/DataGridHeader.types.js.map +1 -0
- package/lib-amd/components/DataGridHeader/index.js +10 -0
- package/lib-amd/components/DataGridHeader/index.js.map +1 -0
- package/lib-amd/components/DataGridHeader/renderDataGridHeader.js +13 -0
- package/lib-amd/components/DataGridHeader/renderDataGridHeader.js.map +1 -0
- package/lib-amd/components/DataGridHeader/useDataGridHeader.js +19 -0
- package/lib-amd/components/DataGridHeader/useDataGridHeader.js.map +1 -0
- package/lib-amd/components/DataGridHeader/useDataGridHeaderStyles.js +18 -0
- package/lib-amd/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js +15 -0
- package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.types.js +5 -0
- package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/index.js +10 -0
- package/lib-amd/components/DataGridHeaderCell/index.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/renderDataGridHeaderCell.js +13 -0
- package/lib-amd/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/useDataGridHeaderCell.js +34 -0
- package/lib-amd/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -0
- package/lib-amd/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +30 -0
- package/lib-amd/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -0
- package/lib-amd/components/DataGridRow/DataGridRow.js +15 -0
- package/lib-amd/components/DataGridRow/DataGridRow.js.map +1 -0
- package/lib-amd/components/DataGridRow/DataGridRow.types.js +5 -0
- package/lib-amd/components/DataGridRow/DataGridRow.types.js.map +1 -0
- package/lib-amd/components/DataGridRow/index.js +10 -0
- package/lib-amd/components/DataGridRow/index.js.map +1 -0
- package/lib-amd/components/DataGridRow/renderDataGridRow.js +16 -0
- package/lib-amd/components/DataGridRow/renderDataGridRow.js.map +1 -0
- package/lib-amd/components/DataGridRow/useDataGridRow.js +49 -0
- package/lib-amd/components/DataGridRow/useDataGridRow.js.map +1 -0
- package/lib-amd/components/DataGridRow/useDataGridRowStyles.js +22 -0
- package/lib-amd/components/DataGridRow/useDataGridRowStyles.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js +15 -0
- package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.types.js +5 -0
- package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/index.js +10 -0
- package/lib-amd/components/DataGridSelectionCell/index.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/renderDataGridSelectionCell.js +13 -0
- package/lib-amd/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/useDataGridSelectionCell.js +39 -0
- package/lib-amd/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -0
- package/lib-amd/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +26 -0
- package/lib-amd/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -0
- package/lib-amd/components/Table/Table.js +15 -0
- package/lib-amd/components/Table/Table.js.map +1 -0
- package/lib-amd/components/Table/Table.types.js +5 -0
- package/lib-amd/components/Table/Table.types.js.map +1 -0
- package/lib-amd/components/Table/index.js +10 -0
- package/lib-amd/components/Table/index.js.map +1 -0
- package/lib-amd/components/Table/renderTable.js +15 -0
- package/lib-amd/components/Table/renderTable.js.map +1 -0
- package/lib-amd/components/Table/useTable.js +29 -0
- package/lib-amd/components/Table/useTable.js.map +1 -0
- package/lib-amd/components/Table/useTableContextValues.js +18 -0
- package/lib-amd/components/Table/useTableContextValues.js.map +1 -0
- package/lib-amd/components/Table/useTableStyles.js +45 -0
- package/lib-amd/components/Table/useTableStyles.js.map +1 -0
- package/lib-amd/components/TableBody/TableBody.js +15 -0
- package/lib-amd/components/TableBody/TableBody.js.map +1 -0
- package/lib-amd/components/TableBody/TableBody.types.js +5 -0
- package/lib-amd/components/TableBody/TableBody.types.js.map +1 -0
- package/lib-amd/components/TableBody/index.js +10 -0
- package/lib-amd/components/TableBody/index.js.map +1 -0
- package/lib-amd/components/TableBody/renderTableBody.js +14 -0
- package/lib-amd/components/TableBody/renderTableBody.js.map +1 -0
- package/lib-amd/components/TableBody/useTableBody.js +28 -0
- package/lib-amd/components/TableBody/useTableBody.js.map +1 -0
- package/lib-amd/components/TableBody/useTableBodyStyles.js +32 -0
- package/lib-amd/components/TableBody/useTableBodyStyles.js.map +1 -0
- package/lib-amd/components/TableCell/TableCell.js +15 -0
- package/lib-amd/components/TableCell/TableCell.js.map +1 -0
- package/lib-amd/components/TableCell/TableCell.types.js +5 -0
- package/lib-amd/components/TableCell/TableCell.types.js.map +1 -0
- package/lib-amd/components/TableCell/index.js +10 -0
- package/lib-amd/components/TableCell/index.js.map +1 -0
- package/lib-amd/components/TableCell/renderTableCell.js +14 -0
- package/lib-amd/components/TableCell/renderTableCell.js.map +1 -0
- package/lib-amd/components/TableCell/useTableCell.js +29 -0
- package/lib-amd/components/TableCell/useTableCell.js.map +1 -0
- package/lib-amd/components/TableCell/useTableCellStyles.js +56 -0
- package/lib-amd/components/TableCell/useTableCellStyles.js.map +1 -0
- package/lib-amd/components/TableCellActions/TableCellActions.js +15 -0
- package/lib-amd/components/TableCellActions/TableCellActions.js.map +1 -0
- package/lib-amd/components/TableCellActions/TableCellActions.types.js +5 -0
- package/lib-amd/components/TableCellActions/TableCellActions.types.js.map +1 -0
- package/lib-amd/components/TableCellActions/index.js +10 -0
- package/lib-amd/components/TableCellActions/index.js.map +1 -0
- package/lib-amd/components/TableCellActions/renderTableCellActions.js +14 -0
- package/lib-amd/components/TableCellActions/renderTableCellActions.js.map +1 -0
- package/lib-amd/components/TableCellActions/useTableCellActions.js +26 -0
- package/lib-amd/components/TableCellActions/useTableCellActions.js.map +1 -0
- package/lib-amd/components/TableCellActions/useTableCellActionsStyles.js +35 -0
- package/lib-amd/components/TableCellActions/useTableCellActionsStyles.js.map +1 -0
- package/lib-amd/components/TableCellLayout/TableCellLayout.js +15 -0
- package/lib-amd/components/TableCellLayout/TableCellLayout.js.map +1 -0
- package/lib-amd/components/TableCellLayout/TableCellLayout.types.js +5 -0
- package/lib-amd/components/TableCellLayout/TableCellLayout.types.js.map +1 -0
- package/lib-amd/components/TableCellLayout/index.js +10 -0
- package/lib-amd/components/TableCellLayout/index.js.map +1 -0
- package/lib-amd/components/TableCellLayout/renderTableCellLayout.js +19 -0
- package/lib-amd/components/TableCellLayout/renderTableCellLayout.js.map +1 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayout.js +42 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayout.js.map +1 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayoutContextValues.js +16 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayoutStyles.js +79 -0
- package/lib-amd/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -0
- package/lib-amd/components/TableHeader/TableHeader.js +15 -0
- package/lib-amd/components/TableHeader/TableHeader.js.map +1 -0
- package/lib-amd/components/TableHeader/TableHeader.types.js +5 -0
- package/lib-amd/components/TableHeader/TableHeader.types.js.map +1 -0
- package/lib-amd/components/TableHeader/index.js +10 -0
- package/lib-amd/components/TableHeader/index.js.map +1 -0
- package/lib-amd/components/TableHeader/renderTableHeader.js +15 -0
- package/lib-amd/components/TableHeader/renderTableHeader.js.map +1 -0
- package/lib-amd/components/TableHeader/useTableHeader.js +28 -0
- package/lib-amd/components/TableHeader/useTableHeader.js.map +1 -0
- package/lib-amd/components/TableHeader/useTableHeaderStyles.js +32 -0
- package/lib-amd/components/TableHeader/useTableHeaderStyles.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/TableHeaderCell.js +15 -0
- package/lib-amd/components/TableHeaderCell/TableHeaderCell.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/TableHeaderCell.types.js +5 -0
- package/lib-amd/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/index.js +10 -0
- package/lib-amd/components/TableHeaderCell/index.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/renderTableHeaderCell.js +18 -0
- package/lib-amd/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/useTableHeaderCell.js +48 -0
- package/lib-amd/components/TableHeaderCell/useTableHeaderCell.js.map +1 -0
- package/lib-amd/components/TableHeaderCell/useTableHeaderCellStyles.js +67 -0
- package/lib-amd/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/TableResizeHandle.js +15 -0
- package/lib-amd/components/TableResizeHandle/TableResizeHandle.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/TableResizeHandle.types.js +5 -0
- package/lib-amd/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/index.js +10 -0
- package/lib-amd/components/TableResizeHandle/index.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/renderTableResizeHandle.js +14 -0
- package/lib-amd/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/useTableResizeHandle.js +29 -0
- package/lib-amd/components/TableResizeHandle/useTableResizeHandle.js.map +1 -0
- package/lib-amd/components/TableResizeHandle/useTableResizeHandleStyles.js +37 -0
- package/lib-amd/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -0
- package/lib-amd/components/TableRow/TableRow.js +15 -0
- package/lib-amd/components/TableRow/TableRow.js.map +1 -0
- package/lib-amd/components/TableRow/TableRow.types.js +5 -0
- package/lib-amd/components/TableRow/TableRow.types.js.map +1 -0
- package/lib-amd/components/TableRow/index.js +10 -0
- package/lib-amd/components/TableRow/index.js.map +1 -0
- package/lib-amd/components/TableRow/renderTableRow.js +14 -0
- package/lib-amd/components/TableRow/renderTableRow.js.map +1 -0
- package/lib-amd/components/TableRow/useTableRow.js +34 -0
- package/lib-amd/components/TableRow/useTableRow.js.map +1 -0
- package/lib-amd/components/TableRow/useTableRowStyles.js +98 -0
- package/lib-amd/components/TableRow/useTableRowStyles.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/TableSelectionCell.js +15 -0
- package/lib-amd/components/TableSelectionCell/TableSelectionCell.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/TableSelectionCell.types.js +5 -0
- package/lib-amd/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/index.js +10 -0
- package/lib-amd/components/TableSelectionCell/index.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/renderTableSelectionCell.js +16 -0
- package/lib-amd/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/useTableSelectionCell.js +28 -0
- package/lib-amd/components/TableSelectionCell/useTableSelectionCell.js.map +1 -0
- package/lib-amd/components/TableSelectionCell/useTableSelectionCellStyles.js +58 -0
- package/lib-amd/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -0
- package/lib-amd/contexts/columnIdContext.js +11 -0
- package/lib-amd/contexts/columnIdContext.js.map +1 -0
- package/lib-amd/contexts/dataGridContext.js +16 -0
- package/lib-amd/contexts/dataGridContext.js.map +1 -0
- package/lib-amd/contexts/rowIdContext.js +11 -0
- package/lib-amd/contexts/rowIdContext.js.map +1 -0
- package/lib-amd/contexts/tableContext.js +15 -0
- package/lib-amd/contexts/tableContext.js.map +1 -0
- package/lib-amd/contexts/tableHeaderContext.js +11 -0
- package/lib-amd/contexts/tableHeaderContext.js.map +1 -0
- package/lib-amd/hooks/createColumn.js +36 -0
- package/lib-amd/hooks/createColumn.js.map +1 -0
- package/lib-amd/hooks/index.js +11 -0
- package/lib-amd/hooks/index.js.map +1 -0
- package/lib-amd/hooks/selectionManager.js +82 -0
- package/lib-amd/hooks/selectionManager.js.map +1 -0
- package/lib-amd/hooks/types.js +5 -0
- package/lib-amd/hooks/types.js.map +1 -0
- package/lib-amd/hooks/useMeasureElement.js +46 -0
- package/lib-amd/hooks/useMeasureElement.js.map +1 -0
- package/lib-amd/hooks/useTableColumnResizeMouseHandler.js +50 -0
- package/lib-amd/hooks/useTableColumnResizeMouseHandler.js.map +1 -0
- package/lib-amd/hooks/useTableColumnResizeState.js +73 -0
- package/lib-amd/hooks/useTableColumnResizeState.js.map +1 -0
- package/lib-amd/hooks/useTableColumnSizing.js +56 -0
- package/lib-amd/hooks/useTableColumnSizing.js.map +1 -0
- package/lib-amd/hooks/useTableFeatures.js +39 -0
- package/lib-amd/hooks/useTableFeatures.js.map +1 -0
- package/lib-amd/hooks/useTableSelection.js +70 -0
- package/lib-amd/hooks/useTableSelection.js.map +1 -0
- package/lib-amd/hooks/useTableSort.js +74 -0
- package/lib-amd/hooks/useTableSort.js.map +1 -0
- package/lib-amd/index.js +107 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/utils/columnResizeUtils.js +158 -0
- package/lib-amd/utils/columnResizeUtils.js.map +1 -0
- package/lib-commonjs/TableResizeHandle.js +8 -0
- package/lib-commonjs/TableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/DataGrid/index.js +1 -0
- package/lib-commonjs/components/DataGrid/index.js.map +1 -1
- package/lib-commonjs/components/DataGrid/useDataGrid.js +15 -3
- package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +2 -1
- package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js +5 -0
- package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +3 -0
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +5 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +1 -0
- package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +18 -4
- package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +3 -1
- package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +3 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +10 -4
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js +20 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js +6 -0
- package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/index.js +12 -0
- package/lib-commonjs/components/TableResizeHandle/index.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js +22 -0
- package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js +35 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js.map +1 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js +56 -0
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -0
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +2 -1
- package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
- package/lib-commonjs/hooks/index.js +1 -0
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useMeasureElement.js +55 -0
- package/lib-commonjs/hooks/useMeasureElement.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js +57 -0
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnResizeState.js +119 -0
- package/lib-commonjs/hooks/useTableColumnResizeState.js.map +1 -0
- package/lib-commonjs/hooks/useTableColumnSizing.js +84 -0
- package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -0
- package/lib-commonjs/hooks/useTableFeatures.js +10 -2
- package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
- package/lib-commonjs/index.js +46 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/columnResizeUtils.js +172 -0
- package/lib-commonjs/utils/columnResizeUtils.js.map +1 -0
- package/package.json +10 -11
|
@@ -27,10 +27,16 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
27
27
|
Bnnss6s: "f1neuvcm",
|
|
28
28
|
xawz: "fkjuxzh"
|
|
29
29
|
},
|
|
30
|
+
rootTruncate: {
|
|
31
|
+
B68tc82: "f1p9o1ba"
|
|
32
|
+
},
|
|
30
33
|
content: {
|
|
31
34
|
mc9l5x: "f22iagw",
|
|
32
35
|
Beiy3e4: "f1vx9l62"
|
|
33
36
|
},
|
|
37
|
+
contentTruncate: {
|
|
38
|
+
B68tc82: "f1p9o1ba"
|
|
39
|
+
},
|
|
34
40
|
media: {
|
|
35
41
|
mc9l5x: "f22iagw",
|
|
36
42
|
Bt984gj: "f122n59"
|
|
@@ -47,6 +53,11 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
47
53
|
mainPrimary: {
|
|
48
54
|
Bhrd7zp: "fl43uef"
|
|
49
55
|
},
|
|
56
|
+
mainTruncate: {
|
|
57
|
+
B68tc82: "f1p9o1ba",
|
|
58
|
+
Huce71: "fz5stix",
|
|
59
|
+
ygn44y: "f1cmbuwj"
|
|
60
|
+
},
|
|
50
61
|
description: {
|
|
51
62
|
sj55zd: "fkfq4zb",
|
|
52
63
|
Bahqtrf: "fk6fouc",
|
|
@@ -55,14 +66,17 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
55
66
|
Bg96gwp: "fwrc4pm"
|
|
56
67
|
}
|
|
57
68
|
}, {
|
|
58
|
-
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".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;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}"]
|
|
69
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fsnqrgy{-webkit-column-gap:var(--spacingHorizontalS);column-gap:var(--spacingHorizontalS);}", ".fylz90v{row-gap:var(--spacingHorizontalS);}", ".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;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fz5stix{white-space:nowrap;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}"]
|
|
59
70
|
});
|
|
60
71
|
/**
|
|
61
72
|
* Apply styling to the TableCellLayout slots based on the state
|
|
62
73
|
*/
|
|
63
74
|
const useTableCellLayoutStyles_unstable = state => {
|
|
64
75
|
const styles = useStyles();
|
|
65
|
-
|
|
76
|
+
const {
|
|
77
|
+
truncate
|
|
78
|
+
} = state;
|
|
79
|
+
state.root.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.root, styles.root, truncate && styles.rootTruncate, state.root.className);
|
|
66
80
|
const primary = state.appearance === 'primary';
|
|
67
81
|
if (state.media) {
|
|
68
82
|
const mediaSizedStyles = {
|
|
@@ -73,13 +87,13 @@ const useTableCellLayoutStyles_unstable = state => {
|
|
|
73
87
|
state.media.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.media, styles.media, mediaSizedStyles[state.size], primary && styles.mediaPrimary, state.media.className);
|
|
74
88
|
}
|
|
75
89
|
if (state.main) {
|
|
76
|
-
state.main.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.main, primary && styles.mainPrimary, state.main.className);
|
|
90
|
+
state.main.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.main, truncate && styles.mainTruncate, primary && styles.mainPrimary, state.main.className);
|
|
77
91
|
}
|
|
78
92
|
if (state.description) {
|
|
79
93
|
state.description.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.description, styles.description, state.description.className);
|
|
80
94
|
}
|
|
81
95
|
if (state.content) {
|
|
82
|
-
state.content.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.content, styles.content, state.content.className);
|
|
96
|
+
state.content.className = react_1.mergeClasses(exports.tableCellLayoutClassNames.content, styles.content, truncate && styles.contentTruncate, state.content.className);
|
|
83
97
|
}
|
|
84
98
|
return state;
|
|
85
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;AAEaA,iCAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,KAAK,EAAE,4BAA4B;EACnCC,IAAI,EAAE,2BAA2B;EACjCC,WAAW,EAAE,kCAAkC;EAC/CC,OAAO,EAAE;CACV;AAED;;;AAGA,MAAMC,SAAS,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;AAEaA,iCAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,KAAK,EAAE,4BAA4B;EACnCC,IAAI,EAAE,2BAA2B;EACjCC,WAAW,EAAE,kCAAkC;EAC/CC,OAAO,EAAE;CACV;AAED;;;AAGA,MAAMC,SAAS,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAoD1B;AAEF;;;AAGO,MAAMC,iCAAiC,GAAIC,KAA2B,IAA0B;EACrG,MAAMC,MAAM,GAAGJ,SAAS,EAAE;EAC1B,MAAM;IAAEK;EAAQ,CAAE,GAAGF,KAAK;EAE1BA,KAAK,CAACR,IAAI,CAACW,SAAS,GAAGL,oBAAY,CACjCP,iCAAyB,CAACC,IAAI,EAC9BS,MAAM,CAACT,IAAI,EACXU,QAAQ,IAAID,MAAM,CAACG,YAAY,EAC/BJ,KAAK,CAACR,IAAI,CAACW,SAAS,CACrB;EACD,MAAME,OAAO,GAAGL,KAAK,CAACM,UAAU,KAAK,SAAS;EAE9C,IAAIN,KAAK,CAACP,KAAK,EAAE;IACf,MAAMc,gBAAgB,GAAG;MACvBC,KAAK,EAAEP,MAAM,CAACQ,mBAAmB;MACjCC,MAAM,EAAET,MAAM,CAACQ,mBAAmB;MAClC,aAAa,EAAER,MAAM,CAACU;KACvB;IAEDX,KAAK,CAACP,KAAK,CAACU,SAAS,GAAGL,oBAAY,CAClCP,iCAAyB,CAACE,KAAK,EAC/BQ,MAAM,CAACR,KAAK,EACZc,gBAAgB,CAACP,KAAK,CAACY,IAAI,CAAC,EAC5BP,OAAO,IAAIJ,MAAM,CAACY,YAAY,EAC9Bb,KAAK,CAACP,KAAK,CAACU,SAAS,CACtB;;EAGH,IAAIH,KAAK,CAACN,IAAI,EAAE;IACdM,KAAK,CAACN,IAAI,CAACS,SAAS,GAAGL,oBAAY,CACjCP,iCAAyB,CAACG,IAAI,EAC9BQ,QAAQ,IAAID,MAAM,CAACa,YAAY,EAC/BT,OAAO,IAAIJ,MAAM,CAACc,WAAW,EAC7Bf,KAAK,CAACN,IAAI,CAACS,SAAS,CACrB;;EAGH,IAAIH,KAAK,CAACL,WAAW,EAAE;IACrBK,KAAK,CAACL,WAAW,CAACQ,SAAS,GAAGL,oBAAY,CACxCP,iCAAyB,CAACI,WAAW,EACrCM,MAAM,CAACN,WAAW,EAClBK,KAAK,CAACL,WAAW,CAACQ,SAAS,CAC5B;;EAGH,IAAIH,KAAK,CAACJ,OAAO,EAAE;IACjBI,KAAK,CAACJ,OAAO,CAACO,SAAS,GAAGL,oBAAY,CACpCP,iCAAyB,CAACK,OAAO,EACjCK,MAAM,CAACL,OAAO,EACdM,QAAQ,IAAID,MAAM,CAACe,eAAe,EAClChB,KAAK,CAACJ,OAAO,CAACO,SAAS,CACxB;;EAGH,OAAOH,KAAK;AACd,CAAC;AAvDYT,yCAAiC","names":["exports","root","media","main","description","content","useStyles","react_1","useTableCellLayoutStyles_unstable","state","styles","truncate","className","rootTruncate","primary","appearance","mediaSizedStyles","small","mediaSmallAndMedium","medium","mediaExtraSmall","size","mediaPrimary","mainTruncate","mainPrimary","contentTruncate"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableCellLayout/useTableCellLayoutStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableCellLayoutSlots, TableCellLayoutState } from './TableCellLayout.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tableCellLayoutClassNames: SlotClassNames<TableCellLayoutSlots> = {\n root: 'fui-TableCellLayout',\n media: 'fui-TableCellLayout__media',\n main: 'fui-TableCellLayout__main',\n description: 'fui-TableCellLayout__description',\n content: 'fui-TableCellLayout__content',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalS),\n ...shorthands.flex(1, 1, '0px'),\n },\n\n rootTruncate: {\n overflowX: 'hidden',\n },\n\n content: {\n display: 'flex',\n flexDirection: 'column',\n },\n\n contentTruncate: {\n overflowX: 'hidden',\n },\n\n media: {\n display: 'flex',\n alignItems: 'center',\n },\n\n mediaExtraSmall: {\n fontSize: '16px',\n },\n\n mediaSmallAndMedium: {\n fontSize: '20px',\n },\n\n mediaPrimary: {\n fontSize: '24px',\n },\n\n mainPrimary: {\n fontWeight: tokens.fontWeightSemibold,\n },\n\n mainTruncate: {\n overflowX: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n\n description: {\n color: tokens.colorNeutralForeground2,\n ...typographyStyles.caption1,\n },\n});\n\n/**\n * Apply styling to the TableCellLayout slots based on the state\n */\nexport const useTableCellLayoutStyles_unstable = (state: TableCellLayoutState): TableCellLayoutState => {\n const styles = useStyles();\n const { truncate } = state;\n\n state.root.className = mergeClasses(\n tableCellLayoutClassNames.root,\n styles.root,\n truncate && styles.rootTruncate,\n state.root.className,\n );\n const primary = state.appearance === 'primary';\n\n if (state.media) {\n const mediaSizedStyles = {\n small: styles.mediaSmallAndMedium,\n medium: styles.mediaSmallAndMedium,\n 'extra-small': styles.mediaExtraSmall,\n };\n\n state.media.className = mergeClasses(\n tableCellLayoutClassNames.media,\n styles.media,\n mediaSizedStyles[state.size],\n primary && styles.mediaPrimary,\n state.media.className,\n );\n }\n\n if (state.main) {\n state.main.className = mergeClasses(\n tableCellLayoutClassNames.main,\n truncate && styles.mainTruncate,\n primary && styles.mainPrimary,\n state.main.className,\n );\n }\n\n if (state.description) {\n state.description.className = mergeClasses(\n tableCellLayoutClassNames.description,\n styles.description,\n state.description.className,\n );\n }\n\n if (state.content) {\n state.content.className = mergeClasses(\n tableCellLayoutClassNames.content,\n styles.content,\n truncate && styles.contentTruncate,\n state.content.className,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -20,7 +20,9 @@ const renderTableHeaderCell_unstable = state => {
|
|
|
20
20
|
...slotProps.button
|
|
21
21
|
}, slotProps.root.children, slots.sortIcon && React.createElement(slots.sortIcon, {
|
|
22
22
|
...slotProps.sortIcon
|
|
23
|
-
}))
|
|
23
|
+
})), slots.aside && React.createElement(slots.aside, {
|
|
24
|
+
...slotProps.aside
|
|
25
|
+
}));
|
|
24
26
|
};
|
|
25
27
|
exports.renderTableHeaderCell_unstable = renderTableHeaderCell_unstable;
|
|
26
28
|
//# sourceMappingURL=renderTableHeaderCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,8BAA8B,GAAIC,KAA2B,IAAI;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAuBH,KAAK,CAAC;EAElE,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BD,oBAACH,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,GAC/BJ,SAAS,CAACG,IAAI,CAACE,QAAQ,EACvBN,KAAK,CAACO,QAAQ,IAAIJ,oBAACH,KAAK,CAACO,QAAQ;IAAA,GAAKN,SAAS,CAACM;EAAQ,EAAI,CAChD,
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,8BAA8B,GAAIC,KAA2B,IAAI;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAuBH,KAAK,CAAC;EAElE,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BD,oBAACH,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,GAC/BJ,SAAS,CAACG,IAAI,CAACE,QAAQ,EACvBN,KAAK,CAACO,QAAQ,IAAIJ,oBAACH,KAAK,CAACO,QAAQ;IAAA,GAAKN,SAAS,CAACM;EAAQ,EAAI,CAChD,EACdP,KAAK,CAACQ,KAAK,IAAIL,oBAACH,KAAK,CAACQ,KAAK;IAAA,GAAKP,SAAS,CAACO;EAAK,EAAI,CACzC;AAEjB,CAAC;AAZYC,sCAA8B","names":["renderTableHeaderCell_unstable","state","slots","slotProps","react_utilities_1","React","root","button","children","sortIcon","aside","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/renderTableHeaderCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableHeaderCellState, TableHeaderCellSlots } from './TableHeaderCell.types';\n\n/**\n * Render the final JSX of TableHeaderCell\n */\nexport const renderTableHeaderCell_unstable = (state: TableHeaderCellState) => {\n const { slots, slotProps } = getSlots<TableHeaderCellSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button}>\n {slotProps.root.children}\n {slots.sortIcon && <slots.sortIcon {...slotProps.sortIcon} />}\n </slots.button>\n {slots.aside && <slots.aside {...slotProps.aside} />}\n </slots.root>\n );\n};\n"]}
|
|
@@ -38,7 +38,8 @@ const useTableHeaderCell_unstable = (props, ref) => {
|
|
|
38
38
|
components: {
|
|
39
39
|
root: rootComponent,
|
|
40
40
|
button: 'button',
|
|
41
|
-
sortIcon: 'span'
|
|
41
|
+
sortIcon: 'span',
|
|
42
|
+
aside: 'span'
|
|
42
43
|
},
|
|
43
44
|
root: react_utilities_1.getNativeElementProps(rootComponent, {
|
|
44
45
|
ref: react_utilities_1.useMergedRefs(ref, react_tabster_1.useFocusWithin()),
|
|
@@ -46,6 +47,7 @@ const useTableHeaderCell_unstable = (props, ref) => {
|
|
|
46
47
|
'aria-sort': sortable ? (_b = props.sortDirection) !== null && _b !== void 0 ? _b : 'none' : undefined,
|
|
47
48
|
...props
|
|
48
49
|
}),
|
|
50
|
+
aside: react_utilities_1.resolveShorthand(props.aside),
|
|
49
51
|
sortIcon: react_utilities_1.resolveShorthand(props.sortIcon, {
|
|
50
52
|
required: !!props.sortDirection,
|
|
51
53
|
defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,MAAMA,SAAS,GAAG;EAChBC,SAAS,eAAEC,oBAACC,4BAAc;IAACC,QAAQ,EAAE;EAAE,EAAI;EAC3CC,UAAU,eAAEH,oBAACC,8BAAgB;IAACC,QAAQ,EAAE;EAAE;CAC3C;AAED;;;;;;;;;AASO,MAAME,2BAA2B,GAAG,CACzCC,KAA2B,EAC3BC,GAA2B,KACH;;EACxB,MAAM;IAAEC,gBAAgB;IAAEC;EAAQ,CAAE,GAAGC,8BAAe,EAAE;EAExD,MAAMC,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIJ,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,OAAO;IACLK,UAAU,EAAE;MACVC,IAAI,EAAEH,aAAa;MACnBI,MAAM,EAAE,QAAQ;MAChBC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,MAAMA,SAAS,GAAG;EAChBC,SAAS,eAAEC,oBAACC,4BAAc;IAACC,QAAQ,EAAE;EAAE,EAAI;EAC3CC,UAAU,eAAEH,oBAACC,8BAAgB;IAACC,QAAQ,EAAE;EAAE;CAC3C;AAED;;;;;;;;;AASO,MAAME,2BAA2B,GAAG,CACzCC,KAA2B,EAC3BC,GAA2B,KACH;;EACxB,MAAM;IAAEC,gBAAgB;IAAEC;EAAQ,CAAE,GAAGC,8BAAe,EAAE;EAExD,MAAMC,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIJ,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,OAAO;IACLK,UAAU,EAAE;MACVC,IAAI,EAAEH,aAAa;MACnBI,MAAM,EAAE,QAAQ;MAChBC,QAAQ,EAAE,MAAM;MAChBC,KAAK,EAAE;KACR;IACDH,IAAI,EAAEI,uCAAqB,CAACP,aAAa,EAAE;MACzCJ,GAAG,EAAEW,+BAAa,CAACX,GAAG,EAAEY,8BAAc,EAAE,CAAC;MACzCC,IAAI,EAAET,aAAa,KAAK,KAAK,GAAG,cAAc,GAAGU,SAAS;MAC1D,WAAW,EAAEZ,QAAQ,GAAG,WAAK,CAACa,aAAa,mCAAI,MAAM,GAAGD,SAAS;MACjE,GAAGf;KACJ,CAAC;IACFW,KAAK,EAAEC,kCAAgB,CAACZ,KAAK,CAACW,KAAK,CAAC;IACpCD,QAAQ,EAAEE,kCAAgB,CAACZ,KAAK,CAACU,QAAQ,EAAE;MACzCO,QAAQ,EAAE,CAAC,CAACjB,KAAK,CAACgB,aAAa;MAC/BE,YAAY,EAAE;QAAEC,QAAQ,EAAEnB,KAAK,CAACgB,aAAa,GAAGvB,SAAS,CAACO,KAAK,CAACgB,aAAa,CAAC,GAAGD;MAAS;KAC3F,CAAC;IACFN,MAAM,EAAEW,mCAAsB,CAACpB,KAAK,CAACS,MAAM,EAAE;MAC3CQ,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZJ,IAAI,EAAE,cAAc;QACpBO,QAAQ,EAAE,CAAC,CAAC;QACZC,IAAI,EAAE,QAAQ;QACd,IAAInB,QAAQ,IAAI;UACdW,IAAI,EAAEC,SAAS;UACfM,QAAQ,EAAEN;SACX;;KAEJ,CAAC;IACFZ,QAAQ;IACRD;GACD;AACH,CAAC;AAxCYqB,mCAA2B","names":["sortIcons","ascending","React","react_icons_1","fontSize","descending","useTableHeaderCell_unstable","props","ref","noNativeElements","sortable","tableContext_1","rootComponent","as","components","root","button","sortIcon","aside","react_utilities_1","react_tabster_1","role","undefined","sortDirection","required","defaultProps","children","react_aria_1","tabIndex","type","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { ArrowUpRegular, ArrowDownRegular } from '@fluentui/react-icons';\nimport type { TableHeaderCellProps, TableHeaderCellState } from './TableHeaderCell.types';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\n\nconst sortIcons = {\n ascending: <ArrowUpRegular fontSize={12} />,\n descending: <ArrowDownRegular fontSize={12} />,\n};\n\n/**\n * Create the state required to render TableHeaderCell.\n *\n * The returned state can be modified with hooks such as useTableHeaderCellStyles_unstable,\n * before being passed to renderTableHeaderCell_unstable.\n *\n * @param props - props from this instance of TableHeaderCell\n * @param ref - reference to root HTMLElement of TableHeaderCell\n */\nexport const useTableHeaderCell_unstable = (\n props: TableHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): TableHeaderCellState => {\n const { noNativeElements, sortable } = useTableContext();\n\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'th';\n return {\n components: {\n root: rootComponent,\n button: 'button',\n sortIcon: 'span',\n aside: 'span',\n },\n root: getNativeElementProps(rootComponent, {\n ref: useMergedRefs(ref, useFocusWithin()),\n role: rootComponent === 'div' ? 'columnheader' : undefined,\n 'aria-sort': sortable ? props.sortDirection ?? 'none' : undefined,\n ...props,\n }),\n aside: resolveShorthand(props.aside),\n sortIcon: resolveShorthand(props.sortIcon, {\n required: !!props.sortDirection,\n defaultProps: { children: props.sortDirection ? sortIcons[props.sortDirection] : undefined },\n }),\n button: useARIAButtonShorthand(props.button, {\n required: true,\n defaultProps: {\n role: 'presentation',\n tabIndex: -1,\n type: 'button',\n ...(sortable && {\n role: undefined,\n tabIndex: undefined,\n }),\n },\n }),\n sortable,\n noNativeElements,\n };\n};\n"]}
|
|
@@ -11,7 +11,8 @@ exports.tableHeaderCellClassName = 'fui-TableHeaderCell';
|
|
|
11
11
|
exports.tableHeaderCellClassNames = {
|
|
12
12
|
root: 'fui-TableHeaderCell',
|
|
13
13
|
button: 'fui-TableHeaderCell__button',
|
|
14
|
-
sortIcon: 'fui-TableHeaderCell__sortIcon'
|
|
14
|
+
sortIcon: 'fui-TableHeaderCell__sortIcon',
|
|
15
|
+
aside: 'fui-TableHeaderCell__aside'
|
|
15
16
|
};
|
|
16
17
|
const useTableLayoutStyles = /*#__PURE__*/react_1.__styles({
|
|
17
18
|
root: {
|
|
@@ -47,7 +48,8 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
47
48
|
pehzd3: ["fs9qmxf", "f187m4uq"],
|
|
48
49
|
B8osjzx: ["f187m4uq", "fs9qmxf"],
|
|
49
50
|
u7xebq: ["f145mzao", "f1uha7eq"],
|
|
50
|
-
Blsv9te: ["f1uha7eq", "f145mzao"]
|
|
51
|
+
Blsv9te: ["f1uha7eq", "f145mzao"],
|
|
52
|
+
qhf8xq: "f10pi13n"
|
|
51
53
|
},
|
|
52
54
|
rootInteractive: {
|
|
53
55
|
Jwef8y: "f1t94bn6",
|
|
@@ -95,9 +97,10 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
95
97
|
mc9l5x: "f22iagw",
|
|
96
98
|
Bt984gj: "f122n59",
|
|
97
99
|
z8tnut: "fclwglc"
|
|
98
|
-
}
|
|
100
|
+
},
|
|
101
|
+
resizeHandle: {}
|
|
99
102
|
}, {
|
|
100
|
-
d: [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fhix6mv[data-fui-focus-within]:focus-within{outline-width:2px;}", ".fha7anx[data-fui-focus-within]:focus-within{outline-style:solid;}", ".f1fmzww4[data-fui-focus-within]:focus-within{outline-color:var(--colorStrokeFocus2);}", ".fs9qmxf[data-fui-focus-within]:focus-within{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f187m4uq[data-fui-focus-within]:focus-within{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f145mzao[data-fui-focus-within]:focus-within{border-top-right-radius:var(--borderRadiusMedium);}", ".f1uha7eq[data-fui-focus-within]:focus-within{border-top-left-radius:var(--borderRadiusMedium);}", ".fq6nmtn{resize:horizontal;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".
|
|
103
|
+
d: [".f1nbblvp{padding-top:0px;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1ov4xf1{padding-bottom:0px;}", ".fhix6mv[data-fui-focus-within]:focus-within{outline-width:2px;}", ".fha7anx[data-fui-focus-within]:focus-within{outline-style:solid;}", ".f1fmzww4[data-fui-focus-within]:focus-within{outline-color:var(--colorStrokeFocus2);}", ".fs9qmxf[data-fui-focus-within]:focus-within{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f187m4uq[data-fui-focus-within]:focus-within{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f145mzao[data-fui-focus-within]:focus-within{border-top-right-radius:var(--borderRadiusMedium);}", ".f1uha7eq[data-fui-focus-within]:focus-within{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".fq6nmtn{resize:horizontal;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".fly5x3f{width:100%;}", ".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;}", ".f1l02sjl{height:100%;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f1ufnopg{-webkit-column-gap:var(--spacingHorizontalXS);column-gap:var(--spacingHorizontalXS);}", ".f14sijuj{row-gap:var(--spacingHorizontalXS);}", ".f1nxs5xn{min-height:32px;}", ".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;}", ".f1s6fcnf{outline-style:none;}", ".f1k6fduh{cursor:pointer;}", ".fclwglc{padding-top:var(--spacingVerticalXXS);}"],
|
|
101
104
|
h: [".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}"],
|
|
102
105
|
a: [".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}"]
|
|
103
106
|
});
|
|
@@ -115,6 +118,9 @@ const useTableHeaderCellStyles_unstable = state => {
|
|
|
115
118
|
if (state.sortIcon) {
|
|
116
119
|
state.sortIcon.className = react_1.mergeClasses(exports.tableHeaderCellClassNames.sortIcon, styles.sortIcon, state.sortIcon.className);
|
|
117
120
|
}
|
|
121
|
+
if (state.aside) {
|
|
122
|
+
state.aside.className = react_1.mergeClasses(exports.tableHeaderCellClassNames.aside, styles.resizeHandle, state.aside.className);
|
|
123
|
+
}
|
|
118
124
|
return state;
|
|
119
125
|
};
|
|
120
126
|
exports.useTableHeaderCellStyles_unstable = useTableHeaderCellStyles_unstable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AAGaA,gCAAwB,GAAG,qBAAqB;AAChDA,iCAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,MAAM,EAAE,6BAA6B;EACrCC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AAGaA,gCAAwB,GAAG,qBAAqB;AAChDA,iCAAyB,GAAyC;EAC7EC,IAAI,EAAE,qBAAqB;EAC3BC,MAAM,EAAE,6BAA6B;EACrCC,QAAQ,EAAE,+BAA+B;EACzCC,KAAK,EAAE;CACR;AAED,MAAMC,oBAAoB,gBAAGC,gBAAU;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAKrC;AAEF,MAAMC,mBAAmB,gBAAGD,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAMpC;AAEF;;;AAGA,MAAME,SAAS,gBAAGF,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EA6D1B;AAEF;;;AAGO,MAAMG,iCAAiC,GAAIC,KAA2B,IAA0B;EACrG,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAER,oBAAoB,EAAE;IAC7BS,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACT,IAAI,CAACc,SAAS,GAAGT,oBAAY,CACjCN,iCAAyB,CAACC,IAAI,EAC9BU,MAAM,CAACV,IAAI,EACXS,KAAK,CAACM,QAAQ,IAAIL,MAAM,CAACM,eAAe,EACxCP,KAAK,CAACQ,gBAAgB,GAAGN,YAAY,CAACE,IAAI,CAACb,IAAI,GAAGW,YAAY,CAACC,KAAK,CAACZ,IAAI,EACzES,KAAK,CAACT,IAAI,CAACc,SAAS,CACrB;EACDL,KAAK,CAACR,MAAM,CAACa,SAAS,GAAGT,oBAAY,CACnCN,iCAAyB,CAACE,MAAM,EAChCS,MAAM,CAACQ,WAAW,EAClBR,MAAM,CAACT,MAAM,EACbQ,KAAK,CAACM,QAAQ,IAAIL,MAAM,CAACK,QAAQ,EACjCN,KAAK,CAACR,MAAM,CAACa,SAAS,CACvB;EAED,IAAIL,KAAK,CAACP,QAAQ,EAAE;IAClBO,KAAK,CAACP,QAAQ,CAACY,SAAS,GAAGT,oBAAY,CACrCN,iCAAyB,CAACG,QAAQ,EAClCQ,MAAM,CAACR,QAAQ,EACfO,KAAK,CAACP,QAAQ,CAACY,SAAS,CACzB;;EAGH,IAAIL,KAAK,CAACN,KAAK,EAAE;IACfM,KAAK,CAACN,KAAK,CAACW,SAAS,GAAGT,oBAAY,CAACN,iCAAyB,CAACI,KAAK,EAAEO,MAAM,CAACS,YAAY,EAAEV,KAAK,CAACN,KAAK,CAACW,SAAS,CAAC;;EAGnH,OAAOL,KAAK;AACd,CAAC;AAlCYV,yCAAiC","names":["exports","root","button","sortIcon","aside","useTableLayoutStyles","react_1","useFlexLayoutStyles","useStyles","useTableHeaderCellStyles_unstable","state","styles","layoutStyles","table","flex","className","sortable","rootInteractive","noNativeElements","resetButton","resizeHandle"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableHeaderCell/useTableHeaderCellStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport type { TableHeaderCellSlots, TableHeaderCellState } from './TableHeaderCell.types';\n\nexport const tableHeaderCellClassName = 'fui-TableHeaderCell';\nexport const tableHeaderCellClassNames: SlotClassNames<TableHeaderCellSlots> = {\n root: 'fui-TableHeaderCell',\n button: 'fui-TableHeaderCell__button',\n sortIcon: 'fui-TableHeaderCell__sortIcon',\n aside: 'fui-TableHeaderCell__aside',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n verticalAlign: 'middle',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: '0px',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n ...shorthands.padding('0px', tokens.spacingHorizontalS),\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus-within', enableOutline: true },\n ),\n position: 'relative',\n },\n\n rootInteractive: {\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n },\n },\n\n resetButton: {\n resize: 'horizontal',\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n ...shorthands.borderStyle('none'),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n },\n\n button: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexGrow: 1,\n height: '100%',\n alignItems: 'center',\n ...shorthands.gap(tokens.spacingHorizontalXS),\n minHeight: '32px',\n ...shorthands.flex(1, 1, '0px'),\n outlineStyle: 'none',\n },\n\n sortable: {\n cursor: 'pointer',\n },\n\n sortIcon: {\n display: 'flex',\n alignItems: 'center',\n paddingTop: tokens.spacingVerticalXXS,\n },\n\n resizeHandle: {},\n});\n\n/**\n * Apply styling to the TableHeaderCell slots based on the state\n */\nexport const useTableHeaderCellStyles_unstable = (state: TableHeaderCellState): TableHeaderCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableHeaderCellClassNames.root,\n styles.root,\n state.sortable && styles.rootInteractive,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n state.button.className = mergeClasses(\n tableHeaderCellClassNames.button,\n styles.resetButton,\n styles.button,\n state.sortable && styles.sortable,\n state.button.className,\n );\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(\n tableHeaderCellClassNames.sortIcon,\n styles.sortIcon,\n state.sortIcon.className,\n );\n }\n\n if (state.aside) {\n state.aside.className = mergeClasses(tableHeaderCellClassNames.aside, styles.resizeHandle, state.aside.className);\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableResizeHandle = void 0;
|
|
7
|
+
const React = /*#__PURE__*/require("react");
|
|
8
|
+
const useTableResizeHandle_1 = /*#__PURE__*/require("./useTableResizeHandle");
|
|
9
|
+
const renderTableResizeHandle_1 = /*#__PURE__*/require("./renderTableResizeHandle");
|
|
10
|
+
const useTableResizeHandleStyles_1 = /*#__PURE__*/require("./useTableResizeHandleStyles");
|
|
11
|
+
/**
|
|
12
|
+
* TableResizeHandle component - TODO: add more docs
|
|
13
|
+
*/
|
|
14
|
+
exports.TableResizeHandle = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
|
+
const state = useTableResizeHandle_1.useTableResizeHandle_unstable(props, ref);
|
|
16
|
+
useTableResizeHandleStyles_1.useTableResizeHandleStyles_unstable(state);
|
|
17
|
+
return renderTableResizeHandle_1.renderTableResizeHandle_unstable(state);
|
|
18
|
+
});
|
|
19
|
+
exports.TableResizeHandle.displayName = 'TableResizeHandle';
|
|
20
|
+
//# sourceMappingURL=TableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,yBAAiB,gBAAgDC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC5G,MAAMC,KAAK,GAAGC,oDAA6B,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEvDG,gEAAmC,CAACF,KAAK,CAAC;EAC1C,OAAOG,0DAAgC,CAACH,KAAK,CAAC;AAChD,CAAC,CAAC;AAEFL,yBAAiB,CAACS,WAAW,GAAG,mBAAmB","names":["exports","React","forwardRef","props","ref","state","useTableResizeHandle_1","useTableResizeHandleStyles_1","renderTableResizeHandle_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/TableResizeHandle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableResizeHandle_unstable } from './useTableResizeHandle';\nimport { renderTableResizeHandle_unstable } from './renderTableResizeHandle';\nimport { useTableResizeHandleStyles_unstable } from './useTableResizeHandleStyles';\nimport type { TableResizeHandleProps } from './TableResizeHandle.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableResizeHandle component - TODO: add more docs\n */\nexport const TableResizeHandle: ForwardRefComponent<TableResizeHandleProps> = React.forwardRef((props, ref) => {\n const state = useTableResizeHandle_unstable(props, ref);\n\n useTableResizeHandleStyles_unstable(state);\n return renderTableResizeHandle_unstable(state);\n});\n\nTableResizeHandle.displayName = 'TableResizeHandle';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
7
|
+
tslib_1.__exportStar(require("./TableResizeHandle"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./TableResizeHandle.types"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./renderTableResizeHandle"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./useTableResizeHandle"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./useTableResizeHandleStyles"), exports);
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/index.ts"],"sourcesContent":["export * from './TableResizeHandle';\nexport * from './TableResizeHandle.types';\nexport * from './renderTableResizeHandle';\nexport * from './useTableResizeHandle';\nexport * from './useTableResizeHandleStyles';\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderTableResizeHandle_unstable = void 0;
|
|
7
|
+
const React = /*#__PURE__*/require("react");
|
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
/**
|
|
10
|
+
* Render the final JSX of TableResizeHandle
|
|
11
|
+
*/
|
|
12
|
+
const renderTableResizeHandle_unstable = state => {
|
|
13
|
+
const {
|
|
14
|
+
slots,
|
|
15
|
+
slotProps
|
|
16
|
+
} = react_utilities_1.getSlots(state);
|
|
17
|
+
return React.createElement(slots.root, {
|
|
18
|
+
...slotProps.root
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.renderTableResizeHandle_unstable = renderTableResizeHandle_unstable;
|
|
22
|
+
//# sourceMappingURL=renderTableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,gCAAgC,GAAIC,KAA6B,IAAI;EAChF,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAyBH,KAAK,CAAC;EACpE,OAAOI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,EAAI;AAC3C,CAAC;AAHYC,wCAAgC","names":["renderTableResizeHandle_unstable","state","slots","slotProps","react_utilities_1","React","root","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/renderTableResizeHandle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableResizeHandleState, TableResizeHandleSlots } from './TableResizeHandle.types';\n\n/**\n * Render the final JSX of TableResizeHandle\n */\nexport const renderTableResizeHandle_unstable = (state: TableResizeHandleState) => {\n const { slots, slotProps } = getSlots<TableResizeHandleSlots>(state);\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTableResizeHandle_unstable = void 0;
|
|
7
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
8
|
+
/**
|
|
9
|
+
* Create the state required to render TableResizeHandle.
|
|
10
|
+
*
|
|
11
|
+
* The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,
|
|
12
|
+
* before being passed to renderTableResizeHandle_unstable.
|
|
13
|
+
*
|
|
14
|
+
* @param props - props from this instance of TableResizeHandle
|
|
15
|
+
* @param ref - reference to root HTMLElement of TableResizeHandle
|
|
16
|
+
*/
|
|
17
|
+
const useTableResizeHandle_unstable = (props, ref) => {
|
|
18
|
+
const onClick = react_utilities_1.useEventCallback(event => {
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
components: {
|
|
25
|
+
root: 'div'
|
|
26
|
+
},
|
|
27
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
|
28
|
+
ref,
|
|
29
|
+
...props,
|
|
30
|
+
onClick
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.useTableResizeHandle_unstable = useTableResizeHandle_unstable;
|
|
35
|
+
//# sourceMappingURL=useTableResizeHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AACA;AAGA;;;;;;;;;AASO,MAAMA,6BAA6B,GAAG,CAC3CC,KAA6B,EAC7BC,GAA2B,KACD;EAC1B,MAAMC,OAAO,GAAGC,kCAAgB,CAAEC,KAAuC,IAAI;;IAC3E,WAAK,CAACF,OAAO,+CAAbF,KAAK,EAAWI,KAAK,CAAC;IACtBA,KAAK,CAACC,eAAe,EAAE;EACzB,CAAC,CAAC;EACF,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAEJ,uCAAqB,CAAC,KAAK,EAAE;MACjCF,GAAG;MACH,GAAGD,KAAK;MACRE;KACD;GACF;AACH,CAAC;AAlBYM,qCAA6B","names":["useTableResizeHandle_unstable","props","ref","onClick","react_utilities_1","event","stopPropagation","components","root","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback } from '@fluentui/react-utilities';\nimport type { TableResizeHandleProps, TableResizeHandleState } from './TableResizeHandle.types';\n\n/**\n * Create the state required to render TableResizeHandle.\n *\n * The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,\n * before being passed to renderTableResizeHandle_unstable.\n *\n * @param props - props from this instance of TableResizeHandle\n * @param ref - reference to root HTMLElement of TableResizeHandle\n */\nexport const useTableResizeHandle_unstable = (\n props: TableResizeHandleProps,\n ref: React.Ref<HTMLElement>,\n): TableResizeHandleState => {\n const onClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n props.onClick?.(event);\n event.stopPropagation();\n });\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n onClick,\n }),\n };\n};\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTableResizeHandleStyles_unstable = exports.tableResizeHandleClassNames = void 0;
|
|
7
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
8
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
9
|
+
exports.tableResizeHandleClassNames = {
|
|
10
|
+
root: 'fui-TableResizeHandle'
|
|
11
|
+
// TODO: add class names for all slots on TableResizeHandleSlots.
|
|
12
|
+
// Should be of the form `<slotName>: 'fui-TableResizeHandle__<slotName>`
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Styles for the root slot
|
|
16
|
+
*/
|
|
17
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
18
|
+
root: {
|
|
19
|
+
qhf8xq: "f1euv43f",
|
|
20
|
+
j35jbq: ["f1e31b4d", "f1vgc2s3"],
|
|
21
|
+
Bhzewxz: "f15twtuk",
|
|
22
|
+
B5kzvoi: "f1yab3r1",
|
|
23
|
+
a9b677: "fjw5fx7",
|
|
24
|
+
B6of3ja: "f1hu3pq6",
|
|
25
|
+
t21cq0: ["fn2i5td", "f1eybr6b"],
|
|
26
|
+
jrapky: "f19f4twv",
|
|
27
|
+
Frg6f3: ["f1eybr6b", "fn2i5td"],
|
|
28
|
+
Bceei9c: "fc3en1c",
|
|
29
|
+
abs64n: "fk73vx1",
|
|
30
|
+
Bmy1vo4: "f13u1uyl",
|
|
31
|
+
B3o57yi: "fezquic",
|
|
32
|
+
Bj3rh1h: "f19g0ac",
|
|
33
|
+
B7zu5sd: "f15pjodv",
|
|
34
|
+
Bs6t6z0: "ftgrb5f",
|
|
35
|
+
Fdvyjd: "f2df6js",
|
|
36
|
+
Biobvvw: "fshsryb",
|
|
37
|
+
Hdbjpj: "f11ef69",
|
|
38
|
+
jc51t6: ["f12lb1dx", "f13tbxeo"],
|
|
39
|
+
u6d25: "fu4ulse",
|
|
40
|
+
Bj55yzk: "fw2wsqs",
|
|
41
|
+
Bkbwdz4: "f1swzn7y"
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
d: [".f1euv43f{position:absolute;}", ".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".f15twtuk{top:0;}", ".f1yab3r1{bottom:0;}", ".fjw5fx7{width:16px;}", ".f1hu3pq6{margin-top:0;}", ".fn2i5td{margin-right:-8px;}", ".f1eybr6b{margin-left:-8px;}", ".f19f4twv{margin-bottom:0;}", ".fc3en1c{cursor:col-resize;}", ".fk73vx1{opacity:0;}", ".f13u1uyl{transition-property:opacity;}", ".fezquic{transition-duration:.2s;}", ".f19g0ac{z-index:1;}", ".ftgrb5f:after{content:\" \";}", ".f2df6js:after{display:block;}", ".fshsryb:after{width:1px;}", ".f11ef69:after{position:absolute;}", ".f12lb1dx:after{left:50%;}", ".f13tbxeo:after{right:50%;}", ".fu4ulse:after{top:0;}", ".fw2wsqs:after{bottom:0;}", ".f1swzn7y:after{background-color:var(--colorNeutralStroke1);}"],
|
|
45
|
+
h: [".f15pjodv:hover{opacity:1;}"]
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Apply styling to the TableResizeHandle slots based on the state
|
|
49
|
+
*/
|
|
50
|
+
const useTableResizeHandleStyles_unstable = state => {
|
|
51
|
+
const styles = useStyles();
|
|
52
|
+
state.root.className = react_1.mergeClasses(exports.tableResizeHandleClassNames.root, styles.root, state.root.className);
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
55
|
+
exports.useTableResizeHandleStyles_unstable = useTableResizeHandleStyles_unstable;
|
|
56
|
+
//# sourceMappingURL=useTableResizeHandleStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAGA;AAEaA,mCAA2B,GAA2C;EACjFC,IAAI,EAAE;EACN;EACA;CACD;AAED;;;AAGA,MAAMC,SAAS,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;AAAA,EA6B1B;AAEF;;;AAGO,MAAMC,mCAAmC,GAAIC,KAA6B,IAA4B;EAC3G,MAAMC,MAAM,GAAGJ,SAAS,EAAE;EAC1BG,KAAK,CAACJ,IAAI,CAACM,SAAS,GAAGJ,oBAAY,CAACH,mCAA2B,CAACC,IAAI,EAAEK,MAAM,CAACL,IAAI,EAAEI,KAAK,CAACJ,IAAI,CAACM,SAAS,CAAC;EACxG,OAAOF,KAAK;AACd,CAAC;AAJYL,2CAAmC","names":["exports","root","useStyles","react_1","useTableResizeHandleStyles_unstable","state","styles","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandleStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableResizeHandleSlots, TableResizeHandleState } from './TableResizeHandle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableResizeHandleClassNames: SlotClassNames<TableResizeHandleSlots> = {\n root: 'fui-TableResizeHandle',\n // TODO: add class names for all slots on TableResizeHandleSlots.\n // Should be of the form `<slotName>: 'fui-TableResizeHandle__<slotName>`\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n right: 0,\n top: 0,\n bottom: 0,\n width: '16px',\n ...shorthands.margin(0, '-8px'),\n cursor: 'col-resize',\n opacity: 0,\n transitionProperty: 'opacity',\n transitionDuration: '.2s',\n zIndex: 1,\n\n ':hover': {\n opacity: 1,\n },\n\n ':after': {\n content: '\" \"',\n display: 'block',\n width: '1px',\n position: 'absolute',\n left: '50%',\n top: 0,\n bottom: 0,\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n});\n\n/**\n * Apply styling to the TableResizeHandle slots based on the state\n */\nexport const useTableResizeHandleStyles_unstable = (state: TableResizeHandleState): TableResizeHandleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableResizeHandleClassNames.root, styles.root, state.root.className);\n return state;\n};\n"]}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useTableSelectionCellStyles_unstable = exports.tableSelectionCellClassNames = void 0;
|
|
6
|
+
exports.useTableSelectionCellStyles_unstable = exports.tableSelectionCellClassNames = exports.CELL_WIDTH = void 0;
|
|
7
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
8
8
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
9
9
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
10
|
+
exports.CELL_WIDTH = 44;
|
|
10
11
|
exports.tableSelectionCellClassNames = {
|
|
11
12
|
root: 'fui-TableSelectionCell',
|
|
12
13
|
checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AAGA;AACA;AAEaA,oCAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,iBAAiB,EAAE,2CAA2C;EAC9DC,cAAc,EAAE;CACjB;AAED,MAAMC,oBAAoB,gBAAGC,gBAAU;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAKrC;AAEF,MAAMC,mBAAmB,gBAAGD,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAQpC;AAEF;;;AAGA,MAAME,SAAS,gBAAGF,gBAAU;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,EAkC1B;AAEF;;;AAGO,MAAMG,oCAAoC,GAAIC,KAA8B,IAA6B;EAC9G,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAER,oBAAoB,EAAE;IAC7BS,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACR,IAAI,CAACa,SAAS,GAAGT,oBAAY,CACjCL,oCAA4B,CAACC,IAAI,EACjCS,MAAM,CAACT,IAAI,EACXQ,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACZ,IAAI,GAAGU,YAAY,CAACC,KAAK,CAACX,IAAI,EACzEQ,KAAK,CAACO,MAAM,IAAIP,KAAK,CAACQ,OAAO,KAAK,KAAK,IAAIP,MAAM,CAACM,MAAM,EACxDP,KAAK,CAACS,MAAM,IAAIR,MAAM,CAACQ,MAAM,EAC7BT,KAAK,CAACR,IAAI,CAACa,SAAS,CACrB;EACD,IAAIL,KAAK,CAACP,iBAAiB,EAAE;IAC3BO,KAAK,CAACP,iBAAiB,CAACY,SAAS,GAAGT,oBAAY,CAC9CL,oCAA4B,CAACE,iBAAiB,EAC9CO,KAAK,CAACP,iBAAiB,CAACY,SAAS,CAClC;;EAGH,IAAIL,KAAK,CAACN,cAAc,EAAE;IACxBM,KAAK,CAACN,cAAc,CAACW,SAAS,GAAGT,oBAAY,CAC3CL,oCAA4B,CAACG,cAAc,EAC3CO,MAAM,CAACP,cAAc,EACrBM,KAAK,CAACN,cAAc,CAACW,SAAS,CAC/B;;EAGH,OAAOL,KAAK;AACd,CAAC;AA9BYT,4CAAoC","names":["exports","root","checkboxIndicator","radioIndicator","useTableLayoutStyles","react_1","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:
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AAGA;AACA;AAEaA,kBAAU,GAAG,EAAE;AAEfA,oCAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,iBAAiB,EAAE,2CAA2C;EAC9DC,cAAc,EAAE;CACjB;AAED,MAAMC,oBAAoB,gBAAGC,gBAAU;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAKrC;AAEF,MAAMC,mBAAmB,gBAAGD,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAQpC;AAEF;;;AAGA,MAAME,SAAS,gBAAGF,gBAAU;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,EAkC1B;AAEF;;;AAGO,MAAMG,oCAAoC,GAAIC,KAA8B,IAA6B;EAC9G,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAER,oBAAoB,EAAE;IAC7BS,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACR,IAAI,CAACa,SAAS,GAAGT,oBAAY,CACjCL,oCAA4B,CAACC,IAAI,EACjCS,MAAM,CAACT,IAAI,EACXQ,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACZ,IAAI,GAAGU,YAAY,CAACC,KAAK,CAACX,IAAI,EACzEQ,KAAK,CAACO,MAAM,IAAIP,KAAK,CAACQ,OAAO,KAAK,KAAK,IAAIP,MAAM,CAACM,MAAM,EACxDP,KAAK,CAACS,MAAM,IAAIR,MAAM,CAACQ,MAAM,EAC7BT,KAAK,CAACR,IAAI,CAACa,SAAS,CACrB;EACD,IAAIL,KAAK,CAACP,iBAAiB,EAAE;IAC3BO,KAAK,CAACP,iBAAiB,CAACY,SAAS,GAAGT,oBAAY,CAC9CL,oCAA4B,CAACE,iBAAiB,EAC9CO,KAAK,CAACP,iBAAiB,CAACY,SAAS,CAClC;;EAGH,IAAIL,KAAK,CAACN,cAAc,EAAE;IACxBM,KAAK,CAACN,cAAc,CAACW,SAAS,GAAGT,oBAAY,CAC3CL,oCAA4B,CAACG,cAAc,EAC3CO,MAAM,CAACP,cAAc,EACrBM,KAAK,CAACN,cAAc,CAACW,SAAS,CAC/B;;EAGH,OAAOL,KAAK;AACd,CAAC;AA9BYT,4CAAoC","names":["exports","root","checkboxIndicator","radioIndicator","useTableLayoutStyles","react_1","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 CELL_WIDTH = 44;\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: `${CELL_WIDTH}px`,\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: `${CELL_WIDTH}px`,\n maxWidth: `${CELL_WIDTH}px`,\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"]}
|
|
@@ -9,4 +9,5 @@ tslib_1.__exportStar(require("./useTableFeatures"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./useTableSort"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./useTableSelection"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./createColumn"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./useTableColumnSizing"), exports);
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/index.ts"],"sourcesContent":["export * from './types';\nexport * from './useTableFeatures';\nexport * from './useTableSort';\nexport * from './useTableSelection';\nexport * from './createColumn';\n"]}
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/index.ts"],"sourcesContent":["export * from './types';\nexport * from './useTableFeatures';\nexport * from './useTableSort';\nexport * from './useTableSelection';\nexport * from './createColumn';\nexport * from './useTableColumnSizing';\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useMeasureElement = void 0;
|
|
7
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
|
10
|
+
/**
|
|
11
|
+
* Provides a way of reporting element width.
|
|
12
|
+
* Returns
|
|
13
|
+
* `width` - current element width (0 by default),
|
|
14
|
+
* `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure
|
|
15
|
+
*/
|
|
16
|
+
function useMeasureElement() {
|
|
17
|
+
const [width, setWidth] = React.useState(0);
|
|
18
|
+
const container = React.useRef(undefined);
|
|
19
|
+
const {
|
|
20
|
+
targetDocument
|
|
21
|
+
} = react_shared_contexts_1.useFluent_unstable();
|
|
22
|
+
// the handler for resize observer
|
|
23
|
+
const handleResize = React.useCallback(() => {
|
|
24
|
+
var _a;
|
|
25
|
+
const containerWidth = (_a = container.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
|
|
26
|
+
setWidth(containerWidth || 0);
|
|
27
|
+
}, []);
|
|
28
|
+
// Keep the reference of ResizeObserver in the state, as it should live through renders
|
|
29
|
+
const [resizeObserver] = React.useState(react_utilities_1.canUseDOM() ? new ResizeObserver(handleResize) : undefined);
|
|
30
|
+
const measureElementRef = React.useCallback(el => {
|
|
31
|
+
if (!targetDocument || !resizeObserver) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// cleanup previous container
|
|
35
|
+
if (container.current) {
|
|
36
|
+
resizeObserver.unobserve(container.current);
|
|
37
|
+
container.current.remove();
|
|
38
|
+
}
|
|
39
|
+
if (el) {
|
|
40
|
+
container.current = targetDocument.createElement('div');
|
|
41
|
+
el.insertAdjacentElement('beforebegin', container.current);
|
|
42
|
+
resizeObserver.observe(container.current);
|
|
43
|
+
handleResize();
|
|
44
|
+
}
|
|
45
|
+
}, [targetDocument, resizeObserver, handleResize]);
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
return () => resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
48
|
+
}, [resizeObserver]);
|
|
49
|
+
return {
|
|
50
|
+
width,
|
|
51
|
+
measureElementRef
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.useMeasureElement = useMeasureElement;
|
|
55
|
+
//# sourceMappingURL=useMeasureElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAEA;;;;;;AAMA,SAAgBA,iBAAiB;EAC/B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,CAAC,CAAC;EAC3C,MAAMC,SAAS,GAAGF,KAAK,CAACG,MAAM,CAA0BC,SAAS,CAAC;EAElE,MAAM;IAAEC;EAAc,CAAE,GAAGC,0CAAS,EAAE;EAEtC;EACA,MAAMC,YAAY,GAAGP,KAAK,CAACQ,WAAW,CAAC,MAAK;;IAC1C,MAAMC,cAAc,GAAG,eAAS,CAACC,OAAO,0CAAEC,qBAAqB,GAAGb,KAAK;IACvEC,QAAQ,CAACU,cAAc,IAAI,CAAC,CAAC;EAC/B,CAAC,EAAE,EAAE,CAAC;EAEN;EACA,MAAM,CAACG,cAAc,CAAC,GAAGZ,KAAK,CAACC,QAAQ,CAACY,2BAAS,EAAE,GAAG,IAAIC,cAAc,CAACP,YAAY,CAAC,GAAGH,SAAS,CAAC;EACnG,MAAMW,iBAAiB,GAAGf,KAAK,CAACQ,WAAW,CACxCQ,EAAmB,IAAI;IACtB,IAAI,CAACX,cAAc,IAAI,CAACO,cAAc,EAAE;MACtC;;IAGF;IACA,IAAIV,SAAS,CAACQ,OAAO,EAAE;MACrBE,cAAc,CAACK,SAAS,CAACf,SAAS,CAACQ,OAAO,CAAC;MAC3CR,SAAS,CAACQ,OAAO,CAACQ,MAAM,EAAE;;IAG5B,IAAIF,EAAE,EAAE;MACNd,SAAS,CAACQ,OAAO,GAAGL,cAAc,CAACc,aAAa,CAAC,KAAK,CAAC;MACvDH,EAAE,CAACI,qBAAqB,CAAC,aAAa,EAAElB,SAAS,CAACQ,OAAO,CAAC;MAC1DE,cAAc,CAACS,OAAO,CAACnB,SAAS,CAACQ,OAAO,CAAC;MACzCH,YAAY,EAAE;;EAElB,CAAC,EACD,CAACF,cAAc,EAAEO,cAAc,EAAEL,YAAY,CAAC,CAC/C;EAEDP,KAAK,CAACsB,SAAS,CAAC,MAAK;IACnB,OAAO,MAAMV,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEW,UAAU,EAAE;EAC3C,CAAC,EAAE,CAACX,cAAc,CAAC,CAAC;EAEpB,OAAO;IAAEd,KAAK;IAAEiB;EAAiB,CAAE;AACrC;AAzCAS","names":["useMeasureElement","width","setWidth","React","useState","container","useRef","undefined","targetDocument","react_shared_contexts_1","handleResize","useCallback","containerWidth","current","getBoundingClientRect","resizeObserver","react_utilities_1","ResizeObserver","measureElementRef","el","unobserve","remove","createElement","insertAdjacentElement","observe","useEffect","disconnect","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useMeasureElement.ts"],"sourcesContent":["import { canUseDOM } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * Provides a way of reporting element width.\n * Returns\n * `width` - current element width (0 by default),\n * `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure\n */\nexport function useMeasureElement<TElement extends HTMLElement = HTMLElement>() {\n const [width, setWidth] = React.useState(0);\n const container = React.useRef<HTMLElement | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n\n // the handler for resize observer\n const handleResize = React.useCallback(() => {\n const containerWidth = container.current?.getBoundingClientRect().width;\n setWidth(containerWidth || 0);\n }, []);\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(canUseDOM() ? new ResizeObserver(handleResize) : undefined);\n const measureElementRef = React.useCallback(\n (el: TElement | null) => {\n if (!targetDocument || !resizeObserver) {\n return;\n }\n\n // cleanup previous container\n if (container.current) {\n resizeObserver.unobserve(container.current);\n container.current.remove();\n }\n\n if (el) {\n container.current = targetDocument.createElement('div');\n el.insertAdjacentElement('beforebegin', container.current);\n resizeObserver.observe(container.current);\n handleResize();\n }\n },\n [targetDocument, resizeObserver, handleResize],\n );\n\n React.useEffect(() => {\n return () => resizeObserver?.disconnect();\n }, [resizeObserver]);\n\n return { width, measureElementRef };\n}\n"]}
|