[FEATURE]: Extensible props for each selectableRowsComponent instance
Feature Check list
- [x] Agree to the Code of Conduct
- [x] Read the README to ensure the feature is not already present
- [x] You read Creating Issues, Features and Pull Requests
- [x] Considered the value versus complexity for all users of the library as well as library maintenance
- [x] Considered if this can be a storybook or documentation example
Is your feature request related to a problem? Please describe
Right now on our a11y maintainability team we've been requested to customize aria attributes for each checkbox within rows, so that each checkbox it's labeled differently but with custom text (we need to use one data field, title in our case). So right now select-row-1 is not an aria-label we can have.
Describe the solution you'd like
I think a modification of selectableRowsComponentProps to accept a function that receives the currently iterated row as param, and expects to output the props obj for that instance, would be a good way to solve this. That way you could have sth like..
selectableRowsComponentProps={commonPropsObj | (row) => { ...commonPropsObj, aria-label: row.title, otherSingularProp: row.whatEver }}
This solution is inspired in cell prop API.
Describe alternatives you've considered
The solution described above, or same approach but for selectableRowsComponent, but that might make selectableRowsComponentProps pointless since you would add your props to your JSX component directly.
Additional context
Having an aria-label "select-row-1" might not be the greatest UX in many cases, so being more flexible regarding Checkbox props would fit better much more use cases.