feat(filterButtons): add filterable item counting
Summary
Introducing ability to count filterable items in filter groups. They can either be counted in a hidable group, or individually.
Also introduced ability to set multiple values to filter specific items (where all values must be enable via filters to show the item).
| All filters active | Some filter disabled |
|---|---|
| Example code from above |
|---|
| Example page link: https://liquipedia.net/counterstrike/User:IMarbot/Majors/Player_Database |
How did you test this change?
Tested with dev tools and via userscripts by myself and extensively by @CarbonDogma
Also tested existing buttons for tournaments list here and they appear to show no regression in behaviour: https://liquipedia.net/counterstrike/User:IMarbot/Sandbox_6
(userscript and above example links use data-filter-dev property on objects to avoid clashes with existing filtering code)
I think this is going to break, or at least be confusing with, the (weird) region mapping stuff in use on e.g. Valorant main page, as they are CSV category values
I think this is going to break the (weird) region mapping stuff in use on e.g. Valorant main page, as they are CSV category values
The data-filter-category field is not split by commas, only the new data-filter-categories field, so it shouldn't make a difference I think.