bootstrap-table-rails 1.15.4 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +147 -54
  3. data/lib/bootstrap-table-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +876 -83
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +684 -208
  6. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +686 -210
  7. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +66 -11
  8. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +1347 -727
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +254 -88
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +139 -66
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1309 -258
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +139 -64
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/{accent-neutralise/bootstrap-table-accent-neutralise.js → custom-view/bootstrap-table-custom-view.js} +582 -752
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +83 -42
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +1219 -208
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +409 -210
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.css +1 -1
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +1369 -904
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/utils.js +2361 -0
  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 +589 -423
  22. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +494 -107
  23. data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +3 -3
  24. data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +217 -73
  25. data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +143 -66
  26. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +374 -138
  27. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +137 -65
  28. data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +87 -42
  29. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +388 -148
  30. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +643 -255
  31. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +348 -136
  32. data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +84 -44
  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 +209 -76
  35. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +490 -202
  36. data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +221 -115
  37. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +92 -42
  38. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +92 -42
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +771 -0
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +92 -42
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +92 -42
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +92 -42
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +92 -42
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +92 -42
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +92 -42
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +114 -63
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +92 -42
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +92 -42
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +92 -42
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +92 -42
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +92 -42
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +92 -42
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +92 -42
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +92 -42
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +92 -42
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +92 -42
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +92 -42
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +92 -42
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +93 -43
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +92 -42
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +92 -42
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +92 -42
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +92 -42
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +92 -42
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +107 -57
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +92 -42
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +92 -42
  68. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +92 -42
  69. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +92 -42
  70. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +92 -42
  71. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +93 -43
  72. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +92 -42
  73. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +92 -42
  74. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +96 -45
  75. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +92 -42
  76. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +92 -42
  77. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +92 -42
  78. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +92 -42
  79. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +771 -0
  80. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +771 -0
  81. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +92 -42
  82. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +92 -42
  83. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +92 -42
  84. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +92 -42
  85. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +92 -42
  86. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +92 -42
  87. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +92 -42
  88. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +92 -42
  89. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +92 -42
  90. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +768 -0
  91. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.js +1049 -0
  92. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.eot +0 -0
  93. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.svg +28 -0
  94. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.ttf +0 -0
  95. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.woff +0 -0
  96. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +80 -12
  97. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +161 -63
  98. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +79 -14
  99. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +166 -65
  100. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +74 -10
  101. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +165 -67
  102. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +80 -14
  103. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +165 -67
  104. metadata +13 -16
  105. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.css +0 -3
  106. data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.css +0 -12
  107. data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.js +0 -2087
  108. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.css +0 -53
  109. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.js +0 -257
  110. data/vendor/assets/javascripts/bootstrap-table/extensions/multi-column-toggle/bootstrap-table-multi-toggle.js +0 -105
  111. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js +0 -85
  112. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.css +0 -17
  113. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.js +0 -143
  114. data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +0 -1265
  115. data/vendor/assets/javascripts/bootstrap-table/extensions/select2-filter/bootstrap-table-select2-filter.js +0 -341
  116. data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.css +0 -1
  117. data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.js +0 -142
@@ -2,9 +2,9 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
3
3
  typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4
4
  (global = global || self, global.BootstrapTable = factory(global.jQuery));
5
- }(this, function ($) { 'use strict';
5
+ }(this, (function ($) { 'use strict';
6
6
 
7
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
7
+ $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
8
8
 
9
9
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
10
 
@@ -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,7 +519,7 @@
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);
@@ -526,6 +532,12 @@
526
532
  return !String(Symbol());
527
533
  });
528
534
 
535
+ var useSymbolAsUid = nativeSymbol
536
+ // eslint-disable-next-line no-undef
537
+ && !Symbol.sham
538
+ // eslint-disable-next-line no-undef
539
+ && typeof Symbol() == 'symbol';
540
+
529
541
  // `IsArray` abstract operation
530
542
  // https://tc39.github.io/ecma262/#sec-isarray
531
543
  var isArray = Array.isArray || function isArray(arg) {
@@ -558,49 +570,77 @@
558
570
 
559
571
  var html = getBuiltIn('document', 'documentElement');
560
572
 
573
+ var GT = '>';
574
+ var LT = '<';
575
+ var PROTOTYPE = 'prototype';
576
+ var SCRIPT = 'script';
561
577
  var IE_PROTO = sharedKey('IE_PROTO');
562
578
 
563
- var PROTOTYPE = 'prototype';
564
- var Empty = function () { /* empty */ };
579
+ var EmptyConstructor = function () { /* empty */ };
580
+
581
+ var scriptTag = function (content) {
582
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
583
+ };
584
+
585
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
586
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
587
+ activeXDocument.write(scriptTag(''));
588
+ activeXDocument.close();
589
+ var temp = activeXDocument.parentWindow.Object;
590
+ activeXDocument = null; // avoid memory leak
591
+ return temp;
592
+ };
565
593
 
566
594
  // Create object with fake `null` prototype: use iframe Object with cleared prototype
567
- var createDict = function () {
595
+ var NullProtoObjectViaIFrame = function () {
568
596
  // Thrash, waste and sodomy: IE GC bug
569
597
  var iframe = documentCreateElement('iframe');
570
- var length = enumBugKeys.length;
571
- var lt = '<';
572
- var script = 'script';
573
- var gt = '>';
574
- var js = 'java' + script + ':';
598
+ var JS = 'java' + SCRIPT + ':';
575
599
  var iframeDocument;
576
600
  iframe.style.display = 'none';
577
601
  html.appendChild(iframe);
578
- iframe.src = String(js);
602
+ // https://github.com/zloirock/core-js/issues/475
603
+ iframe.src = String(JS);
579
604
  iframeDocument = iframe.contentWindow.document;
580
605
  iframeDocument.open();
581
- iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
606
+ iframeDocument.write(scriptTag('document.F=Object'));
582
607
  iframeDocument.close();
583
- createDict = iframeDocument.F;
584
- while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
585
- return createDict();
608
+ return iframeDocument.F;
609
+ };
610
+
611
+ // Check for document.domain and active x support
612
+ // No need to use active x approach when document.domain is not set
613
+ // see https://github.com/es-shims/es5-shim/issues/150
614
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
615
+ // avoid IE GC bug
616
+ var activeXDocument;
617
+ var NullProtoObject = function () {
618
+ try {
619
+ /* global ActiveXObject */
620
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
621
+ } catch (error) { /* ignore */ }
622
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
623
+ var length = enumBugKeys.length;
624
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
625
+ return NullProtoObject();
586
626
  };
587
627
 
628
+ hiddenKeys[IE_PROTO] = true;
629
+
588
630
  // `Object.create` method
589
631
  // https://tc39.github.io/ecma262/#sec-object.create
590
632
  var objectCreate = Object.create || function create(O, Properties) {
591
633
  var result;
592
634
  if (O !== null) {
593
- Empty[PROTOTYPE] = anObject(O);
594
- result = new Empty();
595
- Empty[PROTOTYPE] = null;
635
+ EmptyConstructor[PROTOTYPE] = anObject(O);
636
+ result = new EmptyConstructor();
637
+ EmptyConstructor[PROTOTYPE] = null;
596
638
  // add "__proto__" for Object.getPrototypeOf polyfill
597
639
  result[IE_PROTO] = O;
598
- } else result = createDict();
640
+ } else result = NullProtoObject();
599
641
  return Properties === undefined ? result : objectDefineProperties(result, Properties);
600
642
  };
601
643
 
602
- hiddenKeys[IE_PROTO] = true;
603
-
604
644
  var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
605
645
 
606
646
  var toString$1 = {}.toString;
@@ -627,12 +667,15 @@
627
667
  f: f$5
628
668
  };
629
669
 
670
+ var WellKnownSymbolsStore = shared('wks');
630
671
  var Symbol$1 = global_1.Symbol;
631
- var store$1 = shared('wks');
672
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
632
673
 
633
674
  var wellKnownSymbol = function (name) {
634
- return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
635
- || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
675
+ if (!has(WellKnownSymbolsStore, name)) {
676
+ if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
677
+ else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
678
+ } return WellKnownSymbolsStore[name];
636
679
  };
637
680
 
638
681
  var f$6 = wellKnownSymbol;
@@ -778,8 +821,7 @@
778
821
  var getInternalState = internalState.getterFor(SYMBOL);
779
822
  var ObjectPrototype = Object[PROTOTYPE$1];
780
823
  var $Symbol = global_1.Symbol;
781
- var JSON$1 = global_1.JSON;
782
- var nativeJSONStringify = JSON$1 && JSON$1.stringify;
824
+ var $stringify = getBuiltIn('JSON', 'stringify');
783
825
  var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
784
826
  var nativeDefineProperty$1 = objectDefineProperty.f;
785
827
  var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
@@ -788,7 +830,7 @@
788
830
  var ObjectPrototypeSymbols = shared('op-symbols');
789
831
  var StringToSymbolRegistry = shared('string-to-symbol-registry');
790
832
  var SymbolToStringRegistry = shared('symbol-to-string-registry');
791
- var WellKnownSymbolsStore = shared('wks');
833
+ var WellKnownSymbolsStore$1 = shared('wks');
792
834
  var QObject = global_1.QObject;
793
835
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
794
836
  var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
@@ -931,7 +973,9 @@
931
973
  redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
932
974
  }
933
975
  }
976
+ }
934
977
 
978
+ if (!useSymbolAsUid) {
935
979
  wrappedWellKnownSymbol.f = function (name) {
936
980
  return wrap(wellKnownSymbol(name), name);
937
981
  };
@@ -941,7 +985,7 @@
941
985
  Symbol: $Symbol
942
986
  });
943
987
 
944
- $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
988
+ $forEach(objectKeys(WellKnownSymbolsStore$1), function (name) {
945
989
  defineWellKnownSymbol(name);
946
990
  });
947
991
 
@@ -1000,34 +1044,41 @@
1000
1044
 
1001
1045
  // `JSON.stringify` method behavior with symbols
1002
1046
  // https://tc39.github.io/ecma262/#sec-json.stringify
1003
- JSON$1 && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () {
1004
- var symbol = $Symbol();
1005
- // MS Edge converts symbol values to JSON as {}
1006
- return nativeJSONStringify([symbol]) != '[null]'
1007
- // WebKit converts symbol values to JSON as null
1008
- || nativeJSONStringify({ a: symbol }) != '{}'
1009
- // V8 throws on boxed symbols
1010
- || nativeJSONStringify(Object(symbol)) != '{}';
1011
- }) }, {
1012
- stringify: function stringify(it) {
1013
- var args = [it];
1014
- var index = 1;
1015
- var replacer, $replacer;
1016
- while (arguments.length > index) args.push(arguments[index++]);
1017
- $replacer = replacer = args[1];
1018
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1019
- if (!isArray(replacer)) replacer = function (key, value) {
1020
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1021
- if (!isSymbol(value)) return value;
1022
- };
1023
- args[1] = replacer;
1024
- return nativeJSONStringify.apply(JSON$1, args);
1025
- }
1026
- });
1047
+ if ($stringify) {
1048
+ var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
1049
+ var symbol = $Symbol();
1050
+ // MS Edge converts symbol values to JSON as {}
1051
+ return $stringify([symbol]) != '[null]'
1052
+ // WebKit converts symbol values to JSON as null
1053
+ || $stringify({ a: symbol }) != '{}'
1054
+ // V8 throws on boxed symbols
1055
+ || $stringify(Object(symbol)) != '{}';
1056
+ });
1057
+
1058
+ _export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
1059
+ // eslint-disable-next-line no-unused-vars
1060
+ stringify: function stringify(it, replacer, space) {
1061
+ var args = [it];
1062
+ var index = 1;
1063
+ var $replacer;
1064
+ while (arguments.length > index) args.push(arguments[index++]);
1065
+ $replacer = replacer;
1066
+ if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1067
+ if (!isArray(replacer)) replacer = function (key, value) {
1068
+ if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1069
+ if (!isSymbol(value)) return value;
1070
+ };
1071
+ args[1] = replacer;
1072
+ return $stringify.apply(null, args);
1073
+ }
1074
+ });
1075
+ }
1027
1076
 
1028
1077
  // `Symbol.prototype[@@toPrimitive]` method
1029
1078
  // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
1030
- if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
1079
+ if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
1080
+ createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
1081
+ }
1031
1082
  // `Symbol.prototype[@@toStringTag]` property
1032
1083
  // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
1033
1084
  setToStringTag($Symbol, SYMBOL);
@@ -1087,10 +1138,33 @@
1087
1138
  else object[propertyKey] = value;
1088
1139
  };
1089
1140
 
1141
+ var userAgent = getBuiltIn('navigator', 'userAgent') || '';
1142
+
1143
+ var process = global_1.process;
1144
+ var versions = process && process.versions;
1145
+ var v8 = versions && versions.v8;
1146
+ var match, version;
1147
+
1148
+ if (v8) {
1149
+ match = v8.split('.');
1150
+ version = match[0] + match[1];
1151
+ } else if (userAgent) {
1152
+ match = userAgent.match(/Edge\/(\d+)/);
1153
+ if (!match || match[1] >= 74) {
1154
+ match = userAgent.match(/Chrome\/(\d+)/);
1155
+ if (match) version = match[1];
1156
+ }
1157
+ }
1158
+
1159
+ var v8Version = version && +version;
1160
+
1090
1161
  var SPECIES$1 = wellKnownSymbol('species');
1091
1162
 
1092
1163
  var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1093
- return !fails(function () {
1164
+ // We can't use this feature detection in V8 since it causes
1165
+ // deoptimization and serious performance degradation
1166
+ // https://github.com/zloirock/core-js/issues/677
1167
+ return v8Version >= 51 || !fails(function () {
1094
1168
  var array = [];
1095
1169
  var constructor = array.constructor = {};
1096
1170
  constructor[SPECIES$1] = function () {
@@ -1104,7 +1178,10 @@
1104
1178
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
1105
1179
  var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
1106
1180
 
1107
- var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
1181
+ // We can't use this feature detection in V8 since it causes
1182
+ // deoptimization and serious performance degradation
1183
+ // https://github.com/zloirock/core-js/issues/679
1184
+ var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
1108
1185
  var array = [];
1109
1186
  array[IS_CONCAT_SPREADABLE] = false;
1110
1187
  return array.concat()[0] !== array;
@@ -1148,10 +1225,17 @@
1148
1225
  var $filter = arrayIteration.filter;
1149
1226
 
1150
1227
 
1228
+
1229
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
1230
+ // Edge 14- issue
1231
+ var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
1232
+ [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
1233
+ });
1234
+
1151
1235
  // `Array.prototype.filter` method
1152
1236
  // https://tc39.github.io/ecma262/#sec-array.prototype.filter
1153
1237
  // with adding support of @@species
1154
- _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
1238
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
1155
1239
  filter: function filter(callbackfn /* , thisArg */) {
1156
1240
  return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1157
1241
  }
@@ -1163,7 +1247,10 @@
1163
1247
  // Array.prototype[@@unscopables]
1164
1248
  // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1165
1249
  if (ArrayPrototype[UNSCOPABLES] == undefined) {
1166
- hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
1250
+ objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
1251
+ configurable: true,
1252
+ value: objectCreate(null)
1253
+ });
1167
1254
  }
1168
1255
 
1169
1256
  // add a key to Array.prototype[@@unscopables]
@@ -1293,7 +1380,9 @@
1293
1380
  if (IteratorPrototype == undefined) IteratorPrototype = {};
1294
1381
 
1295
1382
  // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
1296
- if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
1383
+ if ( !has(IteratorPrototype, ITERATOR)) {
1384
+ createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
1385
+ }
1297
1386
 
1298
1387
  var iteratorsCore = {
1299
1388
  IteratorPrototype: IteratorPrototype,
@@ -1377,7 +1466,7 @@
1377
1466
  if (objectSetPrototypeOf) {
1378
1467
  objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
1379
1468
  } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
1380
- hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1469
+ createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1381
1470
  }
1382
1471
  }
1383
1472
  // Set @@toStringTag to native iterators
@@ -1393,7 +1482,7 @@
1393
1482
 
1394
1483
  // define iterator
1395
1484
  if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1396
- hide(IterablePrototype, ITERATOR$1, defaultIterator);
1485
+ createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
1397
1486
  }
1398
1487
 
1399
1488
  // export additional methods
@@ -1468,6 +1557,40 @@
1468
1557
  }
1469
1558
  });
1470
1559
 
1560
+ var $map = arrayIteration.map;
1561
+
1562
+
1563
+
1564
+ var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
1565
+ // FF49- issue
1566
+ var USES_TO_LENGTH$1 = HAS_SPECIES_SUPPORT$1 && !fails(function () {
1567
+ [].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
1568
+ });
1569
+
1570
+ // `Array.prototype.map` method
1571
+ // https://tc39.github.io/ecma262/#sec-array.prototype.map
1572
+ // with adding support of @@species
1573
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$1 }, {
1574
+ map: function map(callbackfn /* , thisArg */) {
1575
+ return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1576
+ }
1577
+ });
1578
+
1579
+ var nativeReverse = [].reverse;
1580
+ var test = [1, 2];
1581
+
1582
+ // `Array.prototype.reverse` method
1583
+ // https://tc39.github.io/ecma262/#sec-array.prototype.reverse
1584
+ // fix for Safari 12.0 bug
1585
+ // https://bugs.webkit.org/show_bug.cgi?id=188794
1586
+ _export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
1587
+ reverse: function reverse() {
1588
+ // eslint-disable-next-line no-self-assign
1589
+ if (isArray(this)) this.length = this.length;
1590
+ return nativeReverse.call(this);
1591
+ }
1592
+ });
1593
+
1471
1594
  var SPECIES$2 = wellKnownSymbol('species');
1472
1595
  var nativeSlice = [].slice;
1473
1596
  var max$1 = Math.max;
@@ -1503,16 +1626,16 @@
1503
1626
  }
1504
1627
  });
1505
1628
 
1506
- var nativeSort = [].sort;
1507
- var test = [1, 2, 3];
1629
+ var test$1 = [];
1630
+ var nativeSort = test$1.sort;
1508
1631
 
1509
1632
  // IE8-
1510
1633
  var FAILS_ON_UNDEFINED = fails(function () {
1511
- test.sort(undefined);
1634
+ test$1.sort(undefined);
1512
1635
  });
1513
1636
  // V8 bug
1514
1637
  var FAILS_ON_NULL = fails(function () {
1515
- test.sort(null);
1638
+ test$1.sort(null);
1516
1639
  });
1517
1640
  // Old WebKit
1518
1641
  var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
@@ -1700,11 +1823,22 @@
1700
1823
  }
1701
1824
 
1702
1825
  var nativeAssign = Object.assign;
1826
+ var defineProperty$4 = Object.defineProperty;
1703
1827
 
1704
1828
  // `Object.assign` method
1705
1829
  // https://tc39.github.io/ecma262/#sec-object.assign
1706
- // should work with symbols and should have deterministic property order (V8 bug)
1707
1830
  var objectAssign = !nativeAssign || fails(function () {
1831
+ // should have correct order of operations (Edge bug)
1832
+ if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$4({}, 'a', {
1833
+ enumerable: true,
1834
+ get: function () {
1835
+ defineProperty$4(this, 'b', {
1836
+ value: 3,
1837
+ enumerable: false
1838
+ });
1839
+ }
1840
+ }), { b: 2 })).b !== 1) return true;
1841
+ // should work with symbols and should have deterministic property order (V8 bug)
1708
1842
  var A = {};
1709
1843
  var B = {};
1710
1844
  // eslint-disable-next-line no-undef
@@ -1779,6 +1913,13 @@
1779
1913
  });
1780
1914
 
1781
1915
  var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1916
+ var test$2 = {};
1917
+
1918
+ test$2[TO_STRING_TAG$1] = 'z';
1919
+
1920
+ var toStringTagSupport = String(test$2) === '[object z]';
1921
+
1922
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1782
1923
  // ES3 wrong here
1783
1924
  var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1784
1925
 
@@ -1790,34 +1931,27 @@
1790
1931
  };
1791
1932
 
1792
1933
  // getting tag from ES6+ `Object.prototype.toString`
1793
- var classof = function (it) {
1934
+ var classof = toStringTagSupport ? classofRaw : function (it) {
1794
1935
  var O, tag, result;
1795
1936
  return it === undefined ? 'Undefined' : it === null ? 'Null'
1796
1937
  // @@toStringTag case
1797
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1938
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
1798
1939
  // builtinTag case
1799
1940
  : CORRECT_ARGUMENTS ? classofRaw(O)
1800
1941
  // ES3 arguments fallback
1801
1942
  : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1802
1943
  };
1803
1944
 
1804
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1805
- var test$1 = {};
1806
-
1807
- test$1[TO_STRING_TAG$2] = 'z';
1808
-
1809
1945
  // `Object.prototype.toString` method implementation
1810
1946
  // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1811
- var objectToString = String(test$1) !== '[object z]' ? function toString() {
1947
+ var objectToString = toStringTagSupport ? {}.toString : function toString() {
1812
1948
  return '[object ' + classof(this) + ']';
1813
- } : test$1.toString;
1814
-
1815
- var ObjectPrototype$2 = Object.prototype;
1949
+ };
1816
1950
 
1817
1951
  // `Object.prototype.toString` method
1818
1952
  // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1819
- if (objectToString !== ObjectPrototype$2.toString) {
1820
- redefine(ObjectPrototype$2, 'toString', objectToString, { unsafe: true });
1953
+ if (!toStringTagSupport) {
1954
+ redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1821
1955
  }
1822
1956
 
1823
1957
  var trim$1 = stringTrim.trim;
@@ -1874,6 +2008,119 @@
1874
2008
  return result;
1875
2009
  };
1876
2010
 
2011
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
2012
+ // so we use an intermediate function.
2013
+ function RE(s, f) {
2014
+ return RegExp(s, f);
2015
+ }
2016
+
2017
+ var UNSUPPORTED_Y = fails(function () {
2018
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2019
+ var re = RE('a', 'y');
2020
+ re.lastIndex = 2;
2021
+ return re.exec('abcd') != null;
2022
+ });
2023
+
2024
+ var BROKEN_CARET = fails(function () {
2025
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2026
+ var re = RE('^r', 'gy');
2027
+ re.lastIndex = 2;
2028
+ return re.exec('str') != null;
2029
+ });
2030
+
2031
+ var regexpStickyHelpers = {
2032
+ UNSUPPORTED_Y: UNSUPPORTED_Y,
2033
+ BROKEN_CARET: BROKEN_CARET
2034
+ };
2035
+
2036
+ var nativeExec = RegExp.prototype.exec;
2037
+ // This always refers to the native implementation, because the
2038
+ // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
2039
+ // which loads this file before patching the method.
2040
+ var nativeReplace = String.prototype.replace;
2041
+
2042
+ var patchedExec = nativeExec;
2043
+
2044
+ var UPDATES_LAST_INDEX_WRONG = (function () {
2045
+ var re1 = /a/;
2046
+ var re2 = /b*/g;
2047
+ nativeExec.call(re1, 'a');
2048
+ nativeExec.call(re2, 'a');
2049
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2050
+ })();
2051
+
2052
+ var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2053
+
2054
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
2055
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2056
+
2057
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
2058
+
2059
+ if (PATCH) {
2060
+ patchedExec = function exec(str) {
2061
+ var re = this;
2062
+ var lastIndex, reCopy, match, i;
2063
+ var sticky = UNSUPPORTED_Y$1 && re.sticky;
2064
+ var flags = regexpFlags.call(re);
2065
+ var source = re.source;
2066
+ var charsAdded = 0;
2067
+ var strCopy = str;
2068
+
2069
+ if (sticky) {
2070
+ flags = flags.replace('y', '');
2071
+ if (flags.indexOf('g') === -1) {
2072
+ flags += 'g';
2073
+ }
2074
+
2075
+ strCopy = String(str).slice(re.lastIndex);
2076
+ // Support anchored sticky behavior.
2077
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
2078
+ source = '(?: ' + source + ')';
2079
+ strCopy = ' ' + strCopy;
2080
+ charsAdded++;
2081
+ }
2082
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
2083
+ // simulate the 'y' flag.
2084
+ reCopy = new RegExp('^(?:' + source + ')', flags);
2085
+ }
2086
+
2087
+ if (NPCG_INCLUDED) {
2088
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2089
+ }
2090
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2091
+
2092
+ match = nativeExec.call(sticky ? reCopy : re, strCopy);
2093
+
2094
+ if (sticky) {
2095
+ if (match) {
2096
+ match.input = match.input.slice(charsAdded);
2097
+ match[0] = match[0].slice(charsAdded);
2098
+ match.index = re.lastIndex;
2099
+ re.lastIndex += match[0].length;
2100
+ } else re.lastIndex = 0;
2101
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
2102
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2103
+ }
2104
+ if (NPCG_INCLUDED && match && match.length > 1) {
2105
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
2106
+ // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2107
+ nativeReplace.call(match[0], reCopy, function () {
2108
+ for (i = 1; i < arguments.length - 2; i++) {
2109
+ if (arguments[i] === undefined) match[i] = undefined;
2110
+ }
2111
+ });
2112
+ }
2113
+
2114
+ return match;
2115
+ };
2116
+ }
2117
+
2118
+ var regexpExec = patchedExec;
2119
+
2120
+ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2121
+ exec: regexpExec
2122
+ });
2123
+
1877
2124
  var TO_STRING = 'toString';
1878
2125
  var RegExpPrototype = RegExp.prototype;
1879
2126
  var nativeToString = RegExpPrototype[TO_STRING];
@@ -1986,58 +2233,6 @@
1986
2233
  return { value: point, done: false };
1987
2234
  });
1988
2235
 
1989
- var nativeExec = RegExp.prototype.exec;
1990
- // This always refers to the native implementation, because the
1991
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
1992
- // which loads this file before patching the method.
1993
- var nativeReplace = String.prototype.replace;
1994
-
1995
- var patchedExec = nativeExec;
1996
-
1997
- var UPDATES_LAST_INDEX_WRONG = (function () {
1998
- var re1 = /a/;
1999
- var re2 = /b*/g;
2000
- nativeExec.call(re1, 'a');
2001
- nativeExec.call(re2, 'a');
2002
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2003
- })();
2004
-
2005
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
2006
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2007
-
2008
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
2009
-
2010
- if (PATCH) {
2011
- patchedExec = function exec(str) {
2012
- var re = this;
2013
- var lastIndex, reCopy, match, i;
2014
-
2015
- if (NPCG_INCLUDED) {
2016
- reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
2017
- }
2018
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2019
-
2020
- match = nativeExec.call(re, str);
2021
-
2022
- if (UPDATES_LAST_INDEX_WRONG && match) {
2023
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2024
- }
2025
- if (NPCG_INCLUDED && match && match.length > 1) {
2026
- // Fix browsers whose `exec` methods don't consistently return `undefined`
2027
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2028
- nativeReplace.call(match[0], reCopy, function () {
2029
- for (i = 1; i < arguments.length - 2; i++) {
2030
- if (arguments[i] === undefined) match[i] = undefined;
2031
- }
2032
- });
2033
- }
2034
-
2035
- return match;
2036
- };
2037
- }
2038
-
2039
- var regexpExec = patchedExec;
2040
-
2041
2236
  var SPECIES$3 = wellKnownSymbol('species');
2042
2237
 
2043
2238
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
@@ -2053,6 +2248,12 @@
2053
2248
  return ''.replace(re, '$<a>') !== '7';
2054
2249
  });
2055
2250
 
2251
+ // IE <= 11 replaces $0 with the whole match, as if it was $&
2252
+ // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2253
+ var REPLACE_KEEPS_$0 = (function () {
2254
+ return 'a'.replace(/./, '$0') === '$0';
2255
+ })();
2256
+
2056
2257
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2057
2258
  // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2058
2259
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
@@ -2077,15 +2278,22 @@
2077
2278
  // Symbol-named RegExp methods call .exec
2078
2279
  var execCalled = false;
2079
2280
  var re = /a/;
2080
- re.exec = function () { execCalled = true; return null; };
2081
2281
 
2082
2282
  if (KEY === 'split') {
2283
+ // We can't use real regex here since it causes deoptimization
2284
+ // and serious performance degradation in V8
2285
+ // https://github.com/zloirock/core-js/issues/306
2286
+ re = {};
2083
2287
  // RegExp[@@split] doesn't call the regex's exec method, but first creates
2084
2288
  // a new one. We need to return the patched regex when creating the new one.
2085
2289
  re.constructor = {};
2086
2290
  re.constructor[SPECIES$3] = function () { return re; };
2291
+ re.flags = '';
2292
+ re[SYMBOL] = /./[SYMBOL];
2087
2293
  }
2088
2294
 
2295
+ re.exec = function () { execCalled = true; return null; };
2296
+
2089
2297
  re[SYMBOL]('');
2090
2298
  return !execCalled;
2091
2299
  });
@@ -2093,7 +2301,7 @@
2093
2301
  if (
2094
2302
  !DELEGATES_TO_SYMBOL ||
2095
2303
  !DELEGATES_TO_EXEC ||
2096
- (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
2304
+ (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
2097
2305
  (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
2098
2306
  ) {
2099
2307
  var nativeRegExpMethod = /./[SYMBOL];
@@ -2108,7 +2316,7 @@
2108
2316
  return { done: true, value: nativeMethod.call(str, regexp, arg2) };
2109
2317
  }
2110
2318
  return { done: false };
2111
- });
2319
+ }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
2112
2320
  var stringMethod = methods[0];
2113
2321
  var regexMethod = methods[1];
2114
2322
 
@@ -2121,8 +2329,9 @@
2121
2329
  // 21.2.5.9 RegExp.prototype[@@search](string)
2122
2330
  : function (string) { return regexMethod.call(string, this); }
2123
2331
  );
2124
- if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
2125
2332
  }
2333
+
2334
+ if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
2126
2335
  };
2127
2336
 
2128
2337
  var charAt$1 = stringMultibyte.charAt;
@@ -2163,7 +2372,7 @@
2163
2372
  };
2164
2373
 
2165
2374
  // @@replace logic
2166
- fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
2375
+ fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
2167
2376
  return [
2168
2377
  // `String.prototype.replace` method
2169
2378
  // https://tc39.github.io/ecma262/#sec-string.prototype.replace
@@ -2177,8 +2386,10 @@
2177
2386
  // `RegExp.prototype[@@replace]` method
2178
2387
  // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
2179
2388
  function (regexp, replaceValue) {
2180
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2181
- if (res.done) return res.value;
2389
+ if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
2390
+ var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2391
+ if (res.done) return res.value;
2392
+ }
2182
2393
 
2183
2394
  var rx = anObject(regexp);
2184
2395
  var S = String(this);
@@ -2508,7 +2719,7 @@
2508
2719
  var CollectionPrototype = Collection && Collection.prototype;
2509
2720
  // some Chrome versions have non-configurable methods on DOMTokenList
2510
2721
  if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2511
- hide(CollectionPrototype, 'forEach', arrayForEach);
2722
+ createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
2512
2723
  } catch (error) {
2513
2724
  CollectionPrototype.forEach = arrayForEach;
2514
2725
  }
@@ -2524,15 +2735,17 @@
2524
2735
  if (CollectionPrototype$1) {
2525
2736
  // some Chrome versions have non-configurable methods on DOMTokenList
2526
2737
  if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues) try {
2527
- hide(CollectionPrototype$1, ITERATOR$2, ArrayValues);
2738
+ createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$2, ArrayValues);
2528
2739
  } catch (error) {
2529
2740
  CollectionPrototype$1[ITERATOR$2] = ArrayValues;
2530
2741
  }
2531
- if (!CollectionPrototype$1[TO_STRING_TAG$3]) hide(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
2742
+ if (!CollectionPrototype$1[TO_STRING_TAG$3]) {
2743
+ createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
2744
+ }
2532
2745
  if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
2533
2746
  // some Chrome versions have non-configurable methods on DOMTokenList
2534
2747
  if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
2535
- hide(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
2748
+ createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
2536
2749
  } catch (error) {
2537
2750
  CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
2538
2751
  }
@@ -2601,6 +2814,10 @@
2601
2814
  }
2602
2815
 
2603
2816
  function _iterableToArrayLimit(arr, i) {
2817
+ if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
2818
+ return;
2819
+ }
2820
+
2604
2821
  var _arr = [];
2605
2822
  var _n = true;
2606
2823
  var _d = false;
@@ -2634,7 +2851,7 @@
2634
2851
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2635
2852
  }
2636
2853
 
2637
- var VERSION = '1.15.4';
2854
+ var VERSION = '1.17.1';
2638
2855
  var bootstrapVersion = 4;
2639
2856
 
2640
2857
  try {
@@ -2647,6 +2864,16 @@
2647
2864
  } catch (e) {// ignore
2648
2865
  }
2649
2866
 
2867
+ try {
2868
+ // eslint-disable-next-line no-undef
2869
+ var _rawVersion = bootstrap.Tooltip.VERSION;
2870
+
2871
+ if (_rawVersion !== undefined) {
2872
+ bootstrapVersion = parseInt(_rawVersion, 10);
2873
+ }
2874
+ } catch (e) {// ignore
2875
+ }
2876
+
2650
2877
  var CONSTANTS = {
2651
2878
  3: {
2652
2879
  iconsPrefix: 'glyphicon',
@@ -2670,6 +2897,7 @@
2670
2897
  buttonsDropdown: 'btn-group',
2671
2898
  pull: 'pull',
2672
2899
  inputGroup: 'input-group',
2900
+ inputPrefix: 'input-',
2673
2901
  input: 'form-control',
2674
2902
  paginationDropdown: 'btn-group dropdown',
2675
2903
  dropup: 'dropup',
@@ -2679,8 +2907,8 @@
2679
2907
  },
2680
2908
  html: {
2681
2909
  toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
2682
- toolbarDropdownItem: '<li role="menuitem"><label>%s</label></li>',
2683
- toolbarDropdownSeperator: '<li class="divider"></li>',
2910
+ toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
2911
+ toolbarDropdownSeparator: '<li class="divider"></li>',
2684
2912
  pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
2685
2913
  pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
2686
2914
  dropdownCaret: '<span class="caret"></span>',
@@ -2715,6 +2943,53 @@
2715
2943
  buttonsDropdown: 'btn-group',
2716
2944
  pull: 'float',
2717
2945
  inputGroup: 'btn-group',
2946
+ inputPrefix: 'form-control-',
2947
+ input: 'form-control',
2948
+ paginationDropdown: 'btn-group dropdown',
2949
+ dropup: 'dropup',
2950
+ dropdownActive: 'active',
2951
+ paginationActive: 'active',
2952
+ buttonActive: 'active'
2953
+ },
2954
+ html: {
2955
+ toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
2956
+ toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
2957
+ pageDropdown: ['<div class="dropdown-menu">', '</div>'],
2958
+ pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
2959
+ toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
2960
+ dropdownCaret: '<span class="caret"></span>',
2961
+ pagination: ['<ul class="pagination%s">', '</ul>'],
2962
+ paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
2963
+ icon: '<i class="%s %s"></i>',
2964
+ inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
2965
+ searchInput: '<input class="%s%s" type="text" placeholder="%s">',
2966
+ searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
2967
+ searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
2968
+ }
2969
+ },
2970
+ 5: {
2971
+ iconsPrefix: 'fa',
2972
+ icons: {
2973
+ paginationSwitchDown: 'fa-caret-square-down',
2974
+ paginationSwitchUp: 'fa-caret-square-up',
2975
+ refresh: 'fa-sync',
2976
+ toggleOff: 'fa-toggle-off',
2977
+ toggleOn: 'fa-toggle-on',
2978
+ columns: 'fa-th-list',
2979
+ detailOpen: 'fa-plus',
2980
+ detailClose: 'fa-minus',
2981
+ fullscreen: 'fa-arrows-alt',
2982
+ search: 'fa-search',
2983
+ clearSearch: 'fa-trash'
2984
+ },
2985
+ classes: {
2986
+ buttonsPrefix: 'btn',
2987
+ buttons: 'secondary',
2988
+ buttonsGroup: 'btn-group',
2989
+ buttonsDropdown: 'btn-group',
2990
+ pull: 'float',
2991
+ inputGroup: 'btn-group',
2992
+ inputPrefix: 'form-control-',
2718
2993
  input: 'form-control',
2719
2994
  paginationDropdown: 'btn-group dropdown',
2720
2995
  dropup: 'dropup',
@@ -2724,10 +2999,10 @@
2724
2999
  },
2725
3000
  html: {
2726
3001
  toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
2727
- toolbarDropdownItem: '<label class="dropdown-item">%s</label>',
3002
+ toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
2728
3003
  pageDropdown: ['<div class="dropdown-menu">', '</div>'],
2729
3004
  pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
2730
- toolbarDropdownSeperator: '<div class="dropdown-divider"></div>',
3005
+ toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
2731
3006
  dropdownCaret: '<span class="caret"></span>',
2732
3007
  pagination: ['<ul class="pagination%s">', '</ul>'],
2733
3008
  paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
@@ -2743,6 +3018,9 @@
2743
3018
  height: undefined,
2744
3019
  classes: 'table table-bordered table-hover',
2745
3020
  theadClasses: '',
3021
+ headerStyle: function headerStyle(column) {
3022
+ return {};
3023
+ },
2746
3024
  rowStyle: function rowStyle(row, index) {
2747
3025
  return {};
2748
3026
  },
@@ -2757,9 +3035,11 @@
2757
3035
  sortClass: undefined,
2758
3036
  silentSort: true,
2759
3037
  sortName: undefined,
2760
- sortOrder: 'asc',
3038
+ sortOrder: undefined,
3039
+ sortReset: false,
2761
3040
  sortStable: false,
2762
3041
  rememberOrder: false,
3042
+ serverSort: true,
2763
3043
  customSort: undefined,
2764
3044
  columns: [[]],
2765
3045
  data: [],
@@ -2782,7 +3062,7 @@
2782
3062
  totalNotFilteredField: 'totalNotFiltered',
2783
3063
  dataField: 'rows',
2784
3064
  pagination: false,
2785
- onlyInfoPagination: false,
3065
+ paginationParts: ['pageInfo', 'pageSize', 'pageList'],
2786
3066
  showExtendedPagination: false,
2787
3067
  paginationLoop: true,
2788
3068
  sidePagination: 'client',
@@ -2821,11 +3101,13 @@
2821
3101
  customSearch: undefined,
2822
3102
  showHeader: true,
2823
3103
  showFooter: false,
2824
- footerStyle: function footerStyle(row, index) {
3104
+ footerStyle: function footerStyle(column) {
2825
3105
  return {};
2826
3106
  },
3107
+ searchAccentNeutralise: false,
2827
3108
  showColumns: false,
2828
3109
  showColumnsToggleAll: false,
3110
+ showColumnsSearch: false,
2829
3111
  minimumCountColumns: 1,
2830
3112
  showPaginationSwitch: false,
2831
3113
  showRefresh: false,
@@ -2852,6 +3134,7 @@
2852
3134
  detailView: false,
2853
3135
  detailViewIcon: true,
2854
3136
  detailViewByClick: false,
3137
+ detailViewAlign: 'left',
2855
3138
  detailFormatter: function detailFormatter(index, row) {
2856
3139
  return '';
2857
3140
  },
@@ -2862,13 +3145,17 @@
2862
3145
  toolbarAlign: 'left',
2863
3146
  buttonsToolbar: undefined,
2864
3147
  buttonsAlign: 'right',
3148
+ buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
2865
3149
  buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
2866
3150
  buttonsClass: CONSTANTS.classes.buttons,
2867
3151
  icons: CONSTANTS.icons,
2868
- html: CONSTANTS.html,
2869
3152
  iconSize: undefined,
2870
3153
  iconsPrefix: CONSTANTS.iconsPrefix,
2871
3154
  // glyphicon or fa(font-awesome)
3155
+ loadingFontSize: 'auto',
3156
+ loadingTemplate: function loadingTemplate(loadingMessage) {
3157
+ return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
3158
+ },
2872
3159
  onAll: function onAll(name, args) {
2873
3160
  return false;
2874
3161
  },
@@ -3062,7 +3349,7 @@
3062
3349
  escape: false,
3063
3350
  events: undefined
3064
3351
  };
3065
- var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'getAllSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'resetWidth', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
3352
+ var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'getAllSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
3066
3353
  var EVENTS = {
3067
3354
  'all.bs.table': 'onAll',
3068
3355
  'click-row.bs.table': 'onClickRow',
@@ -3108,60 +3395,77 @@
3108
3395
  }
3109
3396
  };
3110
3397
 
3111
- // `FlattenIntoArray` abstract operation
3112
- // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
3113
- var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
3114
- var targetIndex = start;
3115
- var sourceIndex = 0;
3116
- var mapFn = mapper ? bindContext(mapper, thisArg, 3) : false;
3117
- var element;
3398
+ var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
3118
3399
 
3119
- while (sourceIndex < sourceLen) {
3120
- if (sourceIndex in source) {
3121
- element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
3400
+ // `Object.keys` method
3401
+ // https://tc39.github.io/ecma262/#sec-object.keys
3402
+ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
3403
+ keys: function keys(it) {
3404
+ return objectKeys(toObject(it));
3405
+ }
3406
+ });
3122
3407
 
3123
- if (depth > 0 && isArray(element)) {
3124
- targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
3125
- } else {
3126
- if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
3127
- target[targetIndex] = element;
3128
- }
3408
+ var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
3129
3409
 
3130
- targetIndex++;
3131
- }
3132
- sourceIndex++;
3133
- }
3134
- return targetIndex;
3135
- };
3136
3410
 
3137
- var flattenIntoArray_1 = flattenIntoArray;
3138
3411
 
3139
- // `Array.prototype.flat` method
3140
- // https://github.com/tc39/proposal-flatMap
3141
- _export({ target: 'Array', proto: true }, {
3142
- flat: function flat(/* depthArg = 1 */) {
3143
- var depthArg = arguments.length ? arguments[0] : undefined;
3144
- var O = toObject(this);
3145
- var sourceLen = toLength(O.length);
3146
- var A = arraySpeciesCreate(O, 0);
3147
- A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
3148
- return A;
3412
+
3413
+
3414
+
3415
+ var nativeEndsWith = ''.endsWith;
3416
+ var min$5 = Math.min;
3417
+
3418
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
3419
+ // https://github.com/zloirock/core-js/pull/702
3420
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
3421
+ var descriptor = getOwnPropertyDescriptor$3(String.prototype, 'endsWith');
3422
+ return descriptor && !descriptor.writable;
3423
+ }();
3424
+
3425
+ // `String.prototype.endsWith` method
3426
+ // https://tc39.github.io/ecma262/#sec-string.prototype.endswith
3427
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
3428
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
3429
+ var that = String(requireObjectCoercible(this));
3430
+ notARegexp(searchString);
3431
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
3432
+ var len = toLength(that.length);
3433
+ var end = endPosition === undefined ? len : min$5(toLength(endPosition), len);
3434
+ var search = String(searchString);
3435
+ return nativeEndsWith
3436
+ ? nativeEndsWith.call(that, search, end)
3437
+ : that.slice(end - search.length, end) === search;
3149
3438
  }
3150
3439
  });
3151
3440
 
3152
- // this method was added to unscopables after implementation
3153
- // in popular engines, so it's moved to a separate module
3441
+ var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
3154
3442
 
3155
3443
 
3156
- addToUnscopables('flat');
3157
3444
 
3158
- var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
3159
3445
 
3160
- // `Object.keys` method
3161
- // https://tc39.github.io/ecma262/#sec-object.keys
3162
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
3163
- keys: function keys(it) {
3164
- return objectKeys(toObject(it));
3446
+
3447
+
3448
+ var nativeStartsWith = ''.startsWith;
3449
+ var min$6 = Math.min;
3450
+
3451
+ var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith');
3452
+ // https://github.com/zloirock/core-js/pull/702
3453
+ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
3454
+ var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'startsWith');
3455
+ return descriptor && !descriptor.writable;
3456
+ }();
3457
+
3458
+ // `String.prototype.startsWith` method
3459
+ // https://tc39.github.io/ecma262/#sec-string.prototype.startswith
3460
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
3461
+ startsWith: function startsWith(searchString /* , position = 0 */) {
3462
+ var that = String(requireObjectCoercible(this));
3463
+ notARegexp(searchString);
3464
+ var index = toLength(min$6(arguments.length > 1 ? arguments[1] : undefined, that.length));
3465
+ var search = String(searchString);
3466
+ return nativeStartsWith
3467
+ ? nativeStartsWith.call(that, search, index)
3468
+ : that.slice(index, index + search.length) === search;
3165
3469
  }
3166
3470
  });
3167
3471
 
@@ -3309,8 +3613,14 @@
3309
3613
  }
3310
3614
  }
3311
3615
  },
3616
+ normalizeAccent: function normalizeAccent(string) {
3617
+ return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
3618
+ },
3312
3619
  updateFieldGroup: function updateFieldGroup(columns) {
3313
- var allColumns = columns.flat();
3620
+ var _ref;
3621
+
3622
+ var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
3623
+
3314
3624
  var _iteratorNormalCompletion4 = true;
3315
3625
  var _didIteratorError4 = false;
3316
3626
  var _iteratorError4 = undefined;
@@ -3473,6 +3783,13 @@
3473
3783
 
3474
3784
  return text;
3475
3785
  },
3786
+ unescapeHTML: function unescapeHTML(text) {
3787
+ if (typeof text === 'string') {
3788
+ return text.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#039;/g, '\'').replace(/&#x60;/g, '`');
3789
+ }
3790
+
3791
+ return text;
3792
+ },
3476
3793
  getRealDataAttr: function getRealDataAttr(dataAttr) {
3477
3794
  for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
3478
3795
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
@@ -3601,7 +3918,7 @@
3601
3918
  });
3602
3919
  return data;
3603
3920
  },
3604
- sort: function sort(a, b, order, sortStable) {
3921
+ sort: function sort(a, b, order, sortStable, aPosition, bPosition) {
3605
3922
  if (a === undefined || a === null) {
3606
3923
  a = '';
3607
3924
  }
@@ -3611,8 +3928,8 @@
3611
3928
  }
3612
3929
 
3613
3930
  if (sortStable && a === b) {
3614
- a = a._position;
3615
- b = b._position;
3931
+ a = aPosition;
3932
+ b = bPosition;
3616
3933
  } // If both values are numeric, do a numeric comparison
3617
3934
 
3618
3935
 
@@ -3646,6 +3963,48 @@
3646
3963
  }
3647
3964
 
3648
3965
  return order;
3966
+ },
3967
+ getResizeEventName: function getResizeEventName() {
3968
+ var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3969
+ id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
3970
+ return "resize.bootstrap-table-".concat(id);
3971
+ },
3972
+ hasDetailViewIcon: function hasDetailViewIcon(options) {
3973
+ return options.detailView && options.detailViewIcon && !options.cardView;
3974
+ },
3975
+ checkAutoMergeCells: function checkAutoMergeCells(data) {
3976
+ var _iteratorNormalCompletion9 = true;
3977
+ var _didIteratorError9 = false;
3978
+ var _iteratorError9 = undefined;
3979
+
3980
+ try {
3981
+ for (var _iterator9 = data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
3982
+ var row = _step9.value;
3983
+
3984
+ for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
3985
+ var key = _Object$keys[_i4];
3986
+
3987
+ if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
3988
+ return true;
3989
+ }
3990
+ }
3991
+ }
3992
+ } catch (err) {
3993
+ _didIteratorError9 = true;
3994
+ _iteratorError9 = err;
3995
+ } finally {
3996
+ try {
3997
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
3998
+ _iterator9.return();
3999
+ }
4000
+ } finally {
4001
+ if (_didIteratorError9) {
4002
+ throw _iteratorError9;
4003
+ }
4004
+ }
4005
+ }
4006
+
4007
+ return false;
3649
4008
  }
3650
4009
  };
3651
4010
 
@@ -3667,7 +4026,7 @@
3667
4026
  this.itemHeight = options.itemHeight;
3668
4027
  this.cache = {};
3669
4028
  this.scrollTop = this.scrollEl.scrollTop;
3670
- this.initDOM(this.rows);
4029
+ this.initDOM(this.rows, options.fixedScroll);
3671
4030
  this.scrollEl.scrollTop = this.scrollTop;
3672
4031
  this.lastCluster = 0;
3673
4032
 
@@ -3690,13 +4049,14 @@
3690
4049
 
3691
4050
  _createClass(VirtualScroll, [{
3692
4051
  key: "initDOM",
3693
- value: function initDOM(rows) {
4052
+ value: function initDOM(rows, fixedScroll) {
3694
4053
  if (typeof this.clusterHeight === 'undefined') {
4054
+ this.cache.scrollTop = this.scrollEl.scrollTop;
3695
4055
  this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
3696
4056
  this.getRowsHeight(rows);
3697
4057
  }
3698
4058
 
3699
- var data = this.initData(rows, this.getNum());
4059
+ var data = this.initData(rows, this.getNum(fixedScroll));
3700
4060
  var thisRows = data.rows.join('');
3701
4061
  var dataChanged = this.checkChanges('data', thisRows);
3702
4062
  var topOffsetChanged = this.checkChanges('top', data.topOffset);
@@ -3715,6 +4075,10 @@
3715
4075
  }
3716
4076
 
3717
4077
  this.contentEl.innerHTML = html.join('');
4078
+
4079
+ if (fixedScroll) {
4080
+ this.contentEl.scrollTop = this.cache.scrollTop;
4081
+ }
3718
4082
  } else if (bottomOffsetChanged) {
3719
4083
  this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
3720
4084
  }
@@ -3734,8 +4098,8 @@
3734
4098
  }
3735
4099
  }, {
3736
4100
  key: "getNum",
3737
- value: function getNum() {
3738
- this.scrollTop = this.scrollEl.scrollTop;
4101
+ value: function getNum(fixedScroll) {
4102
+ this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
3739
4103
  return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
3740
4104
  }
3741
4105
  }, {
@@ -3829,11 +4193,11 @@
3829
4193
  }, {
3830
4194
  key: "initConstants",
3831
4195
  value: function initConstants() {
3832
- var o = this.options;
4196
+ var opts = this.options;
3833
4197
  this.constants = Constants.CONSTANTS;
3834
4198
  this.constants.theme = $.fn.bootstrapTable.theme;
3835
- var buttonsPrefix = o.buttonsPrefix ? "".concat(o.buttonsPrefix, "-") : '';
3836
- this.constants.buttonsClass = [o.buttonsPrefix, buttonsPrefix + o.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), o.iconSize)].join(' ').trim();
4199
+ var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
4200
+ this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
3837
4201
  }
3838
4202
  }, {
3839
4203
  key: "initLocale",
@@ -3861,7 +4225,8 @@
3861
4225
  value: function initContainer() {
3862
4226
  var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
3863
4227
  var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
3864
- this.$container = $("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n <span class=\"loading-wrap\">\n <span class=\"loading-text\">").concat(this.options.formatLoadingMessage(), "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n </div>\n </div>\n <div class=\"fixed-table-footer\"><table><thead><tr></tr></thead></table></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
4228
+ var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
4229
+ this.$container = $("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"><table><thead><tr></tr></thead></table></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
3865
4230
  this.$container.insertAfter(this.$el);
3866
4231
  this.$tableContainer = this.$container.find('.fixed-table-container');
3867
4232
  this.$tableHeader = this.$container.find('.fixed-table-header');
@@ -3895,11 +4260,6 @@
3895
4260
  }
3896
4261
 
3897
4262
  this.$tableFooter = this.$container.find('.fixed-table-footer');
3898
- } else {
3899
- if (!this.$tableFooter.length) {
3900
- this.$el.append('<tfoot><tr></tr></tfoot>');
3901
- this.$tableFooter = this.$el.find('tfoot');
3902
- }
3903
4263
  }
3904
4264
  }
3905
4265
  }, {
@@ -3908,7 +4268,6 @@
3908
4268
  var _this = this;
3909
4269
 
3910
4270
  var columns = [];
3911
- var data = [];
3912
4271
  this.$header = this.$el.find('>thead');
3913
4272
 
3914
4273
  if (!this.$header.length) {
@@ -3917,23 +4276,30 @@
3917
4276
  this.$header.addClass(this.options.theadClasses);
3918
4277
  }
3919
4278
 
4279
+ this._headerTrClasses = [];
3920
4280
  this.$header.find('tr').each(function (i, el) {
4281
+ var $tr = $(el);
3921
4282
  var column = [];
3922
- $(el).find('th').each(function (i, el) {
3923
- // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
3924
- if (typeof $(el).data('field') !== 'undefined') {
3925
- $(el).data('field', "".concat($(el).data('field')));
4283
+ $tr.find('th').each(function (i, el) {
4284
+ var $th = $(el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
4285
+
4286
+ if (typeof $th.data('field') !== 'undefined') {
4287
+ $th.data('field', "".concat($th.data('field')));
3926
4288
  }
3927
4289
 
3928
4290
  column.push($.extend({}, {
3929
- title: $(el).html(),
3930
- 'class': $(el).attr('class'),
3931
- titleTooltip: $(el).attr('title'),
3932
- rowspan: $(el).attr('rowspan') ? +$(el).attr('rowspan') : undefined,
3933
- colspan: $(el).attr('colspan') ? +$(el).attr('colspan') : undefined
3934
- }, $(el).data()));
4291
+ title: $th.html(),
4292
+ 'class': $th.attr('class'),
4293
+ titleTooltip: $th.attr('title'),
4294
+ rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
4295
+ colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
4296
+ }, $th.data()));
3935
4297
  });
3936
4298
  columns.push(column);
4299
+
4300
+ if ($tr.attr('class')) {
4301
+ _this._headerTrClasses.push($tr.attr('class'));
4302
+ }
3937
4303
  });
3938
4304
 
3939
4305
  if (!Array.isArray(this.options.columns[0])) {
@@ -3958,9 +4324,10 @@
3958
4324
  }); // if options.data is setting, do not process tbody and tfoot data
3959
4325
 
3960
4326
  if (!this.options.data.length) {
3961
- this.options.data = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
4327
+ var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
3962
4328
 
3963
- if (data.length) {
4329
+ if (htmlData.length) {
4330
+ this.options.data = htmlData;
3964
4331
  this.fromHtml = true;
3965
4332
  }
3966
4333
  }
@@ -3998,10 +4365,15 @@
3998
4365
  };
3999
4366
  Utils.updateFieldGroup(this.options.columns);
4000
4367
  this.options.columns.forEach(function (columns, i) {
4001
- html.push('<tr>');
4368
+ html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), ">"));
4369
+ var detailViewTemplate = '';
4002
4370
 
4003
- if (i === 0 && !_this2.options.cardView && _this2.options.detailView && _this2.options.detailViewIcon) {
4004
- html.push("<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>\n "));
4371
+ if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
4372
+ detailViewTemplate = "<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>");
4373
+ }
4374
+
4375
+ if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
4376
+ html.push(detailViewTemplate);
4005
4377
  }
4006
4378
 
4007
4379
  columns.forEach(function (column, j) {
@@ -4017,6 +4389,24 @@
4017
4389
  return;
4018
4390
  }
4019
4391
 
4392
+ var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
4393
+ var csses = [];
4394
+ var classes = '';
4395
+
4396
+ if (headerStyle && headerStyle.css) {
4397
+ for (var _i = 0, _Object$entries = Object.entries(headerStyle.css); _i < _Object$entries.length; _i++) {
4398
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
4399
+ key = _Object$entries$_i[0],
4400
+ value = _Object$entries$_i[1];
4401
+
4402
+ csses.push("".concat(key, ": ").concat(value));
4403
+ }
4404
+ }
4405
+
4406
+ if (headerStyle && headerStyle.classes) {
4407
+ classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
4408
+ }
4409
+
4020
4410
  if (typeof column.fieldIndex !== 'undefined') {
4021
4411
  _this2.header.fields[column.fieldIndex] = column.field;
4022
4412
  _this2.header.styles[column.fieldIndex] = align + style;
@@ -4040,7 +4430,7 @@
4040
4430
  visibleColumns[column.field] = column;
4041
4431
  }
4042
4432
 
4043
- html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : class_, Utils.sprintf(' style="%s"', halign + style), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
4433
+ html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
4044
4434
  j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
4045
4435
  html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? 'sortable both' : ''));
4046
4436
  var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
@@ -4059,7 +4449,6 @@
4059
4449
  if (column.radio) {
4060
4450
  text = '';
4061
4451
  _this2.header.stateField = column.field;
4062
- _this2.options.singleSelect = true;
4063
4452
  }
4064
4453
 
4065
4454
  if (!text && column.showSelectTitle) {
@@ -4072,6 +4461,11 @@
4072
4461
  html.push('</div>');
4073
4462
  html.push('</th>');
4074
4463
  });
4464
+
4465
+ if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
4466
+ html.push(detailViewTemplate);
4467
+ }
4468
+
4075
4469
  html.push('</tr>');
4076
4470
  });
4077
4471
  this.$header.html(html.join(''));
@@ -4101,7 +4495,7 @@
4101
4495
  }
4102
4496
  }
4103
4497
  });
4104
- var resizeEvent = "resize.bootstrap-table".concat(this.$el.attr('id') || '');
4498
+ var resizeEvent = Utils.getResizeEventName(this.$el.attr('id'));
4105
4499
  $(window).off(resizeEvent);
4106
4500
 
4107
4501
  if (!this.options.showHeader || this.options.cardView) {
@@ -4114,15 +4508,15 @@
4114
4508
  this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow
4115
4509
 
4116
4510
  this.getCaret();
4117
- $(window).on(resizeEvent, function (e) {
4118
- return _this2.resetWidth(e);
4511
+ $(window).on(resizeEvent, function () {
4512
+ return _this2.resetView();
4119
4513
  });
4120
4514
  }
4121
4515
 
4122
4516
  this.$selectAll = this.$header.find('[name="btSelectAll"]');
4123
- this.$selectAll.off('click').on('click', function (_ref) {
4124
- var currentTarget = _ref.currentTarget;
4125
- var checked = $(currentTarget).prop('checked');
4517
+ this.$selectAll.off('click').on('click', function (e) {
4518
+ e.stopPropagation();
4519
+ var checked = $(e.currentTarget).prop('checked');
4126
4520
 
4127
4521
  _this2[checked ? 'checkAll' : 'uncheckAll']();
4128
4522
 
@@ -4137,10 +4531,15 @@
4137
4531
  } else if (type === 'prepend') {
4138
4532
  this.options.data = [].concat(data).concat(this.options.data);
4139
4533
  } else {
4140
- this.options.data = data || this.options.data;
4534
+ data = data || this.options.data;
4535
+ this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
4141
4536
  }
4142
4537
 
4143
- this.data = this.options.data;
4538
+ this.data = _toConsumableArray(this.options.data);
4539
+
4540
+ if (this.options.sortReset) {
4541
+ this.unsortedData = _toConsumableArray(this.data);
4542
+ }
4144
4543
 
4145
4544
  if (this.options.sidePagination === 'server') {
4146
4545
  return;
@@ -4187,7 +4586,7 @@
4187
4586
  return order * value;
4188
4587
  }
4189
4588
 
4190
- return Utils.sort(aa, bb, order, _this3.options.sortStable);
4589
+ return Utils.sort(aa, bb, order, _this3.options.sortStable, a._position, b._position);
4191
4590
  });
4192
4591
  }
4193
4592
 
@@ -4201,19 +4600,33 @@
4201
4600
  _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
4202
4601
  }, 250);
4203
4602
  }
4603
+ } else if (this.options.sortReset) {
4604
+ this.data = _toConsumableArray(this.unsortedData);
4204
4605
  }
4205
4606
  }
4206
4607
  }, {
4207
4608
  key: "onSort",
4208
- value: function onSort(_ref2) {
4209
- var type = _ref2.type,
4210
- currentTarget = _ref2.currentTarget;
4609
+ value: function onSort(_ref) {
4610
+ var type = _ref.type,
4611
+ currentTarget = _ref.currentTarget;
4211
4612
  var $this = type === 'keypress' ? $(currentTarget) : $(currentTarget).parent();
4212
4613
  var $this_ = this.$header.find('th').eq($this.index());
4213
4614
  this.$header.add(this.$header_).find('span.order').remove();
4214
4615
 
4215
4616
  if (this.options.sortName === $this.data('field')) {
4216
- this.options.sortOrder = this.options.sortOrder === 'asc' ? 'desc' : 'asc';
4617
+ var currentSortOrder = this.options.sortOrder;
4618
+
4619
+ if (currentSortOrder === undefined) {
4620
+ this.options.sortOrder = 'asc';
4621
+ } else if (currentSortOrder === 'asc') {
4622
+ this.options.sortOrder = 'desc';
4623
+ } else if (this.options.sortOrder === 'desc') {
4624
+ this.options.sortOrder = this.options.sortReset ? undefined : 'asc';
4625
+ }
4626
+
4627
+ if (this.options.sortOrder === undefined) {
4628
+ this.options.sortName = undefined;
4629
+ }
4217
4630
  } else {
4218
4631
  this.options.sortName = $this.data('field');
4219
4632
 
@@ -4229,7 +4642,7 @@
4229
4642
 
4230
4643
  this.getCaret();
4231
4644
 
4232
- if (this.options.sidePagination === 'server') {
4645
+ if (this.options.sidePagination === 'server' && this.options.serverSort) {
4233
4646
  this.options.pageNumber = 1;
4234
4647
  this.initServer(this.options.silentSort);
4235
4648
  return;
@@ -4243,72 +4656,112 @@
4243
4656
  value: function initToolbar() {
4244
4657
  var _this4 = this;
4245
4658
 
4246
- var o = this.options;
4659
+ var opts = this.options;
4247
4660
  var html = [];
4248
4661
  var timeoutId = 0;
4249
4662
  var $keepOpen;
4250
- var $search;
4251
4663
  var switchableCount = 0;
4252
4664
 
4253
4665
  if (this.$toolbar.find('.bs-bars').children().length) {
4254
- $('body').append($(o.toolbar));
4666
+ $('body').append($(opts.toolbar));
4255
4667
  }
4256
4668
 
4257
4669
  this.$toolbar.html('');
4258
4670
 
4259
- if (typeof o.toolbar === 'string' || _typeof(o.toolbar) === 'object') {
4260
- $(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, o.toolbarAlign)).appendTo(this.$toolbar).append($(o.toolbar));
4671
+ if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
4672
+ $(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($(opts.toolbar));
4261
4673
  } // showColumns, showToggle, showRefresh
4262
4674
 
4263
4675
 
4264
- html = ["<div class=\"".concat(['columns', "columns-".concat(o.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(o.buttonsAlign)].join(' '), "\">")];
4676
+ html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
4265
4677
 
4266
- if (typeof o.icons === 'string') {
4267
- o.icons = Utils.calculateObjectValue(null, o.icons);
4678
+ if (typeof opts.icons === 'string') {
4679
+ opts.icons = Utils.calculateObjectValue(null, opts.icons);
4268
4680
  }
4269
4681
 
4270
- if (o.showPaginationSwitch) {
4271
- html.push("<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"paginationSwitch\"\n aria-label=\"Pagination Switch\" title=\"").concat(o.formatPaginationSwitch(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.paginationSwitchDown) : '', "\n ").concat(o.showButtonText ? o.formatPaginationSwitchUp() : '', "\n </button>"));
4272
- }
4682
+ var buttonsHtml = {
4683
+ paginationSwitch: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"paginationSwitch\"\n aria-label=\"Pagination Switch\" title=\"").concat(opts.formatPaginationSwitch(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.paginationSwitchDown) : '', "\n ").concat(opts.showButtonText ? opts.formatPaginationSwitchUp() : '', "\n </button>"),
4684
+ refresh: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"refresh\"\n aria-label=\"Refresh\" title=\"").concat(opts.formatRefresh(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.refresh) : '', "\n ").concat(opts.showButtonText ? opts.formatRefresh() : '', "\n </button>"),
4685
+ toggle: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"toggle\"\n aria-label=\"Toggle\" title=\"").concat(opts.formatToggle(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.toggleOff) : '', "\n ").concat(opts.showButtonText ? opts.formatToggleOn() : '', "\n </button>"),
4686
+ fullscreen: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"fullscreen\"\n aria-label=\"Fullscreen\" title=\"").concat(opts.formatFullscreen(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.fullscreen) : '', "\n ").concat(opts.showButtonText ? opts.formatFullscreen() : '', "\n </button>"),
4687
+ columns: function () {
4688
+ var html = [];
4689
+ html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"\n aria-label=\"Columns\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
4273
4690
 
4274
- if (o.showRefresh) {
4275
- html.push("<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"refresh\"\n aria-label=\"Refresh\" title=\"").concat(o.formatRefresh(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.refresh) : '', "\n ").concat(o.showButtonText ? o.formatRefresh() : '', "\n </button>"));
4276
- }
4691
+ if (opts.showColumnsSearch) {
4692
+ html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
4693
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4694
+ }
4277
4695
 
4278
- if (o.showToggle) {
4279
- html.push("<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"toggle\"\n aria-label=\"Toggle\" title=\"").concat(o.formatToggle(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.toggleOff) : '', "\n ").concat(o.showButtonText ? o.formatToggleOn() : '', "\n </button>"));
4280
- }
4696
+ if (opts.showColumnsToggleAll) {
4697
+ var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4698
+ return !_this4.isSelectionColumn(column);
4699
+ }).length;
4281
4700
 
4282
- if (o.showFullscreen) {
4283
- html.push("<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"fullscreen\"\n aria-label=\"Fullscreen\" title=\"").concat(o.formatFullscreen(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.fullscreen) : '', "\n ").concat(o.showButtonText ? o.formatFullscreen() : '', "\n </button>"));
4284
- }
4701
+ html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
4702
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4703
+ }
4285
4704
 
4286
- if (o.showColumns) {
4287
- html.push("<div class=\"keep-open ".concat(this.constants.classes.buttonsDropdown, "\" title=\"").concat(o.formatColumns(), "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"\n aria-label=\"Columns\" title=\"").concat(o.formatColumns(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.columns) : '', "\n ").concat(o.showButtonText ? o.formatColumns() : '', "\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.toolbarDropdown[0]));
4705
+ var visibleColumns = 0;
4288
4706
 
4289
- if (o.showColumnsToggleAll) {
4290
- var allFieldsVisible = this.getVisibleColumns().length === this.columns.length;
4291
- html.push(Utils.sprintf(this.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', o.formatColumnsToggleAll())));
4292
- html.push(this.constants.html.toolbarDropdownSeperator);
4293
- }
4707
+ _this4.columns.forEach(function (column, i) {
4708
+ if (column.visible) {
4709
+ visibleColumns++;
4710
+ }
4711
+ });
4294
4712
 
4295
- this.columns.forEach(function (column, i) {
4296
- if (column.radio || column.checkbox) {
4297
- return;
4298
- }
4713
+ _this4.columns.forEach(function (column, i) {
4714
+ if (_this4.isSelectionColumn(column)) {
4715
+ return;
4716
+ }
4299
4717
 
4300
- if (o.cardView && !column.cardVisible) {
4301
- return;
4302
- }
4718
+ if (opts.cardView && !column.cardVisible) {
4719
+ return;
4720
+ }
4303
4721
 
4304
- var checked = column.visible ? ' checked="checked"' : '';
4722
+ var checked = column.visible ? ' checked="checked"' : '';
4723
+ var disabled = visibleColumns <= _this4.options.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4305
4724
 
4306
- if (column.switchable) {
4307
- html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s> <span>%s</span>', column.field, i, checked, column.title)));
4308
- switchableCount++;
4725
+ if (column.switchable) {
4726
+ html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
4727
+ switchableCount++;
4728
+ }
4729
+ });
4730
+
4731
+ html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4732
+ return html.join('');
4733
+ }()
4734
+ };
4735
+
4736
+ if (typeof opts.buttonsOrder === 'string') {
4737
+ opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4738
+ }
4739
+
4740
+ var _iteratorNormalCompletion = true;
4741
+ var _didIteratorError = false;
4742
+ var _iteratorError = undefined;
4743
+
4744
+ try {
4745
+ for (var _iterator = opts.buttonsOrder[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4746
+ var button = _step.value;
4747
+
4748
+ if (opts['show' + button.charAt(0).toUpperCase() + button.substring(1)]) {
4749
+ html.push(buttonsHtml[button]);
4309
4750
  }
4310
- });
4311
- html.push(this.constants.html.toolbarDropdown[1], '</div>');
4751
+ }
4752
+ } catch (err) {
4753
+ _didIteratorError = true;
4754
+ _iteratorError = err;
4755
+ } finally {
4756
+ try {
4757
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4758
+ _iterator.return();
4759
+ }
4760
+ } finally {
4761
+ if (_didIteratorError) {
4762
+ throw _iteratorError;
4763
+ }
4764
+ }
4312
4765
  }
4313
4766
 
4314
4767
  html.push('</div>'); // Fix #188: this.showToolbar is for extensions
@@ -4317,96 +4770,139 @@
4317
4770
  this.$toolbar.append(html.join(''));
4318
4771
  }
4319
4772
 
4320
- if (o.showPaginationSwitch) {
4773
+ if (opts.showPaginationSwitch) {
4321
4774
  this.$toolbar.find('button[name="paginationSwitch"]').off('click').on('click', function () {
4322
4775
  return _this4.togglePagination();
4323
4776
  });
4324
4777
  }
4325
4778
 
4326
- if (o.showFullscreen) {
4779
+ if (opts.showFullscreen) {
4327
4780
  this.$toolbar.find('button[name="fullscreen"]').off('click').on('click', function () {
4328
4781
  return _this4.toggleFullscreen();
4329
4782
  });
4330
4783
  }
4331
4784
 
4332
- if (o.showRefresh) {
4785
+ if (opts.showRefresh) {
4333
4786
  this.$toolbar.find('button[name="refresh"]').off('click').on('click', function () {
4334
4787
  return _this4.refresh();
4335
4788
  });
4336
4789
  }
4337
4790
 
4338
- if (o.showToggle) {
4791
+ if (opts.showToggle) {
4339
4792
  this.$toolbar.find('button[name="toggle"]').off('click').on('click', function () {
4340
4793
  _this4.toggleView();
4341
4794
  });
4342
4795
  }
4343
4796
 
4344
- if (o.showColumns) {
4797
+ if (opts.showColumns) {
4345
4798
  $keepOpen = this.$toolbar.find('.keep-open');
4346
- var $checkboxes = $keepOpen.find('input:not(".toggle-all")');
4347
- var $toggleAll = $keepOpen.find('input.toggle-all');
4799
+ var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
4800
+ var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
4348
4801
 
4349
- if (switchableCount <= o.minimumCountColumns) {
4802
+ if (switchableCount <= opts.minimumCountColumns) {
4350
4803
  $keepOpen.find('input').prop('disabled', true);
4351
4804
  }
4352
4805
 
4353
4806
  $keepOpen.find('li, label').off('click').on('click', function (e) {
4354
4807
  e.stopImmediatePropagation();
4355
4808
  });
4356
- $checkboxes.off('click').on('click', function (_ref3) {
4357
- var currentTarget = _ref3.currentTarget;
4809
+ $checkboxes.off('click').on('click', function (_ref2) {
4810
+ var currentTarget = _ref2.currentTarget;
4358
4811
  var $this = $(currentTarget);
4359
4812
 
4360
4813
  _this4._toggleColumn($this.val(), $this.prop('checked'), false);
4361
4814
 
4362
4815
  _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
4363
4816
 
4364
- $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.length);
4817
+ $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
4818
+ return !_this4.isSelectionColumn(column);
4819
+ }).length);
4365
4820
  });
4366
- $toggleAll.off('click').on('click', function (_ref4) {
4367
- var currentTarget = _ref4.currentTarget;
4821
+ $toggleAll.off('click').on('click', function (_ref3) {
4822
+ var currentTarget = _ref3.currentTarget;
4368
4823
 
4369
4824
  _this4._toggleAllColumns($(currentTarget).prop('checked'));
4370
4825
  });
4826
+
4827
+ if (opts.showColumnsSearch) {
4828
+ var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
4829
+ var $listItems = $keepOpen.find('.dropdown-item-marker');
4830
+ $columnsSearch.on('keyup paste change', function (_ref4) {
4831
+ var currentTarget = _ref4.currentTarget;
4832
+ var $this = $(currentTarget);
4833
+ var searchValue = $this.val().toLowerCase();
4834
+ $listItems.show();
4835
+ $checkboxes.each(function (i, el) {
4836
+ var $checkbox = $(el);
4837
+ var $listItem = $checkbox.parents('.dropdown-item-marker');
4838
+ var text = $listItem.text().toLowerCase();
4839
+
4840
+ if (!text.includes(searchValue)) {
4841
+ $listItem.hide();
4842
+ }
4843
+ });
4844
+ });
4845
+ }
4371
4846
  } // Fix #4516: this.showSearchClearButton is for extensions
4372
4847
 
4373
4848
 
4374
- if (o.search || this.showSearchClearButton) {
4849
+ if (opts.search || this.showSearchClearButton) {
4375
4850
  html = [];
4376
- var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, o.formatSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.search) : '', o.showButtonText ? o.formatSearch() : '');
4377
- var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, o.formatClearSearch(), o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.clearSearch) : '', o.showButtonText ? o.formatClearSearch() : '');
4378
- var searchInputHtml = "<input class=\"".concat(this.constants.classes.input).concat(Utils.sprintf(' input-%s', o.iconSize), " search-input\" type=\"text\" placeholder=\"").concat(o.formatSearch(), "\">");
4851
+ var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
4852
+ var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
4853
+ var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"text\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
4379
4854
  var searchInputFinalHtml = searchInputHtml;
4380
4855
 
4381
- if (o.showSearchButton || o.showSearchClearButton) {
4382
- var buttonsHtml = (o.showSearchButton ? showSearchButton : '') + (o.showSearchClearButton ? showSearchClearButton : '');
4383
- searchInputFinalHtml = o.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, buttonsHtml) : buttonsHtml;
4856
+ if (opts.showSearchButton || opts.showSearchClearButton) {
4857
+ var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
4858
+
4859
+ searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
4384
4860
  }
4385
4861
 
4386
- html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(o.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
4862
+ html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
4387
4863
  this.$toolbar.append(html.join(''));
4388
4864
  var $searchInput = this.$toolbar.find('.search input');
4389
- $search = o.showSearchButton ? this.$toolbar.find('.search button[name=search]') : $searchInput;
4390
- var eventTriggers = o.showSearchButton ? 'click' : Utils.isIEBrowser() ? 'mouseup' : 'keyup drop blur';
4391
- $search.off(eventTriggers).on(eventTriggers, function (event) {
4392
- if (o.searchOnEnterKey && event.keyCode !== 13) {
4393
- return;
4394
- }
4395
4865
 
4396
- if ([37, 38, 39, 40].includes(event.keyCode)) {
4397
- return;
4398
- }
4866
+ var handleInputEvent = function handleInputEvent() {
4867
+ var eventTriggers = "keyup drop blur ".concat(Utils.isIEBrowser() ? 'mouseup' : '');
4868
+ $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
4869
+ if (opts.searchOnEnterKey && event.keyCode !== 13) {
4870
+ return;
4871
+ }
4399
4872
 
4400
- clearTimeout(timeoutId); // doesn't matter if it's 0
4873
+ if ([37, 38, 39, 40].includes(event.keyCode)) {
4874
+ return;
4875
+ }
4401
4876
 
4402
- timeoutId = setTimeout(function () {
4403
- _this4.onSearch(o.showSearchButton ? {
4404
- currentTarget: $searchInput
4405
- } : event);
4406
- }, o.searchTimeOut);
4407
- });
4877
+ clearTimeout(timeoutId); // doesn't matter if it's 0
4878
+
4879
+ timeoutId = setTimeout(function () {
4880
+ _this4.onSearch({
4881
+ currentTarget: event.currentTarget
4882
+ });
4883
+ }, opts.searchTimeOut);
4884
+ });
4885
+ };
4408
4886
 
4409
- if (o.showSearchClearButton) {
4887
+ if (opts.showSearchButton) {
4888
+ this.$toolbar.find('.search button[name=search]').off('click').on('click', function (event) {
4889
+ clearTimeout(timeoutId); // doesn't matter if it's 0
4890
+
4891
+ timeoutId = setTimeout(function () {
4892
+ _this4.onSearch({
4893
+ currentTarget: $searchInput
4894
+ });
4895
+ }, opts.searchTimeOut);
4896
+ });
4897
+
4898
+ if (opts.searchOnEnterKey) {
4899
+ handleInputEvent();
4900
+ }
4901
+ } else {
4902
+ handleInputEvent();
4903
+ }
4904
+
4905
+ if (opts.showSearchClearButton) {
4410
4906
  this.$toolbar.find('.search button[name=clearSearch]').click(function () {
4411
4907
  _this4.resetSearch();
4412
4908
  });
@@ -4429,7 +4925,7 @@
4429
4925
  $(currentTarget).val(text);
4430
4926
  }
4431
4927
 
4432
- if (this.searchText === text) {
4928
+ if (this.searchText === text && text.length > 0) {
4433
4929
  return;
4434
4930
  }
4435
4931
 
@@ -4468,7 +4964,7 @@
4468
4964
  return;
4469
4965
  }
4470
4966
 
4471
- var s = this.searchText && (this.options.escape ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase();
4967
+ var s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase();
4472
4968
  var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
4473
4969
 
4474
4970
  if (typeof this.filterOptions.filterAlgorithm === 'function') {
@@ -4498,7 +4994,7 @@
4498
4994
  }
4499
4995
 
4500
4996
  return true;
4501
- }) : this.options.data;
4997
+ }) : _toConsumableArray(this.options.data);
4502
4998
  }
4503
4999
 
4504
5000
  var visibleFields = this.getVisibleFields();
@@ -4516,13 +5012,17 @@
4516
5012
  value = item;
4517
5013
  var props = key.split('.');
4518
5014
 
4519
- for (var _i = 0; _i < props.length; _i++) {
4520
- if (value[props[_i]] !== null) {
4521
- value = value[props[_i]];
5015
+ for (var _i2 = 0; _i2 < props.length; _i2++) {
5016
+ if (value[props[_i2]] !== null) {
5017
+ value = value[props[_i2]];
4522
5018
  }
4523
5019
  }
4524
5020
  } else {
4525
5021
  value = item[key];
5022
+ }
5023
+
5024
+ if (_this5.options.searchAccentNeutralise) {
5025
+ value = Utils.normalizeAccent(value);
4526
5026
  } // Fix #142: respect searchFormatter boolean
4527
5027
 
4528
5028
 
@@ -4570,9 +5070,6 @@
4570
5070
  case '=<l':
4571
5071
  comparisonCheck = int >= comparisonInt;
4572
5072
  break;
4573
-
4574
- default:
4575
- break;
4576
5073
  }
4577
5074
  }
4578
5075
 
@@ -4585,6 +5082,12 @@
4585
5082
 
4586
5083
  return false;
4587
5084
  }) : this.data;
5085
+
5086
+ if (this.options.sortReset) {
5087
+ this.unsortedData = _toConsumableArray(this.data);
5088
+ }
5089
+
5090
+ this.initSort();
4588
5091
  }
4589
5092
  }
4590
5093
  }, {
@@ -4592,16 +5095,16 @@
4592
5095
  value: function initPagination() {
4593
5096
  var _this6 = this;
4594
5097
 
4595
- var o = this.options;
5098
+ var opts = this.options;
4596
5099
 
4597
- if (!o.pagination) {
5100
+ if (!opts.pagination) {
4598
5101
  this.$pagination.hide();
4599
5102
  return;
4600
5103
  }
4601
5104
 
4602
5105
  this.$pagination.show();
4603
5106
  var html = [];
4604
- var $allSelected = false;
5107
+ var allSelected = false;
4605
5108
  var i;
4606
5109
  var from;
4607
5110
  var to;
@@ -4612,41 +5115,50 @@
4612
5115
  var data = this.getData({
4613
5116
  includeHiddenRows: false
4614
5117
  });
4615
- var pageList = o.pageList;
5118
+ var pageList = opts.pageList;
5119
+
5120
+ if (typeof pageList === 'string') {
5121
+ pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
5122
+ }
5123
+
5124
+ pageList = pageList.map(function (value) {
5125
+ if (typeof value === 'string') {
5126
+ return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
5127
+ }
5128
+
5129
+ return value;
5130
+ });
5131
+ this.paginationParts = opts.paginationParts;
5132
+
5133
+ if (typeof this.paginationParts === 'string') {
5134
+ this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
5135
+ }
4616
5136
 
4617
- if (o.sidePagination !== 'server') {
4618
- o.totalRows = data.length;
5137
+ if (opts.sidePagination !== 'server') {
5138
+ opts.totalRows = data.length;
4619
5139
  }
4620
5140
 
4621
5141
  this.totalPages = 0;
4622
5142
 
4623
- if (o.totalRows) {
4624
- if (o.pageSize === o.formatAllRows()) {
4625
- o.pageSize = o.totalRows;
4626
- $allSelected = true;
4627
- } else if (o.pageSize === o.totalRows) {
4628
- // Fix #667 Table with pagination,
4629
- // multiple pages and a search this matches to one page throws exception
4630
- var pageLst = typeof o.pageList === 'string' ? o.pageList.replace('[', '').replace(']', '').replace(/ /g, '').toLowerCase().split(',') : o.pageList;
4631
-
4632
- if (pageLst.includes(o.formatAllRows().toLowerCase())) {
4633
- $allSelected = true;
4634
- }
5143
+ if (opts.totalRows) {
5144
+ if (opts.pageSize === opts.formatAllRows()) {
5145
+ opts.pageSize = opts.totalRows;
5146
+ allSelected = true;
4635
5147
  }
4636
5148
 
4637
- this.totalPages = ~~((o.totalRows - 1) / o.pageSize) + 1;
4638
- o.totalPages = this.totalPages;
5149
+ this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
5150
+ opts.totalPages = this.totalPages;
4639
5151
  }
4640
5152
 
4641
- if (this.totalPages > 0 && o.pageNumber > this.totalPages) {
4642
- o.pageNumber = this.totalPages;
5153
+ if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
5154
+ opts.pageNumber = this.totalPages;
4643
5155
  }
4644
5156
 
4645
- this.pageFrom = (o.pageNumber - 1) * o.pageSize + 1;
4646
- this.pageTo = o.pageNumber * o.pageSize;
5157
+ this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
5158
+ this.pageTo = opts.pageNumber * opts.pageSize;
4647
5159
 
4648
- if (this.pageTo > o.totalRows) {
4649
- this.pageTo = o.totalRows;
5160
+ if (this.pageTo > opts.totalRows) {
5161
+ this.pageTo = opts.totalRows;
4650
5162
  }
4651
5163
 
4652
5164
  if (this.options.pagination && this.options.sidePagination !== 'server') {
@@ -4657,73 +5169,56 @@
4657
5169
  this.options.totalNotFiltered = undefined;
4658
5170
  }
4659
5171
 
4660
- var paginationInfo = o.onlyInfoPagination ? o.formatDetailPagination(o.totalRows) : o.formatShowingRows(this.pageFrom, this.pageTo, o.totalRows, o.totalNotFiltered);
4661
- html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(o.paginationDetailHAlign, " pagination-detail\">\n <span class=\"pagination-info\">\n ").concat(paginationInfo, "\n </span>"));
4662
-
4663
- if (!o.onlyInfoPagination) {
4664
- html.push('<span class="page-list">');
4665
- var pageNumber = ["<span class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n <span class=\"page-size\">\n ").concat($allSelected ? o.formatAllRows() : o.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
4666
-
4667
- if (typeof o.pageList === 'string') {
4668
- var list = o.pageList.replace('[', '').replace(']', '').replace(/ /g, '').split(',');
4669
- pageList = [];
4670
- var _iteratorNormalCompletion = true;
4671
- var _didIteratorError = false;
4672
- var _iteratorError = undefined;
5172
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
5173
+ html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
5174
+ }
4673
5175
 
4674
- try {
4675
- for (var _iterator = list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4676
- var value = _step.value;
4677
- pageList.push(value.toLowerCase() === o.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? o.formatAllRows() : +value);
4678
- }
4679
- } catch (err) {
4680
- _didIteratorError = true;
4681
- _iteratorError = err;
4682
- } finally {
4683
- try {
4684
- if (!_iteratorNormalCompletion && _iterator.return != null) {
4685
- _iterator.return();
4686
- }
4687
- } finally {
4688
- if (_didIteratorError) {
4689
- throw _iteratorError;
4690
- }
4691
- }
4692
- }
4693
- }
5176
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
5177
+ var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
5178
+ html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
5179
+ }
4694
5180
 
5181
+ if (this.paginationParts.includes('pageSize')) {
5182
+ html.push('<span class="page-list">');
5183
+ var pageNumber = ["<span class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
4695
5184
  pageList.forEach(function (page, i) {
4696
- if (!o.smartDisplay || i === 0 || pageList[i - 1] < o.totalRows) {
5185
+ if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows) {
4697
5186
  var active;
4698
5187
 
4699
- if ($allSelected) {
4700
- active = page === o.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
5188
+ if (allSelected) {
5189
+ active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
4701
5190
  } else {
4702
- active = page === o.pageSize ? _this6.constants.classes.dropdownActive : '';
5191
+ active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
4703
5192
  }
4704
5193
 
4705
5194
  pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
4706
5195
  }
4707
5196
  });
4708
5197
  pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</span>"));
4709
- html.push(o.formatRecordsPerPage(pageNumber.join('')));
5198
+ html.push(opts.formatRecordsPerPage(pageNumber.join('')));
5199
+ }
5200
+
5201
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
4710
5202
  html.push('</span></div>');
4711
- html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(o.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', o.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', o.formatSRPaginationPreText(), o.paginationPreText));
5203
+ }
4712
5204
 
4713
- if (this.totalPages < o.paginationSuccessivelySize) {
5205
+ if (this.paginationParts.includes('pageList')) {
5206
+ html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
5207
+
5208
+ if (this.totalPages < opts.paginationSuccessivelySize) {
4714
5209
  from = 1;
4715
5210
  to = this.totalPages;
4716
5211
  } else {
4717
- from = o.pageNumber - o.paginationPagesBySide;
4718
- to = from + o.paginationPagesBySide * 2;
5212
+ from = opts.pageNumber - opts.paginationPagesBySide;
5213
+ to = from + opts.paginationPagesBySide * 2;
4719
5214
  }
4720
5215
 
4721
- if (o.pageNumber < o.paginationSuccessivelySize - 1) {
4722
- to = o.paginationSuccessivelySize;
5216
+ if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
5217
+ to = opts.paginationSuccessivelySize;
4723
5218
  }
4724
5219
 
4725
- if (o.paginationSuccessivelySize > this.totalPages - from) {
4726
- from = from - (o.paginationSuccessivelySize - (this.totalPages - from)) + 1;
5220
+ if (opts.paginationSuccessivelySize > this.totalPages - from) {
5221
+ from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
4727
5222
  }
4728
5223
 
4729
5224
  if (from < 1) {
@@ -4734,15 +5229,15 @@
4734
5229
  to = this.totalPages;
4735
5230
  }
4736
5231
 
4737
- var middleSize = Math.round(o.paginationPagesBySide / 2);
5232
+ var middleSize = Math.round(opts.paginationPagesBySide / 2);
4738
5233
 
4739
5234
  var pageItem = function pageItem(i) {
4740
5235
  var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4741
- return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === o.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), o.formatSRPaginationPageText(i), i);
5236
+ return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
4742
5237
  };
4743
5238
 
4744
5239
  if (from > 1) {
4745
- var max = o.paginationPagesBySide;
5240
+ var max = opts.paginationPagesBySide;
4746
5241
  if (max >= from) max = from - 1;
4747
5242
 
4748
5243
  for (i = 1; i <= max; i++) {
@@ -4754,7 +5249,7 @@
4754
5249
  html.push(pageItem(i));
4755
5250
  } else {
4756
5251
  if (from - 1 > max) {
4757
- if (from - o.paginationPagesBySide * 2 > o.paginationPagesBySide && o.paginationUseIntermediate) {
5252
+ if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
4758
5253
  i = Math.round((from - middleSize) / 2 + middleSize);
4759
5254
  html.push(pageItem(i, ' page-intermediate'));
4760
5255
  } else {
@@ -4769,7 +5264,7 @@
4769
5264
  }
4770
5265
 
4771
5266
  if (this.totalPages > to) {
4772
- var min = this.totalPages - (o.paginationPagesBySide - 1);
5267
+ var min = this.totalPages - (opts.paginationPagesBySide - 1);
4773
5268
  if (to >= min) min = to + 1;
4774
5269
 
4775
5270
  if (to + 1 === min - 1) {
@@ -4777,7 +5272,7 @@
4777
5272
  html.push(pageItem(i));
4778
5273
  } else {
4779
5274
  if (min > to + 1) {
4780
- if (this.totalPages - to > o.paginationPagesBySide * 2 && o.paginationUseIntermediate) {
5275
+ if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
4781
5276
  i = Math.round((this.totalPages - middleSize - to) / 2 + to);
4782
5277
  html.push(pageItem(i, ' page-intermediate'));
4783
5278
  } else {
@@ -4791,15 +5286,15 @@
4791
5286
  }
4792
5287
  }
4793
5288
 
4794
- html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', o.formatSRPaginationNextText(), o.paginationNextText));
5289
+ html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
4795
5290
  html.push(this.constants.html.pagination[1], '</div>');
4796
5291
  }
4797
5292
 
4798
5293
  this.$pagination.html(html.join(''));
4799
- var dropupClass = ['bottom', 'both'].includes(o.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
5294
+ var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
4800
5295
  this.$pagination.last().find('.page-list > span').addClass(dropupClass);
4801
5296
 
4802
- if (!o.onlyInfoPagination) {
5297
+ if (!opts.onlyInfoPagination) {
4803
5298
  $pageList = this.$pagination.find('.page-list a');
4804
5299
  $pre = this.$pagination.find('.page-pre');
4805
5300
  $next = this.$pagination.find('.page-next');
@@ -4809,8 +5304,8 @@
4809
5304
  this.$pagination.find('div.pagination').hide();
4810
5305
  }
4811
5306
 
4812
- if (o.smartDisplay) {
4813
- if (pageList.length < 2 || o.totalRows <= pageList[0]) {
5307
+ if (opts.smartDisplay) {
5308
+ if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
4814
5309
  this.$pagination.find('span.page-list').hide();
4815
5310
  }
4816
5311
  } // when data is empty, hide the pagination
@@ -4818,18 +5313,18 @@
4818
5313
 
4819
5314
  this.$pagination[this.getData().length ? 'show' : 'hide']();
4820
5315
 
4821
- if (!o.paginationLoop) {
4822
- if (o.pageNumber === 1) {
5316
+ if (!opts.paginationLoop) {
5317
+ if (opts.pageNumber === 1) {
4823
5318
  $pre.addClass('disabled');
4824
5319
  }
4825
5320
 
4826
- if (o.pageNumber === this.totalPages) {
5321
+ if (opts.pageNumber === this.totalPages) {
4827
5322
  $next.addClass('disabled');
4828
5323
  }
4829
5324
  }
4830
5325
 
4831
- if ($allSelected) {
4832
- o.pageSize = o.formatAllRows();
5326
+ if (allSelected) {
5327
+ opts.pageSize = opts.formatAllRows();
4833
5328
  } // removed the events for last and first, onPageNumber executeds the same logic
4834
5329
 
4835
5330
 
@@ -4860,14 +5355,13 @@
4860
5355
  }
4861
5356
 
4862
5357
  this.initPagination();
5358
+ this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
4863
5359
 
4864
5360
  if (this.options.sidePagination === 'server') {
4865
5361
  this.initServer();
4866
5362
  } else {
4867
5363
  this.initBody();
4868
5364
  }
4869
-
4870
- this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
4871
5365
  }
4872
5366
  }, {
4873
5367
  key: "onPageListChange",
@@ -4940,10 +5434,10 @@
4940
5434
  style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
4941
5435
 
4942
5436
  if (style && style.css) {
4943
- for (var _i2 = 0, _Object$entries = Object.entries(style.css); _i2 < _Object$entries.length; _i2++) {
4944
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
4945
- key = _Object$entries$_i[0],
4946
- value = _Object$entries$_i[1];
5437
+ for (var _i3 = 0, _Object$entries2 = Object.entries(style.css); _i3 < _Object$entries2.length; _i3++) {
5438
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
5439
+ key = _Object$entries2$_i[0],
5440
+ value = _Object$entries2$_i[1];
4947
5441
 
4948
5442
  csses.push("".concat(key, ": ").concat(value));
4949
5443
  }
@@ -4952,20 +5446,20 @@
4952
5446
  attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
4953
5447
 
4954
5448
  if (attributes) {
4955
- for (var _i3 = 0, _Object$entries2 = Object.entries(attributes); _i3 < _Object$entries2.length; _i3++) {
4956
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
4957
- key = _Object$entries2$_i[0],
4958
- value = _Object$entries2$_i[1];
5449
+ for (var _i4 = 0, _Object$entries3 = Object.entries(attributes); _i4 < _Object$entries3.length; _i4++) {
5450
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i4], 2),
5451
+ _key2 = _Object$entries3$_i[0],
5452
+ _value = _Object$entries3$_i[1];
4959
5453
 
4960
- htmlAttributes.push("".concat(key, "=\"").concat(Utils.escapeHTML(value), "\""));
5454
+ htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
4961
5455
  }
4962
5456
  }
4963
5457
 
4964
5458
  if (item._data && !Utils.isEmptyObject(item._data)) {
4965
- for (var _i4 = 0, _Object$entries3 = Object.entries(item._data); _i4 < _Object$entries3.length; _i4++) {
4966
- var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i4], 2),
4967
- k = _Object$entries3$_i[0],
4968
- v = _Object$entries3$_i[1];
5459
+ for (var _i5 = 0, _Object$entries4 = Object.entries(item._data); _i5 < _Object$entries4.length; _i5++) {
5460
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i5], 2),
5461
+ k = _Object$entries4$_i[0],
5462
+ v = _Object$entries4$_i[1];
4969
5463
 
4970
5464
  // ignore data-index
4971
5465
  if (k === 'index') {
@@ -4976,20 +5470,26 @@
4976
5470
  }
4977
5471
  }
4978
5472
 
4979
- html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', !this.options.cardView && this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
5473
+ html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
4980
5474
 
4981
5475
  if (this.options.cardView) {
4982
5476
  html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
4983
5477
  }
4984
5478
 
4985
- if (!this.options.cardView && this.options.detailView && this.options.detailViewIcon) {
4986
- html.push('<td>');
5479
+ var detailViewTemplate = '';
5480
+
5481
+ if (Utils.hasDetailViewIcon(this.options)) {
5482
+ detailViewTemplate = '<td>';
4987
5483
 
4988
5484
  if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
4989
- html.push("\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n "));
5485
+ detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
4990
5486
  }
4991
5487
 
4992
- html.push('</td>');
5488
+ detailViewTemplate += '</td>';
5489
+ }
5490
+
5491
+ if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
5492
+ html.push(detailViewTemplate);
4993
5493
  }
4994
5494
 
4995
5495
  this.header.fields.forEach(function (field, j) {
@@ -5007,7 +5507,7 @@
5007
5507
  var title_ = '';
5008
5508
  var column = _this7.columns[j];
5009
5509
 
5010
- if (_this7.fromHtml && typeof value_ === 'undefined') {
5510
+ if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
5011
5511
  if (!column.checkbox && !column.radio) {
5012
5512
  return;
5013
5513
  }
@@ -5027,7 +5527,7 @@
5027
5527
 
5028
5528
  if (csses.concat([_this7.header.styles[j]]).length) {
5029
5529
  style_ = " style=\"".concat(csses.concat([_this7.header.styles[j]]).join('; '), "\"");
5030
- } // handle td's id and class
5530
+ } // handle id and class of td
5031
5531
 
5032
5532
 
5033
5533
  if (item["_".concat(field, "_id")]) {
@@ -5059,12 +5559,12 @@
5059
5559
  if (cellStyle.css) {
5060
5560
  var csses_ = [];
5061
5561
 
5062
- for (var _i5 = 0, _Object$entries4 = Object.entries(cellStyle.css); _i5 < _Object$entries4.length; _i5++) {
5063
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i5], 2),
5064
- key = _Object$entries4$_i[0],
5065
- _value = _Object$entries4$_i[1];
5562
+ for (var _i6 = 0, _Object$entries5 = Object.entries(cellStyle.css); _i6 < _Object$entries5.length; _i6++) {
5563
+ var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i6], 2),
5564
+ _key3 = _Object$entries5$_i[0],
5565
+ _value2 = _Object$entries5$_i[1];
5066
5566
 
5067
- csses_.push("".concat(key, ": ").concat(_value));
5567
+ csses_.push("".concat(_key3, ": ").concat(_value2));
5068
5568
  }
5069
5569
 
5070
5570
  style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
@@ -5073,17 +5573,17 @@
5073
5573
  value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
5074
5574
 
5075
5575
  if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
5076
- for (var _i6 = 0, _Object$entries5 = Object.entries(item["_".concat(field, "_data")]); _i6 < _Object$entries5.length; _i6++) {
5077
- var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i6], 2),
5078
- k = _Object$entries5$_i[0],
5079
- v = _Object$entries5$_i[1];
5576
+ for (var _i7 = 0, _Object$entries6 = Object.entries(item["_".concat(field, "_data")]); _i7 < _Object$entries6.length; _i7++) {
5577
+ var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
5578
+ _k = _Object$entries6$_i[0],
5579
+ _v = _Object$entries6$_i[1];
5080
5580
 
5081
5581
  // ignore data-index
5082
- if (k === 'index') {
5582
+ if (_k === 'index') {
5083
5583
  return;
5084
5584
  }
5085
5585
 
5086
- data_ += " data-".concat(k, "=\"").concat(v, "\"");
5586
+ data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
5087
5587
  }
5088
5588
  }
5089
5589
 
@@ -5113,6 +5613,10 @@
5113
5613
  html.push(text);
5114
5614
  });
5115
5615
 
5616
+ if (detailViewTemplate && this.options.detailViewAlign === 'right') {
5617
+ html.push(detailViewTemplate);
5618
+ }
5619
+
5116
5620
  if (this.options.cardView) {
5117
5621
  html.push('</div></td>');
5118
5622
  }
@@ -5142,6 +5646,7 @@
5142
5646
  var rows = [];
5143
5647
  var trFragments = $(document.createDocumentFragment());
5144
5648
  var hasTr = false;
5649
+ this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
5145
5650
 
5146
5651
  for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
5147
5652
  var item = data[i];
@@ -5159,7 +5664,7 @@
5159
5664
 
5160
5665
 
5161
5666
  if (!hasTr) {
5162
- this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.$header.find('th').length, this.options.formatNoMatches()), "</tr>"));
5667
+ this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length, this.options.formatNoMatches()), "</tr>"));
5163
5668
  } else {
5164
5669
  if (!this.options.virtualScroll) {
5165
5670
  this.$body.html(trFragments);
@@ -5170,11 +5675,14 @@
5170
5675
 
5171
5676
  this.virtualScroll = new VirtualScroll({
5172
5677
  rows: rows,
5678
+ fixedScroll: fixedScroll,
5173
5679
  scrollEl: this.$tableBody[0],
5174
5680
  contentEl: this.$body[0],
5175
5681
  itemHeight: this.options.virtualScrollItemHeight,
5176
5682
  callback: function callback() {
5177
5683
  _this8.fitHeader();
5684
+
5685
+ _this8.initBodyEvent();
5178
5686
  }
5179
5687
  });
5180
5688
  }
@@ -5182,53 +5690,69 @@
5182
5690
 
5183
5691
  if (!fixedScroll) {
5184
5692
  this.scrollTo(0);
5185
- } // click to select by column
5693
+ }
5694
+
5695
+ this.initBodyEvent();
5696
+ this.updateSelected();
5697
+ this.initFooter();
5698
+ this.resetView();
5699
+
5700
+ if (this.options.sidePagination !== 'server') {
5701
+ this.options.totalRows = data.length;
5702
+ }
5186
5703
 
5704
+ this.trigger('post-body', data);
5705
+ }
5706
+ }, {
5707
+ key: "initBodyEvent",
5708
+ value: function initBodyEvent() {
5709
+ var _this9 = this;
5187
5710
 
5711
+ // click to select by column
5188
5712
  this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
5189
5713
  var $td = $(e.currentTarget);
5190
5714
  var $tr = $td.parent();
5191
5715
  var $cardViewArr = $(e.target).parents('.card-views').children();
5192
5716
  var $cardViewTarget = $(e.target).parents('.card-view');
5193
5717
  var rowIndex = $tr.data('index');
5194
- var item = _this8.data[rowIndex];
5195
- var index = _this8.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
5718
+ var item = _this9.data[rowIndex];
5719
+ var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
5196
5720
 
5197
- var fields = _this8.getVisibleFields();
5721
+ var fields = _this9.getVisibleFields();
5198
5722
 
5199
- var field = fields[_this8.options.detailView && _this8.detailViewIcon && !_this8.options.cardView ? index - 1 : index];
5200
- var column = _this8.columns[_this8.fieldsColumnsIndex[field]];
5201
- var value = Utils.getItemField(item, field, _this8.options.escape);
5723
+ var field = fields[Utils.hasDetailViewIcon(_this9.options) && _this9.options.detailViewAlign !== 'right' ? index - 1 : index];
5724
+ var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
5725
+ var value = Utils.getItemField(item, field, _this9.options.escape);
5202
5726
 
5203
5727
  if ($td.find('.detail-icon').length) {
5204
5728
  return;
5205
5729
  }
5206
5730
 
5207
- _this8.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
5731
+ _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
5208
5732
 
5209
- _this8.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field); // if click to select - then trigger the checkbox/radio click
5733
+ _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field); // if click to select - then trigger the checkbox/radio click
5210
5734
 
5211
5735
 
5212
- if (e.type === 'click' && _this8.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this8.options, _this8.options.ignoreClickToSelectOn, [e.target])) {
5213
- var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this8.options.selectItemName));
5736
+ if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
5737
+ var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
5214
5738
 
5215
5739
  if ($selectItem.length) {
5216
5740
  $selectItem[0].click();
5217
5741
  }
5218
5742
  }
5219
5743
 
5220
- if (e.type === 'click' && _this8.options.detailViewByClick) {
5221
- _this8.toggleDetailView(rowIndex, _this8.header.detailFormatters[_this8.fieldsColumnsIndex[field]]);
5744
+ if (e.type === 'click' && _this9.options.detailViewByClick) {
5745
+ _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
5222
5746
  }
5223
5747
  }).off('mousedown').on('mousedown', function (e) {
5224
5748
  // https://github.com/jquery/jquery/issues/1741
5225
- _this8.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
5226
- _this8.multipleSelectRowShiftKey = e.shiftKey;
5749
+ _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
5750
+ _this9.multipleSelectRowShiftKey = e.shiftKey;
5227
5751
  });
5228
5752
  this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
5229
5753
  e.preventDefault();
5230
5754
 
5231
- _this8.toggleDetailView($(e.currentTarget).parent().parent().data('index'));
5755
+ _this9.toggleDetailView($(e.currentTarget).parent().parent().data('index'));
5232
5756
 
5233
5757
  return false;
5234
5758
  });
@@ -5237,7 +5761,7 @@
5237
5761
  e.stopImmediatePropagation();
5238
5762
  var $this = $(e.currentTarget);
5239
5763
 
5240
- _this8._toggleCheck($this.prop('checked'), $this.data('index'));
5764
+ _this9._toggleCheck($this.prop('checked'), $this.data('index'));
5241
5765
  });
5242
5766
  this.header.events.forEach(function (_events, i) {
5243
5767
  var events = _events;
@@ -5251,15 +5775,15 @@
5251
5775
  events = Utils.calculateObjectValue(null, events);
5252
5776
  }
5253
5777
 
5254
- var field = _this8.header.fields[i];
5778
+ var field = _this9.header.fields[i];
5255
5779
 
5256
- var fieldIndex = _this8.getVisibleFields().indexOf(field);
5780
+ var fieldIndex = _this9.getVisibleFields().indexOf(field);
5257
5781
 
5258
5782
  if (fieldIndex === -1) {
5259
5783
  return;
5260
5784
  }
5261
5785
 
5262
- if (_this8.options.detailView && !_this8.options.cardView) {
5786
+ if (Utils.hasDetailViewIcon(_this9.options) && _this9.options.detailViewAlign !== 'right') {
5263
5787
  fieldIndex += 1;
5264
5788
  }
5265
5789
 
@@ -5270,17 +5794,17 @@
5270
5794
 
5271
5795
  var event = events[key];
5272
5796
 
5273
- _this8.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
5797
+ _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
5274
5798
  var $tr = $(tr);
5275
- var $td = $tr.find(_this8.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
5799
+ var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
5276
5800
  var index = key.indexOf(' ');
5277
5801
  var name = key.substring(0, index);
5278
5802
  var el = key.substring(index + 1);
5279
5803
  $td.find(el).off(name).on(name, function (e) {
5280
5804
  var index = $tr.data('index');
5281
- var row = _this8.data[index];
5805
+ var row = _this9.data[index];
5282
5806
  var value = row[field];
5283
- event.apply(_this8, [e, value, row, index]);
5807
+ event.apply(_this9, [e, value, row, index]);
5284
5808
  });
5285
5809
  });
5286
5810
  };
@@ -5291,20 +5815,11 @@
5291
5815
  if (_ret === "continue") continue;
5292
5816
  }
5293
5817
  });
5294
- this.updateSelected();
5295
- this.initFooter();
5296
- this.resetView();
5297
-
5298
- if (this.options.sidePagination !== 'server') {
5299
- this.options.totalRows = data.length;
5300
- }
5301
-
5302
- this.trigger('post-body', data);
5303
5818
  }
5304
5819
  }, {
5305
5820
  key: "initServer",
5306
5821
  value: function initServer(silent, query, url) {
5307
- var _this9 = this;
5822
+ var _this10 = this;
5308
5823
 
5309
5824
  var data = {};
5310
5825
  var index = this.header.fields.indexOf(this.options.sortName);
@@ -5344,6 +5859,38 @@
5344
5859
  }
5345
5860
  }
5346
5861
 
5862
+ if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
5863
+ return !column.searchable;
5864
+ }).length) {
5865
+ params.searchable = [];
5866
+ var _iteratorNormalCompletion2 = true;
5867
+ var _didIteratorError2 = false;
5868
+ var _iteratorError2 = undefined;
5869
+
5870
+ try {
5871
+ for (var _iterator2 = this.columns[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
5872
+ var column = _step2.value;
5873
+
5874
+ if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
5875
+ params.searchable.push(column.field);
5876
+ }
5877
+ }
5878
+ } catch (err) {
5879
+ _didIteratorError2 = true;
5880
+ _iteratorError2 = err;
5881
+ } finally {
5882
+ try {
5883
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
5884
+ _iterator2.return();
5885
+ }
5886
+ } finally {
5887
+ if (_didIteratorError2) {
5888
+ throw _iteratorError2;
5889
+ }
5890
+ }
5891
+ }
5892
+ }
5893
+
5347
5894
  if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
5348
5895
  params.filter = JSON.stringify(this.filterColumnsPartial, null);
5349
5896
  }
@@ -5366,31 +5913,35 @@
5366
5913
  cache: this.options.cache,
5367
5914
  contentType: this.options.contentType,
5368
5915
  dataType: this.options.dataType,
5369
- success: function success(_res) {
5370
- var res = Utils.calculateObjectValue(_this9.options, _this9.options.responseHandler, [_res], _res);
5916
+ success: function success(_res, textStatus, jqXHR) {
5917
+ var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
5371
5918
 
5372
- _this9.load(res);
5919
+ _this10.load(res);
5373
5920
 
5374
- _this9.trigger('load-success', res);
5921
+ _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
5375
5922
 
5376
5923
  if (!silent) {
5377
- _this9.hideLoading();
5924
+ _this10.hideLoading();
5925
+ }
5926
+
5927
+ if (_this10.options.sidePagination === 'server' && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
5928
+ _this10.updatePagination();
5378
5929
  }
5379
5930
  },
5380
5931
  error: function error(jqXHR) {
5381
5932
  var data = [];
5382
5933
 
5383
- if (_this9.options.sidePagination === 'server') {
5934
+ if (_this10.options.sidePagination === 'server') {
5384
5935
  data = {};
5385
- data[_this9.options.totalField] = 0;
5386
- data[_this9.options.dataField] = [];
5936
+ data[_this10.options.totalField] = 0;
5937
+ data[_this10.options.dataField] = [];
5387
5938
  }
5388
5939
 
5389
- _this9.load(data);
5940
+ _this10.load(data);
5390
5941
 
5391
- _this9.trigger('load-error', jqXHR.status, jqXHR);
5942
+ _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
5392
5943
 
5393
- if (!silent) _this9.$tableLoading.hide();
5944
+ if (!silent) _this10.$tableLoading.hide();
5394
5945
  }
5395
5946
  });
5396
5947
 
@@ -5425,10 +5976,10 @@
5425
5976
  }, {
5426
5977
  key: "getCaret",
5427
5978
  value: function getCaret() {
5428
- var _this10 = this;
5979
+ var _this11 = this;
5429
5980
 
5430
5981
  this.$header.find('th').each(function (i, th) {
5431
- $(th).find('.sortable').removeClass('desc asc').addClass($(th).data('field') === _this10.options.sortName ? _this10.options.sortOrder : 'both');
5982
+ $(th).find('.sortable').removeClass('desc asc').addClass($(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
5432
5983
  });
5433
5984
  }
5434
5985
  }, {
@@ -5443,22 +5994,22 @@
5443
5994
  }, {
5444
5995
  key: "updateRows",
5445
5996
  value: function updateRows() {
5446
- var _this11 = this;
5997
+ var _this12 = this;
5447
5998
 
5448
5999
  this.$selectItem.each(function (i, el) {
5449
- _this11.data[$(el).data('index')][_this11.header.stateField] = $(el).prop('checked');
6000
+ _this12.data[$(el).data('index')][_this12.header.stateField] = $(el).prop('checked');
5450
6001
  });
5451
6002
  }
5452
6003
  }, {
5453
6004
  key: "resetRows",
5454
6005
  value: function resetRows() {
5455
- var _iteratorNormalCompletion2 = true;
5456
- var _didIteratorError2 = false;
5457
- var _iteratorError2 = undefined;
6006
+ var _iteratorNormalCompletion3 = true;
6007
+ var _didIteratorError3 = false;
6008
+ var _iteratorError3 = undefined;
5458
6009
 
5459
6010
  try {
5460
- for (var _iterator2 = this.data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
5461
- var row = _step2.value;
6011
+ for (var _iterator3 = this.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
6012
+ var row = _step3.value;
5462
6013
  this.$selectAll.prop('checked', false);
5463
6014
  this.$selectItem.prop('checked', false);
5464
6015
 
@@ -5467,16 +6018,16 @@
5467
6018
  }
5468
6019
  }
5469
6020
  } catch (err) {
5470
- _didIteratorError2 = true;
5471
- _iteratorError2 = err;
6021
+ _didIteratorError3 = true;
6022
+ _iteratorError3 = err;
5472
6023
  } finally {
5473
6024
  try {
5474
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
5475
- _iterator2.return();
6025
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
6026
+ _iterator3.return();
5476
6027
  }
5477
6028
  } finally {
5478
- if (_didIteratorError2) {
5479
- throw _iteratorError2;
6029
+ if (_didIteratorError3) {
6030
+ throw _iteratorError3;
5480
6031
  }
5481
6032
  }
5482
6033
  }
@@ -5490,8 +6041,8 @@
5490
6041
 
5491
6042
  var name = "".concat(_name, ".bs.table");
5492
6043
 
5493
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
5494
- args[_key2 - 1] = arguments[_key2];
6044
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
6045
+ args[_key4 - 1] = arguments[_key4];
5495
6046
  }
5496
6047
 
5497
6048
  (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, args);
@@ -5503,23 +6054,23 @@
5503
6054
  }, {
5504
6055
  key: "resetHeader",
5505
6056
  value: function resetHeader() {
5506
- var _this12 = this;
6057
+ var _this13 = this;
5507
6058
 
5508
6059
  // fix #61: the hidden table reset header bug.
5509
6060
  // fix bug: get $el.css('width') error sometime (height = 500)
5510
6061
  clearTimeout(this.timeoutId_);
5511
6062
  this.timeoutId_ = setTimeout(function () {
5512
- return _this12.fitHeader();
6063
+ return _this13.fitHeader();
5513
6064
  }, this.$el.is(':hidden') ? 100 : 0);
5514
6065
  }
5515
6066
  }, {
5516
6067
  key: "fitHeader",
5517
6068
  value: function fitHeader() {
5518
- var _this13 = this;
6069
+ var _this14 = this;
5519
6070
 
5520
6071
  if (this.$el.is(':hidden')) {
5521
6072
  this.timeoutId_ = setTimeout(function () {
5522
- return _this13.fitHeader();
6073
+ return _this14.fitHeader();
5523
6074
  }, 100);
5524
6075
  return;
5525
6076
  }
@@ -5558,7 +6109,7 @@
5558
6109
 
5559
6110
 
5560
6111
  this.$header.find('th[data-field]').each(function (i, el) {
5561
- _this13.$header_.find(Utils.sprintf('th[data-field="%s"]', $(el).data('field'))).data($(el).data());
6112
+ _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $(el).data('field'))).data($(el).data());
5562
6113
  });
5563
6114
  var visibleFields = this.getVisibleFields();
5564
6115
  var $ths = this.$header_.find('th');
@@ -5568,27 +6119,24 @@
5568
6119
  $tr = $tr.next();
5569
6120
  }
5570
6121
 
6122
+ var trLength = $tr.find('> *').length;
5571
6123
  $tr.find('> *').each(function (i, el) {
5572
6124
  var $this = $(el);
5573
- var index = i;
5574
6125
 
5575
- if (_this13.options.detailView && _this13.options.detailViewIcon && !_this13.options.cardView) {
5576
- if (i === 0) {
6126
+ if (Utils.hasDetailViewIcon(_this14.options)) {
6127
+ if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
5577
6128
  var $thDetail = $ths.filter('.detail');
5578
6129
 
5579
6130
  var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
5580
6131
 
5581
6132
  $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
6133
+ return;
5582
6134
  }
5583
-
5584
- index = i - 1;
5585
6135
  }
5586
6136
 
5587
- if (index === -1) {
5588
- return;
5589
- }
6137
+ var index = Utils.hasDetailViewIcon(_this14.options) && _this14.options.detailViewAlign !== 'right' ? i - 1 : i;
5590
6138
 
5591
- var $th = _this13.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
6139
+ var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
5592
6140
 
5593
6141
  if ($th.length > 1) {
5594
6142
  $th = $($ths[$this[0].cellIndex]);
@@ -5610,18 +6158,23 @@
5610
6158
 
5611
6159
  var data = this.getData();
5612
6160
  var html = [];
6161
+ var detailTemplate = '';
5613
6162
 
5614
- if (!this.options.cardView && this.options.detailView && this.options.detailViewIcon) {
5615
- html.push('<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>');
6163
+ if (Utils.hasDetailViewIcon(this.options)) {
6164
+ detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
5616
6165
  }
5617
6166
 
5618
- var _iteratorNormalCompletion3 = true;
5619
- var _didIteratorError3 = false;
5620
- var _iteratorError3 = undefined;
6167
+ if (detailTemplate && this.options.detailViewAlign !== 'right') {
6168
+ html.push(detailTemplate);
6169
+ }
6170
+
6171
+ var _iteratorNormalCompletion4 = true;
6172
+ var _didIteratorError4 = false;
6173
+ var _iteratorError4 = undefined;
5621
6174
 
5622
6175
  try {
5623
- for (var _iterator3 = this.columns[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
5624
- var column = _step3.value;
6176
+ for (var _iterator4 = this.columns[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
6177
+ var column = _step4.value;
5625
6178
  var falign = '';
5626
6179
  var valign = '';
5627
6180
  var csses = [];
@@ -5641,10 +6194,10 @@
5641
6194
  style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
5642
6195
 
5643
6196
  if (style && style.css) {
5644
- for (var _i7 = 0, _Object$entries6 = Object.entries(style.css); _i7 < _Object$entries6.length; _i7++) {
5645
- var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
5646
- key = _Object$entries6$_i[0],
5647
- value = _Object$entries6$_i[1];
6197
+ for (var _i8 = 0, _Object$entries7 = Object.entries(style.css); _i8 < _Object$entries7.length; _i8++) {
6198
+ var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
6199
+ key = _Object$entries7$_i[0],
6200
+ value = _Object$entries7$_i[1];
5648
6201
 
5649
6202
  csses.push("".concat(key, ": ").concat(value));
5650
6203
  }
@@ -5663,31 +6216,40 @@
5663
6216
  html.push('</th>');
5664
6217
  }
5665
6218
  } catch (err) {
5666
- _didIteratorError3 = true;
5667
- _iteratorError3 = err;
6219
+ _didIteratorError4 = true;
6220
+ _iteratorError4 = err;
5668
6221
  } finally {
5669
6222
  try {
5670
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
5671
- _iterator3.return();
6223
+ if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
6224
+ _iterator4.return();
5672
6225
  }
5673
6226
  } finally {
5674
- if (_didIteratorError3) {
5675
- throw _iteratorError3;
6227
+ if (_didIteratorError4) {
6228
+ throw _iteratorError4;
5676
6229
  }
5677
6230
  }
5678
6231
  }
5679
6232
 
6233
+ if (detailTemplate && this.options.detailViewAlign === 'right') {
6234
+ html.push(detailTemplate);
6235
+ }
6236
+
6237
+ if (!this.options.height && !this.$tableFooter.length) {
6238
+ this.$el.append('<tfoot><tr></tr></tfoot>');
6239
+ this.$tableFooter = this.$el.find('tfoot');
6240
+ }
6241
+
5680
6242
  this.$tableFooter.find('tr').html(html.join(''));
5681
6243
  this.trigger('post-footer', this.$tableFooter);
5682
6244
  }
5683
6245
  }, {
5684
6246
  key: "fitFooter",
5685
6247
  value: function fitFooter() {
5686
- var _this14 = this;
6248
+ var _this15 = this;
5687
6249
 
5688
6250
  if (this.$el.is(':hidden')) {
5689
6251
  setTimeout(function () {
5690
- return _this14.fitFooter();
6252
+ return _this15.fitFooter();
5691
6253
  }, 100);
5692
6254
  return;
5693
6255
  }
@@ -5703,24 +6265,19 @@
5703
6265
  $tr = $tr.next();
5704
6266
  }
5705
6267
 
6268
+ var trLength = $tr.find('> *').length;
5706
6269
  $tr.find('> *').each(function (i, el) {
5707
6270
  var $this = $(el);
5708
- var index = i;
5709
6271
 
5710
- if (_this14.options.detailView && !_this14.options.cardView) {
5711
- if (i === 0) {
6272
+ if (Utils.hasDetailViewIcon(_this15.options)) {
6273
+ if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
5712
6274
  var $thDetail = $ths.filter('.detail');
5713
6275
 
5714
6276
  var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
5715
6277
 
5716
6278
  $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
6279
+ return;
5717
6280
  }
5718
-
5719
- index = i - 1;
5720
- }
5721
-
5722
- if (index === -1) {
5723
- return;
5724
6281
  }
5725
6282
 
5726
6283
  var $th = $ths.eq(i);
@@ -5732,34 +6289,35 @@
5732
6289
  }, {
5733
6290
  key: "horizontalScroll",
5734
6291
  value: function horizontalScroll() {
5735
- var _this15 = this;
6292
+ var _this16 = this;
5736
6293
 
5737
6294
  // horizontal scroll event
5738
6295
  // TODO: it's probably better improving the layout than binding to scroll event
5739
- this.trigger('scroll-body');
5740
- this.$tableBody.off('scroll').on('scroll', function (_ref6) {
5741
- var currentTarget = _ref6.currentTarget;
6296
+ this.$tableBody.off('scroll').on('scroll', function () {
6297
+ var scrollLeft = _this16.$tableBody.scrollLeft();
5742
6298
 
5743
- if (_this15.options.showHeader && _this15.options.height) {
5744
- _this15.$tableHeader.scrollLeft($(currentTarget).scrollLeft());
6299
+ if (_this16.options.showHeader && _this16.options.height) {
6300
+ _this16.$tableHeader.scrollLeft(scrollLeft);
5745
6301
  }
5746
6302
 
5747
- if (_this15.options.showFooter && !_this15.options.cardView) {
5748
- _this15.$tableFooter.scrollLeft($(currentTarget).scrollLeft());
6303
+ if (_this16.options.showFooter && !_this16.options.cardView) {
6304
+ _this16.$tableFooter.scrollLeft(scrollLeft);
5749
6305
  }
6306
+
6307
+ _this16.trigger('scroll-body', _this16.$tableBody);
5750
6308
  });
5751
6309
  }
5752
6310
  }, {
5753
6311
  key: "getVisibleFields",
5754
6312
  value: function getVisibleFields() {
5755
6313
  var visibleFields = [];
5756
- var _iteratorNormalCompletion4 = true;
5757
- var _didIteratorError4 = false;
5758
- var _iteratorError4 = undefined;
6314
+ var _iteratorNormalCompletion5 = true;
6315
+ var _didIteratorError5 = false;
6316
+ var _iteratorError5 = undefined;
5759
6317
 
5760
6318
  try {
5761
- for (var _iterator4 = this.header.fields[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
5762
- var field = _step4.value;
6319
+ for (var _iterator5 = this.header.fields[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
6320
+ var field = _step5.value;
5763
6321
  var column = this.columns[this.fieldsColumnsIndex[field]];
5764
6322
 
5765
6323
  if (!column || !column.visible) {
@@ -5769,16 +6327,16 @@
5769
6327
  visibleFields.push(field);
5770
6328
  }
5771
6329
  } catch (err) {
5772
- _didIteratorError4 = true;
5773
- _iteratorError4 = err;
6330
+ _didIteratorError5 = true;
6331
+ _iteratorError5 = err;
5774
6332
  } finally {
5775
6333
  try {
5776
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
5777
- _iterator4.return();
6334
+ if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
6335
+ _iterator5.return();
5778
6336
  }
5779
6337
  } finally {
5780
- if (_didIteratorError4) {
5781
- throw _iteratorError4;
6338
+ if (_didIteratorError5) {
6339
+ throw _iteratorError5;
5782
6340
  }
5783
6341
  }
5784
6342
  }
@@ -5816,9 +6374,11 @@
5816
6374
  }, {
5817
6375
  key: "getData",
5818
6376
  value: function getData(params) {
6377
+ var _this17 = this;
6378
+
5819
6379
  var data = this.options.data;
5820
6380
 
5821
- if (this.searchText || this.options.sortName || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) {
6381
+ if ((this.searchText || this.options.customSearch || this.options.sortName || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
5822
6382
  data = this.data;
5823
6383
  }
5824
6384
 
@@ -5833,25 +6393,43 @@
5833
6393
  });
5834
6394
  }
5835
6395
 
6396
+ if (params && params.formatted) {
6397
+ data.forEach(function (row) {
6398
+ for (var _i9 = 0, _Object$entries8 = Object.entries(row); _i9 < _Object$entries8.length; _i9++) {
6399
+ var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
6400
+ key = _Object$entries8$_i[0],
6401
+ value = _Object$entries8$_i[1];
6402
+
6403
+ var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
6404
+
6405
+ if (!column) {
6406
+ return;
6407
+ }
6408
+
6409
+ row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
6410
+ }
6411
+ });
6412
+ }
6413
+
5836
6414
  return data;
5837
6415
  }
5838
6416
  }, {
5839
6417
  key: "getSelections",
5840
6418
  value: function getSelections() {
5841
- var _this16 = this;
6419
+ var _this18 = this;
5842
6420
 
5843
6421
  // fix #2424: from html with checkbox
5844
6422
  return this.data.filter(function (row) {
5845
- return row[_this16.header.stateField] === true;
6423
+ return row[_this18.header.stateField] === true;
5846
6424
  });
5847
6425
  }
5848
6426
  }, {
5849
6427
  key: "getAllSelections",
5850
6428
  value: function getAllSelections() {
5851
- var _this17 = this;
6429
+ var _this19 = this;
5852
6430
 
5853
6431
  return this.options.data.filter(function (row) {
5854
- return row[_this17.header.stateField] === true;
6432
+ return row[_this19.header.stateField] === true;
5855
6433
  });
5856
6434
  }
5857
6435
  }, {
@@ -5905,13 +6483,18 @@
5905
6483
  }
5906
6484
 
5907
6485
  for (i = len - 1; i >= 0; i--) {
6486
+ var exists = false;
5908
6487
  row = this.options.data[i];
5909
6488
 
5910
- if (!row.hasOwnProperty(params.field)) {
6489
+ if (!row.hasOwnProperty(params.field) && params.field !== '$index') {
5911
6490
  continue;
6491
+ } else if (!row.hasOwnProperty(params.field) && params.field === '$index') {
6492
+ exists = params.values.includes(i);
6493
+ } else {
6494
+ exists = params.values.includes(row[params.field]);
5912
6495
  }
5913
6496
 
5914
- if (params.values.includes(row[params.field])) {
6497
+ if (exists) {
5915
6498
  this.options.data.splice(i, 1);
5916
6499
 
5917
6500
  if (this.options.sidePagination === 'server') {
@@ -5956,20 +6539,18 @@
5956
6539
  key: "updateRow",
5957
6540
  value: function updateRow(params) {
5958
6541
  var allParams = Array.isArray(params) ? params : [params];
5959
- var _iteratorNormalCompletion5 = true;
5960
- var _didIteratorError5 = false;
5961
- var _iteratorError5 = undefined;
6542
+ var _iteratorNormalCompletion6 = true;
6543
+ var _didIteratorError6 = false;
6544
+ var _iteratorError6 = undefined;
5962
6545
 
5963
6546
  try {
5964
- for (var _iterator5 = allParams[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
5965
- var _params = _step5.value;
6547
+ for (var _iterator6 = allParams[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
6548
+ var _params = _step6.value;
5966
6549
 
5967
6550
  if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
5968
6551
  continue;
5969
6552
  }
5970
6553
 
5971
- $.extend(this.options.data[_params.index], _params.row);
5972
-
5973
6554
  if (_params.hasOwnProperty('replace') && _params.replace) {
5974
6555
  this.options.data[_params.index] = _params.row;
5975
6556
  } else {
@@ -5977,16 +6558,16 @@
5977
6558
  }
5978
6559
  }
5979
6560
  } catch (err) {
5980
- _didIteratorError5 = true;
5981
- _iteratorError5 = err;
6561
+ _didIteratorError6 = true;
6562
+ _iteratorError6 = err;
5982
6563
  } finally {
5983
6564
  try {
5984
- if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
5985
- _iterator5.return();
6565
+ if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
6566
+ _iterator6.return();
5986
6567
  }
5987
6568
  } finally {
5988
- if (_didIteratorError5) {
5989
- throw _iteratorError5;
6569
+ if (_didIteratorError6) {
6570
+ throw _iteratorError6;
5990
6571
  }
5991
6572
  }
5992
6573
  }
@@ -6042,13 +6623,13 @@
6042
6623
  key: "updateByUniqueId",
6043
6624
  value: function updateByUniqueId(params) {
6044
6625
  var allParams = Array.isArray(params) ? params : [params];
6045
- var _iteratorNormalCompletion6 = true;
6046
- var _didIteratorError6 = false;
6047
- var _iteratorError6 = undefined;
6626
+ var _iteratorNormalCompletion7 = true;
6627
+ var _didIteratorError7 = false;
6628
+ var _iteratorError7 = undefined;
6048
6629
 
6049
6630
  try {
6050
- for (var _iterator6 = allParams[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
6051
- var _params2 = _step6.value;
6631
+ for (var _iterator7 = allParams[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
6632
+ var _params2 = _step7.value;
6052
6633
 
6053
6634
  if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
6054
6635
  continue;
@@ -6067,16 +6648,16 @@
6067
6648
  }
6068
6649
  }
6069
6650
  } catch (err) {
6070
- _didIteratorError6 = true;
6071
- _iteratorError6 = err;
6651
+ _didIteratorError7 = true;
6652
+ _iteratorError7 = err;
6072
6653
  } finally {
6073
6654
  try {
6074
- if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
6075
- _iterator6.return();
6655
+ if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
6656
+ _iterator7.return();
6076
6657
  }
6077
6658
  } finally {
6078
- if (_didIteratorError6) {
6079
- throw _iteratorError6;
6659
+ if (_didIteratorError7) {
6660
+ throw _iteratorError7;
6080
6661
  }
6081
6662
  }
6082
6663
  }
@@ -6123,25 +6704,21 @@
6123
6704
  }, {
6124
6705
  key: "updateCellByUniqueId",
6125
6706
  value: function updateCellByUniqueId(params) {
6126
- var _this18 = this;
6127
-
6128
- if (!params.hasOwnProperty('id') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
6129
- return;
6130
- }
6707
+ var _this20 = this;
6131
6708
 
6132
6709
  var allParams = Array.isArray(params) ? params : [params];
6133
- allParams.forEach(function (_ref7) {
6134
- var id = _ref7.id,
6135
- field = _ref7.field,
6136
- value = _ref7.value;
6710
+ allParams.forEach(function (_ref6) {
6711
+ var id = _ref6.id,
6712
+ field = _ref6.field,
6713
+ value = _ref6.value;
6137
6714
 
6138
- var rowId = _this18.options.data.indexOf(_this18.getRowByUniqueId(id));
6715
+ var rowId = _this20.options.data.indexOf(_this20.getRowByUniqueId(id));
6139
6716
 
6140
6717
  if (rowId === -1) {
6141
6718
  return;
6142
6719
  }
6143
6720
 
6144
- _this18.options.data[rowId][field] = value;
6721
+ _this20.options.data[rowId][field] = value;
6145
6722
  });
6146
6723
 
6147
6724
  if (params.reinit === false) {
@@ -6184,12 +6761,8 @@
6184
6761
  this.hiddenRows.splice(index, 1);
6185
6762
  }
6186
6763
 
6187
- if (visible) {
6188
- this.updatePagination();
6189
- } else {
6190
- this.initBody(true);
6191
- this.initPagination();
6192
- }
6764
+ this.initBody(true);
6765
+ this.initPagination();
6193
6766
  }
6194
6767
  }, {
6195
6768
  key: "getHiddenRows",
@@ -6197,34 +6770,35 @@
6197
6770
  if (show) {
6198
6771
  this.initHiddenRows();
6199
6772
  this.initBody(true);
6773
+ this.initPagination();
6200
6774
  return;
6201
6775
  }
6202
6776
 
6203
6777
  var data = this.getData();
6204
6778
  var rows = [];
6205
- var _iteratorNormalCompletion7 = true;
6206
- var _didIteratorError7 = false;
6207
- var _iteratorError7 = undefined;
6779
+ var _iteratorNormalCompletion8 = true;
6780
+ var _didIteratorError8 = false;
6781
+ var _iteratorError8 = undefined;
6208
6782
 
6209
6783
  try {
6210
- for (var _iterator7 = data[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
6211
- var row = _step7.value;
6784
+ for (var _iterator8 = data[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
6785
+ var row = _step8.value;
6212
6786
 
6213
6787
  if (this.hiddenRows.includes(row)) {
6214
6788
  rows.push(row);
6215
6789
  }
6216
6790
  }
6217
6791
  } catch (err) {
6218
- _didIteratorError7 = true;
6219
- _iteratorError7 = err;
6792
+ _didIteratorError8 = true;
6793
+ _iteratorError8 = err;
6220
6794
  } finally {
6221
6795
  try {
6222
- if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
6223
- _iterator7.return();
6796
+ if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
6797
+ _iterator8.return();
6224
6798
  }
6225
6799
  } finally {
6226
- if (_didIteratorError7) {
6227
- throw _iteratorError7;
6800
+ if (_didIteratorError8) {
6801
+ throw _iteratorError8;
6228
6802
  }
6229
6803
  }
6230
6804
  }
@@ -6235,21 +6809,21 @@
6235
6809
  }, {
6236
6810
  key: "showColumn",
6237
6811
  value: function showColumn(field) {
6238
- var _this19 = this;
6812
+ var _this21 = this;
6239
6813
 
6240
6814
  var fields = Array.isArray(field) ? field : [field];
6241
6815
  fields.forEach(function (field) {
6242
- _this19._toggleColumn(_this19.fieldsColumnsIndex[field], true, true);
6816
+ _this21._toggleColumn(_this21.fieldsColumnsIndex[field], true, true);
6243
6817
  });
6244
6818
  }
6245
6819
  }, {
6246
6820
  key: "hideColumn",
6247
6821
  value: function hideColumn(field) {
6248
- var _this20 = this;
6822
+ var _this22 = this;
6249
6823
 
6250
6824
  var fields = Array.isArray(field) ? field : [field];
6251
6825
  fields.forEach(function (field) {
6252
- _this20._toggleColumn(_this20.fieldsColumnsIndex[field], false, true);
6826
+ _this22._toggleColumn(_this22.fieldsColumnsIndex[field], false, true);
6253
6827
  });
6254
6828
  }
6255
6829
  }, {
@@ -6266,7 +6840,7 @@
6266
6840
  this.initBody();
6267
6841
 
6268
6842
  if (this.options.showColumns) {
6269
- var $items = this.$toolbar.find('.keep-open input').prop('disabled', false);
6843
+ var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
6270
6844
 
6271
6845
  if (needUpdate) {
6272
6846
  $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
@@ -6280,19 +6854,25 @@
6280
6854
  }, {
6281
6855
  key: "getVisibleColumns",
6282
6856
  value: function getVisibleColumns() {
6283
- return this.columns.filter(function (_ref8) {
6284
- var visible = _ref8.visible;
6285
- return visible;
6857
+ var _this23 = this;
6858
+
6859
+ return this.columns.filter(function (column) {
6860
+ return column.visible && !_this23.isSelectionColumn(column);
6286
6861
  });
6287
6862
  }
6288
6863
  }, {
6289
6864
  key: "getHiddenColumns",
6290
6865
  value: function getHiddenColumns() {
6291
- return this.columns.filter(function (_ref9) {
6292
- var visible = _ref9.visible;
6866
+ return this.columns.filter(function (_ref7) {
6867
+ var visible = _ref7.visible;
6293
6868
  return !visible;
6294
6869
  });
6295
6870
  }
6871
+ }, {
6872
+ key: "isSelectionColumn",
6873
+ value: function isSelectionColumn(column) {
6874
+ return column.radio || column.checkbox;
6875
+ }
6296
6876
  }, {
6297
6877
  key: "showAllColumns",
6298
6878
  value: function showAllColumns() {
@@ -6306,15 +6886,15 @@
6306
6886
  }, {
6307
6887
  key: "_toggleAllColumns",
6308
6888
  value: function _toggleAllColumns(visible) {
6309
- var _this21 = this;
6889
+ var _this24 = this;
6310
6890
 
6311
- var _iteratorNormalCompletion8 = true;
6312
- var _didIteratorError8 = false;
6313
- var _iteratorError8 = undefined;
6891
+ var _iteratorNormalCompletion9 = true;
6892
+ var _didIteratorError9 = false;
6893
+ var _iteratorError9 = undefined;
6314
6894
 
6315
6895
  try {
6316
- for (var _iterator8 = this.columns.slice().reverse()[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
6317
- var column = _step8.value;
6896
+ for (var _iterator9 = this.columns.slice().reverse()[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
6897
+ var column = _step9.value;
6318
6898
 
6319
6899
  if (column.switchable) {
6320
6900
  if (!visible && this.options.showColumns && this.getVisibleColumns().length === this.options.minimumCountColumns) {
@@ -6325,16 +6905,16 @@
6325
6905
  }
6326
6906
  }
6327
6907
  } catch (err) {
6328
- _didIteratorError8 = true;
6329
- _iteratorError8 = err;
6908
+ _didIteratorError9 = true;
6909
+ _iteratorError9 = err;
6330
6910
  } finally {
6331
6911
  try {
6332
- if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
6333
- _iterator8.return();
6912
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
6913
+ _iterator9.return();
6334
6914
  }
6335
6915
  } finally {
6336
- if (_didIteratorError8) {
6337
- throw _iteratorError8;
6916
+ if (_didIteratorError9) {
6917
+ throw _iteratorError9;
6338
6918
  }
6339
6919
  }
6340
6920
  }
@@ -6345,13 +6925,13 @@
6345
6925
  this.initBody();
6346
6926
 
6347
6927
  if (this.options.showColumns) {
6348
- var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
6928
+ var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
6349
6929
 
6350
6930
  if (visible) {
6351
6931
  $items.prop('checked', visible);
6352
6932
  } else {
6353
6933
  $items.get().reverse().forEach(function (item) {
6354
- if ($items.filter(':checked').length > _this21.options.minimumCountColumns) {
6934
+ if ($items.filter(':checked').length > _this24.options.minimumCountColumns) {
6355
6935
  $(item).prop('checked', visible);
6356
6936
  }
6357
6937
  });
@@ -6373,7 +6953,7 @@
6373
6953
  var j;
6374
6954
  var $tr = this.$body.find('>tr');
6375
6955
 
6376
- if (this.options.detailView && !this.options.cardView) {
6956
+ if (Utils.hasDetailViewIcon(this.options)) {
6377
6957
  col += 1;
6378
6958
  }
6379
6959
 
@@ -6448,26 +7028,26 @@
6448
7028
  var row = this.data[index];
6449
7029
 
6450
7030
  if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
6451
- var _iteratorNormalCompletion9 = true;
6452
- var _didIteratorError9 = false;
6453
- var _iteratorError9 = undefined;
7031
+ var _iteratorNormalCompletion10 = true;
7032
+ var _didIteratorError10 = false;
7033
+ var _iteratorError10 = undefined;
6454
7034
 
6455
7035
  try {
6456
- for (var _iterator9 = this.options.data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
6457
- var r = _step9.value;
7036
+ for (var _iterator10 = this.options.data[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
7037
+ var r = _step10.value;
6458
7038
  r[this.header.stateField] = false;
6459
7039
  }
6460
7040
  } catch (err) {
6461
- _didIteratorError9 = true;
6462
- _iteratorError9 = err;
7041
+ _didIteratorError10 = true;
7042
+ _iteratorError10 = err;
6463
7043
  } finally {
6464
7044
  try {
6465
- if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
6466
- _iterator9.return();
7045
+ if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
7046
+ _iterator10.return();
6467
7047
  }
6468
7048
  } finally {
6469
- if (_didIteratorError9) {
6470
- throw _iteratorError9;
7049
+ if (_didIteratorError10) {
7050
+ throw _iteratorError10;
6471
7051
  }
6472
7052
  }
6473
7053
  }
@@ -6509,7 +7089,7 @@
6509
7089
  }, {
6510
7090
  key: "_toggleCheckBy",
6511
7091
  value: function _toggleCheckBy(checked, obj) {
6512
- var _this22 = this;
7092
+ var _this25 = this;
6513
7093
 
6514
7094
  if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
6515
7095
  return;
@@ -6522,7 +7102,7 @@
6522
7102
  }
6523
7103
 
6524
7104
  if (obj.values.includes(row[obj.field])) {
6525
- var $el = _this22.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
7105
+ var $el = _this25.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
6526
7106
 
6527
7107
  $el = checked ? $el.not(':checked') : $el.filter(':checked');
6528
7108
 
@@ -6531,10 +7111,10 @@
6531
7111
  }
6532
7112
 
6533
7113
  $el.prop('checked', checked);
6534
- row[_this22.header.stateField] = checked;
7114
+ row[_this25.header.stateField] = checked;
6535
7115
  rows.push(row);
6536
7116
 
6537
- _this22.trigger(checked ? 'check' : 'uncheck', row, $el);
7117
+ _this25.trigger(checked ? 'check' : 'uncheck', row, $el);
6538
7118
  }
6539
7119
  });
6540
7120
  this.updateSelected();
@@ -6581,7 +7161,7 @@
6581
7161
  if (!this.options.cardView && this.options.showHeader && this.options.height) {
6582
7162
  this.$tableHeader.show();
6583
7163
  this.resetHeader();
6584
- padding += this.$header.outerHeight(true);
7164
+ padding += this.$header.outerHeight(true) + 1;
6585
7165
  } else {
6586
7166
  this.$tableHeader.hide();
6587
7167
  this.trigger('post-header');
@@ -6596,13 +7176,32 @@
6596
7176
  }
6597
7177
  }
6598
7178
 
6599
- if (this.options.height) {
7179
+ if (this.$container.hasClass('fullscreen')) {
7180
+ this.$tableContainer.css('height', '');
7181
+ this.$tableContainer.css('width', '');
7182
+ } else if (this.options.height) {
7183
+ if (this.$tableBorder) {
7184
+ this.$tableBorder.css('width', '');
7185
+ this.$tableBorder.css('height', '');
7186
+ }
7187
+
6600
7188
  var toolbarHeight = this.$toolbar.outerHeight(true);
6601
7189
  var paginationHeight = this.$pagination.outerHeight(true);
6602
7190
  var height = this.options.height - toolbarHeight - paginationHeight;
6603
- var tableHeight = this.$tableBody.find('table').outerHeight(true);
7191
+ var $bodyTable = this.$tableBody.find('>table');
7192
+ var tableHeight = $bodyTable.outerHeight();
6604
7193
  this.$tableContainer.css('height', "".concat(height, "px"));
6605
- this.$tableBorder && this.$tableBorder.css('height', "".concat(height - tableHeight - padding - 1, "px"));
7194
+
7195
+ if (this.$tableBorder && $bodyTable.is(':visible')) {
7196
+ var tableBorderHeight = height - tableHeight - 2;
7197
+
7198
+ if (this.$tableBody[0].scrollWidth - this.$tableBody.innerWidth()) {
7199
+ tableBorderHeight -= Utils.getScrollBarWidth();
7200
+ }
7201
+
7202
+ this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
7203
+ this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
7204
+ }
6606
7205
  }
6607
7206
 
6608
7207
  if (this.options.cardView) {
@@ -6618,21 +7217,20 @@
6618
7217
 
6619
7218
  this.trigger('reset-view');
6620
7219
  }
6621
- }, {
6622
- key: "resetWidth",
6623
- value: function resetWidth() {
6624
- if (this.options.showHeader && this.options.height) {
6625
- this.fitHeader();
6626
- }
6627
-
6628
- if (this.options.showFooter && !this.options.cardView) {
6629
- this.fitFooter();
6630
- }
6631
- }
6632
7220
  }, {
6633
7221
  key: "showLoading",
6634
7222
  value: function showLoading() {
6635
7223
  this.$tableLoading.css('display', 'flex');
7224
+ var fontSize = this.options.loadingFontSize;
7225
+
7226
+ if (this.options.loadingFontSize === 'auto') {
7227
+ fontSize = this.$tableLoading.width() * 0.04;
7228
+ fontSize = Math.max(12, fontSize);
7229
+ fontSize = Math.min(32, fontSize);
7230
+ fontSize = "".concat(fontSize, "px");
7231
+ }
7232
+
7233
+ this.$tableLoading.find('.loading-text').css('font-size', fontSize);
6636
7234
  }
6637
7235
  }, {
6638
7236
  key: "hideLoading",
@@ -6699,7 +7297,7 @@
6699
7297
  options = Object.assign(options, params);
6700
7298
  } else if (typeof params === 'string' && params === 'bottom') {
6701
7299
  options.value = this.$tableBody[0].scrollHeight;
6702
- } else if (typeof params === 'string') {
7300
+ } else if (typeof params === 'string' || typeof params === 'number') {
6703
7301
  options.value = params;
6704
7302
  }
6705
7303
 
@@ -6781,6 +7379,17 @@
6781
7379
 
6782
7380
  this.trigger('expand-row', index, row, $element);
6783
7381
  }
7382
+ }, {
7383
+ key: "expandRowByUniqueId",
7384
+ value: function expandRowByUniqueId(uniqueId) {
7385
+ var row = this.getRowByUniqueId(uniqueId);
7386
+
7387
+ if (!row) {
7388
+ return;
7389
+ }
7390
+
7391
+ this.expandRow(this.data.indexOf(row));
7392
+ }
6784
7393
  }, {
6785
7394
  key: "collapseRow",
6786
7395
  value: function collapseRow(index) {
@@ -6798,6 +7407,17 @@
6798
7407
  this.trigger('collapse-row', index, row, $tr.next());
6799
7408
  $tr.next().remove();
6800
7409
  }
7410
+ }, {
7411
+ key: "collapseRowByUniqueId",
7412
+ value: function collapseRowByUniqueId(uniqueId) {
7413
+ var row = this.getRowByUniqueId(uniqueId);
7414
+
7415
+ if (!row) {
7416
+ return;
7417
+ }
7418
+
7419
+ this.collapseRow(this.data.indexOf(row));
7420
+ }
6801
7421
  }, {
6802
7422
  key: "expandAllRows",
6803
7423
  value: function expandAllRows() {
@@ -6870,8 +7490,8 @@
6870
7490
  $.BootstrapTable = BootstrapTable;
6871
7491
 
6872
7492
  $.fn.bootstrapTable = function (option) {
6873
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key3 = 1; _key3 < _len2; _key3++) {
6874
- args[_key3 - 1] = arguments[_key3];
7493
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
7494
+ args[_key5 - 1] = arguments[_key5];
6875
7495
  }
6876
7496
 
6877
7497
  var value;
@@ -6921,4 +7541,4 @@
6921
7541
 
6922
7542
  return BootstrapTable;
6923
7543
 
6924
- }));
7544
+ })));