News for hackers. Stuff that matters.
Re:HTML with Superpowers: An Introduction to Web Components by colecut on Tuesday January 10, 2023 @10:32PM (#34334717)
Why is there no standard/widely used vanilla-js based webcomponent for creating a table with filtering+sorting+pagination? It's such a common and useful thing.
Re:HTML with Superpowers: An Introduction to Web Components by buildingsramen on Tuesday January 10, 2023 @11:21PM (#34334976)
What do you mean? There are tons of these around. Are you complaining that none of them are popular enough?
Re:HTML with Superpowers: An Introduction to Web Components by kgwxd on Tuesday January 10, 2023 @11:44PM (#34335087)
None of them are standard. It should be baked into the cake. It's been a puzzler to me since I started programming over 20 years ago. Every third-party library existed basically just to provide a usable grid because most everything else was good enough. Combo boxes and date pickers too but those were less of a pain to implement.
Re:HTML with Superpowers: An Introduction to Web Components by zerocrates on Wednesday January 11, 2023 @02:11AM (#34335918)
There's various bits and pieces around the margins of grid/table/sorting that make it so it doesn't surprise me that it's not natively provided.

But the lack of a combobox in HTML, I don't get at all. datalist kind of sort of does it but not quite, plus it's inconsistently implemented as to what it actually shows.

Re:HTML with Superpowers: An Introduction to Web Components by jamessb on Wednesday January 11, 2023 @05:37AM (#34337040)
The eventual aim of Open-UI is to establish a set of standard UI components like this.

> The purpose of Open UI to the web platform is to allow web developers to style and extend built-in web UI controls, such as <select> dropdowns, checkboxes, radio buttons, and date/color pickers.

> Today, component frameworks and design systems reinvent common web UI controls to give designers full control over their appearance and behavior. We hope to make it unnecessary to reinvent built-in UI controls

https://open-ui.org/

Re:HTML with Superpowers: An Introduction to Web Components by tiborsaas on Wednesday January 11, 2023 @06:29AM (#34337319)
> None of them are standard.

If there were a standard, you'd probably still complain that it doesn't match your use-case.

Re:HTML with Superpowers: An Introduction to Web Components by PaulDavisThe1st on Wednesday January 11, 2023 @01:12AM (#34335591)
Possibly the same reason there's no standard way to get a file browsing widget from a linux native applications, despite it being a common and useful thing.
Re:HTML with Superpowers: An Introduction to Web Components by The_Colonel on Wednesday January 11, 2023 @06:02AM (#34337164)
I assume that it's because there's basically no upper scope limit, and it's not obvious where the cut should be done.

Just take filtering - there are so many possibilities of how filters can look like, how can they be combined (AND, OR, nested) etc.

Re:HTML with Superpowers: An Introduction to Web Components by Existenceblinks on Wednesday January 11, 2023 @08:30AM (#34338165)
That. Basically a `f` in `filter(f, collection)` is code which can be arbitrary business logic.
Re:HTML with Superpowers: An Introduction to Web Components by Existenceblinks on Wednesday January 11, 2023 @08:28AM (#34338156)
Notion table seems to be close to generic. Basically let users provide a `f` in `filter(f, collection)`.