-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat: startValue binding for RangeCalendar/DateRangePicker #824
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add a story in Chromatic to showcase this ya 😁
@zernonia I've updated the watcher inner variables in both |
@@ -47,8 +49,16 @@ const placeholder = ref(new CalendarDate(2024, 4, 1)) as Ref<CalendarDate> | |||
<RangeCalendar :default-value="defaultValue" prevent-deselect /> | |||
</Variant> | |||
|
|||
<Variant title="Start value"> | |||
<RangeCalendar :default-value="defaultValue" :start-value="startValue" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what's the benefit of adding this new prop ya? Can't we use And I don't quite understand you mentioned
Is the |
The prop can be used for getting a fresh On the
|
@zernonia I gave more of a thought about the I've also renamed the inner watcher variables as suggested. 🚀 |
Icic.. How about we only expose |
Sure thing! I've exposed the event and removed the |
This PR adds a new convenience property to
RangeCalendar
/DateRangePicker
for setting up thestartValue
on the aforementioned components plus an event for listening for saidstartValue
changes. The property cannot be modified outside the component, you would need to update themodelValue
for that.Also, this PR cleans up some of the conditions inside the
DateRange
components for consistent behaviour regardingmodelValue
updates plus some clean code updates on thedefaultValue
.Context for feature: https://www.shadcn-svelte.com/docs/components/date-picker#date-range-picker
cc @sadeghbarati for the feature suggestion