repeater-app
repeater-app copied to clipboard
Add options for pagination, multiline values, custom key name
This PR adds various options
- pagination (defaults to False)
- optional default items per page (defaults to 100)
- multiline value fields (defaults to False)
- optional custom key name
Additionally, to make use of the Contentful Forma 36 v4 Pagination component, the package has been updated to use Forma 36 v4 and React 18 (to fix a build issue with React 17, which is the version the Forma 36 updater would use by default after the upgrade).
This requires the following new instance parameters to be set:
keyName: string, optionalmultiLineValues: boolean, default to falseusePagination: boolean, default to falsedefaultPageItems: number, optional
If all the new settings are left at the default values, the Repeater application will look the same as without this PR, other than the color changes in buttons due to the v4 upgrade.
Context for the change: my usecase required large lists of key-value items, which were large enough to freeze the Contentful web-application. Similarly, multi-line editor were useful in my usecase.
Example with all the options activated (with items per page set to 3 for testing)