Closed nadijagraca closed 4 months ago
This looks great! Just some answers to your open questions and then I will do a full review next week 🙂
- How to hand
value
argument in both date picker and date range picker? I followed the approach of slider and range_slider in this pr, meaning ifvalue
is not provided I takemin_date
allowed for date picker, and [min_date
,max_date
] for date range picker.
This sounds right to me 👍
- Do we keep
min_date
/max_date
or do we replace it withmin
andmax
as in sliders?
Let's go for min
and max
to match the sliders.
- Do we need to add more arguments to the components? I kept it minimal, but some of the additional args to add could be:
allowFreeInput
,clearable
etc. For more information about possible args check: https://www.dash-mantine-components.com/components/datepicker
Definitely keep it minimal and just expose only the essential arguments like we do for slider/rangeslider. What we should do though is set values for these fields if we think the dmc defaults aren't suitable for us. But those wouldn't be configurable as model fields, just hardcoded into the component returned in the build
method.
Be sure to set the dropdownPosition
prop. It seems to be a workaround for this issue: https://github.com/snehilvj/dash-mantine-components/issues/219
@nadijagraca - let us know how it goes! I found several issues regarding the datepickerrange from the mantine library that are still open, all concerning persistence.. So if this is not easy to solve, then let's brainstorm next week what alternatives we have. As Petar said, I also hope that we find a way to fix this other than replacing it with the dcc version 😅 I think even if we would replace it with the dcc version, it should be straight-forward except for the styling 😓 But let's see!
If you haven't seen it yet:
Description
Added temporal selector
DatePicker
forFilter
andParameter
.DatePicker is a single model, but based on value of argument
range
will either returndmc.DatePicker
ordmc.DateRangePicker
. Default value ofrange
isTrue
and the model will returndmc.DateRangePicker
if range is not provided, or if the selector is not defined.Options where
DateRangePicker
is returned:Filter.selector
but filtercolumn
isdatetime
dtype.vm.DatePicker
asFilter.selector
without specifyingrange
argument or by settingrange=True
Option where
DatePicker
is returned:vm.DatePicker
asFilter.selector
and setsvm.DatePicker
range
argument asFalse
.vm.DatePicker.value
supported format are all inputs that could be translated todatetime.date
. See more hereDone is separate pr:
Screenshot
Notice
[x] I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":