react-split-pane 0.1.91 → 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 +13 -0
- package/README.md +4 -5
- package/dist/index.cjs.js +45 -9
- package/dist/index.esm.js +45 -9
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
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
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
|
+
|
|
5
18
|
### [0.1.91](https://github.com/tomkp/react-split-pane/compare/v0.1.89...v0.1.91) (2020-03-23)
|
|
6
19
|
|
|
7
20
|
|
package/README.md
CHANGED
|
@@ -4,20 +4,19 @@
|
|
|
4
4
|

|
|
5
5
|
[](https://npmcharts.com/compare/react-split-pane?minimal=true)
|
|
6
6
|
[](https://npmcharts.com/compare/react-split-pane?minimal=true)
|
|
7
|
-
|
|
7
|
+

|
|
8
8
|
[](https://coveralls.io/r/tomkp/react-split-pane)
|
|
9
9
|
|
|
10
10
|
Split-Pane React component, can be nested or split vertically or horizontally!
|
|
11
11
|
|
|
12
12
|
## Installing
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
````sh
|
|
15
15
|
npm install react-split-pane
|
|
16
16
|
|
|
17
17
|
# or if you use yarn
|
|
18
18
|
|
|
19
19
|
yarn add react-split-pane
|
|
20
|
-
```
|
|
21
20
|
|
|
22
21
|
## Example Usage
|
|
23
22
|
|
|
@@ -26,7 +25,7 @@ yarn add react-split-pane
|
|
|
26
25
|
<div />
|
|
27
26
|
<div />
|
|
28
27
|
</SplitPane>
|
|
29
|
-
|
|
28
|
+
````
|
|
30
29
|
|
|
31
30
|
```jsx
|
|
32
31
|
<SplitPane split="vertical" minSize={50}>
|
|
@@ -111,7 +110,7 @@ could do something like the following:
|
|
|
111
110
|
split="vertical"
|
|
112
111
|
minSize={50}
|
|
113
112
|
defaultSize={parseInt(localStorage.getItem('splitPos'), 10)}
|
|
114
|
-
onChange={size => localStorage.setItem('splitPos', size)}
|
|
113
|
+
onChange={(size) => localStorage.setItem('splitPos', size)}
|
|
115
114
|
>
|
|
116
115
|
<div />
|
|
117
116
|
<div />
|
package/dist/index.cjs.js
CHANGED
|
@@ -111,6 +111,19 @@ function _setPrototypeOf(o, p) {
|
|
|
111
111
|
return _setPrototypeOf(o, p);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
function _isNativeReflectConstruct() {
|
|
115
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
116
|
+
if (Reflect.construct.sham) return false;
|
|
117
|
+
if (typeof Proxy === "function") return true;
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
121
|
+
return true;
|
|
122
|
+
} catch (e) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
114
127
|
function _assertThisInitialized(self) {
|
|
115
128
|
if (self === void 0) {
|
|
116
129
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -127,13 +140,32 @@ function _possibleConstructorReturn(self, call) {
|
|
|
127
140
|
return _assertThisInitialized(self);
|
|
128
141
|
}
|
|
129
142
|
|
|
143
|
+
function _createSuper(Derived) {
|
|
144
|
+
return function () {
|
|
145
|
+
var Super = _getPrototypeOf(Derived),
|
|
146
|
+
result;
|
|
147
|
+
|
|
148
|
+
if (_isNativeReflectConstruct()) {
|
|
149
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
150
|
+
|
|
151
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
152
|
+
} else {
|
|
153
|
+
result = Super.apply(this, arguments);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return _possibleConstructorReturn(this, result);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
130
160
|
var Pane = /*#__PURE__*/function (_React$PureComponent) {
|
|
131
161
|
_inherits(Pane, _React$PureComponent);
|
|
132
162
|
|
|
163
|
+
var _super = _createSuper(Pane);
|
|
164
|
+
|
|
133
165
|
function Pane() {
|
|
134
166
|
_classCallCheck(this, Pane);
|
|
135
167
|
|
|
136
|
-
return
|
|
168
|
+
return _super.apply(this, arguments);
|
|
137
169
|
}
|
|
138
170
|
|
|
139
171
|
_createClass(Pane, [{
|
|
@@ -165,7 +197,7 @@ var Pane = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
165
197
|
}
|
|
166
198
|
|
|
167
199
|
style = Object.assign({}, style, styleProps || {});
|
|
168
|
-
return React.createElement("div", {
|
|
200
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
169
201
|
ref: eleRef,
|
|
170
202
|
className: classes.join(' '),
|
|
171
203
|
style: style
|
|
@@ -191,10 +223,12 @@ var RESIZER_DEFAULT_CLASSNAME = 'Resizer';
|
|
|
191
223
|
var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
192
224
|
_inherits(Resizer, _React$Component);
|
|
193
225
|
|
|
226
|
+
var _super = _createSuper(Resizer);
|
|
227
|
+
|
|
194
228
|
function Resizer() {
|
|
195
229
|
_classCallCheck(this, Resizer);
|
|
196
230
|
|
|
197
|
-
return
|
|
231
|
+
return _super.apply(this, arguments);
|
|
198
232
|
}
|
|
199
233
|
|
|
200
234
|
_createClass(Resizer, [{
|
|
@@ -211,7 +245,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
211
245
|
split = _this$props.split,
|
|
212
246
|
style = _this$props.style;
|
|
213
247
|
var classes = [resizerClassName, split, className];
|
|
214
|
-
return React.createElement("span", {
|
|
248
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
215
249
|
role: "presentation",
|
|
216
250
|
className: classes.join(' '),
|
|
217
251
|
style: style,
|
|
@@ -297,12 +331,14 @@ function removeNullChildren(children) {
|
|
|
297
331
|
var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
298
332
|
_inherits(SplitPane, _React$Component);
|
|
299
333
|
|
|
334
|
+
var _super = _createSuper(SplitPane);
|
|
335
|
+
|
|
300
336
|
function SplitPane(props) {
|
|
301
337
|
var _this;
|
|
302
338
|
|
|
303
339
|
_classCallCheck(this, SplitPane);
|
|
304
340
|
|
|
305
|
-
_this =
|
|
341
|
+
_this = _super.call(this, props);
|
|
306
342
|
_this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
|
|
307
343
|
_this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this));
|
|
308
344
|
_this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
|
|
@@ -558,13 +594,13 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
558
594
|
|
|
559
595
|
var pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
|
|
560
596
|
var pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
|
|
561
|
-
return React.createElement("div", {
|
|
597
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
562
598
|
className: classes.join(' '),
|
|
563
599
|
ref: function ref(node) {
|
|
564
600
|
_this2.splitPane = node;
|
|
565
601
|
},
|
|
566
602
|
style: style
|
|
567
|
-
}, React.createElement(Pane, {
|
|
603
|
+
}, /*#__PURE__*/React.createElement(Pane, {
|
|
568
604
|
className: pane1Classes,
|
|
569
605
|
key: "pane1",
|
|
570
606
|
eleRef: function eleRef(node) {
|
|
@@ -573,7 +609,7 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
573
609
|
size: pane1Size,
|
|
574
610
|
split: split,
|
|
575
611
|
style: pane1Style
|
|
576
|
-
}, notNullChildren[0]), React.createElement(Resizer, {
|
|
612
|
+
}, notNullChildren[0]), /*#__PURE__*/React.createElement(Resizer, {
|
|
577
613
|
className: disabledClass,
|
|
578
614
|
onClick: onResizerClick,
|
|
579
615
|
onDoubleClick: onResizerDoubleClick,
|
|
@@ -584,7 +620,7 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
584
620
|
resizerClassName: resizerClassNamesIncludingDefault,
|
|
585
621
|
split: split,
|
|
586
622
|
style: resizerStyle || {}
|
|
587
|
-
}), React.createElement(Pane, {
|
|
623
|
+
}), /*#__PURE__*/React.createElement(Pane, {
|
|
588
624
|
className: pane2Classes,
|
|
589
625
|
key: "pane2",
|
|
590
626
|
eleRef: function eleRef(node) {
|
package/dist/index.esm.js
CHANGED
|
@@ -105,6 +105,19 @@ function _setPrototypeOf(o, p) {
|
|
|
105
105
|
return _setPrototypeOf(o, p);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
function _isNativeReflectConstruct() {
|
|
109
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
110
|
+
if (Reflect.construct.sham) return false;
|
|
111
|
+
if (typeof Proxy === "function") return true;
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
115
|
+
return true;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
108
121
|
function _assertThisInitialized(self) {
|
|
109
122
|
if (self === void 0) {
|
|
110
123
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -121,13 +134,32 @@ function _possibleConstructorReturn(self, call) {
|
|
|
121
134
|
return _assertThisInitialized(self);
|
|
122
135
|
}
|
|
123
136
|
|
|
137
|
+
function _createSuper(Derived) {
|
|
138
|
+
return function () {
|
|
139
|
+
var Super = _getPrototypeOf(Derived),
|
|
140
|
+
result;
|
|
141
|
+
|
|
142
|
+
if (_isNativeReflectConstruct()) {
|
|
143
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
144
|
+
|
|
145
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
146
|
+
} else {
|
|
147
|
+
result = Super.apply(this, arguments);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return _possibleConstructorReturn(this, result);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
124
154
|
var Pane = /*#__PURE__*/function (_React$PureComponent) {
|
|
125
155
|
_inherits(Pane, _React$PureComponent);
|
|
126
156
|
|
|
157
|
+
var _super = _createSuper(Pane);
|
|
158
|
+
|
|
127
159
|
function Pane() {
|
|
128
160
|
_classCallCheck(this, Pane);
|
|
129
161
|
|
|
130
|
-
return
|
|
162
|
+
return _super.apply(this, arguments);
|
|
131
163
|
}
|
|
132
164
|
|
|
133
165
|
_createClass(Pane, [{
|
|
@@ -159,7 +191,7 @@ var Pane = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
159
191
|
}
|
|
160
192
|
|
|
161
193
|
style = Object.assign({}, style, styleProps || {});
|
|
162
|
-
return React.createElement("div", {
|
|
194
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
163
195
|
ref: eleRef,
|
|
164
196
|
className: classes.join(' '),
|
|
165
197
|
style: style
|
|
@@ -185,10 +217,12 @@ var RESIZER_DEFAULT_CLASSNAME = 'Resizer';
|
|
|
185
217
|
var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
186
218
|
_inherits(Resizer, _React$Component);
|
|
187
219
|
|
|
220
|
+
var _super = _createSuper(Resizer);
|
|
221
|
+
|
|
188
222
|
function Resizer() {
|
|
189
223
|
_classCallCheck(this, Resizer);
|
|
190
224
|
|
|
191
|
-
return
|
|
225
|
+
return _super.apply(this, arguments);
|
|
192
226
|
}
|
|
193
227
|
|
|
194
228
|
_createClass(Resizer, [{
|
|
@@ -205,7 +239,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
205
239
|
split = _this$props.split,
|
|
206
240
|
style = _this$props.style;
|
|
207
241
|
var classes = [resizerClassName, split, className];
|
|
208
|
-
return React.createElement("span", {
|
|
242
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
209
243
|
role: "presentation",
|
|
210
244
|
className: classes.join(' '),
|
|
211
245
|
style: style,
|
|
@@ -291,12 +325,14 @@ function removeNullChildren(children) {
|
|
|
291
325
|
var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
292
326
|
_inherits(SplitPane, _React$Component);
|
|
293
327
|
|
|
328
|
+
var _super = _createSuper(SplitPane);
|
|
329
|
+
|
|
294
330
|
function SplitPane(props) {
|
|
295
331
|
var _this;
|
|
296
332
|
|
|
297
333
|
_classCallCheck(this, SplitPane);
|
|
298
334
|
|
|
299
|
-
_this =
|
|
335
|
+
_this = _super.call(this, props);
|
|
300
336
|
_this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
|
|
301
337
|
_this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this));
|
|
302
338
|
_this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
|
|
@@ -552,13 +588,13 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
552
588
|
|
|
553
589
|
var pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
|
|
554
590
|
var pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
|
|
555
|
-
return React.createElement("div", {
|
|
591
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
556
592
|
className: classes.join(' '),
|
|
557
593
|
ref: function ref(node) {
|
|
558
594
|
_this2.splitPane = node;
|
|
559
595
|
},
|
|
560
596
|
style: style
|
|
561
|
-
}, React.createElement(Pane, {
|
|
597
|
+
}, /*#__PURE__*/React.createElement(Pane, {
|
|
562
598
|
className: pane1Classes,
|
|
563
599
|
key: "pane1",
|
|
564
600
|
eleRef: function eleRef(node) {
|
|
@@ -567,7 +603,7 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
567
603
|
size: pane1Size,
|
|
568
604
|
split: split,
|
|
569
605
|
style: pane1Style
|
|
570
|
-
}, notNullChildren[0]), React.createElement(Resizer, {
|
|
606
|
+
}, notNullChildren[0]), /*#__PURE__*/React.createElement(Resizer, {
|
|
571
607
|
className: disabledClass,
|
|
572
608
|
onClick: onResizerClick,
|
|
573
609
|
onDoubleClick: onResizerDoubleClick,
|
|
@@ -578,7 +614,7 @@ var SplitPane = /*#__PURE__*/function (_React$Component) {
|
|
|
578
614
|
resizerClassName: resizerClassNamesIncludingDefault,
|
|
579
615
|
split: split,
|
|
580
616
|
style: resizerStyle || {}
|
|
581
|
-
}), React.createElement(Pane, {
|
|
617
|
+
}), /*#__PURE__*/React.createElement(Pane, {
|
|
582
618
|
className: pane2Classes,
|
|
583
619
|
key: "pane2",
|
|
584
620
|
eleRef: function eleRef(node) {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist",
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.92",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/tomkp/react-split-pane"
|
|
@@ -33,15 +33,14 @@
|
|
|
33
33
|
"build": "rollup -c",
|
|
34
34
|
"build:watch": "rollup -c --watch",
|
|
35
35
|
"clean": "rimraf dist",
|
|
36
|
-
"clean:website": "rimraf build",
|
|
37
|
-
"prebuild:website": "yarn run clean:website",
|
|
38
|
-
"build:website": "parcel build website/index.html -d build --public-url /react-split-pane/",
|
|
39
36
|
"test": "BABEL_ENV=test mochify -R spec --transform babelify",
|
|
40
37
|
"test:watch": "BABEL_ENV=test mochify -R spec --watch --transform babelify",
|
|
41
38
|
"test:coverage": "BABEL_ENV=test mochify --plugin [ mochify-istanbul --exclude '**/test/**' --report lcovonly ] --transform babelify && cat lcov.info | coveralls && rm lcov.info",
|
|
42
39
|
"prettier": "prettier --write '{src,test}/**/*.js'",
|
|
43
40
|
"lint": "eslint src test",
|
|
44
41
|
"release": "standard-version",
|
|
42
|
+
"build:storybook": "build-storybook -o build",
|
|
43
|
+
"storybook": "start-storybook -p ${PORT:-3001} -h 0.0.0.0",
|
|
45
44
|
"deploy": "gh-pages -d build",
|
|
46
45
|
"prepublishOnly": "yarn run test && yarn run build"
|
|
47
46
|
},
|
|
@@ -62,8 +61,12 @@
|
|
|
62
61
|
"@babel/preset-react": "^7.7.0",
|
|
63
62
|
"@emotion/core": "^10.0.22",
|
|
64
63
|
"@emotion/styled": "^10.0.23",
|
|
64
|
+
"@storybook/addons": "^5.3.17",
|
|
65
|
+
"@storybook/react": "^5.3.17",
|
|
66
|
+
"@storybook/theming": "^5.3.17",
|
|
65
67
|
"@types/react": "^16.9.11",
|
|
66
68
|
"babel-eslint": "^10.0.3",
|
|
69
|
+
"babel-loader": "^8.0.0-beta.6",
|
|
67
70
|
"babelify": "^10.0.0",
|
|
68
71
|
"chai": "^4.2.0",
|
|
69
72
|
"chai-spies": "^1.0.0",
|
|
@@ -84,13 +87,13 @@
|
|
|
84
87
|
"mochify": "^6.6.0",
|
|
85
88
|
"mochify-istanbul": "^2.4.2",
|
|
86
89
|
"parcel-bundler": "^1.12.4",
|
|
87
|
-
"prettier": "
|
|
90
|
+
"prettier": "2.0.5",
|
|
88
91
|
"pretty-quick": "^2.0.1",
|
|
89
92
|
"react": ">=15",
|
|
90
93
|
"react-dom": "^16.0.0-0",
|
|
91
94
|
"react-router-dom": "^5.1.2",
|
|
92
95
|
"rimraf": "^3.0.0",
|
|
93
|
-
"rollup": "^
|
|
96
|
+
"rollup": "^2.3.4",
|
|
94
97
|
"rollup-plugin-babel": "^4.3.3",
|
|
95
98
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
96
99
|
"rollup-plugin-node-resolve": "^5.2.0",
|