Add full support for readOnly, max_items, min_items and other schema properties within rendered collections
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] New Feature
- [x] Feature Improvement
- [x] Refactoring
- [ ] Documentation
- [ ] Other, please describe:
Description:
Hello again 😄
From a user/dev perspective the changes introduced by this PR are:
- Support the
readOnlypydantic field property in all pydantic widgets by making use of streamlitsdisabledwidget property (fully introduced in streamlit 1.5.0 and pinned to this version insetup.py) - Enhance the new list add/remove/clear buttons to respect
max_itemsandmin_itemspydantic field properties that might be present in the model. - Add support for all existing widget types (eg. date, time, boolean etc..) to be rendered in lists and dicts with full validation and formatting options. This is a result of some refactoring to improve code re-use. eg. There is now only one function that rendered a number field, regardless of whether that field is a standalone property or contained within in a list, dict or complex object.
A new showcase example complex_disabled_showcase.py has been added to test/demonstrate all of the major widgets in thier disabled form.
complex_instance_model.py has also been updated to demonstrate some of the now supported collection properties and data types.
Checklist:
- [x] I have read the CONTRIBUTING document.
- [x] My changes don't require a change to the documentation, or if they do, I've added all required information.
Thanks again for this contribution :) I will have some time for review beginning of next week.
I see your now running a build pipeline 👍 and its failing with some mypy errors.
As most of the errors were introduced by this and my previous PR I've just pushed some very minor fixes that resolve all but one of the errors.
The last remaining error is in the form handling code which I haven't touched so I'll let you decide what the best course of action is there.
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
I'm so sorry for the extremely long delay :( I finally got back here to merge and release a new version 🥳
Not a problem! This PR ended up being a bit larger and more complex then I would have liked so I appreciate you making the time to review.
With this one merged in I'll have a few smaller feature PR's coming but I promise they will be a lot more straight forward to review 😄
@HIL340 Awesome :) I got it to a state that it is ready to release, but there is still a problem with the release process which I need to fix 😬