Package-level declarations
Types
Link copied to clipboard
data class TableColors(val primary: Color = SurfaceColor.Primary, val primaryLight: Color = SurfaceColor.ContainerHighest, val headerText: Color = TextColor.OnSurfaceLight, val headerBackground1: Color = SurfaceColor.ContainerLow, val headerBackground2: Color = SurfaceColor.Container, val cellText: Color = TextColor.OnSurfaceVariant, val disabledCellText: Color = TextColor.OnDisabledSurface, val disabledCellBackground: Color = SurfaceColor.DisabledSurfaceBright, val disabledSelectedBackground: Color = SurfaceColor.DisabledSurface, val tableBackground: Color = SurfaceColor.SurfaceBright, val onPrimary: Color = TextColor.OnPrimary, val selectedCell: Color = SurfaceColor.ContainerHighest)
Data class representing the colors used in the table component.
Link copied to clipboard
Link copied to clipboard
data class TableDimensions(val tableHorizontalPadding: Dp = Spacing.Spacing16, val tableVerticalPadding: Dp = Spacing.Spacing16, val defaultCellWidth: Int = 260, val defaultCellHeight: Dp = Spacing.Spacing40, val defaultRowHeaderWidth: Int = 275, val defaultHeaderHeight: Int = 36, val defaultHeaderTextSize: TextUnit = 12.sp, val defaultRowHeaderTextSize: TextUnit = 12.sp, val defaultCellTextSize: TextUnit = 12.sp, val totalWidth: Int = 0, val cellPaddingValues: PaddingValues = PaddingValues(
horizontal = Spacing.Spacing8,
vertical = Spacing.Spacing11,
), val headerCellPaddingValues: PaddingValues = PaddingValues(
horizontal = Spacing.Spacing8,
vertical = Spacing.Spacing11,
), val tableBottomPadding: Dp = Spacing.Spacing200, val extraWidths: Map<String, Int> = emptyMap(), val rowHeaderWidths: Map<String, Int> = emptyMap(), val columnWidth: Map<String, Map<Int, Int>> = emptyMap(), val minRowHeaderWidth: Int = 130, val minColumnWidth: Int = 130, val maxRowHeaderWidth: Int = Int.MAX_VALUE, val maxColumnWidth: Int = Int.MAX_VALUE, val tableEndExtraScroll: Dp = Spacing.Spacing6)
Data class representing the dimensions of the table component.
Link copied to clipboard
Sealed class representing different types of table selections.
Link copied to clipboard
object TableTheme
Object to access the current table theme settings.
Properties
Link copied to clipboard
Link copied to clipboard
CompositionLocal to provide TableColors throughout the Compose hierarchy.
Link copied to clipboard
CompositionLocal to provide TableConfiguration throughout the Compose hierarchy.
Link copied to clipboard
Composition local for the table dimensions.
Link copied to clipboard
CompositionLocal to provide TableSelection throughout the Compose hierarchy.
Functions
Link copied to clipboard
fun DataTable(tableList: List<TableModel>, currentSelection: TableSelection = TableSelection.Unselected(), tableInteractions: TableInteractions? = null, onResizedActions: TableResizeActions? = null, topContent: @Composable () -> Unit? = null, bottomContent: @Composable () -> Unit? = null, contentPadding: PaddingValues = if (
!TableTheme.configuration.editable &&
!tableList.all { it.areAllValuesEmpty() }
) {
PaddingValues(
vertical = LocalTableDimensions.current.tableVerticalPadding,
horizontal = LocalTableDimensions.current.tableHorizontalPadding,
)
} else {
PaddingValues(bottom = TableTheme.dimensions.tableBottomPadding)
}, loading: Boolean = false)
Composable function to display a data table.
Link copied to clipboard
fun TableTheme(tableColors: TableColors = LocalTableColors.current, tableDimensions: TableDimensions = LocalTableDimensions.current, tableConfiguration: TableConfiguration = LocalTableConfiguration.current, tableValidator: Validator = DefaultValidator(), content: @Composable () -> Unit)
Composable function to provide table-related theme settings to the content.