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.
@@ -0,0 +1,701 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import stylePropType from 'react-style-proptype';
4
+ import { polyfill } from 'react-lifecycles-compat';
5
+
6
+ function _classCallCheck(instance, Constructor) {
7
+ if (!(instance instanceof Constructor)) {
8
+ throw new TypeError("Cannot call a class as a function");
9
+ }
10
+ }
11
+
12
+ function _defineProperties(target, props) {
13
+ for (var i = 0; i < props.length; i++) {
14
+ var descriptor = props[i];
15
+ descriptor.enumerable = descriptor.enumerable || false;
16
+ descriptor.configurable = true;
17
+ if ("value" in descriptor) descriptor.writable = true;
18
+ Object.defineProperty(target, descriptor.key, descriptor);
19
+ }
20
+ }
21
+
22
+ function _createClass(Constructor, protoProps, staticProps) {
23
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
24
+ if (staticProps) _defineProperties(Constructor, staticProps);
25
+ return Constructor;
26
+ }
27
+
28
+ function _defineProperty(obj, key, value) {
29
+ if (key in obj) {
30
+ Object.defineProperty(obj, key, {
31
+ value: value,
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true
35
+ });
36
+ } else {
37
+ obj[key] = value;
38
+ }
39
+
40
+ return obj;
41
+ }
42
+
43
+ function ownKeys(object, enumerableOnly) {
44
+ var keys = Object.keys(object);
45
+
46
+ if (Object.getOwnPropertySymbols) {
47
+ var symbols = Object.getOwnPropertySymbols(object);
48
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
49
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
50
+ });
51
+ keys.push.apply(keys, symbols);
52
+ }
53
+
54
+ return keys;
55
+ }
56
+
57
+ function _objectSpread2(target) {
58
+ for (var i = 1; i < arguments.length; i++) {
59
+ var source = arguments[i] != null ? arguments[i] : {};
60
+
61
+ if (i % 2) {
62
+ ownKeys(Object(source), true).forEach(function (key) {
63
+ _defineProperty(target, key, source[key]);
64
+ });
65
+ } else if (Object.getOwnPropertyDescriptors) {
66
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
67
+ } else {
68
+ ownKeys(Object(source)).forEach(function (key) {
69
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70
+ });
71
+ }
72
+ }
73
+
74
+ return target;
75
+ }
76
+
77
+ function _inherits(subClass, superClass) {
78
+ if (typeof superClass !== "function" && superClass !== null) {
79
+ throw new TypeError("Super expression must either be null or a function");
80
+ }
81
+
82
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
83
+ constructor: {
84
+ value: subClass,
85
+ writable: true,
86
+ configurable: true
87
+ }
88
+ });
89
+ if (superClass) _setPrototypeOf(subClass, superClass);
90
+ }
91
+
92
+ function _getPrototypeOf(o) {
93
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
94
+ return o.__proto__ || Object.getPrototypeOf(o);
95
+ };
96
+ return _getPrototypeOf(o);
97
+ }
98
+
99
+ function _setPrototypeOf(o, p) {
100
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
101
+ o.__proto__ = p;
102
+ return o;
103
+ };
104
+
105
+ return _setPrototypeOf(o, p);
106
+ }
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
+
121
+ function _assertThisInitialized(self) {
122
+ if (self === void 0) {
123
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
124
+ }
125
+
126
+ return self;
127
+ }
128
+
129
+ function _possibleConstructorReturn(self, call) {
130
+ if (call && (typeof call === "object" || typeof call === "function")) {
131
+ return call;
132
+ }
133
+
134
+ return _assertThisInitialized(self);
135
+ }
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
+
154
+ var Pane = /*#__PURE__*/function (_React$PureComponent) {
155
+ _inherits(Pane, _React$PureComponent);
156
+
157
+ var _super = _createSuper(Pane);
158
+
159
+ function Pane() {
160
+ _classCallCheck(this, Pane);
161
+
162
+ return _super.apply(this, arguments);
163
+ }
164
+
165
+ _createClass(Pane, [{
166
+ key: "render",
167
+ value: function render() {
168
+ var _this$props = this.props,
169
+ children = _this$props.children,
170
+ className = _this$props.className,
171
+ split = _this$props.split,
172
+ styleProps = _this$props.style,
173
+ size = _this$props.size,
174
+ eleRef = _this$props.eleRef;
175
+ var classes = ['Pane', split, className];
176
+ var style = {
177
+ flex: 1,
178
+ position: 'relative',
179
+ outline: 'none'
180
+ };
181
+
182
+ if (size !== undefined) {
183
+ if (split === 'vertical') {
184
+ style.width = size;
185
+ } else {
186
+ style.height = size;
187
+ style.display = 'flex';
188
+ }
189
+
190
+ style.flex = 'none';
191
+ }
192
+
193
+ style = Object.assign({}, style, styleProps || {});
194
+ return /*#__PURE__*/React.createElement("div", {
195
+ ref: eleRef,
196
+ className: classes.join(' '),
197
+ style: style
198
+ }, children);
199
+ }
200
+ }]);
201
+
202
+ return Pane;
203
+ }(React.PureComponent);
204
+
205
+ Pane.propTypes = {
206
+ className: PropTypes.string.isRequired,
207
+ children: PropTypes.node.isRequired,
208
+ size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
209
+ split: PropTypes.oneOf(['vertical', 'horizontal']),
210
+ style: stylePropType,
211
+ eleRef: PropTypes.func
212
+ };
213
+ Pane.defaultProps = {};
214
+
215
+ var RESIZER_DEFAULT_CLASSNAME = 'Resizer';
216
+
217
+ var Resizer = /*#__PURE__*/function (_React$Component) {
218
+ _inherits(Resizer, _React$Component);
219
+
220
+ var _super = _createSuper(Resizer);
221
+
222
+ function Resizer() {
223
+ _classCallCheck(this, Resizer);
224
+
225
+ return _super.apply(this, arguments);
226
+ }
227
+
228
+ _createClass(Resizer, [{
229
+ key: "render",
230
+ value: function render() {
231
+ var _this$props = this.props,
232
+ className = _this$props.className,
233
+ _onClick = _this$props.onClick,
234
+ _onDoubleClick = _this$props.onDoubleClick,
235
+ _onMouseDown = _this$props.onMouseDown,
236
+ _onTouchEnd = _this$props.onTouchEnd,
237
+ _onTouchStart = _this$props.onTouchStart,
238
+ resizerClassName = _this$props.resizerClassName,
239
+ split = _this$props.split,
240
+ style = _this$props.style;
241
+ var classes = [resizerClassName, split, className];
242
+ return /*#__PURE__*/React.createElement("span", {
243
+ role: "presentation",
244
+ className: classes.join(' '),
245
+ style: style,
246
+ onMouseDown: function onMouseDown(event) {
247
+ return _onMouseDown(event);
248
+ },
249
+ onTouchStart: function onTouchStart(event) {
250
+ event.preventDefault();
251
+
252
+ _onTouchStart(event);
253
+ },
254
+ onTouchEnd: function onTouchEnd(event) {
255
+ event.preventDefault();
256
+
257
+ _onTouchEnd(event);
258
+ },
259
+ onClick: function onClick(event) {
260
+ if (_onClick) {
261
+ event.preventDefault();
262
+
263
+ _onClick(event);
264
+ }
265
+ },
266
+ onDoubleClick: function onDoubleClick(event) {
267
+ if (_onDoubleClick) {
268
+ event.preventDefault();
269
+
270
+ _onDoubleClick(event);
271
+ }
272
+ }
273
+ });
274
+ }
275
+ }]);
276
+
277
+ return Resizer;
278
+ }(React.Component);
279
+
280
+ Resizer.propTypes = {
281
+ className: PropTypes.string.isRequired,
282
+ onClick: PropTypes.func,
283
+ onDoubleClick: PropTypes.func,
284
+ onMouseDown: PropTypes.func.isRequired,
285
+ onTouchStart: PropTypes.func.isRequired,
286
+ onTouchEnd: PropTypes.func.isRequired,
287
+ split: PropTypes.oneOf(['vertical', 'horizontal']),
288
+ style: stylePropType,
289
+ resizerClassName: PropTypes.string.isRequired
290
+ };
291
+ Resizer.defaultProps = {
292
+ resizerClassName: RESIZER_DEFAULT_CLASSNAME
293
+ };
294
+
295
+ function unFocus(document, window) {
296
+ if (document.selection) {
297
+ document.selection.empty();
298
+ } else {
299
+ try {
300
+ window.getSelection().removeAllRanges(); // eslint-disable-next-line no-empty
301
+ } catch (e) {}
302
+ }
303
+ }
304
+
305
+ function getDefaultSize(defaultSize, minSize, maxSize, draggedSize) {
306
+ if (typeof draggedSize === 'number') {
307
+ var min = typeof minSize === 'number' ? minSize : 0;
308
+ var max = typeof maxSize === 'number' && maxSize >= 0 ? maxSize : Infinity;
309
+ return Math.max(min, Math.min(max, draggedSize));
310
+ }
311
+
312
+ if (defaultSize !== undefined) {
313
+ return defaultSize;
314
+ }
315
+
316
+ return minSize;
317
+ }
318
+
319
+ function removeNullChildren(children) {
320
+ return React.Children.toArray(children).filter(function (c) {
321
+ return c;
322
+ });
323
+ }
324
+
325
+ var SplitPane = /*#__PURE__*/function (_React$Component) {
326
+ _inherits(SplitPane, _React$Component);
327
+
328
+ var _super = _createSuper(SplitPane);
329
+
330
+ function SplitPane(props) {
331
+ var _this;
332
+
333
+ _classCallCheck(this, SplitPane);
334
+
335
+ _this = _super.call(this, props);
336
+ _this.onMouseDown = _this.onMouseDown.bind(_assertThisInitialized(_this));
337
+ _this.onTouchStart = _this.onTouchStart.bind(_assertThisInitialized(_this));
338
+ _this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this));
339
+ _this.onTouchMove = _this.onTouchMove.bind(_assertThisInitialized(_this));
340
+ _this.onMouseUp = _this.onMouseUp.bind(_assertThisInitialized(_this)); // order of setting panel sizes.
341
+ // 1. size
342
+ // 2. getDefaultSize(defaultSize, minsize, maxSize)
343
+
344
+ var size = props.size,
345
+ defaultSize = props.defaultSize,
346
+ minSize = props.minSize,
347
+ maxSize = props.maxSize,
348
+ primary = props.primary;
349
+ var initialSize = size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize, null);
350
+ _this.state = {
351
+ active: false,
352
+ resized: false,
353
+ pane1Size: primary === 'first' ? initialSize : undefined,
354
+ pane2Size: primary === 'second' ? initialSize : undefined,
355
+ // these are props that are needed in static functions. ie: gDSFP
356
+ instanceProps: {
357
+ size: size
358
+ }
359
+ };
360
+ return _this;
361
+ }
362
+
363
+ _createClass(SplitPane, [{
364
+ key: "componentDidMount",
365
+ value: function componentDidMount() {
366
+ document.addEventListener('mouseup', this.onMouseUp);
367
+ document.addEventListener('mousemove', this.onMouseMove);
368
+ document.addEventListener('touchmove', this.onTouchMove);
369
+ this.setState(SplitPane.getSizeUpdate(this.props, this.state));
370
+ }
371
+ }, {
372
+ key: "componentWillUnmount",
373
+ value: function componentWillUnmount() {
374
+ document.removeEventListener('mouseup', this.onMouseUp);
375
+ document.removeEventListener('mousemove', this.onMouseMove);
376
+ document.removeEventListener('touchmove', this.onTouchMove);
377
+ }
378
+ }, {
379
+ key: "onMouseDown",
380
+ value: function onMouseDown(event) {
381
+ var eventWithTouches = Object.assign({}, event, {
382
+ touches: [{
383
+ clientX: event.clientX,
384
+ clientY: event.clientY
385
+ }]
386
+ });
387
+ this.onTouchStart(eventWithTouches);
388
+ }
389
+ }, {
390
+ key: "onTouchStart",
391
+ value: function onTouchStart(event) {
392
+ var _this$props = this.props,
393
+ allowResize = _this$props.allowResize,
394
+ onDragStarted = _this$props.onDragStarted,
395
+ split = _this$props.split;
396
+
397
+ if (allowResize) {
398
+ unFocus(document, window);
399
+ var position = split === 'vertical' ? event.touches[0].clientX : event.touches[0].clientY;
400
+
401
+ if (typeof onDragStarted === 'function') {
402
+ onDragStarted();
403
+ }
404
+
405
+ this.setState({
406
+ active: true,
407
+ position: position
408
+ });
409
+ }
410
+ }
411
+ }, {
412
+ key: "onMouseMove",
413
+ value: function onMouseMove(event) {
414
+ var eventWithTouches = Object.assign({}, event, {
415
+ touches: [{
416
+ clientX: event.clientX,
417
+ clientY: event.clientY
418
+ }]
419
+ });
420
+ this.onTouchMove(eventWithTouches);
421
+ }
422
+ }, {
423
+ key: "onTouchMove",
424
+ value: function onTouchMove(event) {
425
+ var _this$props2 = this.props,
426
+ allowResize = _this$props2.allowResize,
427
+ maxSize = _this$props2.maxSize,
428
+ minSize = _this$props2.minSize,
429
+ onChange = _this$props2.onChange,
430
+ split = _this$props2.split,
431
+ step = _this$props2.step;
432
+ var _this$state = this.state,
433
+ active = _this$state.active,
434
+ position = _this$state.position;
435
+
436
+ if (allowResize && active) {
437
+ unFocus(document, window);
438
+ var isPrimaryFirst = this.props.primary === 'first';
439
+ var ref = isPrimaryFirst ? this.pane1 : this.pane2;
440
+ var ref2 = isPrimaryFirst ? this.pane2 : this.pane1;
441
+
442
+ if (ref) {
443
+ var node = ref;
444
+ var node2 = ref2;
445
+
446
+ if (node.getBoundingClientRect) {
447
+ var width = node.getBoundingClientRect().width;
448
+ var height = node.getBoundingClientRect().height;
449
+ var current = split === 'vertical' ? event.touches[0].clientX : event.touches[0].clientY;
450
+ var size = split === 'vertical' ? width : height;
451
+ var positionDelta = position - current;
452
+
453
+ if (step) {
454
+ if (Math.abs(positionDelta) < step) {
455
+ return;
456
+ } // Integer division
457
+ // eslint-disable-next-line no-bitwise
458
+
459
+
460
+ positionDelta = ~~(positionDelta / step) * step;
461
+ }
462
+
463
+ var sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;
464
+ var pane1Order = parseInt(window.getComputedStyle(node).order);
465
+ var pane2Order = parseInt(window.getComputedStyle(node2).order);
466
+
467
+ if (pane1Order > pane2Order) {
468
+ sizeDelta = -sizeDelta;
469
+ }
470
+
471
+ var newMaxSize = maxSize;
472
+
473
+ if (maxSize !== undefined && maxSize <= 0) {
474
+ var splitPane = this.splitPane;
475
+
476
+ if (split === 'vertical') {
477
+ newMaxSize = splitPane.getBoundingClientRect().width + maxSize;
478
+ } else {
479
+ newMaxSize = splitPane.getBoundingClientRect().height + maxSize;
480
+ }
481
+ }
482
+
483
+ var newSize = size - sizeDelta;
484
+ var newPosition = position - positionDelta;
485
+
486
+ if (newSize < minSize) {
487
+ newSize = minSize;
488
+ } else if (maxSize !== undefined && newSize > newMaxSize) {
489
+ newSize = newMaxSize;
490
+ } else {
491
+ this.setState({
492
+ position: newPosition,
493
+ resized: true
494
+ });
495
+ }
496
+
497
+ if (onChange) onChange(newSize);
498
+ this.setState(_defineProperty({
499
+ draggedSize: newSize
500
+ }, isPrimaryFirst ? 'pane1Size' : 'pane2Size', newSize));
501
+ }
502
+ }
503
+ }
504
+ }
505
+ }, {
506
+ key: "onMouseUp",
507
+ value: function onMouseUp() {
508
+ var _this$props3 = this.props,
509
+ allowResize = _this$props3.allowResize,
510
+ onDragFinished = _this$props3.onDragFinished;
511
+ var _this$state2 = this.state,
512
+ active = _this$state2.active,
513
+ draggedSize = _this$state2.draggedSize;
514
+
515
+ if (allowResize && active) {
516
+ if (typeof onDragFinished === 'function') {
517
+ onDragFinished(draggedSize);
518
+ }
519
+
520
+ this.setState({
521
+ active: false
522
+ });
523
+ }
524
+ } // we have to check values since gDSFP is called on every render and more in StrictMode
525
+
526
+ }, {
527
+ key: "render",
528
+ value: function render() {
529
+ var _this2 = this;
530
+
531
+ var _this$props4 = this.props,
532
+ allowResize = _this$props4.allowResize,
533
+ children = _this$props4.children,
534
+ className = _this$props4.className,
535
+ onResizerClick = _this$props4.onResizerClick,
536
+ onResizerDoubleClick = _this$props4.onResizerDoubleClick,
537
+ paneClassName = _this$props4.paneClassName,
538
+ pane1ClassName = _this$props4.pane1ClassName,
539
+ pane2ClassName = _this$props4.pane2ClassName,
540
+ paneStyle = _this$props4.paneStyle,
541
+ pane1StyleProps = _this$props4.pane1Style,
542
+ pane2StyleProps = _this$props4.pane2Style,
543
+ resizerClassName = _this$props4.resizerClassName,
544
+ resizerStyle = _this$props4.resizerStyle,
545
+ split = _this$props4.split,
546
+ styleProps = _this$props4.style;
547
+ var _this$state3 = this.state,
548
+ pane1Size = _this$state3.pane1Size,
549
+ pane2Size = _this$state3.pane2Size;
550
+ var disabledClass = allowResize ? '' : 'disabled';
551
+ var resizerClassNamesIncludingDefault = resizerClassName ? "".concat(resizerClassName, " ").concat(RESIZER_DEFAULT_CLASSNAME) : resizerClassName;
552
+ var notNullChildren = removeNullChildren(children);
553
+
554
+ var style = _objectSpread2({
555
+ display: 'flex',
556
+ flex: 1,
557
+ height: '100%',
558
+ position: 'absolute',
559
+ outline: 'none',
560
+ overflow: 'hidden',
561
+ MozUserSelect: 'text',
562
+ WebkitUserSelect: 'text',
563
+ msUserSelect: 'text',
564
+ userSelect: 'text'
565
+ }, styleProps);
566
+
567
+ if (split === 'vertical') {
568
+ Object.assign(style, {
569
+ flexDirection: 'row',
570
+ left: 0,
571
+ right: 0
572
+ });
573
+ } else {
574
+ Object.assign(style, {
575
+ bottom: 0,
576
+ flexDirection: 'column',
577
+ minHeight: '100%',
578
+ top: 0,
579
+ width: '100%'
580
+ });
581
+ }
582
+
583
+ var classes = ['SplitPane', className, split, disabledClass];
584
+
585
+ var pane1Style = _objectSpread2({}, paneStyle, {}, pane1StyleProps);
586
+
587
+ var pane2Style = _objectSpread2({}, paneStyle, {}, pane2StyleProps);
588
+
589
+ var pane1Classes = ['Pane1', paneClassName, pane1ClassName].join(' ');
590
+ var pane2Classes = ['Pane2', paneClassName, pane2ClassName].join(' ');
591
+ return /*#__PURE__*/React.createElement("div", {
592
+ className: classes.join(' '),
593
+ ref: function ref(node) {
594
+ _this2.splitPane = node;
595
+ },
596
+ style: style
597
+ }, /*#__PURE__*/React.createElement(Pane, {
598
+ className: pane1Classes,
599
+ key: "pane1",
600
+ eleRef: function eleRef(node) {
601
+ _this2.pane1 = node;
602
+ },
603
+ size: pane1Size,
604
+ split: split,
605
+ style: pane1Style
606
+ }, notNullChildren[0]), /*#__PURE__*/React.createElement(Resizer, {
607
+ className: disabledClass,
608
+ onClick: onResizerClick,
609
+ onDoubleClick: onResizerDoubleClick,
610
+ onMouseDown: this.onMouseDown,
611
+ onTouchStart: this.onTouchStart,
612
+ onTouchEnd: this.onMouseUp,
613
+ key: "resizer",
614
+ resizerClassName: resizerClassNamesIncludingDefault,
615
+ split: split,
616
+ style: resizerStyle || {}
617
+ }), /*#__PURE__*/React.createElement(Pane, {
618
+ className: pane2Classes,
619
+ key: "pane2",
620
+ eleRef: function eleRef(node) {
621
+ _this2.pane2 = node;
622
+ },
623
+ size: pane2Size,
624
+ split: split,
625
+ style: pane2Style
626
+ }, notNullChildren[1]));
627
+ }
628
+ }], [{
629
+ key: "getDerivedStateFromProps",
630
+ value: function getDerivedStateFromProps(nextProps, prevState) {
631
+ return SplitPane.getSizeUpdate(nextProps, prevState);
632
+ }
633
+ }, {
634
+ key: "getSizeUpdate",
635
+ value: function getSizeUpdate(props, state) {
636
+ var newState = {};
637
+ var instanceProps = state.instanceProps;
638
+
639
+ if (instanceProps.size === props.size && props.size !== undefined) {
640
+ return {};
641
+ }
642
+
643
+ var newSize = props.size !== undefined ? props.size : getDefaultSize(props.defaultSize, props.minSize, props.maxSize, state.draggedSize);
644
+
645
+ if (props.size !== undefined) {
646
+ newState.draggedSize = newSize;
647
+ }
648
+
649
+ var isPanel1Primary = props.primary === 'first';
650
+ newState[isPanel1Primary ? 'pane1Size' : 'pane2Size'] = newSize;
651
+ newState[isPanel1Primary ? 'pane2Size' : 'pane1Size'] = undefined;
652
+ newState.instanceProps = {
653
+ size: props.size
654
+ };
655
+ return newState;
656
+ }
657
+ }]);
658
+
659
+ return SplitPane;
660
+ }(React.Component);
661
+
662
+ SplitPane.propTypes = {
663
+ allowResize: PropTypes.bool,
664
+ children: PropTypes.arrayOf(PropTypes.node).isRequired,
665
+ className: PropTypes.string,
666
+ primary: PropTypes.oneOf(['first', 'second']),
667
+ minSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
668
+ maxSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
669
+ // eslint-disable-next-line react/no-unused-prop-types
670
+ defaultSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
671
+ size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
672
+ split: PropTypes.oneOf(['vertical', 'horizontal']),
673
+ onDragStarted: PropTypes.func,
674
+ onDragFinished: PropTypes.func,
675
+ onChange: PropTypes.func,
676
+ onResizerClick: PropTypes.func,
677
+ onResizerDoubleClick: PropTypes.func,
678
+ style: stylePropType,
679
+ resizerStyle: stylePropType,
680
+ paneClassName: PropTypes.string,
681
+ pane1ClassName: PropTypes.string,
682
+ pane2ClassName: PropTypes.string,
683
+ paneStyle: stylePropType,
684
+ pane1Style: stylePropType,
685
+ pane2Style: stylePropType,
686
+ resizerClassName: PropTypes.string,
687
+ step: PropTypes.number
688
+ };
689
+ SplitPane.defaultProps = {
690
+ allowResize: true,
691
+ minSize: 50,
692
+ primary: 'first',
693
+ split: 'vertical',
694
+ paneClassName: '',
695
+ pane1ClassName: '',
696
+ pane2ClassName: ''
697
+ };
698
+ polyfill(SplitPane);
699
+
700
+ export default SplitPane;
701
+ export { Pane };