File tree 11 files changed +121
-69
lines changed
11 files changed +121
-69
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module.exports = {
11
11
] ,
12
12
plugins : [
13
13
process . env . ROLLUP && 'external-helpers' ,
14
- process . env . PLUGINS && 'transform-es2015-modules-strip'
14
+ process . env . PLUGINS && 'transform-es2015-modules-strip' ,
15
+ '@babel/proposal-object-rest-spread'
15
16
] . filter ( Boolean )
16
17
} ;
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ const plugins = [
15
15
externalHelpersWhitelist : [ // include only required helpers
16
16
'defineProperties' ,
17
17
'createClass' ,
18
- 'inheritsLoose'
18
+ 'inheritsLoose' ,
19
+ 'extends'
19
20
]
20
21
} )
21
22
]
Original file line number Diff line number Diff line change @@ -223,7 +223,10 @@ const Carousel = (($) => {
223
223
// private
224
224
225
225
_getConfig ( config ) {
226
- config = $ . extend ( { } , Default , config )
226
+ config = {
227
+ ...Default ,
228
+ ...config
229
+ }
227
230
Util . typeCheckConfig ( NAME , config , DefaultType )
228
231
return config
229
232
}
@@ -428,10 +431,16 @@ const Carousel = (($) => {
428
431
static _jQueryInterface ( config ) {
429
432
return this . each ( function ( ) {
430
433
let data = $ ( this ) . data ( DATA_KEY )
431
- const _config = $ . extend ( { } , Default , $ ( this ) . data ( ) )
434
+ let _config = {
435
+ ...Default ,
436
+ ...$ ( this ) . data ( )
437
+ }
432
438
433
439
if ( typeof config === 'object' ) {
434
- $ . extend ( _config , config )
440
+ _config = {
441
+ ..._config ,
442
+ ...config
443
+ }
435
444
}
436
445
437
446
const action = typeof config === 'string' ? config : _config . slide
@@ -468,7 +477,10 @@ const Carousel = (($) => {
468
477
return
469
478
}
470
479
471
- const config = $ . extend ( { } , $ ( target ) . data ( ) , $ ( this ) . data ( ) )
480
+ const config = {
481
+ ...$ ( target ) . data ( ) ,
482
+ ...$ ( this ) . data ( )
483
+ }
472
484
const slideIndex = this . getAttribute ( 'data-slide-to' )
473
485
474
486
if ( slideIndex ) {
Original file line number Diff line number Diff line change @@ -277,7 +277,10 @@ const Collapse = (($) => {
277
277
// private
278
278
279
279
_getConfig ( config ) {
280
- config = $ . extend ( { } , Default , config )
280
+ config = {
281
+ ...Default ,
282
+ ...config
283
+ }
281
284
config . toggle = Boolean ( config . toggle ) // coerce string values
282
285
Util . typeCheckConfig ( NAME , config , DefaultType )
283
286
return config
@@ -338,12 +341,11 @@ const Collapse = (($) => {
338
341
return this . each ( function ( ) {
339
342
const $this = $ ( this )
340
343
let data = $this . data ( DATA_KEY )
341
- const _config = $ . extend (
342
- { } ,
343
- Default ,
344
- $this . data ( ) ,
345
- typeof config === 'object' && config
346
- )
344
+ const _config = {
345
+ ...Default ,
346
+ ...$this . data ( ) ,
347
+ ...typeof config === 'object' && config
348
+ }
347
349
348
350
if ( ! data && _config . toggle && / s h o w | h i d e / . test ( config ) ) {
349
351
_config . toggle = false
Original file line number Diff line number Diff line change @@ -210,12 +210,11 @@ const Dropdown = (($) => {
210
210
}
211
211
212
212
_getConfig ( config ) {
213
- config = $ . extend (
214
- { } ,
215
- this . constructor . Default ,
216
- $ ( this . _element ) . data ( ) ,
217
- config
218
- )
213
+ config = {
214
+ ...this . constructor . Default ,
215
+ ...$ ( this . _element ) . data ( ) ,
216
+ ...config
217
+ }
219
218
220
219
Util . typeCheckConfig (
221
220
NAME ,
@@ -262,7 +261,10 @@ const Dropdown = (($) => {
262
261
const offsetConf = { }
263
262
if ( typeof this . _config . offset === 'function' ) {
264
263
offsetConf . fn = ( data ) => {
265
- data . offsets = $ . extend ( { } , data . offsets , this . _config . offset ( data . offsets ) || { } )
264
+ data . offsets = {
265
+ ...data . offsets ,
266
+ ...this . _config . offset ( data . offsets ) || { }
267
+ }
266
268
return data
267
269
}
268
270
} else {
Original file line number Diff line number Diff line change @@ -227,7 +227,10 @@ const Modal = (($) => {
227
227
// private
228
228
229
229
_getConfig ( config ) {
230
- config = $ . extend ( { } , Default , config )
230
+ config = {
231
+ ...Default ,
232
+ ...config
233
+ }
231
234
Util . typeCheckConfig ( NAME , config , DefaultType )
232
235
return config
233
236
}
@@ -506,12 +509,11 @@ const Modal = (($) => {
506
509
static _jQueryInterface ( config , relatedTarget ) {
507
510
return this . each ( function ( ) {
508
511
let data = $ ( this ) . data ( DATA_KEY )
509
- const _config = $ . extend (
510
- { } ,
511
- Modal . Default ,
512
- $ ( this ) . data ( ) ,
513
- typeof config === 'object' && config
514
- )
512
+ const _config = {
513
+ ...Modal . Default ,
514
+ ...$ ( this ) . data ( ) ,
515
+ ...typeof config === 'object' && config
516
+ }
515
517
516
518
if ( ! data ) {
517
519
data = new Modal ( this , _config )
@@ -547,7 +549,10 @@ const Modal = (($) => {
547
549
}
548
550
549
551
const config = $ ( target ) . data ( DATA_KEY ) ?
550
- 'toggle' : $ . extend ( { } , $ ( target ) . data ( ) , $ ( this ) . data ( ) )
552
+ 'toggle' : {
553
+ ...$ ( target ) . data ( ) ,
554
+ ...$ ( this ) . data ( )
555
+ }
551
556
552
557
if ( this . tagName === 'A' || this . tagName === 'AREA' ) {
553
558
event . preventDefault ( )
Original file line number Diff line number Diff line change @@ -26,19 +26,25 @@ const Popover = (($) => {
26
26
const CLASS_PREFIX = 'bs-popover'
27
27
const BSCLS_PREFIX_REGEX = new RegExp ( `(^|\\s)${ CLASS_PREFIX } \\S+` , 'g' )
28
28
29
- const Default = $ . extend ( { } , Tooltip . Default , {
30
- placement : 'right' ,
31
- trigger : 'click' ,
32
- content : '' ,
33
- template : '<div class="popover" role="tooltip">'
34
- + '<div class="arrow"></div>'
35
- + '<h3 class="popover-header"></h3>'
36
- + '<div class="popover-body"></div></div>'
37
- } )
38
-
39
- const DefaultType = $ . extend ( { } , Tooltip . DefaultType , {
40
- content : '(string|element|function)'
41
- } )
29
+ const Default = {
30
+ ...Tooltip . Default ,
31
+ ...{
32
+ placement : 'right' ,
33
+ trigger : 'click' ,
34
+ content : '' ,
35
+ template : '<div class="popover" role="tooltip">'
36
+ + '<div class="arrow"></div>'
37
+ + '<h3 class="popover-header"></h3>'
38
+ + '<div class="popover-body"></div></div>'
39
+ }
40
+ }
41
+
42
+ const DefaultType = {
43
+ ...Tooltip . DefaultType ,
44
+ ...{
45
+ content : '(string|element|function)'
46
+ }
47
+ }
42
48
43
49
const ClassName = {
44
50
FADE : 'fade' ,
Original file line number Diff line number Diff line change @@ -171,7 +171,10 @@ const ScrollSpy = (($) => {
171
171
// private
172
172
173
173
_getConfig ( config ) {
174
- config = $ . extend ( { } , Default , config )
174
+ config = {
175
+ ...Default ,
176
+ ...config
177
+ }
175
178
176
179
if ( typeof config . target !== 'string' ) {
177
180
let id = $ ( config . target ) . attr ( 'id' )
Original file line number Diff line number Diff line change @@ -501,10 +501,13 @@ const Tooltip = (($) => {
501
501
} )
502
502
503
503
if ( this . config . selector ) {
504
- this . config = $ . extend ( { } , this . config , {
505
- trigger : 'manual' ,
506
- selector : ''
507
- } )
504
+ this . config = {
505
+ ...this . config ,
506
+ ...{
507
+ trigger : 'manual' ,
508
+ selector : ''
509
+ }
510
+ }
508
511
} else {
509
512
this . _fixTitle ( )
510
513
}
@@ -613,12 +616,11 @@ const Tooltip = (($) => {
613
616
}
614
617
615
618
_getConfig ( config ) {
616
- config = $ . extend (
617
- { } ,
618
- this . constructor . Default ,
619
- $ ( this . element ) . data ( ) ,
620
- config
621
- )
619
+ config = {
620
+ ...this . constructor . Default ,
621
+ ...$ ( this . element ) . data ( ) ,
622
+ ...config
623
+ }
622
624
623
625
if ( typeof config . delay === 'number' ) {
624
626
config . delay = {
Original file line number Diff line number Diff line change 80
80
"popper.js" : " ^1.12.6"
81
81
},
82
82
"devDependencies" : {
83
+ "@babel/plugin-proposal-object-rest-spread" : " ^7.0.0-beta.2" ,
83
84
"autoprefixer" : " ^7.1.2" ,
84
85
"babel-cli" : " 7.0.0-beta.2" ,
85
86
"babel-eslint" : " ^8.0.0" ,
You can’t perform that action at this time.
0 commit comments