@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "@fluentui/keyboard-keys", "../TableRow/useTableRow", "../../contexts/dataGridContext", "../DataGridSelectionCell/DataGridSelectionCell", "../../contexts/rowIdContext", "../../contexts/tableHeaderContext"], function (require, exports, tslib_1, react_utilities_1, keyboard_keys_1, useTableRow_1, dataGridContext_1, DataGridSelectionCell_1, rowIdContext_1, tableHeaderContext_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDataGridRow_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DataGridRow.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDataGridRowStyles_unstable,
|
|
9
|
+
* before being passed to renderDataGridRow_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DataGridRow
|
|
12
|
+
* @param ref - reference to root HTMLElement of DataGridRow
|
|
13
|
+
*/
|
|
14
|
+
var useDataGridRow_unstable = function (props, ref) {
|
|
15
|
+
var rowId = rowIdContext_1.useTableRowIdContext();
|
|
16
|
+
var isHeader = tableHeaderContext_1.useIsInTableHeader();
|
|
17
|
+
var columnDefs = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.columns; });
|
|
18
|
+
var selectable = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.selectableRows; });
|
|
19
|
+
var selected = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.selection.isRowSelected(rowId); });
|
|
20
|
+
var tabbable = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.focusMode === 'row_unstable'; });
|
|
21
|
+
var appearance = dataGridContext_1.useDataGridContext_unstable(function (ctx) {
|
|
22
|
+
if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {
|
|
23
|
+
return ctx.selectionAppearance;
|
|
24
|
+
}
|
|
25
|
+
return 'none';
|
|
26
|
+
});
|
|
27
|
+
var toggleRow = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.selection.toggleRow; });
|
|
28
|
+
var onClick = react_utilities_1.useEventCallback(function (e) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (selectable && !isHeader) {
|
|
31
|
+
toggleRow(e, rowId);
|
|
32
|
+
}
|
|
33
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
34
|
+
});
|
|
35
|
+
var onKeyDown = react_utilities_1.useEventCallback(function (e) {
|
|
36
|
+
var _a;
|
|
37
|
+
if (selectable && !isHeader && e.key === keyboard_keys_1.Space && !react_utilities_1.isInteractiveHTMLElement(e.target)) {
|
|
38
|
+
// stop scrolling
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
toggleRow(e, rowId);
|
|
41
|
+
}
|
|
42
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
43
|
+
});
|
|
44
|
+
var baseState = useTableRow_1.useTableRow_unstable(tslib_1.__assign(tslib_1.__assign({ appearance: appearance, 'aria-selected': selectable ? selected : undefined }, props), { onClick: onClick, onKeyDown: onKeyDown, children: null, as: 'div', tabIndex: tabbable && !isHeader ? 0 : undefined }), ref);
|
|
45
|
+
return tslib_1.__assign(tslib_1.__assign({}, baseState), { components: tslib_1.__assign(tslib_1.__assign({}, baseState.components), { selectionCell: DataGridSelectionCell_1.DataGridSelectionCell }), selectionCell: react_utilities_1.resolveShorthand(props.selectionCell, { required: selectable }), renderCell: props.children, columnDefs: columnDefs });
|
|
46
|
+
};
|
|
47
|
+
exports.useDataGridRow_unstable = useDataGridRow_unstable;
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=useDataGridRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataGridRow.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridRow/useDataGridRow.tsx"],"names":[],"mappings":";;;;IAUA;;;;;;;;OAQG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAuB,EAAE,GAA2B;QAC1F,IAAM,KAAK,GAAG,mCAAoB,EAAE,CAAC;QACrC,IAAM,QAAQ,GAAG,uCAAkB,EAAE,CAAC;QACtC,IAAM,UAAU,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,OAAO,EAAX,CAAW,CAAC,CAAC;QACnE,IAAM,UAAU,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,cAAc,EAAlB,CAAkB,CAAC,CAAC;QAC1E,IAAM,QAAQ,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;QACxF,IAAM,QAAQ,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,KAAK,cAAc,EAAhC,CAAgC,CAAC,CAAC;QACtF,IAAM,UAAU,GAAG,6CAA2B,CAAC,UAAA,GAAG;YAChD,IAAI,CAAC,QAAQ,IAAI,UAAU,IAAI,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBACjE,OAAO,GAAG,CAAC,mBAAmB,CAAC;aAChC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,IAAM,SAAS,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,CAAC,SAAS,EAAvB,CAAuB,CAAC,CAAC;QAE9E,IAAM,OAAO,GAAG,kCAAgB,CAAC,UAAC,CAAwC;;YACxE,IAAI,UAAU,IAAI,CAAC,QAAQ,EAAE;gBAC3B,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;aACrB;YAED,MAAA,KAAK,CAAC,OAAO,+CAAb,KAAK,EAAW,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,IAAM,SAAS,GAAG,kCAAgB,CAAC,UAAC,CAA2C;;YAC7E,IAAI,UAAU,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,qBAAK,IAAI,CAAC,0CAAwB,CAAC,CAAC,CAAC,MAAqB,CAAC,EAAE;gBACpG,iBAAiB;gBACjB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;aACrB;YAED,MAAA,KAAK,CAAC,SAAS,+CAAf,KAAK,EAAa,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,IAAM,SAAS,GAAG,kCAAoB,qCAElC,UAAU,YAAA,EACV,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,IAC/C,KAAK,KACR,OAAO,SAAA,EACP,SAAS,WAAA,EACT,QAAQ,EAAE,IAAI,EACd,EAAE,EAAE,KAAK,EACT,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAEjD,GAAG,CACJ,CAAC;QAEF,6CACK,SAAS,KACZ,UAAU,wCACL,SAAS,CAAC,UAAU,KACvB,aAAa,EAAE,6CAAqB,KAEtC,aAAa,EAAE,kCAAgB,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAC9E,UAAU,EAAE,KAAK,CAAC,QAAQ,EAC1B,UAAU,YAAA,IACV;IACJ,CAAC,CAAC;IA1DW,QAAA,uBAAuB,2BA0DlC","sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, resolveShorthand } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);\n const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));\n const tabbable = useDataGridContext_unstable(ctx => ctx.focusMode === 'row_unstable');\n const appearance = useDataGridContext_unstable(ctx => {\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n ...props,\n onClick,\n onKeyDown,\n children: null,\n as: 'div',\n tabIndex: tabbable && !isHeader ? 0 : undefined,\n },\n ref,\n );\n\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell,\n },\n selectionCell: resolveShorthand(props.selectionCell, { required: selectable }),\n renderCell: props.children,\n columnDefs,\n };\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
define(["require", "exports", "@griffel/react", "../TableRow/useTableRowStyles"], function (require, exports, react_1, useTableRowStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDataGridRowStyles_unstable = exports.dataGridRowClassNames = void 0;
|
|
5
|
+
exports.dataGridRowClassNames = {
|
|
6
|
+
root: 'fui-DataGridRow',
|
|
7
|
+
selectionCell: 'fui-DataGridRow__selectionCell',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Apply styling to the DataGridRow slots based on the state
|
|
11
|
+
*/
|
|
12
|
+
var useDataGridRowStyles_unstable = function (state) {
|
|
13
|
+
useTableRowStyles_1.useTableRowStyles_unstable(state);
|
|
14
|
+
state.root.className = react_1.mergeClasses(exports.dataGridRowClassNames.root, state.root.className);
|
|
15
|
+
if (state.selectionCell) {
|
|
16
|
+
state.selectionCell.className = react_1.mergeClasses(exports.dataGridRowClassNames.selectionCell, state.selectionCell.className);
|
|
17
|
+
}
|
|
18
|
+
return state;
|
|
19
|
+
};
|
|
20
|
+
exports.useDataGridRowStyles_unstable = useDataGridRowStyles_unstable;
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=useDataGridRowStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataGridRowStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridRow/useDataGridRowStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;QACvB,aAAa,EAAE,gCAAgC;KAChD,CAAC;IAEF;;OAEG;IACI,IAAM,6BAA6B,GAAG,UAAC,KAAuB;QACnE,8CAA0B,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,6BAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtF,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,KAAK,CAAC,aAAa,CAAC,SAAS,GAAG,oBAAY,CAAC,6BAAqB,CAAC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;SAClH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,6BAA6B,iCAQxC","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell',\n};\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useDataGridSelectionCell", "./renderDataGridSelectionCell", "./useDataGridSelectionCellStyles"], function (require, exports, React, useDataGridSelectionCell_1, renderDataGridSelectionCell_1, useDataGridSelectionCellStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DataGridSelectionCell = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* DataGridSelectionCell component
|
|
7
|
+
*/
|
|
8
|
+
exports.DataGridSelectionCell = React.forwardRef(function (props, ref) {
|
|
9
|
+
var state = useDataGridSelectionCell_1.useDataGridSelectionCell_unstable(props, ref);
|
|
10
|
+
useDataGridSelectionCellStyles_1.useDataGridSelectionCellStyles_unstable(state);
|
|
11
|
+
return renderDataGridSelectionCell_1.renderDataGridSelectionCell_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
exports.DataGridSelectionCell.displayName = 'DataGridSelectionCell';
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=DataGridSelectionCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGridSelectionCell.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/DataGridSelectionCell.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,qBAAqB,GAAoD,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChH,IAAM,KAAK,GAAG,4DAAiC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5D,wEAAuC,CAAC,KAAK,CAAC,CAAC;QAC/C,OAAO,kEAAoC,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,6BAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAC","sourcesContent":["import * as React from 'react';\nimport { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';\nimport { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';\nimport { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles';\nimport type { DataGridSelectionCellProps } from './DataGridSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DataGridSelectionCell component\n */\nexport const DataGridSelectionCell: ForwardRefComponent<DataGridSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridSelectionCell_unstable(props, ref);\n\n useDataGridSelectionCellStyles_unstable(state);\n return renderDataGridSelectionCell_unstable(state);\n});\n\nDataGridSelectionCell.displayName = 'DataGridSelectionCell';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGridSelectionCell.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/DataGridSelectionCell.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n TableSelectionCellProps,\n TableSelectionCellSlots,\n TableSelectionCellState,\n} from '../TableSelectionCell/TableSelectionCell.types';\n\nexport type DataGridSelectionCellSlots = TableSelectionCellSlots;\n\n/**\n * DataGridSelectionCell Props\n */\nexport type DataGridSelectionCellProps = TableSelectionCellProps;\n\n/**\n * State used in rendering DataGridSelectionCell\n */\nexport type DataGridSelectionCellState = TableSelectionCellState;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./DataGridSelectionCell", "./DataGridSelectionCell.types", "./renderDataGridSelectionCell", "./useDataGridSelectionCell", "./useDataGridSelectionCellStyles"], function (require, exports, tslib_1, DataGridSelectionCell_1, DataGridSelectionCell_types_1, renderDataGridSelectionCell_1, useDataGridSelectionCell_1, useDataGridSelectionCellStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(DataGridSelectionCell_1, exports);
|
|
5
|
+
tslib_1.__exportStar(DataGridSelectionCell_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderDataGridSelectionCell_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useDataGridSelectionCell_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useDataGridSelectionCellStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/index.ts"],"names":[],"mappings":";;;IAAA,uDAAwC;IACxC,6DAA8C;IAC9C,6DAA8C;IAC9C,0DAA2C;IAC3C,gEAAiD","sourcesContent":["export * from './DataGridSelectionCell';\nexport * from './DataGridSelectionCell.types';\nexport * from './renderDataGridSelectionCell';\nexport * from './useDataGridSelectionCell';\nexport * from './useDataGridSelectionCellStyles';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
define(["require", "exports", "../TableSelectionCell/renderTableSelectionCell"], function (require, exports, renderTableSelectionCell_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderDataGridSelectionCell_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of DataGridSelectionCell
|
|
7
|
+
*/
|
|
8
|
+
var renderDataGridSelectionCell_unstable = function (state) {
|
|
9
|
+
return renderTableSelectionCell_1.renderTableSelectionCell_unstable(state);
|
|
10
|
+
};
|
|
11
|
+
exports.renderDataGridSelectionCell_unstable = renderDataGridSelectionCell_unstable;
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=renderDataGridSelectionCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderDataGridSelectionCell.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/renderDataGridSelectionCell.tsx"],"names":[],"mappings":";;;;IAGA;;OAEG;IACI,IAAM,oCAAoC,GAAG,UAAC,KAAiC;QACpF,OAAO,4DAAiC,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC;IAFW,QAAA,oCAAoC,wCAE/C","sourcesContent":["import type { DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderTableSelectionCell';\n\n/**\n * Render the final JSX of DataGridSelectionCell\n */\nexport const renderDataGridSelectionCell_unstable = (state: DataGridSelectionCellState) => {\n return renderTableSelectionCell_unstable(state);\n};\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "../../contexts/dataGridContext", "../../contexts/rowIdContext", "../../contexts/tableHeaderContext", "../TableSelectionCell/useTableSelectionCell"], function (require, exports, tslib_1, react_utilities_1, dataGridContext_1, rowIdContext_1, tableHeaderContext_1, useTableSelectionCell_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDataGridSelectionCell_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render DataGridSelectionCell.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,
|
|
9
|
+
* before being passed to renderDataGridSelectionCell_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of DataGridSelectionCell
|
|
12
|
+
* @param ref - reference to root HTMLElement of DataGridSelectionCell
|
|
13
|
+
*/
|
|
14
|
+
var useDataGridSelectionCell_unstable = function (props, ref) {
|
|
15
|
+
var isHeader = tableHeaderContext_1.useIsInTableHeader();
|
|
16
|
+
var rowId = rowIdContext_1.useTableRowIdContext();
|
|
17
|
+
var subtle = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.subtleSelection; });
|
|
18
|
+
var checked = dataGridContext_1.useDataGridContext_unstable(function (ctx) {
|
|
19
|
+
if (isHeader && ctx.selection.selectionMode === 'multiselect') {
|
|
20
|
+
return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;
|
|
21
|
+
}
|
|
22
|
+
return ctx.selection.isRowSelected(rowId);
|
|
23
|
+
});
|
|
24
|
+
var toggleAllRows = dataGridContext_1.useDataGridContext_unstable(function (ctx) { return ctx.selection.toggleAllRows; });
|
|
25
|
+
var type = dataGridContext_1.useDataGridContext_unstable(function (ctx) {
|
|
26
|
+
return ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio';
|
|
27
|
+
});
|
|
28
|
+
var onClick = react_utilities_1.useEventCallback(function (e) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (isHeader) {
|
|
31
|
+
toggleAllRows(e);
|
|
32
|
+
}
|
|
33
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
34
|
+
});
|
|
35
|
+
return useTableSelectionCell_1.useTableSelectionCell_unstable(tslib_1.__assign(tslib_1.__assign({ as: 'div', role: 'gridcell', checked: checked, type: type, hidden: isHeader && type === 'radio', 'aria-checked': isHeader ? checked : undefined, 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked, subtle: subtle }, props), { onClick: onClick }), ref);
|
|
36
|
+
};
|
|
37
|
+
exports.useDataGridSelectionCell_unstable = useDataGridSelectionCell_unstable;
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=useDataGridSelectionCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataGridSelectionCell.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"names":[],"mappings":";;;;IAQA;;;;;;;;OAQG;IACI,IAAM,iCAAiC,GAAG,UAC/C,KAAiC,EACjC,GAA2B;QAE3B,IAAM,QAAQ,GAAG,uCAAkB,EAAE,CAAC;QACtC,IAAM,KAAK,GAAG,mCAAoB,EAAE,CAAC;QACrC,IAAM,MAAM,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,eAAe,EAAnB,CAAmB,CAAC,CAAC;QACvE,IAAM,OAAO,GAAG,6CAA2B,CAAC,UAAA,GAAG;YAC7C,IAAI,QAAQ,IAAI,GAAG,CAAC,SAAS,CAAC,aAAa,KAAK,aAAa,EAAE;gBAC7D,OAAO,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;aAChG;YAED,OAAO,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,IAAM,aAAa,GAAG,6CAA2B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,CAAC,aAAa,EAA3B,CAA2B,CAAC,CAAC;QACtF,IAAM,IAAI,GAAG,6CAA2B,CAAC,UAAA,GAAG;YAC1C,OAAA,GAAG,CAAC,SAAS,CAAC,aAAa,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO;QAApE,CAAoE,CACrE,CAAC;QAEF,IAAM,OAAO,GAAG,kCAAgB,CAAC,UAAC,CAAyC;;YACzE,IAAI,QAAQ,EAAE;gBACZ,aAAa,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,MAAA,KAAK,CAAC,OAAO,+CAAb,KAAK,EAAW,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,OAAO,sDAA8B,qCAEjC,EAAE,EAAE,KAAK,EACT,IAAI,EAAE,UAAU,EAChB,OAAO,SAAA,EACP,IAAI,MAAA,EACJ,MAAM,EAAE,QAAQ,IAAI,IAAI,KAAK,OAAO,EACpC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC9C,eAAe,EAAE,QAAQ,IAAI,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EACtE,MAAM,QAAA,IACH,KAAK,KACR,OAAO,SAAA,KAET,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;IA3CW,QAAA,iCAAiC,qCA2C5C","sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n hidden: isHeader && type === 'radio',\n 'aria-checked': isHeader ? checked : undefined,\n 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
define(["require", "exports", "@griffel/react", "../TableSelectionCell/useTableSelectionCellStyles"], function (require, exports, react_1, useTableSelectionCellStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useDataGridSelectionCellStyles_unstable = exports.dataGridSelectionCellClassNames = void 0;
|
|
5
|
+
exports.dataGridSelectionCellClassNames = {
|
|
6
|
+
root: 'fui-DataGridSelectionCell',
|
|
7
|
+
checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',
|
|
8
|
+
radioIndicator: 'fui-DataGridSelectionCell__radioIndicator',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Apply styling to the DataGridSelectionCell slots based on the state
|
|
12
|
+
*/
|
|
13
|
+
var useDataGridSelectionCellStyles_unstable = function (state) {
|
|
14
|
+
useTableSelectionCellStyles_1.useTableSelectionCellStyles_unstable(state);
|
|
15
|
+
state.root.className = react_1.mergeClasses(exports.dataGridSelectionCellClassNames.root, state.root.className);
|
|
16
|
+
if (state.checkboxIndicator) {
|
|
17
|
+
state.checkboxIndicator.className = react_1.mergeClasses(exports.dataGridSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
|
|
18
|
+
}
|
|
19
|
+
if (state.radioIndicator) {
|
|
20
|
+
state.radioIndicator.className = react_1.mergeClasses(exports.dataGridSelectionCellClassNames.radioIndicator, state.radioIndicator.className);
|
|
21
|
+
}
|
|
22
|
+
return state;
|
|
23
|
+
};
|
|
24
|
+
exports.useDataGridSelectionCellStyles_unstable = useDataGridSelectionCellStyles_unstable;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=useDataGridSelectionCellStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataGridSelectionCellStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCellStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,+BAA+B,GAA+C;QACzF,IAAI,EAAE,2BAA2B;QACjC,iBAAiB,EAAE,8CAA8C;QACjE,cAAc,EAAE,2CAA2C;KAC5D,CAAC;IAEF;;OAEG;IACI,IAAM,uCAAuC,GAAG,UACrD,KAAiC;QAEjC,kEAAoC,CAAC,KAAK,CAAC,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,uCAA+B,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEhG,IAAI,KAAK,CAAC,iBAAiB,EAAE;YAC3B,KAAK,CAAC,iBAAiB,CAAC,SAAS,GAAG,oBAAY,CAC9C,uCAA+B,CAAC,iBAAiB,EACjD,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAClC,CAAC;SACH;QAED,IAAI,KAAK,CAAC,cAAc,EAAE;YACxB,KAAK,CAAC,cAAc,CAAC,SAAS,GAAG,oBAAY,CAC3C,uCAA+B,CAAC,cAAc,EAC9C,KAAK,CAAC,cAAc,CAAC,SAAS,CAC/B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IArBW,QAAA,uCAAuC,2CAqBlD","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridSelectionCellSlots, DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles';\n\nexport const dataGridSelectionCellClassNames: SlotClassNames<DataGridSelectionCellSlots> = {\n root: 'fui-DataGridSelectionCell',\n checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-DataGridSelectionCell__radioIndicator',\n};\n\n/**\n * Apply styling to the DataGridSelectionCell slots based on the state\n */\nexport const useDataGridSelectionCellStyles_unstable = (\n state: DataGridSelectionCellState,\n): DataGridSelectionCellState => {\n useTableSelectionCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);\n\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useTable", "./renderTable", "./useTableStyles", "./useTableContextValues"], function (require, exports, React, useTable_1, renderTable_1, useTableStyles_1, useTableContextValues_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Table = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Table component
|
|
7
|
+
*/
|
|
8
|
+
exports.Table = React.forwardRef(function (props, ref) {
|
|
9
|
+
var state = useTable_1.useTable_unstable(props, ref);
|
|
10
|
+
useTableStyles_1.useTableStyles_unstable(state);
|
|
11
|
+
return renderTable_1.renderTable_unstable(state, useTableContextValues_1.useTableContextValues_unstable(state));
|
|
12
|
+
});
|
|
13
|
+
exports.Table.displayName = 'Table';
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/Table.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,kCAAoB,CAAC,KAAK,EAAE,sDAA8B,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useTable_unstable } from './useTable';\nimport { renderTable_unstable } from './renderTable';\nimport { useTableStyles_unstable } from './useTableStyles';\nimport type { TableProps } from './Table.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTableContextValues_unstable } from './useTableContextValues';\n\n/**\n * Table component\n */\nexport const Table: ForwardRefComponent<TableProps> = React.forwardRef((props, ref) => {\n const state = useTable_unstable(props, ref);\n\n useTableStyles_unstable(state);\n return renderTable_unstable(state, useTableContextValues_unstable(state));\n});\n\nTable.displayName = 'Table';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/Table.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableSlots = {\n root: Slot<'table', 'div'>;\n};\n\nexport type TableContextValue = {\n /**\n * Affects the sizes of all table subcomponents\n * @default medium\n */\n size: 'extra-small' | 'small' | 'medium';\n\n /**\n * Render all table elements as divs instead of semantic table elements\n * Using divs no longer uses `display: table` layout but `display: flex`\n * @default false\n */\n noNativeElements: boolean;\n\n /**\n * Whether the table is sortable\n * @default false\n */\n sortable: boolean;\n};\n\nexport type SortDirection = 'ascending' | 'descending';\n\nexport type TableContextValues = {\n table: TableContextValue;\n};\n\n/**\n * Table Props\n */\nexport type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;\n\n/**\n * State used in rendering Table\n */\nexport type TableState = ComponentState<TableSlots> &\n Pick<Required<TableProps>, 'size' | 'noNativeElements'> &\n TableContextValue;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./Table", "./Table.types", "./renderTable", "./useTable", "./useTableStyles"], function (require, exports, tslib_1, Table_1, Table_types_1, renderTable_1, useTable_1, useTableStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(Table_1, exports);
|
|
5
|
+
tslib_1.__exportStar(Table_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderTable_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useTable_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useTableStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IACxB,6CAA8B;IAC9B,6CAA8B;IAC9B,0CAA2B;IAC3B,gDAAiC","sourcesContent":["export * from './Table';\nexport * from './Table.types';\nexport * from './renderTable';\nexport * from './useTable';\nexport * from './useTableStyles';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../../contexts/tableContext"], function (require, exports, tslib_1, React, react_utilities_1, tableContext_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderTable_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of Table
|
|
7
|
+
*/
|
|
8
|
+
var renderTable_unstable = function (state, contextValues) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
return (React.createElement(tableContext_1.TableContextProvider, { value: contextValues.table },
|
|
11
|
+
React.createElement(slots.root, tslib_1.__assign({}, slotProps.root))));
|
|
12
|
+
};
|
|
13
|
+
exports.renderTable_unstable = renderTable_unstable;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=renderTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTable.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/renderTable.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAAiB,EAAE,aAAiC;QACjF,IAAA,KAAuB,0BAAQ,CAAa,KAAK,CAAC,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAgC,CAAC;QAEzD,OAAO,CACL,oBAAC,mCAAoB,IAAC,KAAK,EAAE,aAAa,CAAC,KAAK;YAC9C,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACb,CACxB,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,oBAAoB,wBAQ/B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableState, TableSlots, TableContextValues } from './Table.types';\nimport { TableContextProvider } from '../../contexts/tableContext';\n\n/**\n * Render the final JSX of Table\n */\nexport const renderTable_unstable = (state: TableState, contextValues: TableContextValues) => {\n const { slots, slotProps } = getSlots<TableSlots>(state);\n\n return (\n <TableContextProvider value={contextValues.table}>\n <slots.root {...slotProps.root} />\n </TableContextProvider>\n );\n};\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useTable_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render Table.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useTableStyles_unstable,
|
|
9
|
+
* before being passed to renderTable_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of Table
|
|
12
|
+
* @param ref - reference to root HTMLElement of Table
|
|
13
|
+
*/
|
|
14
|
+
var useTable_unstable = function (props, ref) {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
16
|
+
var rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : props.noNativeElements) ? 'div' : 'table';
|
|
17
|
+
return {
|
|
18
|
+
components: {
|
|
19
|
+
root: rootComponent,
|
|
20
|
+
},
|
|
21
|
+
root: react_utilities_1.getNativeElementProps(rootComponent, tslib_1.__assign({ ref: ref, role: rootComponent === 'div' ? 'table' : undefined }, props)),
|
|
22
|
+
size: (_b = props.size) !== null && _b !== void 0 ? _b : 'medium',
|
|
23
|
+
noNativeElements: (_c = props.noNativeElements) !== null && _c !== void 0 ? _c : false,
|
|
24
|
+
sortable: (_d = props.sortable) !== null && _d !== void 0 ? _d : false,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.useTable_unstable = useTable_unstable;
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=useTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTable.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/useTable.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAA2B;;QAC9E,IAAM,aAAa,GAAG,CAAA,MAAA,KAAK,CAAC,EAAE,mCAAI,KAAK,CAAC,gBAAgB,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;QAE3E,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,aAAa;aACpB;YACD,IAAI,EAAE,uCAAqB,CAAC,aAAa,qBACvC,GAAG,KAAA,EACH,IAAI,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IAChD,KAAK,EACR;YACF,IAAI,EAAE,MAAA,KAAK,CAAC,IAAI,mCAAI,QAAQ;YAC5B,gBAAgB,EAAE,MAAA,KAAK,CAAC,gBAAgB,mCAAI,KAAK;YACjD,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,KAAK;SAClC,CAAC;IACJ,CAAC,CAAC;IAhBW,QAAA,iBAAiB,qBAgB5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableProps, TableState } from './Table.types';\n\n/**\n * Create the state required to render Table.\n *\n * The returned state can be modified with hooks such as useTableStyles_unstable,\n * before being passed to renderTable_unstable.\n *\n * @param props - props from this instance of Table\n * @param ref - reference to root HTMLElement of Table\n */\nexport const useTable_unstable = (props: TableProps, ref: React.Ref<HTMLElement>): TableState => {\n const rootComponent = props.as ?? props.noNativeElements ? 'div' : 'table';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'table' : undefined,\n ...props,\n }),\n size: props.size ?? 'medium',\n noNativeElements: props.noNativeElements ?? false,\n sortable: props.sortable ?? false,\n };\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
define(["require", "exports", "react"], function (require, exports, React) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useTableContextValues_unstable = void 0;
|
|
5
|
+
function useTableContextValues_unstable(state) {
|
|
6
|
+
var size = state.size, noNativeElements = state.noNativeElements, sortable = state.sortable;
|
|
7
|
+
var tableContext = React.useMemo(function () { return ({
|
|
8
|
+
noNativeElements: noNativeElements,
|
|
9
|
+
size: size,
|
|
10
|
+
sortable: sortable,
|
|
11
|
+
}); }, [noNativeElements, size, sortable]);
|
|
12
|
+
return {
|
|
13
|
+
table: tableContext,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.useTableContextValues_unstable = useTableContextValues_unstable;
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=useTableContextValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/useTableContextValues.ts"],"names":[],"mappings":";;;;IAGA,SAAgB,8BAA8B,CAAC,KAAiB;QACtD,IAAA,IAAI,GAAiC,KAAK,KAAtC,EAAE,gBAAgB,GAAe,KAAK,iBAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAEnD,IAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAChC,cAAM,OAAA,CAAC;YACL,gBAAgB,kBAAA;YAChB,IAAI,MAAA;YACJ,QAAQ,UAAA;SACT,CAAC,EAJI,CAIJ,EACF,CAAC,gBAAgB,EAAE,IAAI,EAAE,QAAQ,CAAC,CACnC,CAAC;QAEF,OAAO;YACL,KAAK,EAAE,YAAY;SACpB,CAAC;IACJ,CAAC;IAfD,wEAeC","sourcesContent":["import * as React from 'react';\nimport { TableContextValues, TableState } from './Table.types';\n\nexport function useTableContextValues_unstable(state: TableState): TableContextValues {\n const { size, noNativeElements, sortable } = state;\n\n const tableContext = React.useMemo(\n () => ({\n noNativeElements,\n size,\n sortable,\n }),\n [noNativeElements, size, sortable],\n );\n\n return {\n table: tableContext,\n };\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
define(["require", "exports", "@griffel/react", "@fluentui/react-theme"], function (require, exports, react_1, react_theme_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useTableStyles_unstable = exports.tableClassNames = exports.tableClassName = void 0;
|
|
5
|
+
exports.tableClassName = 'fui-Table';
|
|
6
|
+
exports.tableClassNames = {
|
|
7
|
+
root: 'fui-Table',
|
|
8
|
+
};
|
|
9
|
+
var useTableLayoutStyles = react_1.makeStyles({
|
|
10
|
+
root: {
|
|
11
|
+
display: 'table',
|
|
12
|
+
verticalAlign: 'middle',
|
|
13
|
+
width: '100%',
|
|
14
|
+
tableLayout: 'fixed',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
var useFlexLayoutStyles = react_1.makeStyles({
|
|
18
|
+
root: {
|
|
19
|
+
display: 'block',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Styles for the root slot
|
|
24
|
+
*/
|
|
25
|
+
var useStyles = react_1.makeStyles({
|
|
26
|
+
root: {
|
|
27
|
+
borderCollapse: 'collapse',
|
|
28
|
+
backgroundColor: react_theme_1.tokens.colorSubtleBackground,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Apply styling to the Table slots based on the state
|
|
33
|
+
*/
|
|
34
|
+
var useTableStyles_unstable = function (state) {
|
|
35
|
+
var styles = useStyles();
|
|
36
|
+
var layoutStyles = {
|
|
37
|
+
table: useTableLayoutStyles(),
|
|
38
|
+
flex: useFlexLayoutStyles(),
|
|
39
|
+
};
|
|
40
|
+
state.root.className = react_1.mergeClasses(exports.tableClassName, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.root.className);
|
|
41
|
+
return state;
|
|
42
|
+
};
|
|
43
|
+
exports.useTableStyles_unstable = useTableStyles_unstable;
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=useTableStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/Table/useTableStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,cAAc,GAAG,WAAW,CAAC;IAC7B,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;KAClB,CAAC;IAEF,IAAM,oBAAoB,GAAG,kBAAU,CAAC;QACtC,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,QAAQ;YACvB,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,OAAO;SACrB;KACF,CAAC,CAAC;IAEH,IAAM,mBAAmB,GAAG,kBAAU,CAAC;QACrC,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,cAAc,EAAE,UAAU;YAC1B,eAAe,EAAE,oBAAM,CAAC,qBAAqB;SAC9C;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAiB;QACvD,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAM,YAAY,GAAG;YACnB,KAAK,EAAE,oBAAoB,EAAE;YAC7B,IAAI,EAAE,mBAAmB,EAAE;SAC5B,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,sBAAc,EACd,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EACzE,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAdW,QAAA,uBAAuB,2BAclC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableSlots, TableState } from './Table.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableClassName = 'fui-Table';\nexport const tableClassNames: SlotClassNames<TableSlots> = {\n root: 'fui-Table',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table',\n verticalAlign: 'middle',\n width: '100%',\n tableLayout: 'fixed',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderCollapse: 'collapse',\n backgroundColor: tokens.colorSubtleBackground,\n },\n});\n\n/**\n * Apply styling to the Table slots based on the state\n */\nexport const useTableStyles_unstable = (state: TableState): TableState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableClassName,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n\n return state;\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
define(["require", "exports", "react", "./useTableBody", "./renderTableBody", "./useTableBodyStyles"], function (require, exports, React, useTableBody_1, renderTableBody_1, useTableBodyStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.TableBody = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* TableBody component
|
|
7
|
+
*/
|
|
8
|
+
exports.TableBody = React.forwardRef(function (props, ref) {
|
|
9
|
+
var state = useTableBody_1.useTableBody_unstable(props, ref);
|
|
10
|
+
useTableBodyStyles_1.useTableBodyStyles_unstable(state);
|
|
11
|
+
return renderTableBody_1.renderTableBody_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
exports.TableBody.displayName = 'TableBody';
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=TableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/TableBody.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,SAAS,GAAwC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACxF,IAAM,KAAK,GAAG,oCAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEhD,gDAA2B,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,0CAAwB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC","sourcesContent":["import * as React from 'react';\nimport { useTableBody_unstable } from './useTableBody';\nimport { renderTableBody_unstable } from './renderTableBody';\nimport { useTableBodyStyles_unstable } from './useTableBodyStyles';\nimport type { TableBodyProps } from './TableBody.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableBody component\n */\nexport const TableBody: ForwardRefComponent<TableBodyProps> = React.forwardRef((props, ref) => {\n const state = useTableBody_unstable(props, ref);\n\n useTableBodyStyles_unstable(state);\n return renderTableBody_unstable(state);\n});\n\nTableBody.displayName = 'TableBody';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBody.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/TableBody.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TableContextValue } from '../Table/Table.types';\n\nexport type TableBodySlots = {\n root: Slot<'tbody', 'div'>;\n};\n\n/**\n * TableBody Props\n */\nexport type TableBodyProps = ComponentProps<TableBodySlots>;\n\n/**\n * State used in rendering TableBody\n */\nexport type TableBodyState = ComponentState<TableBodySlots> & Pick<TableContextValue, 'noNativeElements'>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "./TableBody", "./TableBody.types", "./renderTableBody", "./useTableBody", "./useTableBodyStyles"], function (require, exports, tslib_1, TableBody_1, TableBody_types_1, renderTableBody_1, useTableBody_1, useTableBodyStyles_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
tslib_1.__exportStar(TableBody_1, exports);
|
|
5
|
+
tslib_1.__exportStar(TableBody_types_1, exports);
|
|
6
|
+
tslib_1.__exportStar(renderTableBody_1, exports);
|
|
7
|
+
tslib_1.__exportStar(useTableBody_1, exports);
|
|
8
|
+
tslib_1.__exportStar(useTableBodyStyles_1, exports);
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/index.ts"],"names":[],"mappings":";;;IAAA,2CAA4B;IAC5B,iDAAkC;IAClC,iDAAkC;IAClC,8CAA+B;IAC/B,oDAAqC","sourcesContent":["export * from './TableBody';\nexport * from './TableBody.types';\nexport * from './renderTableBody';\nexport * from './useTableBody';\nexport * from './useTableBodyStyles';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.renderTableBody_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Render the final JSX of TableBody
|
|
7
|
+
*/
|
|
8
|
+
var renderTableBody_unstable = function (state) {
|
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
|
10
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
|
11
|
+
};
|
|
12
|
+
exports.renderTableBody_unstable = renderTableBody_unstable;
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=renderTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTableBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/renderTableBody.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,wBAAwB,GAAG,UAAC,KAAqB;QACtD,IAAA,KAAuB,0BAAQ,CAAiB,KAAK,CAAC,EAApD,KAAK,WAAA,EAAE,SAAS,eAAoC,CAAC;QAE7D,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,wBAAwB,4BAInC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableBodyState, TableBodySlots } from './TableBody.types';\n\n/**\n * Render the final JSX of TableBody\n */\nexport const renderTableBody_unstable = (state: TableBodyState) => {\n const { slots, slotProps } = getSlots<TableBodySlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities", "../../contexts/tableContext"], function (require, exports, tslib_1, react_utilities_1, tableContext_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useTableBody_unstable = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render TableBody.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useTableBodyStyles_unstable,
|
|
9
|
+
* before being passed to renderTableBody_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of TableBody
|
|
12
|
+
* @param ref - reference to root HTMLElement of TableBody
|
|
13
|
+
*/
|
|
14
|
+
var useTableBody_unstable = function (props, ref) {
|
|
15
|
+
var _a;
|
|
16
|
+
var noNativeElements = tableContext_1.useTableContext().noNativeElements;
|
|
17
|
+
var rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : noNativeElements) ? 'div' : 'tbody';
|
|
18
|
+
return {
|
|
19
|
+
components: {
|
|
20
|
+
root: rootComponent,
|
|
21
|
+
},
|
|
22
|
+
root: react_utilities_1.getNativeElementProps(rootComponent, tslib_1.__assign({ ref: ref, role: rootComponent === 'div' ? 'rowgroup' : undefined }, props)),
|
|
23
|
+
noNativeElements: noNativeElements,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.useTableBody_unstable = useTableBody_unstable;
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=useTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableBody.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/useTableBody.ts"],"names":[],"mappings":";;;;IAKA;;;;;;;;OAQG;IACI,IAAM,qBAAqB,GAAG,UAAC,KAAqB,EAAE,GAA2B;;QAC9E,IAAA,gBAAgB,GAAK,8BAAe,EAAE,iBAAtB,CAAuB;QAC/C,IAAM,aAAa,GAAG,CAAA,MAAA,KAAK,CAAC,EAAE,mCAAI,gBAAgB,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;QAErE,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,aAAa;aACpB;YACD,IAAI,EAAE,uCAAqB,CAAC,aAAa,qBACvC,GAAG,KAAA,EACH,IAAI,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IACnD,KAAK,EACR;YACF,gBAAgB,kBAAA;SACjB,CAAC;IACJ,CAAC,CAAC;IAfW,QAAA,qBAAqB,yBAehC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableBodyProps, TableBodyState } from './TableBody.types';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableBody.\n *\n * The returned state can be modified with hooks such as useTableBodyStyles_unstable,\n * before being passed to renderTableBody_unstable.\n *\n * @param props - props from this instance of TableBody\n * @param ref - reference to root HTMLElement of TableBody\n */\nexport const useTableBody_unstable = (props: TableBodyProps, ref: React.Ref<HTMLElement>): TableBodyState => {\n const { noNativeElements } = useTableContext();\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'tbody';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'rowgroup' : undefined,\n ...props,\n }),\n noNativeElements,\n };\n};\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
define(["require", "exports", "@griffel/react"], function (require, exports, react_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useTableBodyStyles_unstable = exports.tableBodyClassNames = exports.tableBodyClassName = void 0;
|
|
5
|
+
var useTableLayoutStyles = react_1.makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
display: 'table-row-group',
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
var useFlexLayoutStyles = react_1.makeStyles({
|
|
11
|
+
root: {
|
|
12
|
+
display: 'block',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
exports.tableBodyClassName = 'fui-TableBody';
|
|
16
|
+
exports.tableBodyClassNames = {
|
|
17
|
+
root: 'fui-TableBody',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Apply styling to the TableBody slots based on the state
|
|
21
|
+
*/
|
|
22
|
+
var useTableBodyStyles_unstable = function (state) {
|
|
23
|
+
var layoutStyles = {
|
|
24
|
+
table: useTableLayoutStyles(),
|
|
25
|
+
flex: useFlexLayoutStyles(),
|
|
26
|
+
};
|
|
27
|
+
state.root.className = react_1.mergeClasses(exports.tableBodyClassName, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.root.className);
|
|
28
|
+
return state;
|
|
29
|
+
};
|
|
30
|
+
exports.useTableBodyStyles_unstable = useTableBodyStyles_unstable;
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=useTableBodyStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableBodyStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-table/src/components/TableBody/useTableBodyStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,oBAAoB,GAAG,kBAAU,CAAC;QACtC,IAAI,EAAE;YACJ,OAAO,EAAE,iBAAiB;SAC3B;KACF,CAAC,CAAC;IAEH,IAAM,mBAAmB,GAAG,kBAAU,CAAC;QACrC,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;IAEU,QAAA,kBAAkB,GAAG,eAAe,CAAC;IACrC,QAAA,mBAAmB,GAAmC;QACjE,IAAI,EAAE,eAAe;KACtB,CAAC;IAEF;;OAEG;IACI,IAAM,2BAA2B,GAAG,UAAC,KAAqB;QAC/D,IAAM,YAAY,GAAG;YACnB,KAAK,EAAE,oBAAoB,EAAE;YAC7B,IAAI,EAAE,mBAAmB,EAAE;SAC5B,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,0BAAkB,EAClB,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EACzE,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAZW,QAAA,2BAA2B,+BAYtC","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport type { TableBodySlots, TableBodyState } from './TableBody.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-row-group',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\nexport const tableBodyClassName = 'fui-TableBody';\nexport const tableBodyClassNames: SlotClassNames<TableBodySlots> = {\n root: 'fui-TableBody',\n};\n\n/**\n * Apply styling to the TableBody slots based on the state\n */\nexport const useTableBodyStyles_unstable = (state: TableBodyState): TableBodyState => {\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableBodyClassName,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n\n return state;\n};\n"]}
|