Skip to content

Releases: stephenWanjala/KomposeTable

v0.0.3

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

KomposeTable 0.0.2

Choose a tag to compare

@stephenWanjala stephenWanjala released this 10 Sep 12:32
d9dbb4a

KomposeTable Release Notes (Version 0.0.2)

KomposeTable 0.0.2, brings significant enhancements to customization, stability, and ease of use for Compose Multiplatform tables!

Key New Features & Improvements:

  • Introducing KomposeTableState for Centralized Configuration:
    • Table configuration (e.g., enableSorting, outlinedTable, dividerThickness, columnResizeMode) is now managed by a KomposeTableState object, which can be created and remembered using rememberKomposeTableState(). This allows for a more organized and state-retaining approach to table settings, even across configuration changes.
    • KomposeTableState is now saveable, meaning your table's configuration will persist across process restarts (e.g., on Android when the app is backgrounded).
  • Enhanced Column Definition with TableSortColumn:
    • The TableColumn class has been renamed to TableSortColumn and now explicitly includes a valueExtractor lambda. This provides a type-safe, reflection-free way to define how data should be extracted from your data class for display and sorting, significantly improving performance and reliability.
  • Improved Column Resizing in CONSTRAINED Mode:
    • The CONSTRAINED column resize mode now intelligently distributes any extra available table width among visible columns, ensuring that the table always fills its allocated space while maintaining the relative proportions of resized columns.
  • New Built-in Material Icons:
    • Custom ArrowDropDown and KeyboardArrowUp icons have been integrated directly into the library, removing the dependency on material-icons-extended and reducing library size.
  • Gradle Plugin Updates and Dependency Cleanup:
    • Updated Gradle plugin versions for compose.compiler, composeMultiplatform, and kotlinMultiplatform.
    • Removed kotlin-plugin-serialization and kotlinx-serialization-json dependencies from the komposetable module, as data extraction is now handled by the valueExtractor lambda.
    • Removed material-icons-extended dependency.
  • New Sample Module:
    • A dedicated sample module has been added, demonstrating how to use KomposeTable with a practical example of a Football League Table. This will make it easier for developers to get started and understand the component's features.
  • Documentation Updates:
    • The README.md has been updated to reflect the new valueExtractor feature, add a note about the sample module, and clarify existing features.
    • Added a "Maven Central Version" badge to the README.
    • Added a TODO section for future documentation and examples.

Breaking Changes (for users upgrading from 0.0.1):

  • TableColumn is now TableSortColumn: You will need to update your column definitions.
  • valueExtractor is now required for TableSortColumn: Instead of relying on reflection with id to extract values, you must provide a valueExtractor lambda.
  • Table Configuration Moved to KomposeTableState: Direct parameters like enableSorting, outlinedTable, alternatingRowColors, etc., have been removed from the KomposeTable composable. You now pass a KomposeTableState object.
  • Removed kotlinx-serialization-json dependency: If your project relied on this transitively through komposetable, you might need to add it explicitly if still required.

Full Changelog: 0.0.1...0.0.2

KomposeTable v0.0.1

Choose a tag to compare

@stephenWanjala stephenWanjala released this 10 Aug 16:03
b43543a

Release Notes - KomposeTable

We are excited to announce the initial release of KomposeTable! Maven Central Version

KomposeTable is a highly customizable table component for Compose Multiplatform, designed to provide a flexible and feature-rich way to display tabular data in your applications.

✨ Features

  • Column Sorting: Easily sort data by clicking on column headers.
  • Column Resizing: Allow users to adjust column widths by dragging dividers.
  • Row Selection: Support for both single and multiple row selection.
  • Customizable Appearance: Extensive options to style the table, rows, and cells, including colors, borders, and dividers.
  • Alternating Row Colors: Option to enhance readability with alternating background colors for rows.
  • Hover Effects: Visual feedback when users hover over rows.
  • Outlined Table Style: Display the table within an outlined card for a modern look.
  • Compose Multiplatform: Built to work seamlessly across all platforms supported by Compose Multiplatform.

🚀 Getting Started

implementation("io.github.stephenwanjala:komposetable:0.0.1")

Check out the README.md for example usage and more details.

🙏 Feedback and Contributions

This is the first release, and we welcome your feedback! Please report any issues or suggest features file an issue on github. Contributions are also welcome!