skeleton
skeleton copied to clipboard
Data Table refactor and cleanup
Per: https://github.com/Brain-Bones/skeleton/issues/194
Given the complexity of the Data Table component I'm pulling this out to it's down dedicated ticket. The Data Table is also widely used in our docs, so this could require quite a bit of update for even small changes.
We might also make considerations for implementing a template-driven table or some other means to insert components into the cells of tables. Currently we can insert HTML, but the template approach might benefit this as well.
The use case is something like this - imagine you had a table mapped with four columns:
foo | bar | fizz | buzz
But you wanted to include extra details included in your source data but not visually present it on in the UI. Something like this:
id (hidden) | foo | bar | fizz | buzz
Currently when tapping the row we only present the data visibly present in the data mapping. However, we should consider providing the full set of data for the row from the original source.
Reference @ryceg proposal for handling data types for data table components:
- https://github.com/Brain-Bones/skeleton/pull/299
Note to self: native HTML tables + action. Perhaps with a Table component just for a simpler interface for generating HTML tables?
Just moving to here:
Issues with column collapsing on individual rows
Just as a note: There were two exports from DataTableService that are used internally of DataTable.svelte (sortAsc and sortDesc), then there is a mapTableSource that is used in the doc page for data-tables.
On the docs page there is also a CodeBlock that shows an import of import { mapTableSource } from '@brainandbones/skeleton/components/Table/DataTableService'; which I'm pretty sure won't work as the alias @brainandbones/skeleton points to the src/index.ts rather than a directory alias.
What probably needs to happen is that these DataTableService exports need to migrate to the top level src/index.ts file and probably have a bit of a namespace scoping like dtsSortAsc or something like that ?
== In the meantime, they have been added to the src/index.ts as exports to assist with the monorepo migration
Adding this for additional context to Nik's note above:
- https://github.com/Brain-Bones/skeleton/issues/478
Feature request: add table pagination
@kimjunsung04 Already exists: https://www.skeleton.dev/components/paginators
Resource: https://twitter.com/vitalyf/status/1589306434050588674
Feature request: Add an option to style the currently selected row as it's currently possible to style the row that's being hovered over
Feature request: Add an option to enable multi row selection
I've updated the original post at the top with desired updates up until this point. Expect updates throughout the week as I implement these changes.