gravity-ui / rfc

Gravity RFC is a process for proposing and implementing changes in our ecosystem
MIT License
3 stars 0 forks source link

customView prop in date pickers #17

Open St1ggy opened 1 month ago

St1ggy commented 1 month ago

I need a RangeDatePicker with a custom trigger. How can I achieve this without a prop for customView?

SeqviriouM commented 1 month ago

@amje @ValeraS @korvin89

korvin89 commented 3 weeks ago

@St1ggy Hi!

Control in RangeDatePicker is the main part of the component and contains a lot of complex logic. This component doesn't have any sense without this valuable part.

You can mix Button (or any trigger you want), Popup and RangeCalendar to create component you want.

St1ggy commented 3 weeks ago

@St1ggy Hi!

Control in RangeDatePicker is the main part of the component and contains a lot of complex logic. This component doesn't have any sense without this valuable part.

You can mix Button (or any trigger you want), Popup and RangeCalendar to create component you want.

But I don’t need RangeCalendar… I need exactly the same RangePicker but with a custom control button

korvin89 commented 3 weeks ago

@St1ggy Hi! Control in RangeDatePicker is the main part of the component and contains a lot of complex logic. This component doesn't have any sense without this valuable part. You can mix Button (or any trigger you want), Popup and RangeCalendar to create component you want.

But I don’t need RangeCalendar… I need exactly the same RangePicker but with a custom control button

As I pointed out earlier, the input for the current component is a fundamental component, the replacement of which is not provided for by the idea of this component. RangeDatePicker component is a high level composition of components I described on my previous message.

Will be it okay if we create a story for RangeCalendar for your case?

St1ggy commented 3 weeks ago

@St1ggy Hi! Control in RangeDatePicker is the main part of the component and contains a lot of complex logic. This component doesn't have any sense without this valuable part. You can mix Button (or any trigger you want), Popup and RangeCalendar to create component you want.

But I don’t need RangeCalendar… I need exactly the same RangePicker but with a custom control button

As I pointed out earlier, the input for the current component is a fundamental component, the replacement of which is not provided for by the idea of this component. RangeDatePicker component is a high level composition of components I described on my previous message.

Will be it okay if we create a story for RangeCalendar for your case?

I'm not sure if this is possible :) Here's my case

image

Both "from" and "to" are optional

korvin89 commented 3 weeks ago

You've created issue about RangeDatePicker, but now I got You were talking about RelativeRangeDatePicker. They are completely different components.

You can mix RelativeRangeDatePickerDialog component with any trigger you want. Is it okay?

St1ggy commented 3 weeks ago

You've created issue about RangeDatePicker, but now I got You were talking about RelativeRangeDatePicker. They are completely different components.

You can mix RelativeRangeDatePickerDialog component with any trigger you want. Is it okay?

Can I disable relative f(x) buttons? I don't need them

korvin89 commented 3 weeks ago

Can I disable relative f(x) buttons? I don't need them

Nope. This component designed exactly for relative dates handling. If you don't need them, you could check regular RangeCalendar, this component more convenient for simple dates range selection