1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import Prefixer from 'inline-style-prefixer' ;
4
3
import stylePropType from 'react-style-proptype' ;
5
4
import { polyfill } from 'react-lifecycles-compat' ;
6
5
7
6
import Pane from './Pane' ;
8
7
import Resizer , { RESIZER_DEFAULT_CLASSNAME } from './Resizer' ;
9
8
10
- const DEFAULT_USER_AGENT =
11
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2' ;
12
- const USER_AGENT =
13
- typeof navigator !== 'undefined' ? navigator . userAgent : DEFAULT_USER_AGENT ;
14
-
15
9
function unFocus ( document , window ) {
16
10
if ( document . selection ) {
17
11
document . selection . empty ( ) ;
@@ -253,7 +247,6 @@ class SplitPane extends React.Component {
253
247
paneStyle,
254
248
pane1Style : pane1StyleProps ,
255
249
pane2Style : pane2StyleProps ,
256
- prefixer,
257
250
resizerClassName,
258
251
resizerStyle,
259
252
split,
@@ -269,22 +262,19 @@ class SplitPane extends React.Component {
269
262
270
263
const notNullChildren = removeNullChildren ( children ) ;
271
264
272
- const style = Object . assign (
273
- { } ,
274
- {
275
- display : 'flex' ,
276
- flex : 1 ,
277
- height : '100%' ,
278
- position : 'absolute' ,
279
- outline : 'none' ,
280
- overflow : 'hidden' ,
281
- MozUserSelect : 'text' ,
282
- WebkitUserSelect : 'text' ,
283
- msUserSelect : 'text' ,
284
- userSelect : 'text' ,
285
- } ,
286
- styleProps || { }
287
- ) ;
265
+ const style = {
266
+ display : 'flex' ,
267
+ flex : 1 ,
268
+ height : '100%' ,
269
+ position : 'absolute' ,
270
+ outline : 'none' ,
271
+ overflow : 'hidden' ,
272
+ MozUserSelect : 'text' ,
273
+ WebkitUserSelect : 'text' ,
274
+ msUserSelect : 'text' ,
275
+ userSelect : 'text' ,
276
+ ...styleProps ,
277
+ } ;
288
278
289
279
if ( split === 'vertical' ) {
290
280
Object . assign ( style , {
@@ -303,12 +293,9 @@ class SplitPane extends React.Component {
303
293
}
304
294
305
295
const classes = [ 'SplitPane' , className , split , disabledClass ] ;
306
- const pane1Style = prefixer . prefix (
307
- Object . assign ( { } , paneStyle || { } , pane1StyleProps || { } )
308
- ) ;
309
- const pane2Style = prefixer . prefix (
310
- Object . assign ( { } , paneStyle || { } , pane2StyleProps || { } )
311
- ) ;
296
+
297
+ const pane1Style = { ...paneStyle , ...pane1StyleProps } ;
298
+ const pane2Style = { ...paneStyle , ...pane2StyleProps } ;
312
299
313
300
const pane1Classes = [ 'Pane1' , paneClassName , pane1ClassName ] . join ( ' ' ) ;
314
301
const pane2Classes = [ 'Pane2' , paneClassName , pane2ClassName ] . join ( ' ' ) ;
@@ -319,7 +306,7 @@ class SplitPane extends React.Component {
319
306
ref = { node => {
320
307
this . splitPane = node ;
321
308
} }
322
- style = { prefixer . prefix ( style ) }
309
+ style = { style }
323
310
>
324
311
< Pane
325
312
className = { pane1Classes }
@@ -378,7 +365,6 @@ SplitPane.propTypes = {
378
365
onChange : PropTypes . func ,
379
366
onResizerClick : PropTypes . func ,
380
367
onResizerDoubleClick : PropTypes . func ,
381
- prefixer : PropTypes . instanceOf ( Prefixer ) . isRequired ,
382
368
style : stylePropType ,
383
369
resizerStyle : stylePropType ,
384
370
paneClassName : PropTypes . string ,
@@ -394,7 +380,6 @@ SplitPane.propTypes = {
394
380
SplitPane . defaultProps = {
395
381
allowResize : true ,
396
382
minSize : 50 ,
397
- prefixer : new Prefixer ( { userAgent : USER_AGENT } ) ,
398
383
primary : 'first' ,
399
384
split : 'vertical' ,
400
385
paneClassName : '' ,
0 commit comments