-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement repeating group (editgrid) #36
Comments
sergei-maertens
added a commit
that referenced
this issue
Mar 11, 2025
This an almost verbatim copy of the EditGrid components, with some re-organized SCSS and improved documentation.
sergei-maertens
added a commit
that referenced
this issue
Mar 12, 2025
It's a bit annoying that the icon library leaks down into everything, but for the time being we're not planning on supporting other icons. It would be possible to refactor this in the future to make it more pluggable, so the code to include an icon will be generalized a bit to make that clear. It's up to the downstream project to ensure the necessary stylesheets are loaded - we leave that out of scope because the complexities of font assets paths are a headache.
sergei-maertens
added a commit
that referenced
this issue
Mar 12, 2025
For the time being, we stick to font-awesome, but it should possible in the future to bring in your own SVG-based icons to render or alternative libraries, so the Icon component has been named in a generic way to make future expansion more natural. Plenty of challenges there that we will *not* tackle right now.
sergei-maertens
added a commit
that referenced
this issue
Mar 12, 2025
sergei-maertens
added a commit
that referenced
this issue
Mar 12, 2025
sergei-maertens
added a commit
that referenced
this issue
Mar 12, 2025
The editgrid state is now encapsulated in FieldArray, which provides the helpers to update/replace individual items at a particular index and/or remove them. It's up to the developer to still properly provide the array of items, using the same source of form state, but this allows automatic wrapping in EditGridItem components so that the implementation details don't have to leak to the outside too much. This actually unlocks a new feature where we can make per-item decisions about which controls for saving/removing are available, a thing we need for the appointment flow with products where you cannot remove the only product if there's only one. To enable adding items, only a blueprint/blank item needs to be provided as a prop (which can also change depending on the state, that's up to the outer component). Providing `null` for this blueprint disables the add button.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also: open-formulieren/open-forms#2441
Tasks
Expected properties/features
label
key
groupLabel
description
tooltip
hideLabel
disableAddingRemovingRows
addAnother
(text)saveRow
(text)removeRow
(text)The text was updated successfully, but these errors were encountered: