bootstrap-table-rails 1.15.5 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -4
  3. data/lib/bootstrap-table-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +106 -64
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +678 -208
  6. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +680 -210
  7. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +66 -10
  8. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +742 -489
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +1103 -213
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +226 -80
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +136 -64
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.js +338 -177
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +402 -110
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +133 -61
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +82 -41
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +243 -75
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +347 -179
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.css +1 -1
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +687 -358
  20. data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.css +12 -14
  21. data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +545 -422
  22. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +488 -92
  23. data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +2 -2
  24. data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +216 -72
  25. data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +142 -65
  26. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +345 -137
  27. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +136 -64
  28. data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +86 -41
  29. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +218 -123
  30. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +640 -254
  31. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +347 -135
  32. data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +83 -43
  33. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css +0 -1
  34. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +203 -75
  35. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +449 -199
  36. data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +207 -114
  37. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +82 -41
  38. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +82 -41
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +82 -41
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +82 -41
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +82 -41
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +82 -41
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +82 -41
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +82 -41
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +104 -62
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +82 -41
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +82 -41
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +82 -41
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +82 -41
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +82 -41
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +82 -41
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +82 -41
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +82 -41
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +82 -41
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +82 -41
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +82 -41
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +82 -41
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +83 -42
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +82 -41
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +82 -41
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +82 -41
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +82 -41
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +82 -41
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +82 -41
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +82 -41
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +82 -41
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +82 -41
  68. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +82 -41
  69. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +82 -41
  70. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +82 -41
  71. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +82 -41
  72. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +82 -41
  73. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +83 -42
  74. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +82 -41
  75. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +82 -41
  76. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +82 -41
  77. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +82 -41
  78. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +82 -41
  79. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +82 -41
  80. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +82 -41
  81. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +82 -41
  82. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +82 -41
  83. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +82 -41
  84. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +82 -41
  85. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +82 -41
  86. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +82 -41
  87. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +82 -41
  88. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +82 -41
  89. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +80 -11
  90. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +106 -60
  91. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +79 -13
  92. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +111 -62
  93. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +74 -9
  94. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +109 -63
  95. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +80 -13
  96. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +110 -64
  97. metadata +1 -2
  98. data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +0 -1265
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
3
3
  typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4
4
  (global = global || self, factory(global.jQuery));
5
- }(this, function ($) { 'use strict';
5
+ }(this, (function ($) { 'use strict';
6
6
 
7
7
  $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
8
 
@@ -12,7 +12,6 @@
12
12
  return module = { exports: {} }, fn(module, module.exports), module.exports;
13
13
  }
14
14
 
15
- var O = 'object';
16
15
  var check = function (it) {
17
16
  return it && it.Math == Math && it;
18
17
  };
@@ -20,10 +19,10 @@
20
19
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
21
20
  var global_1 =
22
21
  // eslint-disable-next-line no-undef
23
- check(typeof globalThis == O && globalThis) ||
24
- check(typeof window == O && window) ||
25
- check(typeof self == O && self) ||
26
- check(typeof commonjsGlobal == O && commonjsGlobal) ||
22
+ check(typeof globalThis == 'object' && globalThis) ||
23
+ check(typeof window == 'object' && window) ||
24
+ check(typeof self == 'object' && self) ||
25
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
27
26
  // eslint-disable-next-line no-new-func
28
27
  Function('return this')();
29
28
 
@@ -179,7 +178,7 @@
179
178
  f: f$2
180
179
  };
181
180
 
182
- var hide = descriptors ? function (object, key, value) {
181
+ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
183
182
  return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
184
183
  } : function (object, key, value) {
185
184
  object[key] = value;
@@ -188,31 +187,42 @@
188
187
 
189
188
  var setGlobal = function (key, value) {
190
189
  try {
191
- hide(global_1, key, value);
190
+ createNonEnumerableProperty(global_1, key, value);
192
191
  } catch (error) {
193
192
  global_1[key] = value;
194
193
  } return value;
195
194
  };
196
195
 
197
- var shared = createCommonjsModule(function (module) {
198
196
  var SHARED = '__core-js_shared__';
199
197
  var store = global_1[SHARED] || setGlobal(SHARED, {});
200
198
 
199
+ var sharedStore = store;
200
+
201
+ var functionToString = Function.toString;
202
+
203
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
204
+ if (typeof sharedStore.inspectSource != 'function') {
205
+ sharedStore.inspectSource = function (it) {
206
+ return functionToString.call(it);
207
+ };
208
+ }
209
+
210
+ var inspectSource = sharedStore.inspectSource;
211
+
212
+ var WeakMap = global_1.WeakMap;
213
+
214
+ var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
215
+
216
+ var shared = createCommonjsModule(function (module) {
201
217
  (module.exports = function (key, value) {
202
- return store[key] || (store[key] = value !== undefined ? value : {});
218
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
203
219
  })('versions', []).push({
204
- version: '3.1.3',
220
+ version: '3.6.0',
205
221
  mode: 'global',
206
222
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
207
223
  });
208
224
  });
209
225
 
210
- var functionToString = shared('native-function-to-string', Function.toString);
211
-
212
- var WeakMap = global_1.WeakMap;
213
-
214
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
215
-
216
226
  var id = 0;
217
227
  var postfix = Math.random();
218
228
 
@@ -245,25 +255,25 @@
245
255
  };
246
256
 
247
257
  if (nativeWeakMap) {
248
- var store = new WeakMap$1();
249
- var wmget = store.get;
250
- var wmhas = store.has;
251
- var wmset = store.set;
258
+ var store$1 = new WeakMap$1();
259
+ var wmget = store$1.get;
260
+ var wmhas = store$1.has;
261
+ var wmset = store$1.set;
252
262
  set = function (it, metadata) {
253
- wmset.call(store, it, metadata);
263
+ wmset.call(store$1, it, metadata);
254
264
  return metadata;
255
265
  };
256
266
  get = function (it) {
257
- return wmget.call(store, it) || {};
267
+ return wmget.call(store$1, it) || {};
258
268
  };
259
269
  has$1 = function (it) {
260
- return wmhas.call(store, it);
270
+ return wmhas.call(store$1, it);
261
271
  };
262
272
  } else {
263
273
  var STATE = sharedKey('state');
264
274
  hiddenKeys[STATE] = true;
265
275
  set = function (it, metadata) {
266
- hide(it, STATE, metadata);
276
+ createNonEnumerableProperty(it, STATE, metadata);
267
277
  return metadata;
268
278
  };
269
279
  get = function (it) {
@@ -285,18 +295,14 @@
285
295
  var redefine = createCommonjsModule(function (module) {
286
296
  var getInternalState = internalState.get;
287
297
  var enforceInternalState = internalState.enforce;
288
- var TEMPLATE = String(functionToString).split('toString');
289
-
290
- shared('inspectSource', function (it) {
291
- return functionToString.call(it);
292
- });
298
+ var TEMPLATE = String(String).split('String');
293
299
 
294
300
  (module.exports = function (O, key, value, options) {
295
301
  var unsafe = options ? !!options.unsafe : false;
296
302
  var simple = options ? !!options.enumerable : false;
297
303
  var noTargetGet = options ? !!options.noTargetGet : false;
298
304
  if (typeof value == 'function') {
299
- if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
305
+ if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
300
306
  enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
301
307
  }
302
308
  if (O === global_1) {
@@ -309,10 +315,10 @@
309
315
  simple = true;
310
316
  }
311
317
  if (simple) O[key] = value;
312
- else hide(O, key, value);
318
+ else createNonEnumerableProperty(O, key, value);
313
319
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
314
320
  })(Function.prototype, 'toString', function toString() {
315
- return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
321
+ return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
316
322
  });
317
323
  });
318
324
 
@@ -349,7 +355,7 @@
349
355
 
350
356
  // Helper for a popular repeating case of the spec:
351
357
  // Let integer be ? ToInteger(index).
352
- // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
358
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
353
359
  var toAbsoluteIndex = function (index, length) {
354
360
  var integer = toInteger(index);
355
361
  return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
@@ -513,40 +519,17 @@
513
519
  }
514
520
  // add a flag to not completely full polyfills
515
521
  if (options.sham || (targetProperty && targetProperty.sham)) {
516
- hide(sourceProperty, 'sham', true);
522
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
517
523
  }
518
524
  // extend global
519
525
  redefine(target, key, sourceProperty, options);
520
526
  }
521
527
  };
522
528
 
523
- var aFunction$1 = function (it) {
524
- if (typeof it != 'function') {
525
- throw TypeError(String(it) + ' is not a function');
526
- } return it;
527
- };
528
-
529
- // optional / simple context binding
530
- var bindContext = function (fn, that, length) {
531
- aFunction$1(fn);
532
- if (that === undefined) return fn;
533
- switch (length) {
534
- case 0: return function () {
535
- return fn.call(that);
536
- };
537
- case 1: return function (a) {
538
- return fn.call(that, a);
539
- };
540
- case 2: return function (a, b) {
541
- return fn.call(that, a, b);
542
- };
543
- case 3: return function (a, b, c) {
544
- return fn.call(that, a, b, c);
545
- };
546
- }
547
- return function (/* ...args */) {
548
- return fn.apply(that, arguments);
549
- };
529
+ // `IsArray` abstract operation
530
+ // https://tc39.github.io/ecma262/#sec-isarray
531
+ var isArray = Array.isArray || function isArray(arg) {
532
+ return classofRaw(arg) == 'Array';
550
533
  };
551
534
 
552
535
  // `ToObject` abstract operation
@@ -555,10 +538,10 @@
555
538
  return Object(requireObjectCoercible(argument));
556
539
  };
557
540
 
558
- // `IsArray` abstract operation
559
- // https://tc39.github.io/ecma262/#sec-isarray
560
- var isArray = Array.isArray || function isArray(arg) {
561
- return classofRaw(arg) == 'Array';
541
+ var createProperty = function (object, key, value) {
542
+ var propertyKey = toPrimitive(key);
543
+ if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
544
+ else object[propertyKey] = value;
562
545
  };
563
546
 
564
547
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
@@ -567,12 +550,21 @@
567
550
  return !String(Symbol());
568
551
  });
569
552
 
553
+ var useSymbolAsUid = nativeSymbol
554
+ // eslint-disable-next-line no-undef
555
+ && !Symbol.sham
556
+ // eslint-disable-next-line no-undef
557
+ && typeof Symbol() == 'symbol';
558
+
559
+ var WellKnownSymbolsStore = shared('wks');
570
560
  var Symbol$1 = global_1.Symbol;
571
- var store$1 = shared('wks');
561
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
572
562
 
573
563
  var wellKnownSymbol = function (name) {
574
- return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
575
- || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
564
+ if (!has(WellKnownSymbolsStore, name)) {
565
+ if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
566
+ else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
567
+ } return WellKnownSymbolsStore[name];
576
568
  };
577
569
 
578
570
  var SPECIES = wellKnownSymbol('species');
@@ -592,6 +584,119 @@
592
584
  } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
593
585
  };
594
586
 
587
+ var userAgent = getBuiltIn('navigator', 'userAgent') || '';
588
+
589
+ var process = global_1.process;
590
+ var versions = process && process.versions;
591
+ var v8 = versions && versions.v8;
592
+ var match, version;
593
+
594
+ if (v8) {
595
+ match = v8.split('.');
596
+ version = match[0] + match[1];
597
+ } else if (userAgent) {
598
+ match = userAgent.match(/Edge\/(\d+)/);
599
+ if (!match || match[1] >= 74) {
600
+ match = userAgent.match(/Chrome\/(\d+)/);
601
+ if (match) version = match[1];
602
+ }
603
+ }
604
+
605
+ var v8Version = version && +version;
606
+
607
+ var SPECIES$1 = wellKnownSymbol('species');
608
+
609
+ var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
610
+ // We can't use this feature detection in V8 since it causes
611
+ // deoptimization and serious performance degradation
612
+ // https://github.com/zloirock/core-js/issues/677
613
+ return v8Version >= 51 || !fails(function () {
614
+ var array = [];
615
+ var constructor = array.constructor = {};
616
+ constructor[SPECIES$1] = function () {
617
+ return { foo: 1 };
618
+ };
619
+ return array[METHOD_NAME](Boolean).foo !== 1;
620
+ });
621
+ };
622
+
623
+ var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
624
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
625
+ var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
626
+
627
+ // We can't use this feature detection in V8 since it causes
628
+ // deoptimization and serious performance degradation
629
+ // https://github.com/zloirock/core-js/issues/679
630
+ var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
631
+ var array = [];
632
+ array[IS_CONCAT_SPREADABLE] = false;
633
+ return array.concat()[0] !== array;
634
+ });
635
+
636
+ var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
637
+
638
+ var isConcatSpreadable = function (O) {
639
+ if (!isObject(O)) return false;
640
+ var spreadable = O[IS_CONCAT_SPREADABLE];
641
+ return spreadable !== undefined ? !!spreadable : isArray(O);
642
+ };
643
+
644
+ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
645
+
646
+ // `Array.prototype.concat` method
647
+ // https://tc39.github.io/ecma262/#sec-array.prototype.concat
648
+ // with adding support of @@isConcatSpreadable and @@species
649
+ _export({ target: 'Array', proto: true, forced: FORCED }, {
650
+ concat: function concat(arg) { // eslint-disable-line no-unused-vars
651
+ var O = toObject(this);
652
+ var A = arraySpeciesCreate(O, 0);
653
+ var n = 0;
654
+ var i, k, length, len, E;
655
+ for (i = -1, length = arguments.length; i < length; i++) {
656
+ E = i === -1 ? O : arguments[i];
657
+ if (isConcatSpreadable(E)) {
658
+ len = toLength(E.length);
659
+ if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
660
+ for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
661
+ } else {
662
+ if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
663
+ createProperty(A, n++, E);
664
+ }
665
+ }
666
+ A.length = n;
667
+ return A;
668
+ }
669
+ });
670
+
671
+ var aFunction$1 = function (it) {
672
+ if (typeof it != 'function') {
673
+ throw TypeError(String(it) + ' is not a function');
674
+ } return it;
675
+ };
676
+
677
+ // optional / simple context binding
678
+ var bindContext = function (fn, that, length) {
679
+ aFunction$1(fn);
680
+ if (that === undefined) return fn;
681
+ switch (length) {
682
+ case 0: return function () {
683
+ return fn.call(that);
684
+ };
685
+ case 1: return function (a) {
686
+ return fn.call(that, a);
687
+ };
688
+ case 2: return function (a, b) {
689
+ return fn.call(that, a, b);
690
+ };
691
+ case 3: return function (a, b, c) {
692
+ return fn.call(that, a, b, c);
693
+ };
694
+ }
695
+ return function (/* ...args */) {
696
+ return fn.apply(that, arguments);
697
+ };
698
+ };
699
+
595
700
  var push = [].push;
596
701
 
597
702
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
@@ -652,26 +757,20 @@
652
757
  findIndex: createMethod$1(6)
653
758
  };
654
759
 
655
- var SPECIES$1 = wellKnownSymbol('species');
760
+ var $filter = arrayIteration.filter;
656
761
 
657
- var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
658
- return !fails(function () {
659
- var array = [];
660
- var constructor = array.constructor = {};
661
- constructor[SPECIES$1] = function () {
662
- return { foo: 1 };
663
- };
664
- return array[METHOD_NAME](Boolean).foo !== 1;
665
- });
666
- };
667
762
 
668
- var $filter = arrayIteration.filter;
669
763
 
764
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
765
+ // Edge 14- issue
766
+ var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
767
+ [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
768
+ });
670
769
 
671
770
  // `Array.prototype.filter` method
672
771
  // https://tc39.github.io/ecma262/#sec-array.prototype.filter
673
772
  // with adding support of @@species
674
- _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
773
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
675
774
  filter: function filter(callbackfn /* , thisArg */) {
676
775
  return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
677
776
  }
@@ -697,56 +796,87 @@
697
796
 
698
797
  var html = getBuiltIn('document', 'documentElement');
699
798
 
799
+ var GT = '>';
800
+ var LT = '<';
801
+ var PROTOTYPE = 'prototype';
802
+ var SCRIPT = 'script';
700
803
  var IE_PROTO = sharedKey('IE_PROTO');
701
804
 
702
- var PROTOTYPE = 'prototype';
703
- var Empty = function () { /* empty */ };
805
+ var EmptyConstructor = function () { /* empty */ };
806
+
807
+ var scriptTag = function (content) {
808
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
809
+ };
810
+
811
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
812
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
813
+ activeXDocument.write(scriptTag(''));
814
+ activeXDocument.close();
815
+ var temp = activeXDocument.parentWindow.Object;
816
+ activeXDocument = null; // avoid memory leak
817
+ return temp;
818
+ };
704
819
 
705
820
  // Create object with fake `null` prototype: use iframe Object with cleared prototype
706
- var createDict = function () {
821
+ var NullProtoObjectViaIFrame = function () {
707
822
  // Thrash, waste and sodomy: IE GC bug
708
823
  var iframe = documentCreateElement('iframe');
709
- var length = enumBugKeys.length;
710
- var lt = '<';
711
- var script = 'script';
712
- var gt = '>';
713
- var js = 'java' + script + ':';
824
+ var JS = 'java' + SCRIPT + ':';
714
825
  var iframeDocument;
715
826
  iframe.style.display = 'none';
716
827
  html.appendChild(iframe);
717
- iframe.src = String(js);
828
+ // https://github.com/zloirock/core-js/issues/475
829
+ iframe.src = String(JS);
718
830
  iframeDocument = iframe.contentWindow.document;
719
831
  iframeDocument.open();
720
- iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
832
+ iframeDocument.write(scriptTag('document.F=Object'));
721
833
  iframeDocument.close();
722
- createDict = iframeDocument.F;
723
- while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
724
- return createDict();
834
+ return iframeDocument.F;
835
+ };
836
+
837
+ // Check for document.domain and active x support
838
+ // No need to use active x approach when document.domain is not set
839
+ // see https://github.com/es-shims/es5-shim/issues/150
840
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
841
+ // avoid IE GC bug
842
+ var activeXDocument;
843
+ var NullProtoObject = function () {
844
+ try {
845
+ /* global ActiveXObject */
846
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
847
+ } catch (error) { /* ignore */ }
848
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
849
+ var length = enumBugKeys.length;
850
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
851
+ return NullProtoObject();
725
852
  };
726
853
 
854
+ hiddenKeys[IE_PROTO] = true;
855
+
727
856
  // `Object.create` method
728
857
  // https://tc39.github.io/ecma262/#sec-object.create
729
858
  var objectCreate = Object.create || function create(O, Properties) {
730
859
  var result;
731
860
  if (O !== null) {
732
- Empty[PROTOTYPE] = anObject(O);
733
- result = new Empty();
734
- Empty[PROTOTYPE] = null;
861
+ EmptyConstructor[PROTOTYPE] = anObject(O);
862
+ result = new EmptyConstructor();
863
+ EmptyConstructor[PROTOTYPE] = null;
735
864
  // add "__proto__" for Object.getPrototypeOf polyfill
736
865
  result[IE_PROTO] = O;
737
- } else result = createDict();
866
+ } else result = NullProtoObject();
738
867
  return Properties === undefined ? result : objectDefineProperties(result, Properties);
739
868
  };
740
869
 
741
- hiddenKeys[IE_PROTO] = true;
742
-
743
870
  var UNSCOPABLES = wellKnownSymbol('unscopables');
744
871
  var ArrayPrototype = Array.prototype;
745
872
 
746
873
  // Array.prototype[@@unscopables]
747
874
  // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
748
875
  if (ArrayPrototype[UNSCOPABLES] == undefined) {
749
- hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
876
+ objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
877
+ configurable: true,
878
+ value: objectCreate(null)
879
+ });
750
880
  }
751
881
 
752
882
  // add a key to Array.prototype[@@unscopables]
@@ -828,8 +958,8 @@
828
958
  }
829
959
  });
830
960
 
831
- var nativeSort = [].sort;
832
- var test = [1, 2, 3];
961
+ var test = [];
962
+ var nativeSort = test.sort;
833
963
 
834
964
  // IE8-
835
965
  var FAILS_ON_UNDEFINED = fails(function () {
@@ -842,11 +972,11 @@
842
972
  // Old WebKit
843
973
  var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
844
974
 
845
- var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
975
+ var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
846
976
 
847
977
  // `Array.prototype.sort` method
848
978
  // https://tc39.github.io/ecma262/#sec-array.prototype.sort
849
- _export({ target: 'Array', proto: true, forced: FORCED }, {
979
+ _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
850
980
  sort: function sort(comparefn) {
851
981
  return comparefn === undefined
852
982
  ? nativeSort.call(toObject(this))
@@ -865,6 +995,13 @@
865
995
  });
866
996
 
867
997
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
998
+ var test$1 = {};
999
+
1000
+ test$1[TO_STRING_TAG] = 'z';
1001
+
1002
+ var toStringTagSupport = String(test$1) === '[object z]';
1003
+
1004
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
868
1005
  // ES3 wrong here
869
1006
  var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
870
1007
 
@@ -876,36 +1013,79 @@
876
1013
  };
877
1014
 
878
1015
  // getting tag from ES6+ `Object.prototype.toString`
879
- var classof = function (it) {
1016
+ var classof = toStringTagSupport ? classofRaw : function (it) {
880
1017
  var O, tag, result;
881
1018
  return it === undefined ? 'Undefined' : it === null ? 'Null'
882
1019
  // @@toStringTag case
883
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
1020
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
884
1021
  // builtinTag case
885
1022
  : CORRECT_ARGUMENTS ? classofRaw(O)
886
1023
  // ES3 arguments fallback
887
1024
  : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
888
1025
  };
889
1026
 
890
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
891
- var test$1 = {};
892
-
893
- test$1[TO_STRING_TAG$1] = 'z';
894
-
895
1027
  // `Object.prototype.toString` method implementation
896
1028
  // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
897
- var objectToString = String(test$1) !== '[object z]' ? function toString() {
1029
+ var objectToString = toStringTagSupport ? {}.toString : function toString() {
898
1030
  return '[object ' + classof(this) + ']';
899
- } : test$1.toString;
900
-
901
- var ObjectPrototype = Object.prototype;
1031
+ };
902
1032
 
903
1033
  // `Object.prototype.toString` method
904
1034
  // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
905
- if (objectToString !== ObjectPrototype.toString) {
906
- redefine(ObjectPrototype, 'toString', objectToString, { unsafe: true });
1035
+ if (!toStringTagSupport) {
1036
+ redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
907
1037
  }
908
1038
 
1039
+ // a string of all valid unicode whitespaces
1040
+ // eslint-disable-next-line max-len
1041
+ var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1042
+
1043
+ var whitespace = '[' + whitespaces + ']';
1044
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
1045
+ var rtrim = RegExp(whitespace + whitespace + '*$');
1046
+
1047
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1048
+ var createMethod$2 = function (TYPE) {
1049
+ return function ($this) {
1050
+ var string = String(requireObjectCoercible($this));
1051
+ if (TYPE & 1) string = string.replace(ltrim, '');
1052
+ if (TYPE & 2) string = string.replace(rtrim, '');
1053
+ return string;
1054
+ };
1055
+ };
1056
+
1057
+ var stringTrim = {
1058
+ // `String.prototype.{ trimLeft, trimStart }` methods
1059
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
1060
+ start: createMethod$2(1),
1061
+ // `String.prototype.{ trimRight, trimEnd }` methods
1062
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
1063
+ end: createMethod$2(2),
1064
+ // `String.prototype.trim` method
1065
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1066
+ trim: createMethod$2(3)
1067
+ };
1068
+
1069
+ var trim = stringTrim.trim;
1070
+
1071
+
1072
+ var nativeParseInt = global_1.parseInt;
1073
+ var hex = /^[+-]?0[Xx]/;
1074
+ var FORCED$2 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
1075
+
1076
+ // `parseInt` method
1077
+ // https://tc39.github.io/ecma262/#sec-parseint-string-radix
1078
+ var _parseInt = FORCED$2 ? function parseInt(string, radix) {
1079
+ var S = trim(String(string));
1080
+ return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
1081
+ } : nativeParseInt;
1082
+
1083
+ // `parseInt` method
1084
+ // https://tc39.github.io/ecma262/#sec-parseint-string-radix
1085
+ _export({ global: true, forced: parseInt != _parseInt }, {
1086
+ parseInt: _parseInt
1087
+ });
1088
+
909
1089
  // `RegExp.prototype.flags` getter implementation
910
1090
  // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
911
1091
  var regexpFlags = function () {
@@ -920,6 +1100,119 @@
920
1100
  return result;
921
1101
  };
922
1102
 
1103
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
1104
+ // so we use an intermediate function.
1105
+ function RE(s, f) {
1106
+ return RegExp(s, f);
1107
+ }
1108
+
1109
+ var UNSUPPORTED_Y = fails(function () {
1110
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1111
+ var re = RE('a', 'y');
1112
+ re.lastIndex = 2;
1113
+ return re.exec('abcd') != null;
1114
+ });
1115
+
1116
+ var BROKEN_CARET = fails(function () {
1117
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1118
+ var re = RE('^r', 'gy');
1119
+ re.lastIndex = 2;
1120
+ return re.exec('str') != null;
1121
+ });
1122
+
1123
+ var regexpStickyHelpers = {
1124
+ UNSUPPORTED_Y: UNSUPPORTED_Y,
1125
+ BROKEN_CARET: BROKEN_CARET
1126
+ };
1127
+
1128
+ var nativeExec = RegExp.prototype.exec;
1129
+ // This always refers to the native implementation, because the
1130
+ // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
1131
+ // which loads this file before patching the method.
1132
+ var nativeReplace = String.prototype.replace;
1133
+
1134
+ var patchedExec = nativeExec;
1135
+
1136
+ var UPDATES_LAST_INDEX_WRONG = (function () {
1137
+ var re1 = /a/;
1138
+ var re2 = /b*/g;
1139
+ nativeExec.call(re1, 'a');
1140
+ nativeExec.call(re2, 'a');
1141
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1142
+ })();
1143
+
1144
+ var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
1145
+
1146
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
1147
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1148
+
1149
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
1150
+
1151
+ if (PATCH) {
1152
+ patchedExec = function exec(str) {
1153
+ var re = this;
1154
+ var lastIndex, reCopy, match, i;
1155
+ var sticky = UNSUPPORTED_Y$1 && re.sticky;
1156
+ var flags = regexpFlags.call(re);
1157
+ var source = re.source;
1158
+ var charsAdded = 0;
1159
+ var strCopy = str;
1160
+
1161
+ if (sticky) {
1162
+ flags = flags.replace('y', '');
1163
+ if (flags.indexOf('g') === -1) {
1164
+ flags += 'g';
1165
+ }
1166
+
1167
+ strCopy = String(str).slice(re.lastIndex);
1168
+ // Support anchored sticky behavior.
1169
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
1170
+ source = '(?: ' + source + ')';
1171
+ strCopy = ' ' + strCopy;
1172
+ charsAdded++;
1173
+ }
1174
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
1175
+ // simulate the 'y' flag.
1176
+ reCopy = new RegExp('^(?:' + source + ')', flags);
1177
+ }
1178
+
1179
+ if (NPCG_INCLUDED) {
1180
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1181
+ }
1182
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1183
+
1184
+ match = nativeExec.call(sticky ? reCopy : re, strCopy);
1185
+
1186
+ if (sticky) {
1187
+ if (match) {
1188
+ match.input = match.input.slice(charsAdded);
1189
+ match[0] = match[0].slice(charsAdded);
1190
+ match.index = re.lastIndex;
1191
+ re.lastIndex += match[0].length;
1192
+ } else re.lastIndex = 0;
1193
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
1194
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1195
+ }
1196
+ if (NPCG_INCLUDED && match && match.length > 1) {
1197
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
1198
+ // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1199
+ nativeReplace.call(match[0], reCopy, function () {
1200
+ for (i = 1; i < arguments.length - 2; i++) {
1201
+ if (arguments[i] === undefined) match[i] = undefined;
1202
+ }
1203
+ });
1204
+ }
1205
+
1206
+ return match;
1207
+ };
1208
+ }
1209
+
1210
+ var regexpExec = patchedExec;
1211
+
1212
+ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
1213
+ exec: regexpExec
1214
+ });
1215
+
923
1216
  var TO_STRING = 'toString';
924
1217
  var RegExpPrototype = RegExp.prototype;
925
1218
  var nativeToString = RegExpPrototype[TO_STRING];
@@ -978,58 +1271,6 @@
978
1271
  }
979
1272
  });
980
1273
 
981
- var nativeExec = RegExp.prototype.exec;
982
- // This always refers to the native implementation, because the
983
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
984
- // which loads this file before patching the method.
985
- var nativeReplace = String.prototype.replace;
986
-
987
- var patchedExec = nativeExec;
988
-
989
- var UPDATES_LAST_INDEX_WRONG = (function () {
990
- var re1 = /a/;
991
- var re2 = /b*/g;
992
- nativeExec.call(re1, 'a');
993
- nativeExec.call(re2, 'a');
994
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
995
- })();
996
-
997
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
998
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
999
-
1000
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
1001
-
1002
- if (PATCH) {
1003
- patchedExec = function exec(str) {
1004
- var re = this;
1005
- var lastIndex, reCopy, match, i;
1006
-
1007
- if (NPCG_INCLUDED) {
1008
- reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
1009
- }
1010
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1011
-
1012
- match = nativeExec.call(re, str);
1013
-
1014
- if (UPDATES_LAST_INDEX_WRONG && match) {
1015
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1016
- }
1017
- if (NPCG_INCLUDED && match && match.length > 1) {
1018
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1019
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1020
- nativeReplace.call(match[0], reCopy, function () {
1021
- for (i = 1; i < arguments.length - 2; i++) {
1022
- if (arguments[i] === undefined) match[i] = undefined;
1023
- }
1024
- });
1025
- }
1026
-
1027
- return match;
1028
- };
1029
- }
1030
-
1031
- var regexpExec = patchedExec;
1032
-
1033
1274
  var SPECIES$2 = wellKnownSymbol('species');
1034
1275
 
1035
1276
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
@@ -1045,6 +1286,12 @@
1045
1286
  return ''.replace(re, '$<a>') !== '7';
1046
1287
  });
1047
1288
 
1289
+ // IE <= 11 replaces $0 with the whole match, as if it was $&
1290
+ // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
1291
+ var REPLACE_KEEPS_$0 = (function () {
1292
+ return 'a'.replace(/./, '$0') === '$0';
1293
+ })();
1294
+
1048
1295
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
1049
1296
  // Weex JS has frozen built-in prototypes, so use try / catch wrapper
1050
1297
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
@@ -1069,15 +1316,22 @@
1069
1316
  // Symbol-named RegExp methods call .exec
1070
1317
  var execCalled = false;
1071
1318
  var re = /a/;
1072
- re.exec = function () { execCalled = true; return null; };
1073
1319
 
1074
1320
  if (KEY === 'split') {
1321
+ // We can't use real regex here since it causes deoptimization
1322
+ // and serious performance degradation in V8
1323
+ // https://github.com/zloirock/core-js/issues/306
1324
+ re = {};
1075
1325
  // RegExp[@@split] doesn't call the regex's exec method, but first creates
1076
1326
  // a new one. We need to return the patched regex when creating the new one.
1077
1327
  re.constructor = {};
1078
1328
  re.constructor[SPECIES$2] = function () { return re; };
1329
+ re.flags = '';
1330
+ re[SYMBOL] = /./[SYMBOL];
1079
1331
  }
1080
1332
 
1333
+ re.exec = function () { execCalled = true; return null; };
1334
+
1081
1335
  re[SYMBOL]('');
1082
1336
  return !execCalled;
1083
1337
  });
@@ -1085,7 +1339,7 @@
1085
1339
  if (
1086
1340
  !DELEGATES_TO_SYMBOL ||
1087
1341
  !DELEGATES_TO_EXEC ||
1088
- (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
1342
+ (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
1089
1343
  (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
1090
1344
  ) {
1091
1345
  var nativeRegExpMethod = /./[SYMBOL];
@@ -1100,7 +1354,7 @@
1100
1354
  return { done: true, value: nativeMethod.call(str, regexp, arg2) };
1101
1355
  }
1102
1356
  return { done: false };
1103
- });
1357
+ }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
1104
1358
  var stringMethod = methods[0];
1105
1359
  var regexMethod = methods[1];
1106
1360
 
@@ -1113,12 +1367,13 @@
1113
1367
  // 21.2.5.9 RegExp.prototype[@@search](string)
1114
1368
  : function (string) { return regexMethod.call(string, this); }
1115
1369
  );
1116
- if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
1117
1370
  }
1371
+
1372
+ if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
1118
1373
  };
1119
1374
 
1120
1375
  // `String.prototype.{ codePointAt, at }` methods implementation
1121
- var createMethod$2 = function (CONVERT_TO_STRING) {
1376
+ var createMethod$3 = function (CONVERT_TO_STRING) {
1122
1377
  return function ($this, pos) {
1123
1378
  var S = String(requireObjectCoercible($this));
1124
1379
  var position = toInteger(pos);
@@ -1136,10 +1391,10 @@
1136
1391
  var stringMultibyte = {
1137
1392
  // `String.prototype.codePointAt` method
1138
1393
  // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
1139
- codeAt: createMethod$2(false),
1394
+ codeAt: createMethod$3(false),
1140
1395
  // `String.prototype.at` method
1141
1396
  // https://github.com/mathiasbynens/String.prototype.at
1142
- charAt: createMethod$2(true)
1397
+ charAt: createMethod$3(true)
1143
1398
  };
1144
1399
 
1145
1400
  var charAt = stringMultibyte.charAt;
@@ -1217,7 +1472,7 @@
1217
1472
  };
1218
1473
 
1219
1474
  // @@replace logic
1220
- fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
1475
+ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
1221
1476
  return [
1222
1477
  // `String.prototype.replace` method
1223
1478
  // https://tc39.github.io/ecma262/#sec-string.prototype.replace
@@ -1231,8 +1486,10 @@
1231
1486
  // `RegExp.prototype[@@replace]` method
1232
1487
  // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
1233
1488
  function (regexp, replaceValue) {
1234
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
1235
- if (res.done) return res.value;
1489
+ if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
1490
+ var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
1491
+ if (res.done) return res.value;
1492
+ }
1236
1493
 
1237
1494
  var rx = anObject(regexp);
1238
1495
  var S = String(this);
@@ -1456,36 +1713,6 @@
1456
1713
  ];
1457
1714
  }, !SUPPORTS_Y);
1458
1715
 
1459
- // a string of all valid unicode whitespaces
1460
- // eslint-disable-next-line max-len
1461
- var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1462
-
1463
- var whitespace = '[' + whitespaces + ']';
1464
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1465
- var rtrim = RegExp(whitespace + whitespace + '*$');
1466
-
1467
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1468
- var createMethod$3 = function (TYPE) {
1469
- return function ($this) {
1470
- var string = String(requireObjectCoercible($this));
1471
- if (TYPE & 1) string = string.replace(ltrim, '');
1472
- if (TYPE & 2) string = string.replace(rtrim, '');
1473
- return string;
1474
- };
1475
- };
1476
-
1477
- var stringTrim = {
1478
- // `String.prototype.{ trimLeft, trimStart }` methods
1479
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
1480
- start: createMethod$3(1),
1481
- // `String.prototype.{ trimRight, trimEnd }` methods
1482
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
1483
- end: createMethod$3(2),
1484
- // `String.prototype.trim` method
1485
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1486
- trim: createMethod$3(3)
1487
- };
1488
-
1489
1716
  var non = '\u200B\u0085\u180E';
1490
1717
 
1491
1718
  // check that a method works with the correct list
@@ -1557,7 +1784,7 @@
1557
1784
  var CollectionPrototype = Collection && Collection.prototype;
1558
1785
  // some Chrome versions have non-configurable methods on DOMTokenList
1559
1786
  if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1560
- hide(CollectionPrototype, 'forEach', arrayForEach);
1787
+ createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
1561
1788
  } catch (error) {
1562
1789
  CollectionPrototype.forEach = arrayForEach;
1563
1790
  }
@@ -1687,6 +1914,18 @@
1687
1914
  getOptionsFromSelectControl: function getOptionsFromSelectControl(selectControl) {
1688
1915
  return selectControl.get(selectControl.length - 1).options;
1689
1916
  },
1917
+ getControlContainer: function getControlContainer() {
1918
+ if (UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer) {
1919
+ return $("".concat(UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer));
1920
+ }
1921
+
1922
+ return UtilsFilterControl.getCurrentHeader(UtilsFilterControl.bootstrapTableInstance);
1923
+ },
1924
+ getSearchControls: function getSearchControls(scope) {
1925
+ var header = UtilsFilterControl.getControlContainer();
1926
+ var searchControls = UtilsFilterControl.getCurrentSearchControls(scope);
1927
+ return header.find(searchControls);
1928
+ },
1690
1929
  hideUnusedSelectOptions: function hideUnusedSelectOptions(selectControl, uniqueValues) {
1691
1930
  var options = UtilsFilterControl.getOptionsFromSelectControl(selectControl);
1692
1931
 
@@ -1705,7 +1944,7 @@
1705
1944
  var $selectControl = $(selectControl.get(selectControl.length - 1));
1706
1945
 
1707
1946
  if (!UtilsFilterControl.existOptionInSelectControl(selectControl, value)) {
1708
- var option = $($('<option></option>').attr('value', value).text($('<div />').html(text).text()));
1947
+ var option = $("<option value=\"".concat(value, "\">").concat(text, "</option>"));
1709
1948
 
1710
1949
  if (value === selected) {
1711
1950
  option.attr('selected', true);
@@ -1789,10 +2028,9 @@
1789
2028
  $(el).val(el.value);
1790
2029
  },
1791
2030
  copyValues: function copyValues(that) {
1792
- var header = UtilsFilterControl.getCurrentHeader(that);
1793
- var searchControls = UtilsFilterControl.getCurrentSearchControls(that);
2031
+ var searchControls = UtilsFilterControl.getSearchControls(that);
1794
2032
  that.options.valuesFilterControl = [];
1795
- header.find(searchControls).each(function () {
2033
+ searchControls.each(function () {
1796
2034
  that.options.valuesFilterControl.push({
1797
2035
  field: $(this).closest('[data-field]').data('field'),
1798
2036
  value: $(this).val(),
@@ -1804,13 +2042,12 @@
1804
2042
  setValues: function setValues(that) {
1805
2043
  var field = null;
1806
2044
  var result = [];
1807
- var header = UtilsFilterControl.getCurrentHeader(that);
1808
- var searchControls = UtilsFilterControl.getCurrentSearchControls(that);
2045
+ var searchControls = UtilsFilterControl.getSearchControls(that);
1809
2046
 
1810
2047
  if (that.options.valuesFilterControl.length > 0) {
1811
2048
  // Callback to apply after settings fields values
1812
2049
  var fieldToFocusCallback = null;
1813
- header.find(searchControls).each(function (index, ele) {
2050
+ searchControls.each(function (index, ele) {
1814
2051
  field = $(this).closest('[data-field]').data('field');
1815
2052
  result = that.options.valuesFilterControl.filter(function (valueObj) {
1816
2053
  return valueObj.field === field;
@@ -1819,7 +2056,7 @@
1819
2056
  if (result.length > 0) {
1820
2057
  $(this).val(result[0].value);
1821
2058
 
1822
- if (result[0].hasFocus) {
2059
+ if (result[0].hasFocus && result[0].value !== '') {
1823
2060
  // set callback if the field had the focus.
1824
2061
  fieldToFocusCallback = function (fieldToFocus, carretPosition) {
1825
2062
  // Closure here to capture the field and cursor position
@@ -1842,6 +2079,7 @@
1842
2079
  collectBootstrapCookies: function collectBootstrapCookies() {
1843
2080
  var cookies = [];
1844
2081
  var foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
2082
+ var foundLocalStorage = localStorage;
1845
2083
 
1846
2084
  if (foundCookies) {
1847
2085
  $.each(foundCookies, function (i, _cookie) {
@@ -1855,11 +2093,27 @@
1855
2093
  cookies.push(cookie);
1856
2094
  }
1857
2095
  });
1858
- return cookies;
1859
2096
  }
2097
+
2098
+ if (foundLocalStorage) {
2099
+ for (var i = 0; i < foundLocalStorage.length; i++) {
2100
+ var cookie = foundLocalStorage.key(i);
2101
+
2102
+ if (/./.test(cookie)) {
2103
+ cookie = cookie.split('.').pop();
2104
+ }
2105
+
2106
+ if (!cookies.includes(cookie)) {
2107
+ cookies.push(cookie);
2108
+ }
2109
+ }
2110
+ }
2111
+
2112
+ return cookies;
1860
2113
  },
1861
2114
  escapeID: function escapeID(id) {
1862
- return String(id).replace(/(:|\.|\[|\]|,)/g, '\\$1');
2115
+ // eslint-disable-next-line no-useless-escape
2116
+ return String(id).replace(/([:.\[\],])/g, '\\$1');
1863
2117
  },
1864
2118
  isColumnSearchableViaSelect: function isColumnSearchableViaSelect(_ref4) {
1865
2119
  var filterControl = _ref4.filterControl,
@@ -1875,11 +2129,10 @@
1875
2129
  },
1876
2130
  initFilterSelectControls: function initFilterSelectControls(that) {
1877
2131
  var data = that.data;
1878
- var itemsPerPage = that.pageTo < that.options.data.length ? that.options.data.length : that.pageTo;
1879
2132
  var z = that.options.pagination ? that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows : that.pageTo;
1880
2133
  $.each(that.header.fields, function (j, field) {
1881
2134
  var column = that.columns[that.fieldsColumnsIndex[field]];
1882
- var selectControl = that.$tableBody.find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
2135
+ var selectControl = UtilsFilterControl.getControlContainer().find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
1883
2136
 
1884
2137
  if (UtilsFilterControl.isColumnSearchableViaSelect(column) && UtilsFilterControl.isFilterDataNotGiven(column) && UtilsFilterControl.hasSelectControlElement(selectControl)) {
1885
2138
  if (selectControl.get(selectControl.length - 1).options.length === 0) {
@@ -1892,12 +2145,15 @@
1892
2145
  for (var i = 0; i < z; i++) {
1893
2146
  // Added a new value
1894
2147
  var fieldValue = data[i][field];
1895
- var formattedValue = Utils.calculateObjectValue(that.header, that.header.formatters[j], [fieldValue, data[i], i], fieldValue);
2148
+ var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
2149
+ var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
1896
2150
 
1897
2151
  if (column.filterDataCollector) {
1898
2152
  formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
1899
2153
  }
1900
2154
 
2155
+ uniqueValues[formattedValue] = fieldValue;
2156
+
1901
2157
  if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
1902
2158
  formattedValue.forEach(function (value) {
1903
2159
  UtilsFilterControl.addOptionToSelectControl(selectControl, value, value, column.filterDefault);
@@ -1930,35 +2186,39 @@
1930
2186
  },
1931
2187
  createControls: function createControls(that, header) {
1932
2188
  var addedFilterControl = false;
1933
- var isVisible;
1934
2189
  var html;
1935
2190
  $.each(that.columns, function (i, column) {
1936
- isVisible = 'hidden';
1937
2191
  html = [];
1938
2192
 
1939
2193
  if (!column.visible) {
1940
2194
  return;
1941
2195
  }
1942
2196
 
1943
- if (!column.filterControl) {
2197
+ if (!column.filterControl && !that.options.filterControlContainer) {
1944
2198
  html.push('<div class="no-filter-control"></div>');
2199
+ } else if (that.options.filterControlContainer) {
2200
+ var $filterControl = $(".bootstrap-table-filter-control-".concat(column.field));
2201
+ var placeholder = column.filterControlPlaceholder ? column.filterControlPlaceholder : '';
2202
+ $filterControl.attr('placeholder', placeholder);
2203
+ $filterControl.val(column.filterDefault);
2204
+ $filterControl.attr('data-field', column.field);
2205
+ addedFilterControl = true;
1945
2206
  } else {
1946
- html.push('<div class="filter-control">');
1947
2207
  var nameControl = column.filterControl.toLowerCase();
2208
+ html.push('<div class="filter-control">');
2209
+ addedFilterControl = true;
1948
2210
 
1949
2211
  if (column.searchable && that.options.filterTemplate[nameControl]) {
1950
- addedFilterControl = true;
1951
- isVisible = 'visible';
1952
- html.push(that.options.filterTemplate[nameControl](that, column.field, isVisible, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
1953
-
1954
- if ('' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
1955
- if ($.isEmptyObject(that.filterColumnsPartial)) {
1956
- that.filterColumnsPartial = {};
1957
- }
2212
+ html.push(that.options.filterTemplate[nameControl](that, column.field, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
2213
+ }
2214
+ }
1958
2215
 
1959
- that.filterColumnsPartial[column.field] = column.filterDefault;
1960
- }
2216
+ if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
2217
+ if ($.isEmptyObject(that.filterColumnsPartial)) {
2218
+ that.filterColumnsPartial = {};
1961
2219
  }
2220
+
2221
+ that.filterColumnsPartial[column.field] = column.filterDefault;
1962
2222
  }
1963
2223
 
1964
2224
  $.each(header.children().children(), function (i, tr) {
@@ -1979,95 +2239,78 @@
1979
2239
 
1980
2240
  if (filterDataType !== null) {
1981
2241
  filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
1982
- selectControl = that.$tableBody.find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
2242
+ selectControl = UtilsFilterControl.getControlContainer().find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
1983
2243
  UtilsFilterControl.addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
1984
- filterDataType(filterDataSource, selectControl, column.filterDefault);
2244
+ filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
1985
2245
  } else {
1986
- throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, json, url.' + ' Use like this: var: {key: "value"}');
1987
- }
1988
-
1989
- var variableValues;
1990
- var key; // eslint-disable-next-line default-case
1991
-
1992
- switch (filterDataType) {
1993
- case 'url':
1994
- $.ajax({
1995
- url: filterDataSource,
1996
- dataType: 'json',
1997
- success: function success(data) {
1998
- // eslint-disable-next-line guard-for-in
1999
- for (var _key in data) {
2000
- UtilsFilterControl.addOptionToSelectControl(selectControl, _key, data[_key], column.filterDefault);
2001
- }
2002
-
2003
- UtilsFilterControl.sortSelectControl(selectControl, column.filterOrderBy);
2004
- }
2005
- });
2006
- break;
2007
-
2008
- case 'var':
2009
- variableValues = window[filterDataSource]; // eslint-disable-next-line guard-for-in
2010
-
2011
- for (key in variableValues) {
2012
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], column.filterDefault);
2013
- }
2014
-
2015
- UtilsFilterControl.sortSelectControl(selectControl, column.filterOrderBy);
2016
- break;
2017
-
2018
- case 'jso':
2019
- variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
2020
-
2021
- for (key in variableValues) {
2022
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], column.filterDefault);
2023
- }
2024
-
2025
- UtilsFilterControl.sortSelectControl(selectControl, column.filterOrderBy);
2026
- break;
2246
+ throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
2027
2247
  }
2028
2248
  }
2029
2249
  });
2030
2250
 
2031
2251
  if (addedFilterControl) {
2032
- header.off('keyup', 'input').on('keyup', 'input', function (event, obj) {
2252
+ UtilsFilterControl.getControlContainer().off('keyup', 'input').on('keyup', 'input', function (_ref6, obj) {
2253
+ var currentTarget = _ref6.currentTarget,
2254
+ keyCode = _ref6.keyCode;
2033
2255
  // Simulate enter key action from clear button
2034
- event.keyCode = obj ? obj.keyCode : event.keyCode;
2256
+ keyCode = obj ? obj.keyCode : keyCode;
2035
2257
 
2036
- if (that.options.searchOnEnterKey && event.keyCode !== 13) {
2258
+ if (that.options.searchOnEnterKey && keyCode !== 13) {
2037
2259
  return;
2038
2260
  }
2039
2261
 
2040
- if ($.inArray(event.keyCode, [37, 38, 39, 40]) > -1) {
2262
+ if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2041
2263
  return;
2042
2264
  }
2043
2265
 
2044
- var $currentTarget = $(event.currentTarget);
2266
+ var $currentTarget = $(currentTarget);
2045
2267
 
2046
2268
  if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
2047
2269
  return;
2048
2270
  }
2049
2271
 
2050
- clearTimeout(event.currentTarget.timeoutId || 0);
2051
- event.currentTarget.timeoutId = setTimeout(function () {
2052
- that.onColumnSearch(event);
2272
+ clearTimeout(currentTarget.timeoutId || 0);
2273
+ currentTarget.timeoutId = setTimeout(function () {
2274
+ that.onColumnSearch({
2275
+ currentTarget: currentTarget,
2276
+ keyCode: keyCode
2277
+ });
2053
2278
  }, that.options.searchTimeOut);
2054
2279
  });
2055
- header.off('change', 'select').on('change', 'select', function (event) {
2056
- if (that.options.searchOnEnterKey && event.keyCode !== 13) {
2280
+ UtilsFilterControl.getControlContainer().off('change', 'select').on('change', 'select', function (_ref7) {
2281
+ var currentTarget = _ref7.currentTarget,
2282
+ keyCode = _ref7.keyCode;
2283
+
2284
+ if (that.options.searchOnEnterKey && keyCode !== 13) {
2057
2285
  return;
2058
2286
  }
2059
2287
 
2060
- if ($.inArray(event.keyCode, [37, 38, 39, 40]) > -1) {
2288
+ if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2061
2289
  return;
2062
2290
  }
2063
2291
 
2064
- clearTimeout(event.currentTarget.timeoutId || 0);
2065
- event.currentTarget.timeoutId = setTimeout(function () {
2066
- that.onColumnSearch(event);
2292
+ var $select = $(currentTarget);
2293
+ var value = $select.val();
2294
+
2295
+ if ($.trim(value)) {
2296
+ $select.find('option[selected]').removeAttr('selected');
2297
+ $select.find('option[value="' + value + '"]').attr('selected', true);
2298
+ } else {
2299
+ $select.find('option[selected]').removeAttr('selected');
2300
+ }
2301
+
2302
+ clearTimeout(currentTarget.timeoutId || 0);
2303
+ currentTarget.timeoutId = setTimeout(function () {
2304
+ that.onColumnSearch({
2305
+ currentTarget: currentTarget,
2306
+ keyCode: keyCode
2307
+ });
2067
2308
  }, that.options.searchTimeOut);
2068
2309
  });
2069
- header.off('mouseup', 'input').on('mouseup', 'input', function (event) {
2070
- var $input = $(this);
2310
+ header.off('mouseup', 'input').on('mouseup', 'input', function (_ref8) {
2311
+ var currentTarget = _ref8.currentTarget,
2312
+ keyCode = _ref8.keyCode;
2313
+ var $input = $(currentTarget);
2071
2314
  var oldValue = $input.val();
2072
2315
 
2073
2316
  if (oldValue === '') {
@@ -2078,25 +2321,33 @@
2078
2321
  var newValue = $input.val();
2079
2322
 
2080
2323
  if (newValue === '') {
2081
- clearTimeout(event.currentTarget.timeoutId || 0);
2082
- event.currentTarget.timeoutId = setTimeout(function () {
2083
- that.onColumnSearch(event);
2324
+ clearTimeout(currentTarget.timeoutId || 0);
2325
+ currentTarget.timeoutId = setTimeout(function () {
2326
+ that.onColumnSearch({
2327
+ currentTarget: currentTarget,
2328
+ keyCode: keyCode
2329
+ });
2084
2330
  }, that.options.searchTimeOut);
2085
2331
  }
2086
2332
  }, 1);
2087
2333
  });
2088
2334
 
2089
- if (header.find('.date-filter-control').length > 0) {
2090
- $.each(that.columns, function (i, _ref6) {
2091
- var filterControl = _ref6.filterControl,
2092
- field = _ref6.field,
2093
- filterDatepickerOptions = _ref6.filterDatepickerOptions;
2335
+ if (UtilsFilterControl.getControlContainer().find('.date-filter-control').length > 0) {
2336
+ $.each(that.columns, function (i, _ref9) {
2337
+ var filterControl = _ref9.filterControl,
2338
+ field = _ref9.field,
2339
+ filterDatepickerOptions = _ref9.filterDatepickerOptions;
2094
2340
 
2095
2341
  if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
2096
- header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field)).datepicker(filterDatepickerOptions).on('changeDate', function (event) {
2097
- clearTimeout(event.currentTarget.timeoutId || 0);
2098
- event.currentTarget.timeoutId = setTimeout(function () {
2099
- that.onColumnSearch(event);
2342
+ UtilsFilterControl.getControlContainer().find(".date-filter-control.bootstrap-table-filter-control-".concat(field)).datepicker(filterDatepickerOptions).on('changeDate', function (_ref10) {
2343
+ var currentTarget = _ref10.currentTarget,
2344
+ keyCode = _ref10.keyCode;
2345
+ clearTimeout(currentTarget.timeoutId || 0);
2346
+ currentTarget.timeoutId = setTimeout(function () {
2347
+ that.onColumnSearch({
2348
+ currentTarget: currentTarget,
2349
+ keyCode: keyCode
2350
+ });
2100
2351
  }, that.options.searchTimeOut);
2101
2352
  });
2102
2353
  }
@@ -2104,12 +2355,10 @@
2104
2355
  }
2105
2356
 
2106
2357
  if (that.options.sidePagination !== 'server') {
2107
- header.find('[class*=\'bootstrap-table-filter-control\']').each(function (k, input) {
2108
- $(input).trigger('change');
2109
- });
2358
+ that.triggerSearch();
2110
2359
  }
2111
2360
  } else {
2112
- header.find('.filterControl').hide();
2361
+ UtilsFilterControl.getControlContainer().find('.filterControl').hide();
2113
2362
  }
2114
2363
  },
2115
2364
  getDirectionOfSelectOptions: function getDirectionOfSelectOptions(_alignment) {
@@ -2131,8 +2380,34 @@
2131
2380
  }
2132
2381
  };
2133
2382
  var filterDataMethods = {
2383
+ func: function func(filterDataSource, selectControl, filterOrderBy, selected) {
2384
+ var variableValues = window[filterDataSource].apply();
2385
+
2386
+ for (var key in variableValues) {
2387
+ UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2388
+ }
2389
+
2390
+ UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2391
+ },
2392
+ obj: function obj(filterDataSource, selectControl, filterOrderBy, selected) {
2393
+ var objectKeys = filterDataSource.split('.');
2394
+ var variableName = objectKeys.shift();
2395
+ var variableValues = window[variableName];
2396
+
2397
+ if (objectKeys.length > 0) {
2398
+ objectKeys.forEach(function (key) {
2399
+ variableValues = variableValues[key];
2400
+ });
2401
+ }
2402
+
2403
+ for (var key in variableValues) {
2404
+ UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2405
+ }
2406
+
2407
+ UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2408
+ },
2134
2409
  var: function _var(filterDataSource, selectControl, filterOrderBy, selected) {
2135
- var variableValues = window[filterDataSource]; // eslint-disable-next-line guard-for-in
2410
+ var variableValues = window[filterDataSource];
2136
2411
 
2137
2412
  for (var key in variableValues) {
2138
2413
  UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
@@ -2145,7 +2420,6 @@
2145
2420
  url: filterDataSource,
2146
2421
  dataType: 'json',
2147
2422
  success: function success(data) {
2148
- // eslint-disable-next-line guard-for-in
2149
2423
  for (var key in data) {
2150
2424
  UtilsFilterControl.addOptionToSelectControl(selectControl, key, data[key], selected);
2151
2425
  }
@@ -2155,7 +2429,7 @@
2155
2429
  });
2156
2430
  },
2157
2431
  json: function json(filterDataSource, selectControl, filterOrderBy, selected) {
2158
- var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
2432
+ var variableValues = JSON.parse(filterDataSource);
2159
2433
 
2160
2434
  for (var key in variableValues) {
2161
2435
  UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
@@ -2174,15 +2448,15 @@
2174
2448
  },
2175
2449
  alignmentSelectControlOptions: undefined,
2176
2450
  filterTemplate: {
2177
- input: function input(that, field, isVisible, placeholder, value) {
2178
- return Utils.sprintf('<input type="text" class="form-control bootstrap-table-filter-control-%s" style="width: 100%; visibility: %s" placeholder="%s" value="%s">', field, isVisible, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
2451
+ input: function input(that, field, placeholder, value) {
2452
+ return Utils.sprintf('<input type="text" class="form-control bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
2179
2453
  },
2180
- select: function select(_ref7, field, isVisible) {
2181
- var options = _ref7.options;
2182
- return Utils.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%; visibility: %s" dir="%s"></select>', field, isVisible, UtilsFilterControl.getDirectionOfSelectOptions(options.alignmentSelectControlOptions));
2454
+ select: function select(_ref11, field) {
2455
+ var options = _ref11.options;
2456
+ return Utils.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%;" dir="%s"></select>', field, UtilsFilterControl.getDirectionOfSelectOptions(options.alignmentSelectControlOptions));
2183
2457
  },
2184
- datepicker: function datepicker(that, field, isVisible, value) {
2185
- return Utils.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%; visibility: %s" value="%s">', field, isVisible, 'undefined' === typeof value ? '' : value);
2458
+ datepicker: function datepicker(that, field, value) {
2459
+ return Utils.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', field, 'undefined' === typeof value ? '' : value);
2186
2460
  }
2187
2461
  },
2188
2462
  disableControlWhenSearch: false,
@@ -2236,7 +2510,8 @@
2236
2510
  value: function init() {
2237
2511
  var _this = this;
2238
2512
 
2239
- // Make sure that the filterControl option is set
2513
+ UtilsFilterControl.bootstrapTableInstance = this; // Make sure that the filterControl option is set
2514
+
2240
2515
  if (this.options.filterControl) {
2241
2516
  var that = this; // Make sure that the internal variables are set correctly
2242
2517
 
@@ -2248,15 +2523,15 @@
2248
2523
  } // Avoid recreate the controls
2249
2524
 
2250
2525
 
2251
- if (that.$tableHeader.find('select').length > 0 || that.$tableHeader.find('input').length > 0) {
2526
+ if (UtilsFilterControl.getControlContainer().find('select').length > 0 || UtilsFilterControl.getControlContainer().find('input').length > 0) {
2252
2527
  return;
2253
2528
  }
2254
2529
 
2255
- UtilsFilterControl.createControls(that, that.$tableHeader);
2530
+ UtilsFilterControl.createControls(that, UtilsFilterControl.getControlContainer());
2256
2531
  }).on('post-header.bs.table', function () {
2257
2532
  UtilsFilterControl.setValues(that);
2258
2533
  }).on('post-body.bs.table', function () {
2259
- if (that.options.height) {
2534
+ if (that.options.height && !that.options.filterControlContainer) {
2260
2535
  UtilsFilterControl.fixHeaderCSS(that);
2261
2536
  }
2262
2537
 
@@ -2264,9 +2539,9 @@
2264
2539
  }).on('column-switch.bs.table', function () {
2265
2540
  UtilsFilterControl.setValues(that);
2266
2541
  }).on('load-success.bs.table', function () {
2267
- that.EnableControls(true);
2542
+ that.enableControls(true);
2268
2543
  }).on('load-error.bs.table', function () {
2269
- that.EnableControls(true);
2544
+ that.enableControls(true);
2270
2545
  });
2271
2546
  }
2272
2547
 
@@ -2281,7 +2556,7 @@
2281
2556
  return;
2282
2557
  }
2283
2558
 
2284
- UtilsFilterControl.createControls(this, this.$header);
2559
+ UtilsFilterControl.createControls(this, UtilsFilterControl.getControlContainer());
2285
2560
  }
2286
2561
  }, {
2287
2562
  key: "initBody",
@@ -2311,34 +2586,85 @@
2311
2586
 
2312
2587
  that.data = fp ? that.options.data.filter(function (item, i) {
2313
2588
  var itemIsExpected = [];
2314
- Object.keys(item).forEach(function (x, index) {
2315
- var key = that.header.fields[index];
2589
+ var keys1 = Object.keys(item);
2590
+ var keys2 = Object.keys(fp);
2591
+ var keys = keys1.concat(keys2.filter(function (item) {
2592
+ return !keys1.includes(item);
2593
+ }));
2594
+ keys.forEach(function (key) {
2316
2595
  var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
2317
2596
  var fval = (fp[key] || '').toLowerCase();
2318
2597
  var value = Utils.getItemField(item, key, false);
2598
+ var tmpItemIsExpected;
2319
2599
 
2320
2600
  if (fval === '') {
2321
- itemIsExpected.push(true);
2601
+ tmpItemIsExpected = true;
2322
2602
  } else {
2323
- // Fix #142: search use formated data
2603
+ // Fix #142: search use formatted data
2324
2604
  if (thisColumn && thisColumn.searchFormatter) {
2325
2605
  value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header, that.header.formatters[$.inArray(key, that.header.fields)], [value, item, i], value);
2326
2606
  }
2327
2607
 
2328
2608
  if ($.inArray(key, that.header.fields) !== -1) {
2329
2609
  if (value === undefined || value === null) {
2330
- itemIsExpected.push(false);
2610
+ tmpItemIsExpected = false;
2331
2611
  } else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
2332
2612
  if (thisColumn.filterStrictSearch) {
2333
- itemIsExpected.push(value.toString().toLowerCase() === fval.toString().toLowerCase());
2613
+ tmpItemIsExpected = value.toString().toLowerCase() === fval.toString().toLowerCase();
2334
2614
  } else if (thisColumn.filterStartsWithSearch) {
2335
- itemIsExpected.push("".concat(value).toLowerCase().indexOf(fval) === 0);
2615
+ tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(fval) === 0;
2336
2616
  } else {
2337
- itemIsExpected.push("".concat(value).toLowerCase().includes(fval));
2617
+ tmpItemIsExpected = "".concat(value).toLowerCase().includes(fval);
2618
+ }
2619
+
2620
+ var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
2621
+ var matches = largerSmallerEqualsRegex.exec(fval);
2622
+
2623
+ if (matches) {
2624
+ var operator = matches[1] || "".concat(matches[5], "l");
2625
+ var comparisonValue = matches[2] || matches[3];
2626
+ var int = parseInt(value, 10);
2627
+ var comparisonInt = parseInt(comparisonValue, 10);
2628
+
2629
+ switch (operator) {
2630
+ case '>':
2631
+ case '<l':
2632
+ tmpItemIsExpected = int > comparisonInt;
2633
+ break;
2634
+
2635
+ case '<':
2636
+ case '>l':
2637
+ tmpItemIsExpected = int < comparisonInt;
2638
+ break;
2639
+
2640
+ case '<=':
2641
+ case '=<':
2642
+ case '>=l':
2643
+ case '=>l':
2644
+ tmpItemIsExpected = int <= comparisonInt;
2645
+ break;
2646
+
2647
+ case '>=':
2648
+ case '=>':
2649
+ case '<=l':
2650
+ case '=<l':
2651
+ tmpItemIsExpected = int >= comparisonInt;
2652
+ break;
2653
+ }
2654
+ }
2655
+
2656
+ if (thisColumn.filterCustomSearch) {
2657
+ var customSearchResult = Utils.calculateObjectValue(that, thisColumn.filterCustomSearch, [fval, value, key, that.options.data], true);
2658
+
2659
+ if (customSearchResult !== null) {
2660
+ tmpItemIsExpected = customSearchResult;
2661
+ }
2338
2662
  }
2339
2663
  }
2340
2664
  }
2341
2665
  }
2666
+
2667
+ itemIsExpected.push(tmpItemIsExpected);
2342
2668
  });
2343
2669
  return !itemIsExpected.includes(false);
2344
2670
  }) : that.data;
@@ -2350,7 +2676,7 @@
2350
2676
 
2351
2677
  if (filterColumnsDefaults) {
2352
2678
  this.filterColumnsPartial = filterColumnsDefaults;
2353
- this.updatePagination(); // eslint-disable-next-line guard-for-in
2679
+ this.updatePagination();
2354
2680
 
2355
2681
  for (var filter in filterColumnsDefaults) {
2356
2682
  this.trigger('column-search', filter, filterColumnsDefaults[filter]);
@@ -2359,14 +2685,17 @@
2359
2685
  }
2360
2686
  }, {
2361
2687
  key: "onColumnSearch",
2362
- value: function onColumnSearch(event) {
2363
- if ($.inArray(event.keyCode, [37, 38, 39, 40]) > -1) {
2688
+ value: function onColumnSearch(_ref12) {
2689
+ var currentTarget = _ref12.currentTarget,
2690
+ keyCode = _ref12.keyCode;
2691
+
2692
+ if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2364
2693
  return;
2365
2694
  }
2366
2695
 
2367
2696
  UtilsFilterControl.copyValues(this);
2368
- var text = $.trim($(event.currentTarget).val());
2369
- var $field = $(event.currentTarget).closest('[data-field]').data('field');
2697
+ var text = $.trim($(currentTarget).val());
2698
+ var $field = $(currentTarget).closest('[data-field]').data('field');
2370
2699
 
2371
2700
  if ($.isEmptyObject(this.filterColumnsPartial)) {
2372
2701
  this.filterColumnsPartial = {};
@@ -2379,8 +2708,10 @@
2379
2708
  }
2380
2709
 
2381
2710
  this.options.pageNumber = 1;
2382
- this.EnableControls(false);
2383
- this.onSearch(event, false);
2711
+ this.enableControls(false);
2712
+ this.onSearch({
2713
+ currentTarget: currentTarget
2714
+ }, false);
2384
2715
  this.trigger('column-search', $field, text);
2385
2716
  }
2386
2717
  }, {
@@ -2392,12 +2723,12 @@
2392
2723
  }
2393
2724
  }, {
2394
2725
  key: "resetSearch",
2395
- value: function resetSearch() {
2726
+ value: function resetSearch(text) {
2396
2727
  if (this.options.filterControl && this.options.showSearchClearButton) {
2397
2728
  this.clearFilterControl();
2398
2729
  }
2399
2730
 
2400
- _get(_getPrototypeOf(_class.prototype), "resetSearch", this).call(this);
2731
+ _get(_getPrototypeOf(_class.prototype), "resetSearch", this).call(this, text);
2401
2732
  }
2402
2733
  }, {
2403
2734
  key: "clearFilterControl",
@@ -2468,9 +2799,8 @@
2468
2799
  }, {
2469
2800
  key: "triggerSearch",
2470
2801
  value: function triggerSearch() {
2471
- var header = UtilsFilterControl.getCurrentHeader(this);
2472
- var searchControls = UtilsFilterControl.getCurrentSearchControls(this);
2473
- header.find(searchControls).each(function () {
2802
+ var searchControls = UtilsFilterControl.getSearchControls(this);
2803
+ searchControls.each(function () {
2474
2804
  var el = $(this);
2475
2805
 
2476
2806
  if (el.is('select')) {
@@ -2481,16 +2811,15 @@
2481
2811
  });
2482
2812
  }
2483
2813
  }, {
2484
- key: "EnableControls",
2485
- value: function EnableControls(enable) {
2814
+ key: "enableControls",
2815
+ value: function enableControls(enable) {
2486
2816
  if (this.options.disableControlWhenSearch && this.options.sidePagination === 'server') {
2487
- var header = UtilsFilterControl.getCurrentHeader(this);
2488
- var searchControls = UtilsFilterControl.getCurrentSearchControls(this);
2817
+ var searchControls = UtilsFilterControl.getSearchControls(this);
2489
2818
 
2490
2819
  if (!enable) {
2491
- header.find(searchControls).prop('disabled', 'disabled');
2820
+ searchControls.prop('disabled', 'disabled');
2492
2821
  } else {
2493
- header.find(searchControls).removeProp('disabled');
2822
+ searchControls.removeProp('disabled');
2494
2823
  }
2495
2824
  }
2496
2825
  }
@@ -2499,4 +2828,4 @@
2499
2828
  return _class;
2500
2829
  }($.BootstrapTable);
2501
2830
 
2502
- }));
2831
+ })));