react-split-pane 0.1.86 → 0.1.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [0.1.92](https://github.com/tomkp/react-split-pane/compare/v0.1.91...v0.1.92) (2020-08-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * add storybook ([3a8b6e6](https://github.com/tomkp/react-split-pane/commit/3a8b6e664d05e8daf3d0339eadfdcd69adde9d04))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * no coverage for now ([a1ef084](https://github.com/tomkp/react-split-pane/commit/a1ef08488865cc1b4f35bb77a11865b07683f282))
16
+ * typo ([2ab168d](https://github.com/tomkp/react-split-pane/commit/2ab168d0ed2137efe679ab0aacbfc5d439a634f0))
17
+
18
+ ### [0.1.91](https://github.com/tomkp/react-split-pane/compare/v0.1.89...v0.1.91) (2020-03-23)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * typescript typings ([ae3e41f](https://github.com/tomkp/react-split-pane/commit/ae3e41f0076903e02cc4c5011b31ea7eeadf2ac9))
24
+ * Update site title ([f61efff](https://github.com/tomkp/react-split-pane/commit/f61efff1f7676059d6b049774f004c4e49cb1e1f))
25
+
26
+ ### [0.1.90](https://github.com/tomkp/react-split-pane/compare/v0.1.89...v0.1.90) (2020-03-23)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * typescript typings ([ae3e41f](https://github.com/tomkp/react-split-pane/commit/ae3e41f0076903e02cc4c5011b31ea7eeadf2ac9))
32
+ * Update site title ([f61efff](https://github.com/tomkp/react-split-pane/commit/f61efff1f7676059d6b049774f004c4e49cb1e1f))
33
+
34
+ ### [0.1.89](https://github.com/tomkp/react-split-pane/compare/v0.1.88...v0.1.89) (2019-11-12)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * also include named exports ([bfd16af](https://github.com/tomkp/react-split-pane/commit/bfd16afe8e4f186968ecfd73929a961a9525abed))
40
+ * ignore changelog in prettier ([7c0a6a4](https://github.com/tomkp/react-split-pane/commit/7c0a6a4f123fe266dece1d823bd0de580cca6507))
41
+
42
+ ### [0.1.88](https://github.com/tomkp/react-split-pane/compare/v0.1.87...v0.1.88) (2019-11-12)
43
+
44
+ ### Features
45
+
46
+ - new less complex site w parcel and gh-pages deploys ([#378](https://github.com/tomkp/react-split-pane/issues/378)) ([ea98d68](https://github.com/tomkp/react-split-pane/commit/ea98d6853f71c479b3b351a4dd23520fe7595409))
47
+
48
+ ### Bug Fixes
49
+
50
+ - excluded react and react-dom from bundle ([#349](https://github.com/tomkp/react-split-pane/issues/349)) ([eb6b2bc](https://github.com/tomkp/react-split-pane/commit/eb6b2bc92873f1b671243de4f8fba96029f119df))
package/README.md CHANGED
@@ -4,41 +4,43 @@
4
4
  ![NPM license](https://img.shields.io/npm/l/react-split-pane.svg?style=flat)
5
5
  [![NPM total downloads](https://img.shields.io/npm/dt/react-split-pane.svg?style=flat)](https://npmcharts.com/compare/react-split-pane?minimal=true)
6
6
  [![NPM monthly downloads](https://img.shields.io/npm/dm/react-split-pane.svg?style=flat)](https://npmcharts.com/compare/react-split-pane?minimal=true)
7
- [![Build Status](https://img.shields.io/travis/tomkp/react-split-pane/master.svg?style=flat-square)](https://travis-ci.org/tomkp/react-split-pane)
8
- [![Coverage Status](https://img.shields.io/coveralls/tomkp/react-split-pane/master.svg?style=flat-square)](https://coveralls.io/r/tomkp/react-split-pane)
7
+ ![Build Test](https://github.com/tomkp/react-split-pane/workflows/Build%20Test/badge.svg)
8
+ [![Coverage Status](https://img.shields.io/coveralls/tomkp/react-split-pane/master.svg?style=flat)](https://coveralls.io/r/tomkp/react-split-pane)
9
9
 
10
- Split-Pane React component, can be nested or split vertically or horizontally. Check out some demos [here](http://react-split-pane.surge.sh/)!
10
+ Split-Pane React component, can be nested or split vertically or horizontally!
11
11
 
12
12
  ## Installing
13
- ```sh
13
+
14
+ ````sh
14
15
  npm install react-split-pane
15
16
 
16
17
  # or if you use yarn
17
18
 
18
19
  yarn add react-split-pane
19
- ```
20
20
 
21
21
  ## Example Usage
22
+
22
23
  ```jsx
23
- <SplitPane split="vertical" minSize={50} defaultSize={100}>
24
- <div></div>
25
- <div></div>
26
- </SplitPane>
27
- ```
24
+ <SplitPane split="vertical" minSize={50} defaultSize={100}>
25
+ <div />
26
+ <div />
27
+ </SplitPane>
28
+ ````
28
29
 
29
30
  ```jsx
30
- <SplitPane split="vertical" minSize={50}>
31
- <div></div>
32
- <SplitPane split="horizontal">
33
- <div></div>
34
- <div></div>
35
- </SplitPane>
31
+ <SplitPane split="vertical" minSize={50}>
32
+ <div />
33
+ <SplitPane split="horizontal">
34
+ <div />
35
+ <div />
36
36
  </SplitPane>
37
+ </SplitPane>
37
38
  ```
38
39
 
39
40
  ## Props
40
41
 
41
42
  ### primary
43
+
42
44
  By dragging 'draggable' surface you can change size of the first pane.
43
45
  The first pane keeps then its size while the second pane is resized by browser window.
44
46
  By default it is the left pane for 'vertical' SplitPane and the top pane for 'horizontal' SplitPane.
@@ -52,13 +54,14 @@ You can also set the size of the pane using the `size` prop. Note that a size se
52
54
  In this example right pane keeps its width 200px while user is resizing browser window.
53
55
 
54
56
  ```jsx
55
- <SplitPane split="vertical" defaultSize={200} primary="second">
56
- <div></div>
57
- <div></div>
58
- </SplitPane>
57
+ <SplitPane split="vertical" defaultSize={200} primary="second">
58
+ <div />
59
+ <div />
60
+ </SplitPane>
59
61
  ```
60
62
 
61
63
  ### maxSize
64
+
62
65
  You can limit the maximal size of the 'fixed' pane using the maxSize parameter with a positive value (measured in pixels but state just a number).
63
66
  If you wrap the SplitPane into a container component (yes you can, just remember the container has to have the relative or absolute positioning),
64
67
  then you'll need to limit the movement of the splitter (resizer) at the end of the SplitPane (otherwise it can be dragged outside the SplitPane
@@ -68,30 +71,34 @@ And more: if you set the maxSize to negative value (e.g. -200), then the splitte
68
71
  size of the 'resizable' pane in this case). This can be useful also in the full-screen case of use.
69
72
 
70
73
  ### step
74
+
71
75
  You can use the step prop to only allow resizing in fixed increments.
72
76
 
73
77
  ### onDragStarted
78
+
74
79
  This callback is invoked when a drag starts.
75
80
 
76
81
  ### onDragFinished
82
+
77
83
  This callback is invoked when a drag ends.
78
84
 
79
85
  ### onChange
86
+
80
87
  This callback is invoked with the current drag during a drag event. It is recommended that it is wrapped in a debounce function.
81
88
 
82
89
  ### Inline Styles
83
90
 
84
91
  You can also pass inline styles to the components via props. These are:
85
92
 
86
- * `style` - Styling to be applied to the main container.
87
- * `paneStyle` - Styling to be applied to both panes
88
- * `pane1Style` - Styling to be applied to the first pane, with precedence over `paneStyle`
89
- * `pane2Style` - Styling to be applied to the second pane, with precedence over `paneStyle`
90
- * `resizerStyle` - Styling to be applied to the resizer bar
93
+ - `style` - Styling to be applied to the main container.
94
+ - `paneStyle` - Styling to be applied to both panes
95
+ - `pane1Style` - Styling to be applied to the first pane, with precedence over `paneStyle`
96
+ - `pane2Style` - Styling to be applied to the second pane, with precedence over `paneStyle`
97
+ - `resizerStyle` - Styling to be applied to the resizer bar
91
98
 
92
99
  ## Persisting Positions
93
100
 
94
- Each SplitPane accepts an onChange function prop. Used in conjunction with
101
+ Each SplitPane accepts an onChange function prop. Used in conjunction with
95
102
  defaultSize and a persistence layer, you can ensure that your splitter choices
96
103
  survive a refresh of your app.
97
104
 
@@ -99,89 +106,129 @@ For example, if you are comfortable with the trade-offs of localStorage, you
99
106
  could do something like the following:
100
107
 
101
108
  ```jsx
102
- <SplitPane split="vertical" minSize={50}
103
- defaultSize={ parseInt(localStorage.getItem('splitPos'), 10) }
104
- onChange={ size => localStorage.setItem('splitPos', size) }>
105
- <div></div>
106
- <div></div>
107
- </SplitPane>
109
+ <SplitPane
110
+ split="vertical"
111
+ minSize={50}
112
+ defaultSize={parseInt(localStorage.getItem('splitPos'), 10)}
113
+ onChange={(size) => localStorage.setItem('splitPos', size)}
114
+ >
115
+ <div />
116
+ <div />
117
+ </SplitPane>
108
118
  ```
109
119
 
110
- Disclaimer: localStorage has a variety of performance trade-offs. Browsers such
120
+ Disclaimer: localStorage has a variety of performance trade-offs. Browsers such
111
121
  as Firefox have now optimized localStorage use so that they will asynchronously
112
122
  initiate a read of all saved localStorage data for an origin once they know the
113
- page will load. If the data has not fully loaded by the time code accesses
123
+ page will load. If the data has not fully loaded by the time code accesses
114
124
  localStorage, the code will cause the page's main thread to block until the
115
- database load completes. When the main thread is blocked, no other JS code will
116
- run or layout will occur. In multiprocess browsers and for users with fast
117
- disk storage, this will be less of a problem. You *are* likely to get yelled at
125
+ database load completes. When the main thread is blocked, no other JS code will
126
+ run or layout will occur. In multiprocess browsers and for users with fast
127
+ disk storage, this will be less of a problem. You _are_ likely to get yelled at
118
128
  if you use localStorage.
119
129
 
120
130
  A potentially better idea is to use something like
121
131
  https://github.com/mozilla/localForage although hooking it up will be slightly
122
- more involved. You are likely to be admired by all for judiciously avoiding
132
+ more involved. You are likely to be admired by all for judiciously avoiding
123
133
  use of localStorage.
124
134
 
125
135
  ## Example styling
126
136
 
127
137
  This gives a single pixel wide divider, but with a 'grabbable' surface of 11 pixels.
128
138
 
129
- Thanks to ```background-clip: padding-box;``` for making transparent borders possible.
130
-
139
+ Thanks to `background-clip: padding-box;` for making transparent borders possible.
131
140
 
132
141
  ```css
142
+ .Resizer {
143
+ background: #000;
144
+ opacity: 0.2;
145
+ z-index: 1;
146
+ -moz-box-sizing: border-box;
147
+ -webkit-box-sizing: border-box;
148
+ box-sizing: border-box;
149
+ -moz-background-clip: padding;
150
+ -webkit-background-clip: padding;
151
+ background-clip: padding-box;
152
+ }
153
+
154
+ .Resizer:hover {
155
+ -webkit-transition: all 2s ease;
156
+ transition: all 2s ease;
157
+ }
158
+
159
+ .Resizer.horizontal {
160
+ height: 11px;
161
+ margin: -5px 0;
162
+ border-top: 5px solid rgba(255, 255, 255, 0);
163
+ border-bottom: 5px solid rgba(255, 255, 255, 0);
164
+ cursor: row-resize;
165
+ width: 100%;
166
+ }
167
+
168
+ .Resizer.horizontal:hover {
169
+ border-top: 5px solid rgba(0, 0, 0, 0.5);
170
+ border-bottom: 5px solid rgba(0, 0, 0, 0.5);
171
+ }
172
+
173
+ .Resizer.vertical {
174
+ width: 11px;
175
+ margin: 0 -5px;
176
+ border-left: 5px solid rgba(255, 255, 255, 0);
177
+ border-right: 5px solid rgba(255, 255, 255, 0);
178
+ cursor: col-resize;
179
+ }
180
+
181
+ .Resizer.vertical:hover {
182
+ border-left: 5px solid rgba(0, 0, 0, 0.5);
183
+ border-right: 5px solid rgba(0, 0, 0, 0.5);
184
+ }
185
+ .Resizer.disabled {
186
+ cursor: not-allowed;
187
+ }
188
+ .Resizer.disabled:hover {
189
+ border-color: transparent;
190
+ }
191
+ ```
192
+
193
+ ## New Version
194
+
195
+ **I'm working on an updated version of this library, and looking for help:**
196
+
197
+ Demo
133
198
 
134
- .Resizer {
135
- background: #000;
136
- opacity: .2;
137
- z-index: 1;
138
- -moz-box-sizing: border-box;
139
- -webkit-box-sizing: border-box;
140
- box-sizing: border-box;
141
- -moz-background-clip: padding;
142
- -webkit-background-clip: padding;
143
- background-clip: padding-box;
144
- }
145
-
146
- .Resizer:hover {
147
- -webkit-transition: all 2s ease;
148
- transition: all 2s ease;
149
- }
150
-
151
- .Resizer.horizontal {
152
- height: 11px;
153
- margin: -5px 0;
154
- border-top: 5px solid rgba(255, 255, 255, 0);
155
- border-bottom: 5px solid rgba(255, 255, 255, 0);
156
- cursor: row-resize;
157
- width: 100%;
158
- }
159
-
160
- .Resizer.horizontal:hover {
161
- border-top: 5px solid rgba(0, 0, 0, 0.5);
162
- border-bottom: 5px solid rgba(0, 0, 0, 0.5);
163
- }
164
-
165
- .Resizer.vertical {
166
- width: 11px;
167
- margin: 0 -5px;
168
- border-left: 5px solid rgba(255, 255, 255, 0);
169
- border-right: 5px solid rgba(255, 255, 255, 0);
170
- cursor: col-resize;
171
- }
172
-
173
- .Resizer.vertical:hover {
174
- border-left: 5px solid rgba(0, 0, 0, 0.5);
175
- border-right: 5px solid rgba(0, 0, 0, 0.5);
176
- }
177
- .Resizer.disabled {
178
- cursor: not-allowed;
179
- }
180
- .Resizer.disabled:hover {
181
- border-color: transparent;
182
- }
183
-
184
- ```
199
+ http://react-split-pane-v2.surge.sh/
200
+
201
+ Install
202
+
203
+ ```sh
204
+ npm install react-split-pane@next
205
+
206
+ # or if you use yarn
207
+
208
+ yarn add react-split-pane@next
209
+ ```
210
+
211
+ Usage
212
+
213
+ ```jsx
214
+ import SplitPane, { Pane } from 'react-split-pane';
215
+
216
+ <SplitPane split="vertical">
217
+ <Pane initialSize="200px">You can use a Pane component</Pane>
218
+ <div>or you can use a plain old div</div>
219
+ <Pane initialSize="25%" minSize="10%" maxSize="500px">
220
+ Using a Pane allows you to specify any constraints directly
221
+ </Pane>
222
+ </SplitPane>;
223
+ ```
224
+
225
+ Pull request
226
+
227
+ https://github.com/tomkp/react-split-pane/pull/240
228
+
229
+ More discussion
230
+
231
+ https://github.com/tomkp/react-split-pane/issues/233
185
232
 
186
233
  ## Contributing
187
234
 
@@ -189,6 +236,4 @@ I'm always happy to receive Pull Requests for contributions of any kind.
189
236
 
190
237
  Please include tests and/or update the examples if possible.
191
238
 
192
- **I'm working on an updated version of this library, and looking for help:** https://github.com/tomkp/react-split-pane/pull/240
193
-
194
- Thanks, Tom
239
+ Thanks, Tom