You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An intuitive React component set for multi-column resizing. It is easy to use and it also can [customize the behavior of resizing](#customize-resize-behavior) in a very simple way. Working on every modern browser [which](https://caniuse.com/#feat=flexbox)support[flexible box layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout).
4
+
An intuitive React component set for multi-column(row) resizing. You could [customize the behavior of resizing](#customize-resize-behavior) in a very simple way. Works in every modern browser [which](https://caniuse.com/#feat=flexbox)supports[flexible box layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout).
5
5
6
6
#### Table of Contents
7
7
-[Installation](#installation)
@@ -11,7 +11,6 @@ An intuitive React component set for multi-column resizing. It is easy to use an
> Determine that whether using vertical layout or not, default is `false`.
61
70
62
-
##### onActivate
63
-
> Triggered when any [`Bar`](#bar-) activated. i.e, [onMouseDown](https://developer.mozilla.org/en/docs/Web/Events/mousedown) or [onTouchStart](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart).
71
+
##### `vertical`
72
+
73
+
Determine whether using vertical layout or not, default is `false`.
74
+
75
+
##### `onActivate`
76
+
77
+
Triggered when any [`Bar`](#bar-) is activated. i.e, [onMouseDown](https://developer.mozilla.org/en/docs/Web/Events/mousedown) or [onTouchStart](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart).
78
+
79
+
##### `beforeApplyResizer`
64
80
65
-
##### beforeApplyResizer
66
-
> Used to [customize resize behavior](#customize-resize-behavior). In this method, you __don't__ need to call [`applyResizer`](#applyresizer) to apply the resize result. Please note that you should not do any side effect on this method. If you want to do something after the resizing, see [`afterResizing`](#afterresizing) below.
81
+
Used to [customize resize behavior](#customize-resize-behavior). In this method, you __don't__ need to call [`applyResizer`](#applyresizer) to apply the resize result. Please note that you should not do any side effect on this method. If you want to do something after resizing, see [`afterResizing`](#afterresizing) below.
67
82
68
-
##### afterResizing
69
-
> Triggered after a <aname="resizing-section">__resizing section__</a> is completed. Which means that it will be triggered after the [onMouseUp](https://developer.mozilla.org/en-US/docs/Web/Events/mouseup) and [onTouchEnd](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) events. If you want to do something after each time the size of section has changed, using the [`onSizeChanged`](#onsizechanged) props on the [`Section`](#section-) instead.
83
+
##### `afterResizing`
84
+
85
+
Triggered after a <aname="resizing-section">__resizing section__</a> is completed, which means that it will be triggered after [onMouseUp](https://developer.mozilla.org/en-US/docs/Web/Events/mouseup) and [onTouchEnd](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) events. If you want to do something after size of section has changed, use [`onSizeChanged`](#onsizechanged) props on the [`Section`](#section-) instead.
70
86
71
87
#### Instance properties
72
88
```typescript
@@ -77,14 +93,19 @@ class Container extends React.PureComponent<ContainerProps> {
77
93
public applyResizer(resizer:Resizer):void
78
94
}
79
95
```
80
-
##### getResizer
81
-
> Used to get the newest [`Resizer`](#customize-resize-behavior). But any change won't apply unless you pass the `Resizer` to `applyResizer`.
96
+
##### `getResizer`
97
+
Used to get newest [`Resizer`](#customize-resize-behavior). But any change won't apply unless you pass the `Resizer` to `applyResizer`.
> Used to set the `Section`'s size. If `size`exists, `Section` will ignore the value of `defaultSize`, `maxSize` and `minSize`.
123
+
##### `size`
124
+
Used to set `Section`'s size. If `size`is set, `Section` will ignore the value of `defaultSize`, `maxSize` and `minSize`.
104
125
105
-
##### defaultSize
106
-
> Used to set the default size of `Section`.
126
+
##### `defaultSize`
127
+
Used to set default size of `Section`.
107
128
108
-
##### maxSize
109
-
> Used to set the max size of `Section`.
129
+
##### `maxSize`
130
+
Used to set max size of `Section`.
110
131
111
-
##### minSize
112
-
> Used to set the min size of `Section`.
132
+
##### `minSize`
133
+
Used to set min size of `Section`.
113
134
114
-
##### disableResponsive
115
-
> Each `Section` is responsive as default, unless `size`is exists. the responsivemeans that the `Section`'s size is related with `Container`'s size, if `Container`'s size turn smaller, the `Section`'s size also turn smaller automatically. Otherwise, the changes of `Container` size won't affect the `Section`that`disableResponsive` is `true`.
135
+
##### `disableResponsive`
136
+
Each `Section` is responsive as default, unless `size` exists. The `responsive` here means that `Section`'s size is related with `Container`'s size, if `Container`'s size turn smaller, the `Section`'s size also turn smaller automatically. Otherwise, changes of `Container` size won't affect the `Section`when`disableResponsive` is `true`.
116
137
117
-
##### onSizeChanged
118
-
> Will be triggered each time the size has changed.
> Used to expanding the interactive area of the`Bar`.
173
+
##### `expandInteractiveArea`
174
+
Used to expand interactive area of `Bar`.
149
175
150
-
##### onStatusChanged
151
-
> Triggered when the state of the`Bar` has changed.
176
+
##### `onStatusChanged`
177
+
Triggered when the state of `Bar` has changed.
152
178
153
-
##### onClick
154
-
> Triggered if not moving events. The main different with original `onClick` event is that __there is no parameters__ on _this_`onClick`. You could also use it as a touch event on mobile platform, without 300ms click delay.
179
+
##### `onClick`
180
+
Triggered if there's no "move" events. The main difference between it and original `onClick` event is that __there is no parameters__ on _this_`onClick`. You could also use it as a touch event on mobile platform, without 300ms click delay.
155
181
156
-
##### innerRef
157
-
> Used to get the actual DOM ref of `Bar`.
182
+
##### `innerRef`
183
+
Used to get the actual DOM ref of `Bar`.
158
184
159
185
## Customize resize behavior
160
-
If you want to customize the behavior of resizing, then the `Resizer` is what you need to know.
186
+
If you want to customize behavior of resizing, then you have to know how to use `Resizer`.
161
187
162
-
> There is two ways to get the `Resizer`. One is the method [`beforeApplyResizer`](#beforeapplyresizer) defined on the __props__ of `Container`, and the other is the method [`getResizer`](#getresizer) defined on the __instance__ of `Container`
188
+
There is two ways to get the `Resizer`. One is [`beforeApplyResizer`](#beforeapplyresizer) defined on the __props__ of `Container`, and the other is [`getResizer`](#getresizer) defined on the __instance__ of `Container`.
163
189
164
190
```typescript
165
191
interfaceResizer {
@@ -173,36 +199,33 @@ interface Resizer {
173
199
}
174
200
```
175
201
176
-
##### resizeSection
177
-
> Used to set the size of the nth `Section`.
178
-
> In multi-column layout, there is not only one `Bar` could change the `Section`'s size. Therefor, you could use `preferMoveLeftBar` to try to use the left side `Bar` to resizing.
202
+
##### `resizeSection`
203
+
Used to set size of the nth `Section`.
204
+
In multi-column layout, there're several `Bar`s could change the `Section`'s size. Therefore, you could try to use the left side `Bar` to resizing by setting `preferMoveLeftBar`.
179
205
180
-
##### moveBar
181
-
> Used to move the nth `Bar` to resizing.
182
-
> If the value of A is negative, move `Bar` to the left. Once[`vertical`](#vertical) is `true`, move up.
206
+
##### `moveBar`
207
+
Used to move the nth `Bar` to resizing.
208
+
If the value of A is negative, move `Bar` to the left. When[`vertical`](#vertical) is `true`, move up.
183
209
184
-
##### discard
185
-
> Discard resizing at this time.
210
+
##### `discard`
211
+
Discard resizing at this time.
186
212
187
-
##### isSectionResized
188
-
> Used to determine whether the nth `Section`'s size is changed at current [resizing section](#user-content-resizing-section) or not.
213
+
##### `isSectionResized`
214
+
Used to determine whether the nth `Section`'s size is changed at current [resizing section](#user-content-resizing-section) or not.
189
215
190
-
##### isBarActivated
191
-
> Used to determine whether the nth `Bar` is active or not.
216
+
##### `isBarActivated`
217
+
Used to determine whether the nth `Bar` is active or not.
192
218
193
-
##### getSectionSize
194
-
> Used to get the size of the nth `Section`. if there is no nth `Section`, return `-1`.
219
+
##### `getSectionSize`
220
+
Used to get size of the nth `Section`. if there is no nth `Section`, return `-1`.
The main purpose of this repository is to continue to evolve react-simple-resizer, making it faster, smaller and easier to use. We are grateful to the community for contributing bugfixes and improvements.
206
229
207
230
#### About Demo
208
-
Feel free to let us know that you have create some new customized resize behavior. If you want, you could make a PR to let more people see your works. Also, if you find some behavior that you can not create, let us know too.
231
+
Feel free to let us know that you have created some new customized resize behavior. You could create a PR to let more people see your works. Also, if you find some behaviors that you cannot create, let us know too.
0 commit comments