Tables #1253
Replies: 1 comment 7 replies
-
Agreed! I was just talking with @MathieuPuech about this and that we should probably start by making a list of requirements of a.. let's call it Basics:
Table-wide features,:
These features could perhaps be abstracted into a handler layer that happens before rendering layer but does not mutate the original data/state (items). Footer features:
Keep in mind with features we should probably stick to only the most common / generic ones and leave implementers/subclassers to add their own opinionated ones. For example, CRUD actions like deleting rows, adding new items through the UI, I would consider to be quite opinionated. Some people would pop up a confim dialog before deleting, for adding new item you'd need some kind of form, etc. etc. we can of course create demos showing examples. These are the requirements that come to mind after reading about:
In terms of API, and this is obviously going beyond just "requirements" but I still want to give my 2 cents, I really like lit-datatable and vuetify data-tables. The API seems straight forward to me, I'm combining a bit the vuetifyjs and lit-datatable APIs here: <lion-data-table
.items=[{ name: 'foo', value: 15 }]
.headers=[{ text: 'Foo', value: 'name' }, { text: 'Amount', value: 'value' }]
>
<lion-data-table-column
property="name"
.html=${(val, prop) => html`<lion-button>${prop}: ${val}</lion-button>`}
></lion-data-table-column>
</lion-data-table> I believe it has the right amount of declarative styled API, but also allow more complex things by changing the renderer ( I also believe it is an API that is fitting pretty well to lion, which is my main gripe with stampino which uses So at this moment, in my opinion the lit-datatable is quite excellent in terms of API and I think we could take that approach, and there's a few things for vuetifyjs that I do prefer. I also think vuetifyjs does some other things really well that I think we should take inspiration from: mainly their dynamic slots feature to customize things about the data table seems really useful if we were to adopt such an equivalent in our data table. |
Beta Was this translation helpful? Give feedback.
-
I'd love to see Lion tackle tabular data. Tables have such a huge use case for many enterprise apps with functionality like searching, sorting, filtering. Something similar to this.
Beta Was this translation helpful? Give feedback.
All reactions