Repository navigation
Releases: stephenWanjala/KomposeTable
Releases · stephenWanjala/KomposeTable
Release list
v0.0.3
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
KomposeTable 0.0.2
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
KomposeTableStatefor Centralized Configuration:- Table configuration (e.g.,
enableSorting,outlinedTable,dividerThickness,columnResizeMode) is now managed by aKomposeTableStateobject, which can be created and remembered usingrememberKomposeTableState(). This allows for a more organized and state-retaining approach to table settings, even across configuration changes. KomposeTableStateis nowsaveable, meaning your table's configuration will persist across process restarts (e.g., on Android when the app is backgrounded).
- Table configuration (e.g.,
- Enhanced Column Definition with
TableSortColumn:- The
TableColumnclass has been renamed toTableSortColumnand now explicitly includes avalueExtractorlambda. 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.
- The
- Improved Column Resizing in
CONSTRAINEDMode:- The
CONSTRAINEDcolumn 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.
- The
- New Built-in Material Icons:
- Custom
ArrowDropDownandKeyboardArrowUpicons have been integrated directly into the library, removing the dependency onmaterial-icons-extendedand reducing library size.
- Custom
- Gradle Plugin Updates and Dependency Cleanup:
- Updated Gradle plugin versions for
compose.compiler,composeMultiplatform, andkotlinMultiplatform. - Removed
kotlin-plugin-serializationandkotlinx-serialization-jsondependencies from thekomposetablemodule, as data extraction is now handled by thevalueExtractorlambda. - Removed
material-icons-extendeddependency.
- Updated Gradle plugin versions for
- New Sample Module:
- A dedicated
samplemodule has been added, demonstrating how to useKomposeTablewith a practical example of a Football League Table. This will make it easier for developers to get started and understand the component's features.
- A dedicated
- Documentation Updates:
- The
README.mdhas been updated to reflect the newvalueExtractorfeature, 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.
- The
Breaking Changes (for users upgrading from 0.0.1):
TableColumnis nowTableSortColumn: You will need to update your column definitions.valueExtractoris now required forTableSortColumn: Instead of relying on reflection withidto extract values, you must provide avalueExtractorlambda.- Table Configuration Moved to
KomposeTableState: Direct parameters likeenableSorting,outlinedTable,alternatingRowColors, etc., have been removed from theKomposeTablecomposable. You now pass aKomposeTableStateobject. - Removed
kotlinx-serialization-jsondependency: If your project relied on this transitively throughkomposetable, you might need to add it explicitly if still required.
Full Changelog: 0.0.1...0.0.2
KomposeTable v0.0.1
Release Notes - KomposeTable
We are excited to announce the initial release of KomposeTable!
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!