bootstrap-table-rails 1.17.1 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bootstrap-table-rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +321 -3
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +10 -2
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +517 -248
  6. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +26 -5
  7. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +61 -12
  8. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +45 -5
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +78 -14
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +59 -448
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +83 -22
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +65 -11
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css +3 -2
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +179 -501
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +2 -1
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +65 -437
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +74 -17
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +17 -4
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +71 -18
  20. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +6 -0
  21. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +6 -0
  22. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +6 -0
  23. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +6 -0
  24. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +6 -0
  25. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +6 -0
  26. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +9 -3
  27. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +6 -0
  28. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +6 -0
  29. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +6 -0
  30. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +6 -0
  31. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +6 -0
  32. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +6 -0
  33. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +6 -0
  34. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +6 -0
  35. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +6 -0
  36. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +6 -0
  37. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +6 -0
  38. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +6 -0
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +6 -0
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +6 -0
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +6 -0
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +6 -0
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +6 -0
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +6 -0
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +6 -0
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +6 -0
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +6 -0
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +6 -0
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +6 -0
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +6 -0
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +6 -0
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +6 -0
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +6 -0
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +6 -0
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +6 -0
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +6 -0
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +6 -0
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +6 -0
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +6 -0
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +6 -0
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +6 -0
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +6 -0
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +6 -0
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +6 -0
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +6 -0
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +6 -0
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +6 -0
  68. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +6 -0
  69. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +6 -0
  70. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +6 -0
  71. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +6 -0
  72. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +6 -0
  73. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +9 -1
  74. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +9 -1
  75. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +1 -1
  76. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +9 -1
  77. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +1 -1
  78. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +9 -1
  79. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +9 -1
  80. metadata +1 -1
@@ -1994,6 +1994,15 @@
1994
1994
  parseInt: _parseInt
1995
1995
  });
1996
1996
 
1997
+ var MATCH = wellKnownSymbol('match');
1998
+
1999
+ // `IsRegExp` abstract operation
2000
+ // https://tc39.github.io/ecma262/#sec-isregexp
2001
+ var isRegexp = function (it) {
2002
+ var isRegExp;
2003
+ return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
2004
+ };
2005
+
1997
2006
  // `RegExp.prototype.flags` getter implementation
1998
2007
  // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
1999
2008
  var regexpFlags = function () {
@@ -2033,6 +2042,101 @@
2033
2042
  BROKEN_CARET: BROKEN_CARET
2034
2043
  };
2035
2044
 
2045
+ var SPECIES$3 = wellKnownSymbol('species');
2046
+
2047
+ var setSpecies = function (CONSTRUCTOR_NAME) {
2048
+ var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
2049
+ var defineProperty = objectDefineProperty.f;
2050
+
2051
+ if (descriptors && Constructor && !Constructor[SPECIES$3]) {
2052
+ defineProperty(Constructor, SPECIES$3, {
2053
+ configurable: true,
2054
+ get: function () { return this; }
2055
+ });
2056
+ }
2057
+ };
2058
+
2059
+ var defineProperty$5 = objectDefineProperty.f;
2060
+ var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
2061
+
2062
+
2063
+
2064
+
2065
+
2066
+ var setInternalState$2 = internalState.set;
2067
+
2068
+
2069
+
2070
+ var MATCH$1 = wellKnownSymbol('match');
2071
+ var NativeRegExp = global_1.RegExp;
2072
+ var RegExpPrototype = NativeRegExp.prototype;
2073
+ var re1 = /a/g;
2074
+ var re2 = /a/g;
2075
+
2076
+ // "new" should create a new object, old webkit bug
2077
+ var CORRECT_NEW = new NativeRegExp(re1) !== re1;
2078
+
2079
+ var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
2080
+
2081
+ var FORCED$4 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
2082
+ re2[MATCH$1] = false;
2083
+ // RegExp constructor can alter flags and IsRegExp works correct with @@match
2084
+ return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
2085
+ })));
2086
+
2087
+ // `RegExp` constructor
2088
+ // https://tc39.github.io/ecma262/#sec-regexp-constructor
2089
+ if (FORCED$4) {
2090
+ var RegExpWrapper = function RegExp(pattern, flags) {
2091
+ var thisIsRegExp = this instanceof RegExpWrapper;
2092
+ var patternIsRegExp = isRegexp(pattern);
2093
+ var flagsAreUndefined = flags === undefined;
2094
+ var sticky;
2095
+
2096
+ if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
2097
+ return pattern;
2098
+ }
2099
+
2100
+ if (CORRECT_NEW) {
2101
+ if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
2102
+ } else if (pattern instanceof RegExpWrapper) {
2103
+ if (flagsAreUndefined) flags = regexpFlags.call(pattern);
2104
+ pattern = pattern.source;
2105
+ }
2106
+
2107
+ if (UNSUPPORTED_Y$1) {
2108
+ sticky = !!flags && flags.indexOf('y') > -1;
2109
+ if (sticky) flags = flags.replace(/y/g, '');
2110
+ }
2111
+
2112
+ var result = inheritIfRequired(
2113
+ CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
2114
+ thisIsRegExp ? this : RegExpPrototype,
2115
+ RegExpWrapper
2116
+ );
2117
+
2118
+ if (UNSUPPORTED_Y$1 && sticky) setInternalState$2(result, { sticky: sticky });
2119
+
2120
+ return result;
2121
+ };
2122
+ var proxy = function (key) {
2123
+ key in RegExpWrapper || defineProperty$5(RegExpWrapper, key, {
2124
+ configurable: true,
2125
+ get: function () { return NativeRegExp[key]; },
2126
+ set: function (it) { NativeRegExp[key] = it; }
2127
+ });
2128
+ };
2129
+ var keys$2 = getOwnPropertyNames$1(NativeRegExp);
2130
+ var index = 0;
2131
+ while (keys$2.length > index) proxy(keys$2[index++]);
2132
+ RegExpPrototype.constructor = RegExpWrapper;
2133
+ RegExpWrapper.prototype = RegExpPrototype;
2134
+ redefine(global_1, 'RegExp', RegExpWrapper);
2135
+ }
2136
+
2137
+ // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
2138
+ setSpecies('RegExp');
2139
+
2036
2140
  var nativeExec = RegExp.prototype.exec;
2037
2141
  // This always refers to the native implementation, because the
2038
2142
  // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
@@ -2049,18 +2153,18 @@
2049
2153
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2050
2154
  })();
2051
2155
 
2052
- var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2156
+ var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2053
2157
 
2054
2158
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
2055
2159
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2056
2160
 
2057
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
2161
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
2058
2162
 
2059
2163
  if (PATCH) {
2060
2164
  patchedExec = function exec(str) {
2061
2165
  var re = this;
2062
2166
  var lastIndex, reCopy, match, i;
2063
- var sticky = UNSUPPORTED_Y$1 && re.sticky;
2167
+ var sticky = UNSUPPORTED_Y$2 && re.sticky;
2064
2168
  var flags = regexpFlags.call(re);
2065
2169
  var source = re.source;
2066
2170
  var charsAdded = 0;
@@ -2122,8 +2226,8 @@
2122
2226
  });
2123
2227
 
2124
2228
  var TO_STRING = 'toString';
2125
- var RegExpPrototype = RegExp.prototype;
2126
- var nativeToString = RegExpPrototype[TO_STRING];
2229
+ var RegExpPrototype$1 = RegExp.prototype;
2230
+ var nativeToString = RegExpPrototype$1[TO_STRING];
2127
2231
 
2128
2232
  var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
2129
2233
  // FF44- RegExp#toString has a wrong name
@@ -2136,27 +2240,18 @@
2136
2240
  var R = anObject(this);
2137
2241
  var p = String(R.source);
2138
2242
  var rf = R.flags;
2139
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
2243
+ var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
2140
2244
  return '/' + p + '/' + f;
2141
2245
  }, { unsafe: true });
2142
2246
  }
2143
2247
 
2144
- var MATCH = wellKnownSymbol('match');
2145
-
2146
- // `IsRegExp` abstract operation
2147
- // https://tc39.github.io/ecma262/#sec-isregexp
2148
- var isRegexp = function (it) {
2149
- var isRegExp;
2150
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
2151
- };
2152
-
2153
2248
  var notARegexp = function (it) {
2154
2249
  if (isRegexp(it)) {
2155
2250
  throw TypeError("The method doesn't accept regular expressions");
2156
2251
  } return it;
2157
2252
  };
2158
2253
 
2159
- var MATCH$1 = wellKnownSymbol('match');
2254
+ var MATCH$2 = wellKnownSymbol('match');
2160
2255
 
2161
2256
  var correctIsRegexpLogic = function (METHOD_NAME) {
2162
2257
  var regexp = /./;
@@ -2164,7 +2259,7 @@
2164
2259
  '/./'[METHOD_NAME](regexp);
2165
2260
  } catch (e) {
2166
2261
  try {
2167
- regexp[MATCH$1] = false;
2262
+ regexp[MATCH$2] = false;
2168
2263
  return '/./'[METHOD_NAME](regexp);
2169
2264
  } catch (f) { /* empty */ }
2170
2265
  } return false;
@@ -2209,13 +2304,13 @@
2209
2304
 
2210
2305
 
2211
2306
  var STRING_ITERATOR = 'String Iterator';
2212
- var setInternalState$2 = internalState.set;
2307
+ var setInternalState$3 = internalState.set;
2213
2308
  var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
2214
2309
 
2215
2310
  // `String.prototype[@@iterator]` method
2216
2311
  // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
2217
2312
  defineIterator(String, 'String', function (iterated) {
2218
- setInternalState$2(this, {
2313
+ setInternalState$3(this, {
2219
2314
  type: STRING_ITERATOR,
2220
2315
  string: String(iterated),
2221
2316
  index: 0
@@ -2233,7 +2328,7 @@
2233
2328
  return { value: point, done: false };
2234
2329
  });
2235
2330
 
2236
- var SPECIES$3 = wellKnownSymbol('species');
2331
+ var SPECIES$4 = wellKnownSymbol('species');
2237
2332
 
2238
2333
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2239
2334
  // #replace needs built-in support for named groups.
@@ -2287,7 +2382,7 @@
2287
2382
  // RegExp[@@split] doesn't call the regex's exec method, but first creates
2288
2383
  // a new one. We need to return the patched regex when creating the new one.
2289
2384
  re.constructor = {};
2290
- re.constructor[SPECIES$3] = function () { return re; };
2385
+ re.constructor[SPECIES$4] = function () { return re; };
2291
2386
  re.flags = '';
2292
2387
  re[SYMBOL] = /./[SYMBOL];
2293
2388
  }
@@ -2515,14 +2610,14 @@
2515
2610
  ];
2516
2611
  });
2517
2612
 
2518
- var SPECIES$4 = wellKnownSymbol('species');
2613
+ var SPECIES$5 = wellKnownSymbol('species');
2519
2614
 
2520
2615
  // `SpeciesConstructor` abstract operation
2521
2616
  // https://tc39.github.io/ecma262/#sec-speciesconstructor
2522
2617
  var speciesConstructor = function (O, defaultConstructor) {
2523
2618
  var C = anObject(O).constructor;
2524
2619
  var S;
2525
- return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
2620
+ return C === undefined || (S = anObject(C)[SPECIES$5]) == undefined ? defaultConstructor : aFunction$1(S);
2526
2621
  };
2527
2622
 
2528
2623
  var arrayPush = [].push;
@@ -2851,7 +2946,7 @@
2851
2946
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2852
2947
  }
2853
2948
 
2854
- var VERSION = '1.17.1';
2949
+ var VERSION = '1.18.0';
2855
2950
  var bootstrapVersion = 4;
2856
2951
 
2857
2952
  try {
@@ -3017,6 +3112,7 @@
3017
3112
  var DEFAULTS = {
3018
3113
  height: undefined,
3019
3114
  classes: 'table table-bordered table-hover',
3115
+ buttons: {},
3020
3116
  theadClasses: '',
3021
3117
  headerStyle: function headerStyle(column) {
3022
3118
  return {};
@@ -3061,6 +3157,7 @@
3061
3157
  totalField: 'total',
3062
3158
  totalNotFilteredField: 'totalNotFiltered',
3063
3159
  dataField: 'rows',
3160
+ footerField: 'footer',
3064
3161
  pagination: false,
3065
3162
  paginationParts: ['pageInfo', 'pageSize', 'pageList'],
3066
3163
  showExtendedPagination: false,
@@ -3087,8 +3184,10 @@
3087
3184
  paginationUseIntermediate: false,
3088
3185
  // Calculate intermediate pages for quick access
3089
3186
  search: false,
3187
+ searchHighlight: false,
3090
3188
  searchOnEnterKey: false,
3091
3189
  strictSearch: false,
3190
+ searchSelector: false,
3092
3191
  visibleSearch: false,
3093
3192
  showButtonIcons: true,
3094
3193
  showButtonText: false,
@@ -3346,10 +3445,11 @@
3346
3445
  footerFormatter: undefined,
3347
3446
  detailFormatter: undefined,
3348
3447
  searchFormatter: true,
3448
+ searchHighlightFormatter: false,
3349
3449
  escape: false,
3350
3450
  events: undefined
3351
3451
  };
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'];
3452
+ var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', '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'];
3353
3453
  var EVENTS = {
3354
3454
  'all.bs.table': 'onAll',
3355
3455
  'click-row.bs.table': 'onClickRow',
@@ -3470,6 +3570,13 @@
3470
3570
  });
3471
3571
 
3472
3572
  var Utils = {
3573
+ getSearchInput: function getSearchInput(that) {
3574
+ if (typeof that.options.searchSelector === 'string') {
3575
+ return $(that.options.searchSelector);
3576
+ }
3577
+
3578
+ return that.$toolbar.find('.search input');
3579
+ },
3473
3580
  // it only does '%s', and return '' when arguments are undefined
3474
3581
  sprintf: function sprintf(_str) {
3475
3582
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -3492,6 +3599,9 @@
3492
3599
 
3493
3600
  return flag ? str : '';
3494
3601
  },
3602
+ isObject: function isObject(val) {
3603
+ return val instanceof Object && !Array.isArray(val);
3604
+ },
3495
3605
  isEmptyObject: function isEmptyObject() {
3496
3606
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3497
3607
  return Object.entries(obj).length === 0 && obj.constructor === Object;
@@ -3589,12 +3699,10 @@
3589
3699
  r.colspanGroup = r.colspan;
3590
3700
  }
3591
3701
 
3592
- for (var k = 0; k < rowspan; k++) {
3593
- flag[_i + k][index] = true;
3594
- }
3595
-
3596
- for (var _k = 0; _k < colspan; _k++) {
3597
- flag[_i][index + _k] = true;
3702
+ for (var _j = 0; _j < rowspan; _j++) {
3703
+ for (var k = 0; k < colspan; k++) {
3704
+ flag[_i + _j][index + k] = true;
3705
+ }
3598
3706
  }
3599
3707
  }
3600
3708
  } catch (err) {
@@ -3613,8 +3721,12 @@
3613
3721
  }
3614
3722
  }
3615
3723
  },
3616
- normalizeAccent: function normalizeAccent(string) {
3617
- return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
3724
+ normalizeAccent: function normalizeAccent(value) {
3725
+ if (typeof value !== 'string') {
3726
+ return value;
3727
+ }
3728
+
3729
+ return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
3618
3730
  },
3619
3731
  updateFieldGroup: function updateFieldGroup(columns) {
3620
3732
  var _ref;
@@ -3707,7 +3819,9 @@
3707
3819
 
3708
3820
  return this.cachedWidth;
3709
3821
  },
3710
- calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
3822
+ calculateObjectValue: function calculateObjectValue(self, name) {
3823
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3824
+ var defaultValue = arguments.length > 3 ? arguments[3] : undefined;
3711
3825
  var func = name;
3712
3826
 
3713
3827
  if (typeof name === 'string') {
@@ -3879,14 +3993,17 @@
3879
3993
  var data = [];
3880
3994
  var m = [];
3881
3995
  $els.each(function (y, el) {
3996
+ var $el = $(el);
3882
3997
  var row = {}; // save tr's id, class and data-* attributes
3883
3998
 
3884
- row._id = $(el).attr('id');
3885
- row._class = $(el).attr('class');
3886
- row._data = _this.getRealDataAttr($(el).data());
3887
- $(el).find('>td,>th').each(function (_x, el) {
3888
- var cspan = +$(el).attr('colspan') || 1;
3889
- var rspan = +$(el).attr('rowspan') || 1;
3999
+ row._id = $el.attr('id');
4000
+ row._class = $el.attr('class');
4001
+ row._data = _this.getRealDataAttr($el.data());
4002
+ row._style = $el.attr('style');
4003
+ $el.find('>td,>th').each(function (_x, el) {
4004
+ var $el = $(el);
4005
+ var cspan = +$el.attr('colspan') || 1;
4006
+ var rspan = +$el.attr('rowspan') || 1;
3890
4007
  var x = _x; // skip already occupied cells in current row
3891
4008
 
3892
4009
  for (; m[y] && m[y][x]; x++) {} // ignore
@@ -3905,14 +4022,15 @@
3905
4022
  }
3906
4023
 
3907
4024
  var field = columns[x].field;
3908
- row[field] = $(el).html().trim(); // save td's id, class and data-* attributes
3909
-
3910
- row["_".concat(field, "_id")] = $(el).attr('id');
3911
- row["_".concat(field, "_class")] = $(el).attr('class');
3912
- row["_".concat(field, "_rowspan")] = $(el).attr('rowspan');
3913
- row["_".concat(field, "_colspan")] = $(el).attr('colspan');
3914
- row["_".concat(field, "_title")] = $(el).attr('title');
3915
- row["_".concat(field, "_data")] = _this.getRealDataAttr($(el).data());
4025
+ row[field] = $el.html().trim(); // save td's id, class and data-* attributes
4026
+
4027
+ row["_".concat(field, "_id")] = $el.attr('id');
4028
+ row["_".concat(field, "_class")] = $el.attr('class');
4029
+ row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
4030
+ row["_".concat(field, "_colspan")] = $el.attr('colspan');
4031
+ row["_".concat(field, "_title")] = $el.attr('title');
4032
+ row["_".concat(field, "_data")] = _this.getRealDataAttr($el.data());
4033
+ row["_".concat(field, "_style")] = $el.attr('style');
3916
4034
  });
3917
4035
  data.push(row);
3918
4036
  });
@@ -3964,14 +4082,17 @@
3964
4082
 
3965
4083
  return order;
3966
4084
  },
3967
- getResizeEventName: function getResizeEventName() {
3968
- var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4085
+ getEventName: function getEventName(eventPrefix) {
4086
+ var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
3969
4087
  id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
3970
- return "resize.bootstrap-table-".concat(id);
4088
+ return "".concat(eventPrefix, "-").concat(id);
3971
4089
  },
3972
4090
  hasDetailViewIcon: function hasDetailViewIcon(options) {
3973
4091
  return options.detailView && options.detailViewIcon && !options.cardView;
3974
4092
  },
4093
+ getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
4094
+ return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
4095
+ },
3975
4096
  checkAutoMergeCells: function checkAutoMergeCells(data) {
3976
4097
  var _iteratorNormalCompletion9 = true;
3977
4098
  var _didIteratorError9 = false;
@@ -4005,6 +4126,13 @@
4005
4126
  }
4006
4127
 
4007
4128
  return false;
4129
+ },
4130
+ deepCopy: function deepCopy(arg) {
4131
+ if (arg === undefined) {
4132
+ return arg;
4133
+ }
4134
+
4135
+ return $.extend(true, Array.isArray(arg) ? [] : {}, arg);
4008
4136
  }
4009
4137
  };
4010
4138
 
@@ -4171,7 +4299,6 @@
4171
4299
  this.$el_ = this.$el.clone();
4172
4300
  this.timeoutId_ = 0;
4173
4301
  this.timeoutFooter_ = 0;
4174
- this.init();
4175
4302
  }
4176
4303
 
4177
4304
  _createClass(BootstrapTable, [{
@@ -4198,6 +4325,7 @@
4198
4325
  this.constants.theme = $.fn.bootstrapTable.theme;
4199
4326
  var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
4200
4327
  this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
4328
+ this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], []);
4201
4329
  }
4202
4330
  }, {
4203
4331
  key: "initLocale",
@@ -4277,6 +4405,7 @@
4277
4405
  }
4278
4406
 
4279
4407
  this._headerTrClasses = [];
4408
+ this._headerTrStyles = [];
4280
4409
  this.$header.find('tr').each(function (i, el) {
4281
4410
  var $tr = $(el);
4282
4411
  var column = [];
@@ -4300,6 +4429,10 @@
4300
4429
  if ($tr.attr('class')) {
4301
4430
  _this._headerTrClasses.push($tr.attr('class'));
4302
4431
  }
4432
+
4433
+ if ($tr.attr('style')) {
4434
+ _this._headerTrStyles.push($tr.attr('style'));
4435
+ }
4303
4436
  });
4304
4437
 
4305
4438
  if (!Array.isArray(this.options.columns[0])) {
@@ -4332,7 +4465,9 @@
4332
4465
  }
4333
4466
  }
4334
4467
 
4335
- this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
4468
+ if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
4469
+ this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
4470
+ }
4336
4471
 
4337
4472
  if (this.footerData) {
4338
4473
  this.$el.find('tfoot').html('<tr></tr>');
@@ -4365,7 +4500,7 @@
4365
4500
  };
4366
4501
  Utils.updateFieldGroup(this.options.columns);
4367
4502
  this.options.columns.forEach(function (columns, i) {
4368
- html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), ">"));
4503
+ html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
4369
4504
  var detailViewTemplate = '';
4370
4505
 
4371
4506
  if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
@@ -4495,7 +4630,7 @@
4495
4630
  }
4496
4631
  }
4497
4632
  });
4498
- var resizeEvent = Utils.getResizeEventName(this.$el.attr('id'));
4633
+ var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
4499
4634
  $(window).off(resizeEvent);
4500
4635
 
4501
4636
  if (!this.options.showHeader || this.options.cardView) {
@@ -4531,7 +4666,7 @@
4531
4666
  } else if (type === 'prepend') {
4532
4667
  this.options.data = [].concat(data).concat(this.options.data);
4533
4668
  } else {
4534
- data = data || this.options.data;
4669
+ data = data || Utils.deepCopy(this.options.data);
4535
4670
  this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
4536
4671
  }
4537
4672
 
@@ -4679,63 +4814,153 @@
4679
4814
  opts.icons = Utils.calculateObjectValue(null, opts.icons);
4680
4815
  }
4681
4816
 
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]));
4817
+ if (typeof opts.buttonsOrder === 'string') {
4818
+ opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4819
+ }
4690
4820
 
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);
4821
+ this.buttons = Object.assign(this.buttons, {
4822
+ paginationSwitch: {
4823
+ text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
4824
+ icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
4825
+ render: false,
4826
+ event: this.togglePagination,
4827
+ attributes: {
4828
+ 'aria-label': opts.formatPaginationSwitch(),
4829
+ title: opts.formatPaginationSwitch()
4830
+ }
4831
+ },
4832
+ refresh: {
4833
+ text: opts.formatRefresh(),
4834
+ icon: opts.icons.refresh,
4835
+ render: false,
4836
+ event: this.refresh,
4837
+ attributes: {
4838
+ 'aria-label': opts.formatRefresh(),
4839
+ title: opts.formatRefresh()
4694
4840
  }
4841
+ },
4842
+ toggle: {
4843
+ text: opts.formatToggle(),
4844
+ icon: opts.icons.toggleOff,
4845
+ render: false,
4846
+ event: this.toggleView,
4847
+ attributes: {
4848
+ 'aria-label': opts.formatToggleOn(),
4849
+ title: opts.formatToggleOn()
4850
+ }
4851
+ },
4852
+ fullscreen: {
4853
+ text: opts.formatFullscreen(),
4854
+ icon: opts.icons.fullscreen,
4855
+ render: false,
4856
+ event: this.toggleFullscreen,
4857
+ attributes: {
4858
+ 'aria-label': opts.formatFullscreen(),
4859
+ title: opts.formatFullscreen()
4860
+ }
4861
+ },
4862
+ columns: {
4863
+ render: false,
4864
+ html: function html() {
4865
+ var html = [];
4866
+ 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]));
4867
+
4868
+ if (opts.showColumnsSearch) {
4869
+ 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())));
4870
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4871
+ }
4872
+
4873
+ if (opts.showColumnsToggleAll) {
4874
+ var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4875
+ return !_this4.isSelectionColumn(column);
4876
+ }).length;
4877
+
4878
+ 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())));
4879
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4880
+ }
4881
+
4882
+ var visibleColumns = 0;
4883
+
4884
+ _this4.columns.forEach(function (column, i) {
4885
+ if (column.visible) {
4886
+ visibleColumns++;
4887
+ }
4888
+ });
4889
+
4890
+ _this4.columns.forEach(function (column, i) {
4891
+ if (_this4.isSelectionColumn(column)) {
4892
+ return;
4893
+ }
4894
+
4895
+ if (opts.cardView && !column.cardVisible) {
4896
+ return;
4897
+ }
4695
4898
 
4696
- if (opts.showColumnsToggleAll) {
4697
- var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4698
- return !_this4.isSelectionColumn(column);
4699
- }).length;
4899
+ var checked = column.visible ? ' checked="checked"' : '';
4900
+ var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4700
4901
 
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);
4902
+ if (column.switchable) {
4903
+ 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)));
4904
+ switchableCount++;
4905
+ }
4906
+ });
4907
+
4908
+ html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4909
+ return html.join('');
4703
4910
  }
4911
+ }
4912
+ });
4913
+ var buttonsHtml = {};
4704
4914
 
4705
- var visibleColumns = 0;
4915
+ for (var _i2 = 0, _Object$entries2 = Object.entries(this.buttons); _i2 < _Object$entries2.length; _i2++) {
4916
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
4917
+ buttonName = _Object$entries2$_i[0],
4918
+ buttonConfig = _Object$entries2$_i[1];
4706
4919
 
4707
- _this4.columns.forEach(function (column, i) {
4708
- if (column.visible) {
4709
- visibleColumns++;
4710
- }
4711
- });
4920
+ var buttonHtml = void 0;
4712
4921
 
4713
- _this4.columns.forEach(function (column, i) {
4714
- if (_this4.isSelectionColumn(column)) {
4715
- return;
4716
- }
4922
+ if (buttonConfig.hasOwnProperty('html')) {
4923
+ buttonHtml = Utils.calculateObjectValue(opts, buttonConfig.html);
4924
+ } else {
4925
+ buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
4717
4926
 
4718
- if (opts.cardView && !column.cardVisible) {
4719
- return;
4927
+ if (buttonConfig.hasOwnProperty('attributes')) {
4928
+ for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
4929
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
4930
+ attributeName = _Object$entries4$_i[0],
4931
+ value = _Object$entries4$_i[1];
4932
+
4933
+ buttonHtml += " ".concat(attributeName, "=\"").concat(Utils.calculateObjectValue(opts, value), "\"");
4720
4934
  }
4935
+ }
4721
4936
 
4722
- var checked = column.visible ? ' checked="checked"' : '';
4723
- var disabled = visibleColumns <= _this4.options.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4937
+ buttonHtml += '>';
4724
4938
 
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
- });
4939
+ if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
4940
+ var icon = Utils.calculateObjectValue(opts, buttonConfig.icon);
4941
+ buttonHtml += Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, icon) + ' ';
4942
+ }
4730
4943
 
4731
- html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4732
- return html.join('');
4733
- }()
4734
- };
4944
+ if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
4945
+ buttonHtml += Utils.calculateObjectValue(opts, buttonConfig.text);
4946
+ }
4947
+
4948
+ buttonHtml += '</button>';
4949
+ }
4950
+
4951
+ buttonsHtml[buttonName] = buttonHtml;
4952
+ var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
4953
+ var showOption = opts[optionName];
4954
+
4955
+ if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
4956
+ opts[optionName] = true;
4957
+ }
4958
+
4959
+ if (!opts.buttonsOrder.includes(buttonName)) {
4960
+ opts.buttonsOrder.push(buttonName);
4961
+ }
4962
+ } // Adding the button html to the final toolbar html when the showOption is true
4735
4963
 
4736
- if (typeof opts.buttonsOrder === 'string') {
4737
- opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4738
- }
4739
4964
 
4740
4965
  var _iteratorNormalCompletion = true;
4741
4966
  var _didIteratorError = false;
@@ -4744,8 +4969,9 @@
4744
4969
  try {
4745
4970
  for (var _iterator = opts.buttonsOrder[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4746
4971
  var button = _step.value;
4972
+ var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
4747
4973
 
4748
- if (opts['show' + button.charAt(0).toUpperCase() + button.substring(1)]) {
4974
+ if (_showOption) {
4749
4975
  html.push(buttonsHtml[button]);
4750
4976
  }
4751
4977
  }
@@ -4770,28 +4996,42 @@
4770
4996
  this.$toolbar.append(html.join(''));
4771
4997
  }
4772
4998
 
4773
- if (opts.showPaginationSwitch) {
4774
- this.$toolbar.find('button[name="paginationSwitch"]').off('click').on('click', function () {
4775
- return _this4.togglePagination();
4776
- });
4777
- }
4999
+ for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
5000
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
5001
+ _buttonName = _Object$entries3$_i[0],
5002
+ _buttonConfig = _Object$entries3$_i[1];
4778
5003
 
4779
- if (opts.showFullscreen) {
4780
- this.$toolbar.find('button[name="fullscreen"]').off('click').on('click', function () {
4781
- return _this4.toggleFullscreen();
4782
- });
4783
- }
5004
+ if (_buttonConfig.hasOwnProperty('event')) {
5005
+ if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
5006
+ var _ret = function () {
5007
+ var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
4784
5008
 
4785
- if (opts.showRefresh) {
4786
- this.$toolbar.find('button[name="refresh"]').off('click').on('click', function () {
4787
- return _this4.refresh();
4788
- });
4789
- }
5009
+ _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
5010
+ return event.call(_this4);
5011
+ });
4790
5012
 
4791
- if (opts.showToggle) {
4792
- this.$toolbar.find('button[name="toggle"]').off('click').on('click', function () {
4793
- _this4.toggleView();
4794
- });
5013
+ return "continue";
5014
+ }();
5015
+
5016
+ if (_ret === "continue") continue;
5017
+ }
5018
+
5019
+ var _loop = function _loop() {
5020
+ var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
5021
+ eventType = _Object$entries5$_i[0],
5022
+ eventFunction = _Object$entries5$_i[1];
5023
+
5024
+ var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
5025
+
5026
+ _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
5027
+ return event.call(_this4);
5028
+ });
5029
+ };
5030
+
5031
+ for (var _i5 = 0, _Object$entries5 = Object.entries(_buttonConfig.event); _i5 < _Object$entries5.length; _i5++) {
5032
+ _loop();
5033
+ }
5034
+ }
4795
5035
  }
4796
5036
 
4797
5037
  if (opts.showColumns) {
@@ -4843,14 +5083,35 @@
4843
5083
  });
4844
5084
  });
4845
5085
  }
4846
- } // Fix #4516: this.showSearchClearButton is for extensions
5086
+ }
5087
+
5088
+ var handleInputEvent = function handleInputEvent($searchInput) {
5089
+ var eventTriggers = 'keyup drop blur mouseup';
5090
+ $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
5091
+ if (opts.searchOnEnterKey && event.keyCode !== 13) {
5092
+ return;
5093
+ }
5094
+
5095
+ if ([37, 38, 39, 40].includes(event.keyCode)) {
5096
+ return;
5097
+ }
5098
+
5099
+ clearTimeout(timeoutId); // doesn't matter if it's 0
5100
+
5101
+ timeoutId = setTimeout(function () {
5102
+ _this4.onSearch({
5103
+ currentTarget: event.currentTarget
5104
+ });
5105
+ }, opts.searchTimeOut);
5106
+ });
5107
+ }; // Fix #4516: this.showSearchClearButton is for extensions
4847
5108
 
4848
5109
 
4849
- if (opts.search || this.showSearchClearButton) {
5110
+ if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
4850
5111
  html = [];
4851
5112
  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
5113
  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\">");
5114
+ 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=\"search\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
4854
5115
  var searchInputFinalHtml = searchInputHtml;
4855
5116
 
4856
5117
  if (opts.showSearchButton || opts.showSearchClearButton) {
@@ -4861,28 +5122,7 @@
4861
5122
 
4862
5123
  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));
4863
5124
  this.$toolbar.append(html.join(''));
4864
- var $searchInput = this.$toolbar.find('.search input');
4865
-
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
- }
4872
-
4873
- if ([37, 38, 39, 40].includes(event.keyCode)) {
4874
- return;
4875
- }
4876
-
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
- };
5125
+ var $searchInput = Utils.getSearchInput(this);
4886
5126
 
4887
5127
  if (opts.showSearchButton) {
4888
5128
  this.$toolbar.find('.search button[name=search]').off('click').on('click', function (event) {
@@ -4896,10 +5136,10 @@
4896
5136
  });
4897
5137
 
4898
5138
  if (opts.searchOnEnterKey) {
4899
- handleInputEvent();
5139
+ handleInputEvent($searchInput);
4900
5140
  }
4901
5141
  } else {
4902
- handleInputEvent();
5142
+ handleInputEvent($searchInput);
4903
5143
  }
4904
5144
 
4905
5145
  if (opts.showSearchClearButton) {
@@ -4907,6 +5147,10 @@
4907
5147
  _this4.resetSearch();
4908
5148
  });
4909
5149
  }
5150
+ } else if (typeof opts.searchSelector === 'string') {
5151
+ var _$searchInput = Utils.getSearchInput(this);
5152
+
5153
+ handleInputEvent(_$searchInput);
4910
5154
  }
4911
5155
  }
4912
5156
  }, {
@@ -4925,11 +5169,11 @@
4925
5169
  $(currentTarget).val(text);
4926
5170
  }
4927
5171
 
4928
- if (this.searchText === text && text.length > 0) {
5172
+ if (this.searchText === text) {
4929
5173
  return;
4930
5174
  }
4931
5175
 
4932
- if ($(currentTarget).hasClass('search-input')) {
5176
+ if (currentTarget === Utils.getSearchInput(this)[0] || $(currentTarget).hasClass('search-input')) {
4933
5177
  this.searchText = text;
4934
5178
  this.options.searchText = text;
4935
5179
  }
@@ -4961,6 +5205,11 @@
4961
5205
  if (this.options.sidePagination !== 'server') {
4962
5206
  if (this.options.customSearch) {
4963
5207
  this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
5208
+
5209
+ if (this.options.sortReset) {
5210
+ this.unsortedData = _toConsumableArray(this.data);
5211
+ }
5212
+
4964
5213
  return;
4965
5214
  }
4966
5215
 
@@ -5012,9 +5261,9 @@
5012
5261
  value = item;
5013
5262
  var props = key.split('.');
5014
5263
 
5015
- for (var _i2 = 0; _i2 < props.length; _i2++) {
5016
- if (value[props[_i2]] !== null) {
5017
- value = value[props[_i2]];
5264
+ for (var _i6 = 0; _i6 < props.length; _i6++) {
5265
+ if (value[props[_i6]] !== null) {
5266
+ value = value[props[_i6]];
5018
5267
  }
5019
5268
  }
5020
5269
  } else {
@@ -5434,10 +5683,10 @@
5434
5683
  style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
5435
5684
 
5436
5685
  if (style && style.css) {
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];
5686
+ for (var _i7 = 0, _Object$entries6 = Object.entries(style.css); _i7 < _Object$entries6.length; _i7++) {
5687
+ var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
5688
+ key = _Object$entries6$_i[0],
5689
+ value = _Object$entries6$_i[1];
5441
5690
 
5442
5691
  csses.push("".concat(key, ": ").concat(value));
5443
5692
  }
@@ -5446,20 +5695,20 @@
5446
5695
  attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
5447
5696
 
5448
5697
  if (attributes) {
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];
5698
+ for (var _i8 = 0, _Object$entries7 = Object.entries(attributes); _i8 < _Object$entries7.length; _i8++) {
5699
+ var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
5700
+ _key2 = _Object$entries7$_i[0],
5701
+ _value = _Object$entries7$_i[1];
5453
5702
 
5454
5703
  htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
5455
5704
  }
5456
5705
  }
5457
5706
 
5458
5707
  if (item._data && !Utils.isEmptyObject(item._data)) {
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];
5708
+ for (var _i9 = 0, _Object$entries8 = Object.entries(item._data); _i9 < _Object$entries8.length; _i9++) {
5709
+ var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
5710
+ k = _Object$entries8$_i[0],
5711
+ v = _Object$entries8$_i[1];
5463
5712
 
5464
5713
  // ignore data-index
5465
5714
  if (k === 'index') {
@@ -5470,7 +5719,7 @@
5470
5719
  }
5471
5720
  }
5472
5721
 
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_), '>');
5722
+ 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)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " 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_), '>');
5474
5723
 
5475
5724
  if (this.options.cardView) {
5476
5725
  html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
@@ -5501,6 +5750,7 @@
5501
5750
  var id_ = '';
5502
5751
  var class_ = _this7.header.classes[j];
5503
5752
  var style_ = '';
5753
+ var styleToAdd_ = '';
5504
5754
  var data_ = '';
5505
5755
  var rowspan_ = '';
5506
5756
  var colspan_ = '';
@@ -5523,11 +5773,21 @@
5523
5773
 
5524
5774
  if (column.escape) {
5525
5775
  value_ = Utils.escapeHTML(value_);
5526
- }
5776
+ } // Style concat
5777
+
5527
5778
 
5528
5779
  if (csses.concat([_this7.header.styles[j]]).length) {
5529
- style_ = " style=\"".concat(csses.concat([_this7.header.styles[j]]).join('; '), "\"");
5530
- } // handle id and class of td
5780
+ styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
5781
+ }
5782
+
5783
+ if (item["_".concat(field, "_style")]) {
5784
+ styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
5785
+ }
5786
+
5787
+ if (styleToAdd_) {
5788
+ style_ = " style=\"".concat(styleToAdd_, "\"");
5789
+ } // Style concat
5790
+ // handle id and class of td
5531
5791
 
5532
5792
 
5533
5793
  if (item["_".concat(field, "_id")]) {
@@ -5559,10 +5819,10 @@
5559
5819
  if (cellStyle.css) {
5560
5820
  var csses_ = [];
5561
5821
 
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];
5822
+ for (var _i10 = 0, _Object$entries9 = Object.entries(cellStyle.css); _i10 < _Object$entries9.length; _i10++) {
5823
+ var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
5824
+ _key3 = _Object$entries9$_i[0],
5825
+ _value2 = _Object$entries9$_i[1];
5566
5826
 
5567
5827
  csses_.push("".concat(_key3, ": ").concat(_value2));
5568
5828
  }
@@ -5572,11 +5832,15 @@
5572
5832
 
5573
5833
  value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
5574
5834
 
5835
+ if (_this7.searchText !== '' && _this7.options.searchHighlight) {
5836
+ value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], value.replace(new RegExp('(' + _this7.searchText + ')', 'gim'), '<mark>$1</mark>'));
5837
+ }
5838
+
5575
5839
  if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
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];
5840
+ for (var _i11 = 0, _Object$entries10 = Object.entries(item["_".concat(field, "_data")]); _i11 < _Object$entries10.length; _i11++) {
5841
+ var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
5842
+ _k = _Object$entries10$_i[0],
5843
+ _v = _Object$entries10$_i[1];
5580
5844
 
5581
5845
  // ignore data-index
5582
5846
  if (_k === 'index') {
@@ -5591,7 +5855,7 @@
5591
5855
  type = column.checkbox ? 'checkbox' : type;
5592
5856
  type = column.radio ? 'radio' : type;
5593
5857
  var c = column['class'] || '';
5594
- var isChecked = (value === true || value_ || value && value.checked) && value !== false;
5858
+ var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
5595
5859
  var isDisabled = !column.checkboxEnabled || value && value.disabled;
5596
5860
  text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
5597
5861
  item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
@@ -5664,7 +5928,7 @@
5664
5928
 
5665
5929
 
5666
5930
  if (!hasTr) {
5667
- this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length, this.options.formatNoMatches()), "</tr>"));
5931
+ this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
5668
5932
  } else {
5669
5933
  if (!this.options.virtualScroll) {
5670
5934
  this.$body.html(trFragments);
@@ -5720,7 +5984,7 @@
5720
5984
 
5721
5985
  var fields = _this9.getVisibleFields();
5722
5986
 
5723
- var field = fields[Utils.hasDetailViewIcon(_this9.options) && _this9.options.detailViewAlign !== 'right' ? index - 1 : index];
5987
+ var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
5724
5988
  var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
5725
5989
  var value = Utils.getItemField(item, field, _this9.options.escape);
5726
5990
 
@@ -5783,11 +6047,9 @@
5783
6047
  return;
5784
6048
  }
5785
6049
 
5786
- if (Utils.hasDetailViewIcon(_this9.options) && _this9.options.detailViewAlign !== 'right') {
5787
- fieldIndex += 1;
5788
- }
6050
+ fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
5789
6051
 
5790
- var _loop = function _loop(key) {
6052
+ var _loop2 = function _loop2(key) {
5791
6053
  if (!events.hasOwnProperty(key)) {
5792
6054
  return "continue";
5793
6055
  }
@@ -5810,9 +6072,9 @@
5810
6072
  };
5811
6073
 
5812
6074
  for (var key in events) {
5813
- var _ret = _loop(key);
6075
+ var _ret2 = _loop2(key);
5814
6076
 
5815
- if (_ret === "continue") continue;
6077
+ if (_ret2 === "continue") continue;
5816
6078
  }
5817
6079
  });
5818
6080
  }
@@ -5964,7 +6226,7 @@
5964
6226
  this.searchText = '';
5965
6227
 
5966
6228
  if (this.options.searchText !== '') {
5967
- var $search = this.$toolbar.find('.search input');
6229
+ var $search = Utils.getSearchInput(this);
5968
6230
  $search.val(this.options.searchText);
5969
6231
  this.onSearch({
5970
6232
  currentTarget: $search,
@@ -6037,7 +6299,7 @@
6037
6299
  }, {
6038
6300
  key: "trigger",
6039
6301
  value: function trigger(_name) {
6040
- var _this$options;
6302
+ var _this$options, _this$options2;
6041
6303
 
6042
6304
  var name = "".concat(_name, ".bs.table");
6043
6305
 
@@ -6045,11 +6307,17 @@
6045
6307
  args[_key4 - 1] = arguments[_key4];
6046
6308
  }
6047
6309
 
6048
- (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, args);
6310
+ (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
6311
+
6312
+ this.$el.trigger($.Event(name, {
6313
+ sender: this
6314
+ }), args);
6315
+
6316
+ (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
6049
6317
 
6050
- this.$el.trigger($.Event(name), args);
6051
- this.options.onAll(name, args);
6052
- this.$el.trigger($.Event('all.bs.table'), [name, args]);
6318
+ this.$el.trigger($.Event('all.bs.table', {
6319
+ sender: this
6320
+ }), [name, args]);
6053
6321
  }
6054
6322
  }, {
6055
6323
  key: "resetHeader",
@@ -6134,7 +6402,7 @@
6134
6402
  }
6135
6403
  }
6136
6404
 
6137
- var index = Utils.hasDetailViewIcon(_this14.options) && _this14.options.detailViewAlign !== 'right' ? i - 1 : i;
6405
+ var index = i - Utils.getDetailViewIndexOffset(_this14.options);
6138
6406
 
6139
6407
  var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
6140
6408
 
@@ -6181,7 +6449,7 @@
6181
6449
  var style = {};
6182
6450
  var class_ = Utils.sprintf(' class="%s"', column['class']);
6183
6451
 
6184
- if (!column.visible) {
6452
+ if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
6185
6453
  continue;
6186
6454
  }
6187
6455
 
@@ -6194,12 +6462,12 @@
6194
6462
  style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
6195
6463
 
6196
6464
  if (style && style.css) {
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];
6465
+ for (var _i12 = 0, _Object$entries11 = Object.entries(style.css); _i12 < _Object$entries11.length; _i12++) {
6466
+ var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
6467
+ key = _Object$entries11$_i[0],
6468
+ _value3 = _Object$entries11$_i[1];
6201
6469
 
6202
- csses.push("".concat(key, ": ").concat(value));
6470
+ csses.push("".concat(key, ": ").concat(_value3));
6203
6471
  }
6204
6472
  }
6205
6473
 
@@ -6207,9 +6475,26 @@
6207
6475
  class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
6208
6476
  }
6209
6477
 
6210
- html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')), '>');
6478
+ html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
6479
+ var colspan = 0;
6480
+
6481
+ if (this.footerData && this.footerData.length > 0) {
6482
+ colspan = this.footerData[0]['_' + column.field + '_colspan'] || 0;
6483
+ }
6484
+
6485
+ if (colspan) {
6486
+ html.push(" colspan=\"".concat(colspan, "\" "));
6487
+ }
6488
+
6489
+ html.push('>');
6211
6490
  html.push('<div class="th-inner">');
6212
- html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data], this.footerData[0] && this.footerData[0][column.field] || ''));
6491
+ var value = '';
6492
+
6493
+ if (this.footerData && this.footerData.length > 0) {
6494
+ value = this.footerData[0][column.field] || '';
6495
+ }
6496
+
6497
+ html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
6213
6498
  html.push('</div>');
6214
6499
  html.push('<div class="fht-cell"></div>');
6215
6500
  html.push('</div>');
@@ -6260,6 +6545,7 @@
6260
6545
  var visibleFields = this.getVisibleFields();
6261
6546
  var $ths = this.$tableFooter.find('th');
6262
6547
  var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
6548
+ $ths.find('.fht-cell').width('auto');
6263
6549
 
6264
6550
  while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
6265
6551
  $tr = $tr.next();
@@ -6378,7 +6664,7 @@
6378
6664
 
6379
6665
  var data = this.options.data;
6380
6666
 
6381
- if ((this.searchText || this.options.customSearch || this.options.sortName || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
6667
+ if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
6382
6668
  data = this.data;
6383
6669
  }
6384
6670
 
@@ -6395,10 +6681,10 @@
6395
6681
 
6396
6682
  if (params && params.formatted) {
6397
6683
  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];
6684
+ for (var _i13 = 0, _Object$entries12 = Object.entries(row); _i13 < _Object$entries12.length; _i13++) {
6685
+ var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
6686
+ key = _Object$entries12$_i[0],
6687
+ value = _Object$entries12$_i[1];
6402
6688
 
6403
6689
  var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
6404
6690
 
@@ -6418,18 +6704,8 @@
6418
6704
  value: function getSelections() {
6419
6705
  var _this18 = this;
6420
6706
 
6421
- // fix #2424: from html with checkbox
6422
- return this.data.filter(function (row) {
6423
- return row[_this18.header.stateField] === true;
6424
- });
6425
- }
6426
- }, {
6427
- key: "getAllSelections",
6428
- value: function getAllSelections() {
6429
- var _this19 = this;
6430
-
6431
6707
  return this.options.data.filter(function (row) {
6432
- return row[_this19.header.stateField] === true;
6708
+ return row[_this18.header.stateField] === true;
6433
6709
  });
6434
6710
  }
6435
6711
  }, {
@@ -6440,10 +6716,8 @@
6440
6716
 
6441
6717
  if (this.options.pagination && this.options.sidePagination === 'server') {
6442
6718
  this.options.totalRows = data[this.options.totalField];
6443
- }
6444
-
6445
- if (this.options.pagination && this.options.sidePagination === 'server') {
6446
6719
  this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
6720
+ this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
6447
6721
  }
6448
6722
 
6449
6723
  fixedScroll = data.fixedScroll;
@@ -6704,7 +6978,7 @@
6704
6978
  }, {
6705
6979
  key: "updateCellByUniqueId",
6706
6980
  value: function updateCellByUniqueId(params) {
6707
- var _this20 = this;
6981
+ var _this19 = this;
6708
6982
 
6709
6983
  var allParams = Array.isArray(params) ? params : [params];
6710
6984
  allParams.forEach(function (_ref6) {
@@ -6712,13 +6986,13 @@
6712
6986
  field = _ref6.field,
6713
6987
  value = _ref6.value;
6714
6988
 
6715
- var rowId = _this20.options.data.indexOf(_this20.getRowByUniqueId(id));
6989
+ var rowId = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
6716
6990
 
6717
6991
  if (rowId === -1) {
6718
6992
  return;
6719
6993
  }
6720
6994
 
6721
- _this20.options.data[rowId][field] = value;
6995
+ _this19.options.data[rowId][field] = value;
6722
6996
  });
6723
6997
 
6724
6998
  if (params.reinit === false) {
@@ -6809,21 +7083,21 @@
6809
7083
  }, {
6810
7084
  key: "showColumn",
6811
7085
  value: function showColumn(field) {
6812
- var _this21 = this;
7086
+ var _this20 = this;
6813
7087
 
6814
7088
  var fields = Array.isArray(field) ? field : [field];
6815
7089
  fields.forEach(function (field) {
6816
- _this21._toggleColumn(_this21.fieldsColumnsIndex[field], true, true);
7090
+ _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
6817
7091
  });
6818
7092
  }
6819
7093
  }, {
6820
7094
  key: "hideColumn",
6821
7095
  value: function hideColumn(field) {
6822
- var _this22 = this;
7096
+ var _this21 = this;
6823
7097
 
6824
7098
  var fields = Array.isArray(field) ? field : [field];
6825
7099
  fields.forEach(function (field) {
6826
- _this22._toggleColumn(_this22.fieldsColumnsIndex[field], false, true);
7100
+ _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
6827
7101
  });
6828
7102
  }
6829
7103
  }, {
@@ -6854,10 +7128,10 @@
6854
7128
  }, {
6855
7129
  key: "getVisibleColumns",
6856
7130
  value: function getVisibleColumns() {
6857
- var _this23 = this;
7131
+ var _this22 = this;
6858
7132
 
6859
7133
  return this.columns.filter(function (column) {
6860
- return column.visible && !_this23.isSelectionColumn(column);
7134
+ return column.visible && !_this22.isSelectionColumn(column);
6861
7135
  });
6862
7136
  }
6863
7137
  }, {
@@ -6886,7 +7160,7 @@
6886
7160
  }, {
6887
7161
  key: "_toggleAllColumns",
6888
7162
  value: function _toggleAllColumns(visible) {
6889
- var _this24 = this;
7163
+ var _this23 = this;
6890
7164
 
6891
7165
  var _iteratorNormalCompletion9 = true;
6892
7166
  var _didIteratorError9 = false;
@@ -6931,7 +7205,7 @@
6931
7205
  $items.prop('checked', visible);
6932
7206
  } else {
6933
7207
  $items.get().reverse().forEach(function (item) {
6934
- if ($items.filter(':checked').length > _this24.options.minimumCountColumns) {
7208
+ if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
6935
7209
  $(item).prop('checked', visible);
6936
7210
  }
6937
7211
  });
@@ -6952,11 +7226,7 @@
6952
7226
  var i;
6953
7227
  var j;
6954
7228
  var $tr = this.$body.find('>tr');
6955
-
6956
- if (Utils.hasDetailViewIcon(this.options)) {
6957
- col += 1;
6958
- }
6959
-
7229
+ col += Utils.getDetailViewIndexOffset(this.options);
6960
7230
  var $td = $tr.eq(row).find('>td').eq(col);
6961
7231
 
6962
7232
  if (row < 0 || col < 0 || row >= this.data.length) {
@@ -6988,6 +7258,7 @@
6988
7258
  this.$selectAll.add(this.$selectAll_).prop('checked', checked);
6989
7259
  this.$selectItem.filter(':enabled').prop('checked', checked);
6990
7260
  this.updateRows();
7261
+ this.updateSelected();
6991
7262
  var rowsAfter = this.getSelections();
6992
7263
 
6993
7264
  if (checked) {
@@ -7025,7 +7296,7 @@
7025
7296
  key: "_toggleCheck",
7026
7297
  value: function _toggleCheck(checked, index) {
7027
7298
  var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
7028
- var row = this.data[index];
7299
+ var row = this.options.data[index];
7029
7300
 
7030
7301
  if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
7031
7302
  var _iteratorNormalCompletion10 = true;
@@ -7089,7 +7360,7 @@
7089
7360
  }, {
7090
7361
  key: "_toggleCheckBy",
7091
7362
  value: function _toggleCheckBy(checked, obj) {
7092
- var _this25 = this;
7363
+ var _this24 = this;
7093
7364
 
7094
7365
  if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
7095
7366
  return;
@@ -7102,7 +7373,7 @@
7102
7373
  }
7103
7374
 
7104
7375
  if (obj.values.includes(row[obj.field])) {
7105
- var $el = _this25.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
7376
+ var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
7106
7377
 
7107
7378
  $el = checked ? $el.not(':checked') : $el.filter(':checked');
7108
7379
 
@@ -7111,10 +7382,10 @@
7111
7382
  }
7112
7383
 
7113
7384
  $el.prop('checked', checked);
7114
- row[_this25.header.stateField] = checked;
7385
+ row[_this24.header.stateField] = checked;
7115
7386
  rows.push(row);
7116
7387
 
7117
- _this25.trigger(checked ? 'check' : 'uncheck', row, $el);
7388
+ _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
7118
7389
  }
7119
7390
  });
7120
7391
  this.updateSelected();
@@ -7220,7 +7491,7 @@
7220
7491
  }, {
7221
7492
  key: "showLoading",
7222
7493
  value: function showLoading() {
7223
- this.$tableLoading.css('display', 'flex');
7494
+ this.$tableLoading.toggleClass('open', true);
7224
7495
  var fontSize = this.options.loadingFontSize;
7225
7496
 
7226
7497
  if (this.options.loadingFontSize === 'auto') {
@@ -7235,7 +7506,7 @@
7235
7506
  }, {
7236
7507
  key: "hideLoading",
7237
7508
  value: function hideLoading() {
7238
- this.$tableLoading.css('display', 'none');
7509
+ this.$tableLoading.toggleClass('open', false);
7239
7510
  }
7240
7511
  }, {
7241
7512
  key: "togglePagination",
@@ -7266,7 +7537,7 @@
7266
7537
  }, {
7267
7538
  key: "resetSearch",
7268
7539
  value: function resetSearch(text) {
7269
- var $search = this.$toolbar.find('.search input');
7540
+ var $search = Utils.getSearchInput(this);
7270
7541
  $search.val(text || '');
7271
7542
  this.onSearch({
7272
7543
  currentTarget: $search
@@ -7284,10 +7555,6 @@
7284
7555
  }, {
7285
7556
  key: "scrollTo",
7286
7557
  value: function scrollTo(params) {
7287
- if (typeof params === 'undefined') {
7288
- return this.$tableBody.scrollTop();
7289
- }
7290
-
7291
7558
  var options = {
7292
7559
  unit: 'px',
7293
7560
  value: 0
@@ -7315,7 +7582,7 @@
7315
7582
  }, {
7316
7583
  key: "getScrollPosition",
7317
7584
  value: function getScrollPosition() {
7318
- return this.scrollTo();
7585
+ return this.$tableBody.scrollTop();
7319
7586
  }
7320
7587
  }, {
7321
7588
  key: "selectPage",
@@ -7518,7 +7785,9 @@
7518
7785
  }
7519
7786
 
7520
7787
  if (!data) {
7521
- $(el).data('bootstrap.table', data = new $.BootstrapTable(el, options));
7788
+ data = new $.BootstrapTable(el, options);
7789
+ $(el).data('bootstrap.table', data);
7790
+ data.init();
7522
7791
  }
7523
7792
  });
7524
7793
  return typeof value === 'undefined' ? this : value;