Offer a column's known values as its filter, add multiple row selection, and give the filter a real icon - #322
Merged
Conversation
…al icon A column whose values come from a known set - a status, a kind, an enum rendered as text - could only be filtered by typing. The menu picked its input from dataType alone, and 'boolean' was the only case that listed values, so an enum column declared numeric asked the user to type the underlying number while the cell showed the word. Column.filterOptions supplies those values, rendered as a list and narrowed to equals/not equals, because 'starts with' means nothing over a closed set. The trigger also rendered U+2315 TELEPHONE RECORDER in a span, sized by the ambient font - which is why it read as a tiny unrecognizable mark rather than a filter. It is now a funnel drawn as an SVG and sized against the header row.
The parts manifest is the contract for what a component emits, so a new data-cratis-part has to be declared there; the pinned Storybook index count moves by the two stories added for the new filter and selection behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
Column.filterOptionssupplies the values a column can be filtered by, rendered as a list instead of a free-form input, with the match modes narrowed to equals/not equals.selectionMode='multiple'on the data tables andDataPage, with a checkbox per row, a select-all header checkbox, andselectedItems/onSelectedItemsChange.dataTable.selectAllRowsmessage for localizing the select-all accessible name.Fixed
U+2315 TELEPHONE RECORDERin aspanat the ambient font size, so it showed as a tiny mark that does not read as a filter. It is now a funnel SVG sized against the header row.Notes
A column whose values come from a known set — a status, a kind, an enum rendered as text — could previously only be filtered by typing.
ColumnFilterMenupicked its value input fromdataTypealone, andbooleanwas the only case that listed values. An enum column declareddataType='numeric'therefore asked the user to type the underlying number while the cell showed the word, which is indistinguishable from the filter not working.Multiple selection is additive rather than a change to the existing single-selection contract:
selection/onSelectionChangekeep their current types, and the new set is reported throughselectedItems/onSelectedItemsChange. Nothing that compiles today changes meaning.Select-all covers the rows the filter currently leaves visible, not the whole loaded page — a bulk action that silently included rows hidden behind a filter would act on more than it showed.
Consumed by Cratis/Chronicle#4140 and Cratis/Chronicle#4141.