skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

Data Table refactor and cleanup

Open endigo9740 opened this issue 1 year ago • 4 comments

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.

endigo9740 avatar Sep 10 '22 19:09 endigo9740

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.

endigo9740 avatar Sep 14 '22 22:09 endigo9740

Reference @ryceg proposal for handling data types for data table components:

  • https://github.com/Brain-Bones/skeleton/pull/299

endigo9740 avatar Sep 28 '22 16:09 endigo9740

Note to self: native HTML tables + action. Perhaps with a Table component just for a simpler interface for generating HTML tables?

endigo9740 avatar Oct 11 '22 20:10 endigo9740

Just moving to here:

Issues with column collapsing on individual rows

niktek avatar Oct 13 '22 05:10 niktek

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

niktek avatar Oct 31 '22 07:10 niktek

Adding this for additional context to Nik's note above:

  • https://github.com/Brain-Bones/skeleton/issues/478

endigo9740 avatar Nov 01 '22 19:11 endigo9740

Feature request: add table pagination

kimjunsung04 avatar Nov 05 '22 15:11 kimjunsung04

@kimjunsung04 Already exists: https://www.skeleton.dev/components/paginators

endigo9740 avatar Nov 05 '22 17:11 endigo9740

Resource: https://twitter.com/vitalyf/status/1589306434050588674

endigo9740 avatar Nov 07 '22 17:11 endigo9740

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

jonas-dongowski avatar Nov 08 '22 19:11 jonas-dongowski

Feature request: Add an option to enable multi row selection

jonas-dongowski avatar Nov 08 '22 19:11 jonas-dongowski

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.

endigo9740 avatar Nov 09 '22 17:11 endigo9740