reshaped icon indicating copy to clipboard operation
reshaped copied to clipboard

New Resizer/Splitter component

Open vladoyoung opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Not particularly a problem. We're rebuilding a major application from Kendo to Reshaped and we'll need a resizer component at some point. Would be great if you consider it as an additional new component!

Describe the solution you'd like A new resizer/splitter component. Similar to the Kendo UI one or this open source one or like the PrimeReact one?

Describe alternatives you've considered The above mentioned.

vladoyoung avatar May 02 '24 14:05 vladoyoung

Added it to 3.1.0. It shouldn't indicate the timeline but mostly its priority compared to the major release planned for early July. We might pick it up earlier based on the availability

blvdmitry avatar May 06 '24 19:05 blvdmitry

Gonna keep it opened since we use issues in the github project 😅

blvdmitry avatar May 07 '24 12:05 blvdmitry

Component usage:

<Splitter>
	<Splitter.Item minSize="20%" maxSize="50%" />

	{/* Default handle */}
	<Splitter.Handle />

	<Splitter.Item />

	{/* Custom handle */}
	<Splitter.Handle>
	  {attributes => (
		  <div className="bar">
		    <Actionable attributes={attributes}>...</Actionable>
		  </div>  
	  )}
	</Splitter.Handle>

	<Splitter.Item />
</Splitter>

Component props:

type Props = {
	orientation?: 'horizontal' | 'vertical';
	height?: string;
}

type ItemProps = {
	minSize?: string;
	maxSize?: string;
	onResize?: ({ size }) => void;
}

blvdmitry avatar Jul 24 '24 21:07 blvdmitry

@vladoyoung if you look at the code snippets above, would you need anything on top of that for your use cases?

blvdmitry avatar Jul 24 '24 21:07 blvdmitry

@blvdmitry first version looks great! Easy to use and straightforward.

vladoyoung avatar Jul 31 '24 10:07 vladoyoung

@vladoyoung since it's your request, I would like to ask if you have any requirements for the min/max/default sizes. Do you need this functionality now? If you do, do you need to pass them in px, %, something else?

I'm asking since implementation is based on the flexGrow so I can't just assign any css value and have to resolve all potential property values in js

blvdmitry avatar Aug 01 '24 22:08 blvdmitry

I don't need the resizer at the moment and I have no planned usage, but i think px, % and calc() should be more than enough for sizing.

vladoyoung avatar Aug 02 '24 13:08 vladoyoung

Writing tests and docs now. Should be out in 3.1

https://github.com/user-attachments/assets/aaaf02e7-de33-4569-9a79-0aa87d8c95b1

blvdmitry avatar Aug 04 '24 15:08 blvdmitry

That's absolutely on point! Amazing work 💯

vladoyoung avatar Aug 05 '24 07:08 vladoyoung