Repository navigation
KomposeTable 0.0.3
New Features
- Configurable Selections:
KomposeTableStateandrememberKomposeTableStatenow acceptdefaultSelectedIndicesandselectionMode([SINGLE] or [MULTIPLE]).- New
KomposeTablevariant for directdefaultSelectedIndicesandselectionModesetup.
- Optimized Selection Observation:
snapshotFlow,map, anddistinctUntilChangedimprove performance foronSelectionChangecallbacks.
- Enhanced Documentation: Comprehensive KDoc comments added for clarity.
- Sample Application: Updated
FootballLeagueTableScreento demonstrate new selection features.
Enhancements
- Granular Selection Callbacks: Optional
onSelectionChangecallbacks inTableSelectionModelmethods (selectItem,deselectItem, etc.). - Robust Default Selection:
LaunchedEffectensures proper initialization of default selections. - State Persistence:
KomposeTableState.Savernow preservesdefaultSelectedIndicesandselectionMode.
Bug Fixes
- Default selections are validated against data indices to prevent errors.
- Strict enforcement of single-selection constraints.
Backward Compatibility
- Fully backward compatible.
- Existing
KomposeTableusage remains unchanged.
Usage Example
val state = rememberKomposeTableState(
defaultSelectedIndices = setOf(0, 2, 5),
selectionMode = SelectionMode.MULTIPLE
)
KomposeTable(
columns = columns,
tableData = data,
state = state,
onSelectionChange = { selectedItems -> /* ... */ }
)Version
0.0.3
Full Changelog: 0.0.2...0.0.3