Skip to content

v0.0.3

Latest

Choose a tag to compare

@stephenWanjala stephenWanjala released this 11 Sep 02:45
34551e6

KomposeTable 0.0.3

New Features

  • Configurable Selections:
    • KomposeTableState and rememberKomposeTableState now accept defaultSelectedIndices and selectionMode ([SINGLE] or [MULTIPLE]).
    • New KomposeTable variant for direct defaultSelectedIndices and selectionMode setup.
  • Optimized Selection Observation:
    • snapshotFlow, map, and distinctUntilChanged improve performance for onSelectionChange callbacks.
  • Enhanced Documentation: Comprehensive KDoc comments added for clarity.
  • Sample Application: Updated FootballLeagueTableScreen to demonstrate new selection features.

Enhancements

  • Granular Selection Callbacks: Optional onSelectionChange callbacks in TableSelectionModel methods (selectItem, deselectItem, etc.).
  • Robust Default Selection: LaunchedEffect ensures proper initialization of default selections.
  • State Persistence: KomposeTableState.Saver now preserves defaultSelectedIndices and selectionMode.

Bug Fixes

  • Default selections are validated against data indices to prevent errors.
  • Strict enforcement of single-selection constraints.

Backward Compatibility

  • Fully backward compatible.
  • Existing KomposeTable usage 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