-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to pass custom table components #1167
Conversation
@gregnb, @gabrielliwerant - could you take alook at this? |
@vbartusevicius There is a rather long backlog of PRs and issues, and they should be taken somewhat in order, unless it's a quick bug fix or something. This doesn't qualify, and so I'm afraid it may be a while. Additionally, I'm not too sure about this approach. The way customization tends to be handled now is through custom renderers. There's no precedent in the library for customization that works in the way you propose, so I'm not too sure about adding it. |
@gabrielliwerant, yes there is a long backlog, but I don't see too much of activity there. I think this PR could help with cases like #351 In addition to that I intentionally introduced separate prop If you think that it would be more reasonable to move |
This is an exceptionally cool idea. Currently much of what's described here can be done with the table's various customRender functions, however, this type of API (to me at least) is much easier to understand. This approach would also solve the Tooltip component problem described in #1217 (though this PR doesn't have Tooltip available as an override so I may look into that). It also lends itself well to the new plug-in selection, and would allow alternative forms of various components for common use cases. The downsides I see are that if any prop name to one of these overridable components changes, the custom component will break. But these names have been pretty stable, and maybe saving such a change for a major release would be the way to go if such a situation arose. There could also be issues if any data formats changed, but customRender functions have this same issue. I may add something in the documentation about recommending the use of ~versions for apps that do lots of custom internal overrides. Anyway, I've merged this into the upcoming v3 branch. Sorry for the delay and thank you for putting this together! |
@patorjk - thanks for appreciation! |
Currently there is no way to change built-in table components. This PR enables some customization.
This is a bit different that customizing with custom Material theme as this allows to react to given props.
In example: you can change the color of
Chip
inTableFilterList
depending on current value. Useful for filtering by some status-like fields - you will have oneChip
indicating status with visual feedback in filter list instead of duplicating this feedback throughout entire table.