infor-design / enterprise

Enterprise-grade component library for the Infor Design System
https://design.infor.com
Apache License 2.0
134 stars 81 forks source link

Datagrid: Current filterMaskOptions are inadequate to control input for filtering numeric and date columns #5618

Closed claudenbach closed 10 months ago

claudenbach commented 3 years ago

Problem: Landmark is developing a feature to allow columns to be filtered by more than one filter term. We are presently using the comma character as the delimiter between filter terms. So for example on an alpha column the user would be able to enter Apples, Grapes.

If the term itself contains the comma character, the user would need to enclose the filter term with double quotes. So for example on a numeric column the user would have to enter "1,000.00", "99,999".

We are currently implementing the feature using the filterMaskOptions. However when using the pattern function it only allows control over the individual characters being entered. If an entered character matches the mask its accepted regardless of whether the input makes sense.

For example, for a date column the user can enter the following and because it matches the mask it is accepted: ' ///// 2015'

For example, for a decimal column the user can enter the following and because it matches the mask it is accepted: '12-------,,,,,,5959595'

Describe the solution you'd like: The current column.maskOptions works great for editing a column cell. Able to expand on it for filterMaskOptions to indicate multiples are allowed with a specified delimiter and whether a space between filter term values is accepted?

Today the only way that I know to allow the user to type in multiples were the delimiter is a comma, is to change the filterType to 'text'. This is problematic for a date column since changing the filterType from 'date' to 'text' will remove the date icon within the filter cell.

Attached the sample test-filter-mask-options.html to illustrate what I'm currently doing. Open to other suggestions to resolve.

claudenbach commented 3 years ago

FilterMaskOptions.zip

tmcconechy commented 3 years ago

@EdwardCoyle Do you have any ideas how we could do this with maybe some customizations to the existing code so this isnt something we would have to support? I.E. Adding the custom regex/functions

I think this is going be tricky and seems like it would make things a bit complicated to type. What abut just using the multiselect filter instead. This seems better UX to me.

https://main-enterprise.demo.design.infor.com/components/datagrid/example-filter.html and elimnates the need for this.

Screen Shot 2021-09-16 at 9 32 40 AM
lipetzan commented 2 years ago

Any target sprint or dates on this @tmcconechy ?

tmcconechy commented 2 years ago

No, i was waiting for feedback on my proposal of doing it another way using the multiselect to pick multiples. As i think this adds a lot of complexity for one use case. Also wondering of @EdwardCoyle has any suggestions to make this simpler/saner?

tmcconechy commented 2 years ago

Discussing this it seems like a really heavy ask. Especially having commas inside values of different types inside values? Maybe we can come up with a design that doesnt put this all on a mask as this is pretty complex (and probably hard for a user to use).

Lets see if we can come up with a design like maybe a modal with separate inputs? Current mask code is not setup to handle this in any way.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tmcconechy commented 10 months ago

Closing stale issues