bootstrap-table-rails 1.16.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +142 -33
  3. data/lib/bootstrap-table-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +1017 -129
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +7 -1
  6. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +7 -1
  7. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +18 -8
  8. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +1055 -457
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +58 -13
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +64 -14
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1040 -241
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +84 -17
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +1198 -0
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +1 -1
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +1054 -209
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +110 -31
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +928 -726
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/{cell-input/bootstrap-table-cell-input.js → filter-control/utils.js} +1152 -1028
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +52 -1
  20. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css +3 -2
  21. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +196 -523
  22. data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +1 -1
  23. data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +3 -2
  24. data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +6 -8
  25. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +122 -470
  26. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +27 -4
  27. data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +9 -10
  28. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +267 -35
  29. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +17 -6
  30. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +6 -3
  31. data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +1 -1
  32. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +21 -7
  33. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +120 -28
  34. data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +14 -1
  35. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +17 -2
  36. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +17 -2
  37. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +777 -0
  38. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +17 -2
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +17 -2
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +17 -2
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +18 -3
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +17 -2
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +17 -2
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +16 -1
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +33 -18
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +16 -1
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +31 -16
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +16 -1
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +16 -1
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +16 -1
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +17 -2
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +17 -2
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +17 -2
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +17 -2
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +16 -1
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +16 -1
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +25 -10
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +16 -1
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +17 -2
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +17 -2
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +17 -2
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +17 -2
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +32 -17
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +17 -2
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +17 -2
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +17 -2
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +17 -2
  68. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +17 -2
  69. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +17 -2
  70. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +17 -2
  71. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +35 -19
  72. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +19 -3
  73. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +17 -2
  74. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +17 -2
  75. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +17 -2
  76. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +31 -16
  77. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +17 -2
  78. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +16 -1
  79. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +17 -2
  80. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +17 -2
  81. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +17 -2
  82. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +17 -2
  83. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +17 -2
  84. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +17 -2
  85. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +17 -2
  86. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +17 -2
  87. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +16 -1
  88. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +781 -0
  89. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.js +1049 -0
  90. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.eot +0 -0
  91. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.svg +28 -0
  92. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.ttf +0 -0
  93. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.woff +0 -0
  94. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +17 -7
  95. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +55 -3
  96. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +22 -7
  97. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +63 -5
  98. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +22 -7
  99. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +63 -5
  100. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +17 -7
  101. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +54 -2
  102. metadata +10 -4
  103. data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +0 -2647
  104. data/vendor/assets/javascripts/bootstrap-table/extensions/cell-input/bootstrap-table-cell-input.css +0 -12
@@ -4,7 +4,7 @@
4
4
  (global = global || self, global.BootstrapTable = factory(global.jQuery));
5
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
 
@@ -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,9 @@
2851
2946
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2852
2947
  }
2853
2948
 
2854
- var VERSION = '1.16.0';
2949
+ /* eslint-disable no-unused-vars */
2950
+
2951
+ var VERSION = '1.18.1';
2855
2952
  var bootstrapVersion = 4;
2856
2953
 
2857
2954
  try {
@@ -2864,6 +2961,16 @@
2864
2961
  } catch (e) {// ignore
2865
2962
  }
2866
2963
 
2964
+ try {
2965
+ // eslint-disable-next-line no-undef
2966
+ var _rawVersion = bootstrap.Tooltip.VERSION;
2967
+
2968
+ if (_rawVersion !== undefined) {
2969
+ bootstrapVersion = parseInt(_rawVersion, 10);
2970
+ }
2971
+ } catch (e) {// ignore
2972
+ }
2973
+
2867
2974
  var CONSTANTS = {
2868
2975
  3: {
2869
2976
  iconsPrefix: 'glyphicon',
@@ -2956,11 +3063,58 @@
2956
3063
  searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
2957
3064
  searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
2958
3065
  }
3066
+ },
3067
+ 5: {
3068
+ iconsPrefix: 'fa',
3069
+ icons: {
3070
+ paginationSwitchDown: 'fa-caret-square-down',
3071
+ paginationSwitchUp: 'fa-caret-square-up',
3072
+ refresh: 'fa-sync',
3073
+ toggleOff: 'fa-toggle-off',
3074
+ toggleOn: 'fa-toggle-on',
3075
+ columns: 'fa-th-list',
3076
+ detailOpen: 'fa-plus',
3077
+ detailClose: 'fa-minus',
3078
+ fullscreen: 'fa-arrows-alt',
3079
+ search: 'fa-search',
3080
+ clearSearch: 'fa-trash'
3081
+ },
3082
+ classes: {
3083
+ buttonsPrefix: 'btn',
3084
+ buttons: 'secondary',
3085
+ buttonsGroup: 'btn-group',
3086
+ buttonsDropdown: 'btn-group',
3087
+ pull: 'float',
3088
+ inputGroup: 'btn-group',
3089
+ inputPrefix: 'form-control-',
3090
+ input: 'form-control',
3091
+ paginationDropdown: 'btn-group dropdown',
3092
+ dropup: 'dropup',
3093
+ dropdownActive: 'active',
3094
+ paginationActive: 'active',
3095
+ buttonActive: 'active'
3096
+ },
3097
+ html: {
3098
+ toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
3099
+ toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
3100
+ pageDropdown: ['<div class="dropdown-menu">', '</div>'],
3101
+ pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
3102
+ toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
3103
+ dropdownCaret: '<span class="caret"></span>',
3104
+ pagination: ['<ul class="pagination%s">', '</ul>'],
3105
+ paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
3106
+ icon: '<i class="%s %s"></i>',
3107
+ inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
3108
+ searchInput: '<input class="%s%s" type="text" placeholder="%s">',
3109
+ searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
3110
+ searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
3111
+ }
2959
3112
  }
2960
3113
  }[bootstrapVersion];
2961
3114
  var DEFAULTS = {
2962
3115
  height: undefined,
2963
3116
  classes: 'table table-bordered table-hover',
3117
+ buttons: {},
2964
3118
  theadClasses: '',
2965
3119
  headerStyle: function headerStyle(column) {
2966
3120
  return {};
@@ -2979,7 +3133,8 @@
2979
3133
  sortClass: undefined,
2980
3134
  silentSort: true,
2981
3135
  sortName: undefined,
2982
- sortOrder: 'asc',
3136
+ sortOrder: undefined,
3137
+ sortReset: false,
2983
3138
  sortStable: false,
2984
3139
  rememberOrder: false,
2985
3140
  serverSort: true,
@@ -3004,8 +3159,9 @@
3004
3159
  totalField: 'total',
3005
3160
  totalNotFilteredField: 'totalNotFiltered',
3006
3161
  dataField: 'rows',
3162
+ footerField: 'footer',
3007
3163
  pagination: false,
3008
- onlyInfoPagination: false,
3164
+ paginationParts: ['pageInfo', 'pageSize', 'pageList'],
3009
3165
  showExtendedPagination: false,
3010
3166
  paginationLoop: true,
3011
3167
  sidePagination: 'client',
@@ -3030,8 +3186,10 @@
3030
3186
  paginationUseIntermediate: false,
3031
3187
  // Calculate intermediate pages for quick access
3032
3188
  search: false,
3189
+ searchHighlight: false,
3033
3190
  searchOnEnterKey: false,
3034
3191
  strictSearch: false,
3192
+ searchSelector: false,
3035
3193
  visibleSearch: false,
3036
3194
  showButtonIcons: true,
3037
3195
  showButtonText: false,
@@ -3047,6 +3205,7 @@
3047
3205
  footerStyle: function footerStyle(column) {
3048
3206
  return {};
3049
3207
  },
3208
+ searchAccentNeutralise: false,
3050
3209
  showColumns: false,
3051
3210
  showColumnsToggleAll: false,
3052
3211
  showColumnsSearch: false,
@@ -3076,6 +3235,7 @@
3076
3235
  detailView: false,
3077
3236
  detailViewIcon: true,
3078
3237
  detailViewByClick: false,
3238
+ detailViewAlign: 'left',
3079
3239
  detailFormatter: function detailFormatter(index, row) {
3080
3240
  return '';
3081
3241
  },
@@ -3090,10 +3250,13 @@
3090
3250
  buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
3091
3251
  buttonsClass: CONSTANTS.classes.buttons,
3092
3252
  icons: CONSTANTS.icons,
3093
- html: CONSTANTS.html,
3094
3253
  iconSize: undefined,
3095
3254
  iconsPrefix: CONSTANTS.iconsPrefix,
3096
3255
  // glyphicon or fa(font-awesome)
3256
+ loadingFontSize: 'auto',
3257
+ loadingTemplate: function loadingTemplate(loadingMessage) {
3258
+ 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 ");
3259
+ },
3097
3260
  onAll: function onAll(name, args) {
3098
3261
  return false;
3099
3262
  },
@@ -3252,7 +3415,7 @@
3252
3415
  field: undefined,
3253
3416
  title: undefined,
3254
3417
  titleTooltip: undefined,
3255
- 'class': undefined,
3418
+ class: undefined,
3256
3419
  width: undefined,
3257
3420
  widthUnit: 'px',
3258
3421
  rowspan: undefined,
@@ -3284,10 +3447,11 @@
3284
3447
  footerFormatter: undefined,
3285
3448
  detailFormatter: undefined,
3286
3449
  searchFormatter: true,
3450
+ searchHighlightFormatter: false,
3287
3451
  escape: false,
3288
3452
  events: undefined
3289
3453
  };
3290
- 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', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
3454
+ 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'];
3291
3455
  var EVENTS = {
3292
3456
  'all.bs.table': 'onAll',
3293
3457
  'click-row.bs.table': 'onClickRow',
@@ -3343,7 +3507,78 @@
3343
3507
  }
3344
3508
  });
3345
3509
 
3510
+ var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
3511
+
3512
+
3513
+
3514
+
3515
+
3516
+
3517
+ var nativeEndsWith = ''.endsWith;
3518
+ var min$5 = Math.min;
3519
+
3520
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
3521
+ // https://github.com/zloirock/core-js/pull/702
3522
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
3523
+ var descriptor = getOwnPropertyDescriptor$3(String.prototype, 'endsWith');
3524
+ return descriptor && !descriptor.writable;
3525
+ }();
3526
+
3527
+ // `String.prototype.endsWith` method
3528
+ // https://tc39.github.io/ecma262/#sec-string.prototype.endswith
3529
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
3530
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
3531
+ var that = String(requireObjectCoercible(this));
3532
+ notARegexp(searchString);
3533
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
3534
+ var len = toLength(that.length);
3535
+ var end = endPosition === undefined ? len : min$5(toLength(endPosition), len);
3536
+ var search = String(searchString);
3537
+ return nativeEndsWith
3538
+ ? nativeEndsWith.call(that, search, end)
3539
+ : that.slice(end - search.length, end) === search;
3540
+ }
3541
+ });
3542
+
3543
+ var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
3544
+
3545
+
3546
+
3547
+
3548
+
3549
+
3550
+ var nativeStartsWith = ''.startsWith;
3551
+ var min$6 = Math.min;
3552
+
3553
+ var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith');
3554
+ // https://github.com/zloirock/core-js/pull/702
3555
+ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
3556
+ var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'startsWith');
3557
+ return descriptor && !descriptor.writable;
3558
+ }();
3559
+
3560
+ // `String.prototype.startsWith` method
3561
+ // https://tc39.github.io/ecma262/#sec-string.prototype.startswith
3562
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
3563
+ startsWith: function startsWith(searchString /* , position = 0 */) {
3564
+ var that = String(requireObjectCoercible(this));
3565
+ notARegexp(searchString);
3566
+ var index = toLength(min$6(arguments.length > 1 ? arguments[1] : undefined, that.length));
3567
+ var search = String(searchString);
3568
+ return nativeStartsWith
3569
+ ? nativeStartsWith.call(that, search, index)
3570
+ : that.slice(index, index + search.length) === search;
3571
+ }
3572
+ });
3573
+
3346
3574
  var Utils = {
3575
+ getSearchInput: function getSearchInput(that) {
3576
+ if (typeof that.options.searchSelector === 'string') {
3577
+ return $(that.options.searchSelector);
3578
+ }
3579
+
3580
+ return that.$toolbar.find('.search input');
3581
+ },
3347
3582
  // it only does '%s', and return '' when arguments are undefined
3348
3583
  sprintf: function sprintf(_str) {
3349
3584
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -3366,6 +3601,9 @@
3366
3601
 
3367
3602
  return flag ? str : '';
3368
3603
  },
3604
+ isObject: function isObject(val) {
3605
+ return val instanceof Object && !Array.isArray(val);
3606
+ },
3369
3607
  isEmptyObject: function isEmptyObject() {
3370
3608
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3371
3609
  return Object.entries(obj).length === 0 && obj.constructor === Object;
@@ -3463,12 +3701,10 @@
3463
3701
  r.colspanGroup = r.colspan;
3464
3702
  }
3465
3703
 
3466
- for (var k = 0; k < rowspan; k++) {
3467
- flag[_i + k][index] = true;
3468
- }
3469
-
3470
- for (var _k = 0; _k < colspan; _k++) {
3471
- flag[_i][index + _k] = true;
3704
+ for (var _j = 0; _j < rowspan; _j++) {
3705
+ for (var k = 0; k < colspan; k++) {
3706
+ flag[_i + _j][index + k] = true;
3707
+ }
3472
3708
  }
3473
3709
  }
3474
3710
  } catch (err) {
@@ -3487,6 +3723,13 @@
3487
3723
  }
3488
3724
  }
3489
3725
  },
3726
+ normalizeAccent: function normalizeAccent(value) {
3727
+ if (typeof value !== 'string') {
3728
+ return value;
3729
+ }
3730
+
3731
+ return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
3732
+ },
3490
3733
  updateFieldGroup: function updateFieldGroup(columns) {
3491
3734
  var _ref;
3492
3735
 
@@ -3654,6 +3897,13 @@
3654
3897
 
3655
3898
  return text;
3656
3899
  },
3900
+ unescapeHTML: function unescapeHTML(text) {
3901
+ if (typeof text === 'string') {
3902
+ return text.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#039;/g, '\'').replace(/&#x60;/g, '`');
3903
+ }
3904
+
3905
+ return text;
3906
+ },
3657
3907
  getRealDataAttr: function getRealDataAttr(dataAttr) {
3658
3908
  for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
3659
3909
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
@@ -3743,14 +3993,17 @@
3743
3993
  var data = [];
3744
3994
  var m = [];
3745
3995
  $els.each(function (y, el) {
3996
+ var $el = $(el);
3746
3997
  var row = {}; // save tr's id, class and data-* attributes
3747
3998
 
3748
- row._id = $(el).attr('id');
3749
- row._class = $(el).attr('class');
3750
- row._data = _this.getRealDataAttr($(el).data());
3751
- $(el).find('>td,>th').each(function (_x, el) {
3752
- var cspan = +$(el).attr('colspan') || 1;
3753
- 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;
3754
4007
  var x = _x; // skip already occupied cells in current row
3755
4008
 
3756
4009
  for (; m[y] && m[y][x]; x++) {} // ignore
@@ -3769,14 +4022,15 @@
3769
4022
  }
3770
4023
 
3771
4024
  var field = columns[x].field;
3772
- row[field] = $(el).html().trim(); // save td's id, class and data-* attributes
3773
-
3774
- row["_".concat(field, "_id")] = $(el).attr('id');
3775
- row["_".concat(field, "_class")] = $(el).attr('class');
3776
- row["_".concat(field, "_rowspan")] = $(el).attr('rowspan');
3777
- row["_".concat(field, "_colspan")] = $(el).attr('colspan');
3778
- row["_".concat(field, "_title")] = $(el).attr('title');
3779
- 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');
3780
4034
  });
3781
4035
  data.push(row);
3782
4036
  });
@@ -3828,10 +4082,57 @@
3828
4082
 
3829
4083
  return order;
3830
4084
  },
3831
- getResizeEventName: function getResizeEventName() {
3832
- 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] : '';
3833
4087
  id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
3834
- return "resize.bootstrap-table-".concat(id);
4088
+ return "".concat(eventPrefix, "-").concat(id);
4089
+ },
4090
+ hasDetailViewIcon: function hasDetailViewIcon(options) {
4091
+ return options.detailView && options.detailViewIcon && !options.cardView;
4092
+ },
4093
+ getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
4094
+ return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
4095
+ },
4096
+ checkAutoMergeCells: function checkAutoMergeCells(data) {
4097
+ var _iteratorNormalCompletion9 = true;
4098
+ var _didIteratorError9 = false;
4099
+ var _iteratorError9 = undefined;
4100
+
4101
+ try {
4102
+ for (var _iterator9 = data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
4103
+ var row = _step9.value;
4104
+
4105
+ for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
4106
+ var key = _Object$keys[_i4];
4107
+
4108
+ if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
4109
+ return true;
4110
+ }
4111
+ }
4112
+ }
4113
+ } catch (err) {
4114
+ _didIteratorError9 = true;
4115
+ _iteratorError9 = err;
4116
+ } finally {
4117
+ try {
4118
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
4119
+ _iterator9.return();
4120
+ }
4121
+ } finally {
4122
+ if (_didIteratorError9) {
4123
+ throw _iteratorError9;
4124
+ }
4125
+ }
4126
+ }
4127
+
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);
3835
4136
  }
3836
4137
  };
3837
4138
 
@@ -3998,7 +4299,6 @@
3998
4299
  this.$el_ = this.$el.clone();
3999
4300
  this.timeoutId_ = 0;
4000
4301
  this.timeoutFooter_ = 0;
4001
- this.init();
4002
4302
  }
4003
4303
 
4004
4304
  _createClass(BootstrapTable, [{
@@ -4025,6 +4325,15 @@
4025
4325
  this.constants.theme = $.fn.bootstrapTable.theme;
4026
4326
  var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
4027
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, [], {});
4329
+
4330
+ if (_typeof(this.buttons) !== 'object') {
4331
+ this.buttons = {};
4332
+ }
4333
+
4334
+ if (typeof opts.icons === 'string') {
4335
+ opts.icons = Utils.calculateObjectValue(null, opts.icons);
4336
+ }
4028
4337
  }
4029
4338
  }, {
4030
4339
  key: "initLocale",
@@ -4052,7 +4361,8 @@
4052
4361
  value: function initContainer() {
4053
4362
  var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
4054
4363
  var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
4055
- 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 "));
4364
+ var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
4365
+ 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 "));
4056
4366
  this.$container.insertAfter(this.$el);
4057
4367
  this.$tableContainer = this.$container.find('.fixed-table-container');
4058
4368
  this.$tableHeader = this.$container.find('.fixed-table-header');
@@ -4102,23 +4412,35 @@
4102
4412
  this.$header.addClass(this.options.theadClasses);
4103
4413
  }
4104
4414
 
4415
+ this._headerTrClasses = [];
4416
+ this._headerTrStyles = [];
4105
4417
  this.$header.find('tr').each(function (i, el) {
4418
+ var $tr = $(el);
4106
4419
  var column = [];
4107
- $(el).find('th').each(function (i, el) {
4108
- // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
4109
- if (typeof $(el).data('field') !== 'undefined') {
4110
- $(el).data('field', "".concat($(el).data('field')));
4420
+ $tr.find('th').each(function (i, el) {
4421
+ var $th = $(el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
4422
+
4423
+ if (typeof $th.data('field') !== 'undefined') {
4424
+ $th.data('field', "".concat($th.data('field')));
4111
4425
  }
4112
4426
 
4113
4427
  column.push($.extend({}, {
4114
- title: $(el).html(),
4115
- 'class': $(el).attr('class'),
4116
- titleTooltip: $(el).attr('title'),
4117
- rowspan: $(el).attr('rowspan') ? +$(el).attr('rowspan') : undefined,
4118
- colspan: $(el).attr('colspan') ? +$(el).attr('colspan') : undefined
4119
- }, $(el).data()));
4428
+ title: $th.html(),
4429
+ class: $th.attr('class'),
4430
+ titleTooltip: $th.attr('title'),
4431
+ rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
4432
+ colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
4433
+ }, $th.data()));
4120
4434
  });
4121
4435
  columns.push(column);
4436
+
4437
+ if ($tr.attr('class')) {
4438
+ _this._headerTrClasses.push($tr.attr('class'));
4439
+ }
4440
+
4441
+ if ($tr.attr('style')) {
4442
+ _this._headerTrStyles.push($tr.attr('style'));
4443
+ }
4122
4444
  });
4123
4445
 
4124
4446
  if (!Array.isArray(this.options.columns[0])) {
@@ -4143,14 +4465,17 @@
4143
4465
  }); // if options.data is setting, do not process tbody and tfoot data
4144
4466
 
4145
4467
  if (!this.options.data.length) {
4146
- this.options.data = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
4468
+ var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
4147
4469
 
4148
- if (this.options.data.length) {
4470
+ if (htmlData.length) {
4471
+ this.options.data = htmlData;
4149
4472
  this.fromHtml = true;
4150
4473
  }
4151
4474
  }
4152
4475
 
4153
- this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
4476
+ if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
4477
+ this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
4478
+ }
4154
4479
 
4155
4480
  if (this.footerData) {
4156
4481
  this.$el.find('tfoot').html('<tr></tr>');
@@ -4183,10 +4508,15 @@
4183
4508
  };
4184
4509
  Utils.updateFieldGroup(this.options.columns);
4185
4510
  this.options.columns.forEach(function (columns, i) {
4186
- html.push('<tr>');
4511
+ html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
4512
+ var detailViewTemplate = '';
4513
+
4514
+ if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
4515
+ detailViewTemplate = "<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>");
4516
+ }
4187
4517
 
4188
- if (i === 0 && !_this2.options.cardView && _this2.options.detailView && _this2.options.detailViewIcon) {
4189
- html.push("<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>\n "));
4518
+ if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
4519
+ html.push(detailViewTemplate);
4190
4520
  }
4191
4521
 
4192
4522
  columns.forEach(function (column, j) {
@@ -4274,6 +4604,11 @@
4274
4604
  html.push('</div>');
4275
4605
  html.push('</th>');
4276
4606
  });
4607
+
4608
+ if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
4609
+ html.push(detailViewTemplate);
4610
+ }
4611
+
4277
4612
  html.push('</tr>');
4278
4613
  });
4279
4614
  this.$header.html(html.join(''));
@@ -4303,7 +4638,7 @@
4303
4638
  }
4304
4639
  }
4305
4640
  });
4306
- var resizeEvent = Utils.getResizeEventName(this.$el.attr('id'));
4641
+ var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
4307
4642
  $(window).off(resizeEvent);
4308
4643
 
4309
4644
  if (!this.options.showHeader || this.options.cardView) {
@@ -4339,10 +4674,15 @@
4339
4674
  } else if (type === 'prepend') {
4340
4675
  this.options.data = [].concat(data).concat(this.options.data);
4341
4676
  } else {
4342
- this.options.data = data || this.options.data;
4677
+ data = data || Utils.deepCopy(this.options.data);
4678
+ this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
4343
4679
  }
4344
4680
 
4345
- this.data = this.options.data;
4681
+ this.data = _toConsumableArray(this.options.data);
4682
+
4683
+ if (this.options.sortReset) {
4684
+ this.unsortedData = _toConsumableArray(this.data);
4685
+ }
4346
4686
 
4347
4687
  if (this.options.sidePagination === 'server') {
4348
4688
  return;
@@ -4403,6 +4743,8 @@
4403
4743
  _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
4404
4744
  }, 250);
4405
4745
  }
4746
+ } else if (this.options.sortReset) {
4747
+ this.data = _toConsumableArray(this.unsortedData);
4406
4748
  }
4407
4749
  }
4408
4750
  }, {
@@ -4415,7 +4757,19 @@
4415
4757
  this.$header.add(this.$header_).find('span.order').remove();
4416
4758
 
4417
4759
  if (this.options.sortName === $this.data('field')) {
4418
- this.options.sortOrder = this.options.sortOrder === 'asc' ? 'desc' : 'asc';
4760
+ var currentSortOrder = this.options.sortOrder;
4761
+
4762
+ if (currentSortOrder === undefined) {
4763
+ this.options.sortOrder = 'asc';
4764
+ } else if (currentSortOrder === 'asc') {
4765
+ this.options.sortOrder = 'desc';
4766
+ } else if (this.options.sortOrder === 'desc') {
4767
+ this.options.sortOrder = this.options.sortReset ? undefined : 'asc';
4768
+ }
4769
+
4770
+ if (this.options.sortOrder === undefined) {
4771
+ this.options.sortName = undefined;
4772
+ }
4419
4773
  } else {
4420
4774
  this.options.sortName = $this.data('field');
4421
4775
 
@@ -4464,67 +4818,156 @@
4464
4818
 
4465
4819
  html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
4466
4820
 
4467
- if (typeof opts.icons === 'string') {
4468
- opts.icons = Utils.calculateObjectValue(null, opts.icons);
4469
- }
4821
+ if (typeof opts.buttonsOrder === 'string') {
4822
+ opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
4823
+ }
4824
+
4825
+ this.buttons = Object.assign(this.buttons, {
4826
+ paginationSwitch: {
4827
+ text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
4828
+ icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
4829
+ render: false,
4830
+ event: this.togglePagination,
4831
+ attributes: {
4832
+ 'aria-label': opts.formatPaginationSwitch(),
4833
+ title: opts.formatPaginationSwitch()
4834
+ }
4835
+ },
4836
+ refresh: {
4837
+ text: opts.formatRefresh(),
4838
+ icon: opts.icons.refresh,
4839
+ render: false,
4840
+ event: this.refresh,
4841
+ attributes: {
4842
+ 'aria-label': opts.formatRefresh(),
4843
+ title: opts.formatRefresh()
4844
+ }
4845
+ },
4846
+ toggle: {
4847
+ text: opts.formatToggle(),
4848
+ icon: opts.icons.toggleOff,
4849
+ render: false,
4850
+ event: this.toggleView,
4851
+ attributes: {
4852
+ 'aria-label': opts.formatToggleOn(),
4853
+ title: opts.formatToggleOn()
4854
+ }
4855
+ },
4856
+ fullscreen: {
4857
+ text: opts.formatFullscreen(),
4858
+ icon: opts.icons.fullscreen,
4859
+ render: false,
4860
+ event: this.toggleFullscreen,
4861
+ attributes: {
4862
+ 'aria-label': opts.formatFullscreen(),
4863
+ title: opts.formatFullscreen()
4864
+ }
4865
+ },
4866
+ columns: {
4867
+ render: false,
4868
+ html: function html() {
4869
+ var html = [];
4870
+ 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]));
4871
+
4872
+ if (opts.showColumnsSearch) {
4873
+ 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())));
4874
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4875
+ }
4876
+
4877
+ if (opts.showColumnsToggleAll) {
4878
+ var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4879
+ return !_this4.isSelectionColumn(column);
4880
+ }).length;
4881
+
4882
+ 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())));
4883
+ html.push(_this4.constants.html.toolbarDropdownSeparator);
4884
+ }
4885
+
4886
+ var visibleColumns = 0;
4887
+
4888
+ _this4.columns.forEach(function (column) {
4889
+ if (column.visible) {
4890
+ visibleColumns++;
4891
+ }
4892
+ });
4893
+
4894
+ _this4.columns.forEach(function (column, i) {
4895
+ if (_this4.isSelectionColumn(column)) {
4896
+ return;
4897
+ }
4470
4898
 
4471
- var buttonsHtml = {
4472
- 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>"),
4473
- 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>"),
4474
- 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>"),
4475
- 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>"),
4476
- columns: function () {
4477
- var html = [];
4478
- 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]));
4899
+ if (opts.cardView && !column.cardVisible) {
4900
+ return;
4901
+ }
4902
+
4903
+ var checked = column.visible ? ' checked="checked"' : '';
4904
+ var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4905
+
4906
+ if (column.switchable) {
4907
+ 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)));
4908
+ switchableCount++;
4909
+ }
4910
+ });
4479
4911
 
4480
- if (opts.showColumnsSearch) {
4481
- html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" id="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
4482
- html.push(_this4.constants.html.toolbarDropdownSeparator);
4912
+ html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4913
+ return html.join('');
4483
4914
  }
4915
+ }
4916
+ });
4917
+ var buttonsHtml = {};
4918
+
4919
+ for (var _i2 = 0, _Object$entries2 = Object.entries(this.buttons); _i2 < _Object$entries2.length; _i2++) {
4920
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
4921
+ buttonName = _Object$entries2$_i[0],
4922
+ buttonConfig = _Object$entries2$_i[1];
4484
4923
 
4485
- if (opts.showColumnsToggleAll) {
4486
- var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4487
- return !_this4.isSelectionColumn(column);
4488
- }).length;
4924
+ var buttonHtml = void 0;
4489
4925
 
4490
- 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())));
4491
- html.push(_this4.constants.html.toolbarDropdownSeparator);
4926
+ if (buttonConfig.hasOwnProperty('html')) {
4927
+ if (typeof buttonConfig.html === 'function') {
4928
+ buttonHtml = buttonConfig.html();
4929
+ } else if (typeof buttonConfig.html === 'string') {
4930
+ buttonHtml = buttonConfig.html;
4492
4931
  }
4932
+ } else {
4933
+ buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
4493
4934
 
4494
- var visibleColumns = 0;
4935
+ if (buttonConfig.hasOwnProperty('attributes')) {
4936
+ for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
4937
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
4938
+ attributeName = _Object$entries4$_i[0],
4939
+ value = _Object$entries4$_i[1];
4495
4940
 
4496
- _this4.columns.forEach(function (column, i) {
4497
- if (column.visible) {
4498
- visibleColumns++;
4941
+ buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
4499
4942
  }
4500
- });
4943
+ }
4501
4944
 
4502
- _this4.columns.forEach(function (column, i) {
4503
- if (_this4.isSelectionColumn(column)) {
4504
- return;
4505
- }
4945
+ buttonHtml += '>';
4506
4946
 
4507
- if (opts.cardView && !column.cardVisible) {
4508
- return;
4509
- }
4947
+ if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
4948
+ buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
4949
+ }
4510
4950
 
4511
- var checked = column.visible ? ' checked="checked"' : '';
4512
- var disabled = visibleColumns <= _this4.options.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4951
+ if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
4952
+ buttonHtml += buttonConfig.text;
4953
+ }
4513
4954
 
4514
- if (column.switchable) {
4515
- 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)));
4516
- switchableCount++;
4517
- }
4518
- });
4955
+ buttonHtml += '</button>';
4956
+ }
4519
4957
 
4520
- html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4521
- return html.join('');
4522
- }()
4523
- };
4958
+ buttonsHtml[buttonName] = buttonHtml;
4959
+ var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
4960
+ var showOption = opts[optionName];
4961
+
4962
+ if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
4963
+ opts[optionName] = true;
4964
+ }
4965
+
4966
+ if (!opts.buttonsOrder.includes(buttonName)) {
4967
+ opts.buttonsOrder.push(buttonName);
4968
+ }
4969
+ } // Adding the button html to the final toolbar html when the showOption is true
4524
4970
 
4525
- if (typeof opts.buttonsOrder === 'string') {
4526
- opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4527
- }
4528
4971
 
4529
4972
  var _iteratorNormalCompletion = true;
4530
4973
  var _didIteratorError = false;
@@ -4533,8 +4976,9 @@
4533
4976
  try {
4534
4977
  for (var _iterator = opts.buttonsOrder[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4535
4978
  var button = _step.value;
4979
+ var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
4536
4980
 
4537
- if (opts['show' + button.charAt(0).toUpperCase() + button.substring(1)]) {
4981
+ if (_showOption) {
4538
4982
  html.push(buttonsHtml[button]);
4539
4983
  }
4540
4984
  }
@@ -4559,28 +5003,42 @@
4559
5003
  this.$toolbar.append(html.join(''));
4560
5004
  }
4561
5005
 
4562
- if (opts.showPaginationSwitch) {
4563
- this.$toolbar.find('button[name="paginationSwitch"]').off('click').on('click', function () {
4564
- return _this4.togglePagination();
4565
- });
4566
- }
5006
+ for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
5007
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
5008
+ _buttonName = _Object$entries3$_i[0],
5009
+ _buttonConfig = _Object$entries3$_i[1];
4567
5010
 
4568
- if (opts.showFullscreen) {
4569
- this.$toolbar.find('button[name="fullscreen"]').off('click').on('click', function () {
4570
- return _this4.toggleFullscreen();
4571
- });
4572
- }
5011
+ if (_buttonConfig.hasOwnProperty('event')) {
5012
+ if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
5013
+ var _ret = function () {
5014
+ var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
4573
5015
 
4574
- if (opts.showRefresh) {
4575
- this.$toolbar.find('button[name="refresh"]').off('click').on('click', function () {
4576
- return _this4.refresh();
4577
- });
4578
- }
5016
+ _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
5017
+ return event.call(_this4);
5018
+ });
4579
5019
 
4580
- if (opts.showToggle) {
4581
- this.$toolbar.find('button[name="toggle"]').off('click').on('click', function () {
4582
- _this4.toggleView();
4583
- });
5020
+ return "continue";
5021
+ }();
5022
+
5023
+ if (_ret === "continue") continue;
5024
+ }
5025
+
5026
+ var _loop = function _loop() {
5027
+ var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
5028
+ eventType = _Object$entries5$_i[0],
5029
+ eventFunction = _Object$entries5$_i[1];
5030
+
5031
+ var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
5032
+
5033
+ _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
5034
+ return event.call(_this4);
5035
+ });
5036
+ };
5037
+
5038
+ for (var _i5 = 0, _Object$entries5 = Object.entries(_buttonConfig.event); _i5 < _Object$entries5.length; _i5++) {
5039
+ _loop();
5040
+ }
5041
+ }
4584
5042
  }
4585
5043
 
4586
5044
  if (opts.showColumns) {
@@ -4614,7 +5072,7 @@
4614
5072
  });
4615
5073
 
4616
5074
  if (opts.showColumnsSearch) {
4617
- var $columnsSearch = $keepOpen.find('#columnsSearch');
5075
+ var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
4618
5076
  var $listItems = $keepOpen.find('.dropdown-item-marker');
4619
5077
  $columnsSearch.on('keyup paste change', function (_ref4) {
4620
5078
  var currentTarget = _ref4.currentTarget;
@@ -4632,14 +5090,35 @@
4632
5090
  });
4633
5091
  });
4634
5092
  }
4635
- } // Fix #4516: this.showSearchClearButton is for extensions
5093
+ }
5094
+
5095
+ var handleInputEvent = function handleInputEvent($searchInput) {
5096
+ var eventTriggers = 'keyup drop blur mouseup';
5097
+ $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
5098
+ if (opts.searchOnEnterKey && event.keyCode !== 13) {
5099
+ return;
5100
+ }
5101
+
5102
+ if ([37, 38, 39, 40].includes(event.keyCode)) {
5103
+ return;
5104
+ }
5105
+
5106
+ clearTimeout(timeoutId); // doesn't matter if it's 0
4636
5107
 
5108
+ timeoutId = setTimeout(function () {
5109
+ _this4.onSearch({
5110
+ currentTarget: event.currentTarget
5111
+ });
5112
+ }, opts.searchTimeOut);
5113
+ });
5114
+ }; // Fix #4516: this.showSearchClearButton is for extensions
4637
5115
 
4638
- if (opts.search || this.showSearchClearButton) {
5116
+
5117
+ if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
4639
5118
  html = [];
4640
5119
  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() : '');
4641
5120
  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() : '');
4642
- 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\">");
5121
+ 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\">");
4643
5122
  var searchInputFinalHtml = searchInputHtml;
4644
5123
 
4645
5124
  if (opts.showSearchButton || opts.showSearchClearButton) {
@@ -4650,31 +5129,10 @@
4650
5129
 
4651
5130
  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));
4652
5131
  this.$toolbar.append(html.join(''));
4653
- var $searchInput = this.$toolbar.find('.search input');
4654
-
4655
- var handleInputEvent = function handleInputEvent() {
4656
- var eventTriggers = "keyup drop blur ".concat(Utils.isIEBrowser() ? 'mouseup' : '');
4657
- $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
4658
- if (opts.searchOnEnterKey && event.keyCode !== 13) {
4659
- return;
4660
- }
4661
-
4662
- if ([37, 38, 39, 40].includes(event.keyCode)) {
4663
- return;
4664
- }
4665
-
4666
- clearTimeout(timeoutId); // doesn't matter if it's 0
4667
-
4668
- timeoutId = setTimeout(function () {
4669
- _this4.onSearch({
4670
- currentTarget: event.currentTarget
4671
- });
4672
- }, opts.searchTimeOut);
4673
- });
4674
- };
5132
+ var $searchInput = Utils.getSearchInput(this);
4675
5133
 
4676
5134
  if (opts.showSearchButton) {
4677
- this.$toolbar.find('.search button[name=search]').off('click').on('click', function (event) {
5135
+ this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
4678
5136
  clearTimeout(timeoutId); // doesn't matter if it's 0
4679
5137
 
4680
5138
  timeoutId = setTimeout(function () {
@@ -4685,10 +5143,10 @@
4685
5143
  });
4686
5144
 
4687
5145
  if (opts.searchOnEnterKey) {
4688
- handleInputEvent();
5146
+ handleInputEvent($searchInput);
4689
5147
  }
4690
5148
  } else {
4691
- handleInputEvent();
5149
+ handleInputEvent($searchInput);
4692
5150
  }
4693
5151
 
4694
5152
  if (opts.showSearchClearButton) {
@@ -4696,6 +5154,10 @@
4696
5154
  _this4.resetSearch();
4697
5155
  });
4698
5156
  }
5157
+ } else if (typeof opts.searchSelector === 'string') {
5158
+ var _$searchInput = Utils.getSearchInput(this);
5159
+
5160
+ handleInputEvent(_$searchInput);
4699
5161
  }
4700
5162
  }
4701
5163
  }, {
@@ -4714,11 +5176,11 @@
4714
5176
  $(currentTarget).val(text);
4715
5177
  }
4716
5178
 
4717
- if (this.searchText === text && text.length > 0) {
5179
+ if (this.searchText === text) {
4718
5180
  return;
4719
5181
  }
4720
5182
 
4721
- if ($(currentTarget).hasClass('search-input')) {
5183
+ if (currentTarget === Utils.getSearchInput(this)[0] || $(currentTarget).hasClass('search-input')) {
4722
5184
  this.searchText = text;
4723
5185
  this.options.searchText = text;
4724
5186
  }
@@ -4750,6 +5212,11 @@
4750
5212
  if (this.options.sidePagination !== 'server') {
4751
5213
  if (this.options.customSearch) {
4752
5214
  this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
5215
+
5216
+ if (this.options.sortReset) {
5217
+ this.unsortedData = _toConsumableArray(this.data);
5218
+ }
5219
+
4753
5220
  return;
4754
5221
  }
4755
5222
 
@@ -4757,11 +5224,11 @@
4757
5224
  var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
4758
5225
 
4759
5226
  if (typeof this.filterOptions.filterAlgorithm === 'function') {
4760
- this.data = this.options.data.filter(function (item, i) {
5227
+ this.data = this.options.data.filter(function (item) {
4761
5228
  return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
4762
5229
  });
4763
5230
  } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
4764
- this.data = f ? this.options.data.filter(function (item, i) {
5231
+ this.data = f ? this.options.data.filter(function (item) {
4765
5232
  var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
4766
5233
 
4767
5234
  if (filterAlgorithm === 'and') {
@@ -4783,7 +5250,7 @@
4783
5250
  }
4784
5251
 
4785
5252
  return true;
4786
- }) : this.options.data;
5253
+ }) : _toConsumableArray(this.options.data);
4787
5254
  }
4788
5255
 
4789
5256
  var visibleFields = this.getVisibleFields();
@@ -4801,13 +5268,17 @@
4801
5268
  value = item;
4802
5269
  var props = key.split('.');
4803
5270
 
4804
- for (var _i2 = 0; _i2 < props.length; _i2++) {
4805
- if (value[props[_i2]] !== null) {
4806
- value = value[props[_i2]];
5271
+ for (var _i6 = 0; _i6 < props.length; _i6++) {
5272
+ if (value[props[_i6]] !== null) {
5273
+ value = value[props[_i6]];
4807
5274
  }
4808
5275
  }
4809
5276
  } else {
4810
5277
  value = item[key];
5278
+ }
5279
+
5280
+ if (_this5.options.searchAccentNeutralise) {
5281
+ value = Utils.normalizeAccent(value);
4811
5282
  } // Fix #142: respect searchFormatter boolean
4812
5283
 
4813
5284
 
@@ -4867,9 +5338,13 @@
4867
5338
 
4868
5339
  return false;
4869
5340
  }) : this.data;
4870
- }
4871
5341
 
4872
- this.initSort();
5342
+ if (this.options.sortReset) {
5343
+ this.unsortedData = _toConsumableArray(this.data);
5344
+ }
5345
+
5346
+ this.initSort();
5347
+ }
4873
5348
  }
4874
5349
  }, {
4875
5350
  key: "initPagination",
@@ -4909,6 +5384,11 @@
4909
5384
 
4910
5385
  return value;
4911
5386
  });
5387
+ this.paginationParts = opts.paginationParts;
5388
+
5389
+ if (typeof this.paginationParts === 'string') {
5390
+ this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
5391
+ }
4912
5392
 
4913
5393
  if (opts.sidePagination !== 'server') {
4914
5394
  opts.totalRows = data.length;
@@ -4945,14 +5425,20 @@
4945
5425
  this.options.totalNotFiltered = undefined;
4946
5426
  }
4947
5427
 
4948
- var paginationInfo = opts.onlyInfoPagination ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
4949
- html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">\n <span class=\"pagination-info\">\n ").concat(paginationInfo, "\n </span>"));
5428
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
5429
+ html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
5430
+ }
4950
5431
 
4951
- if (!opts.onlyInfoPagination) {
5432
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
5433
+ var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
5434
+ html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
5435
+ }
5436
+
5437
+ if (this.paginationParts.includes('pageSize')) {
4952
5438
  html.push('<span class="page-list">');
4953
5439
  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])];
4954
5440
  pageList.forEach(function (page, i) {
4955
- if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows) {
5441
+ if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
4956
5442
  var active;
4957
5443
 
4958
5444
  if (allSelected) {
@@ -4966,7 +5452,13 @@
4966
5452
  });
4967
5453
  pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</span>"));
4968
5454
  html.push(opts.formatRecordsPerPage(pageNumber.join('')));
5455
+ }
5456
+
5457
+ if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
4969
5458
  html.push('</span></div>');
5459
+ }
5460
+
5461
+ if (this.paginationParts.includes('pageList')) {
4970
5462
  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));
4971
5463
 
4972
5464
  if (this.totalPages < opts.paginationSuccessivelySize) {
@@ -5011,14 +5503,12 @@
5011
5503
  if (from - 1 === max + 1) {
5012
5504
  i = from - 1;
5013
5505
  html.push(pageItem(i));
5014
- } else {
5015
- if (from - 1 > max) {
5016
- if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
5017
- i = Math.round((from - middleSize) / 2 + middleSize);
5018
- html.push(pageItem(i, ' page-intermediate'));
5019
- } else {
5020
- html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
5021
- }
5506
+ } else if (from - 1 > max) {
5507
+ if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
5508
+ i = Math.round((from - middleSize) / 2 + middleSize);
5509
+ html.push(pageItem(i, ' page-intermediate'));
5510
+ } else {
5511
+ html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
5022
5512
  }
5023
5513
  }
5024
5514
  }
@@ -5034,14 +5524,12 @@
5034
5524
  if (to + 1 === min - 1) {
5035
5525
  i = to + 1;
5036
5526
  html.push(pageItem(i));
5037
- } else {
5038
- if (min > to + 1) {
5039
- if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
5040
- i = Math.round((this.totalPages - middleSize - to) / 2 + to);
5041
- html.push(pageItem(i, ' page-intermediate'));
5042
- } else {
5043
- html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
5044
- }
5527
+ } else if (min > to + 1) {
5528
+ if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
5529
+ i = Math.round((this.totalPages - middleSize - to) / 2 + to);
5530
+ html.push(pageItem(i, ' page-intermediate'));
5531
+ } else {
5532
+ html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
5045
5533
  }
5046
5534
  }
5047
5535
 
@@ -5119,14 +5607,13 @@
5119
5607
  }
5120
5608
 
5121
5609
  this.initPagination();
5610
+ this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
5122
5611
 
5123
5612
  if (this.options.sidePagination === 'server') {
5124
5613
  this.initServer();
5125
5614
  } else {
5126
5615
  this.initBody();
5127
5616
  }
5128
-
5129
- this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
5130
5617
  }
5131
5618
  }, {
5132
5619
  key: "onPageListChange",
@@ -5179,7 +5666,8 @@
5179
5666
  this.options.pageNumber = +$(event.currentTarget).text();
5180
5667
  this.updatePagination(event);
5181
5668
  return false;
5182
- }
5669
+ } // eslint-disable-next-line no-unused-vars
5670
+
5183
5671
  }, {
5184
5672
  key: "initRow",
5185
5673
  value: function initRow(item, i, data, trFragments) {
@@ -5199,10 +5687,10 @@
5199
5687
  style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
5200
5688
 
5201
5689
  if (style && style.css) {
5202
- for (var _i3 = 0, _Object$entries2 = Object.entries(style.css); _i3 < _Object$entries2.length; _i3++) {
5203
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
5204
- key = _Object$entries2$_i[0],
5205
- value = _Object$entries2$_i[1];
5690
+ for (var _i7 = 0, _Object$entries6 = Object.entries(style.css); _i7 < _Object$entries6.length; _i7++) {
5691
+ var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
5692
+ key = _Object$entries6$_i[0],
5693
+ value = _Object$entries6$_i[1];
5206
5694
 
5207
5695
  csses.push("".concat(key, ": ").concat(value));
5208
5696
  }
@@ -5211,20 +5699,20 @@
5211
5699
  attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
5212
5700
 
5213
5701
  if (attributes) {
5214
- for (var _i4 = 0, _Object$entries3 = Object.entries(attributes); _i4 < _Object$entries3.length; _i4++) {
5215
- var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i4], 2),
5216
- _key2 = _Object$entries3$_i[0],
5217
- _value = _Object$entries3$_i[1];
5702
+ for (var _i8 = 0, _Object$entries7 = Object.entries(attributes); _i8 < _Object$entries7.length; _i8++) {
5703
+ var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
5704
+ _key2 = _Object$entries7$_i[0],
5705
+ _value = _Object$entries7$_i[1];
5218
5706
 
5219
5707
  htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
5220
5708
  }
5221
5709
  }
5222
5710
 
5223
5711
  if (item._data && !Utils.isEmptyObject(item._data)) {
5224
- for (var _i5 = 0, _Object$entries4 = Object.entries(item._data); _i5 < _Object$entries4.length; _i5++) {
5225
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i5], 2),
5226
- k = _Object$entries4$_i[0],
5227
- v = _Object$entries4$_i[1];
5712
+ for (var _i9 = 0, _Object$entries8 = Object.entries(item._data); _i9 < _Object$entries8.length; _i9++) {
5713
+ var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
5714
+ k = _Object$entries8$_i[0],
5715
+ v = _Object$entries8$_i[1];
5228
5716
 
5229
5717
  // ignore data-index
5230
5718
  if (k === 'index') {
@@ -5235,20 +5723,26 @@
5235
5723
  }
5236
5724
  }
5237
5725
 
5238
- 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_), '>');
5726
+ 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_), '>');
5239
5727
 
5240
5728
  if (this.options.cardView) {
5241
5729
  html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
5242
5730
  }
5243
5731
 
5244
- if (!this.options.cardView && this.options.detailView && this.options.detailViewIcon) {
5245
- html.push('<td>');
5732
+ var detailViewTemplate = '';
5733
+
5734
+ if (Utils.hasDetailViewIcon(this.options)) {
5735
+ detailViewTemplate = '<td>';
5246
5736
 
5247
5737
  if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
5248
- 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 "));
5738
+ 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 ");
5249
5739
  }
5250
5740
 
5251
- html.push('</td>');
5741
+ detailViewTemplate += '</td>';
5742
+ }
5743
+
5744
+ if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
5745
+ html.push(detailViewTemplate);
5252
5746
  }
5253
5747
 
5254
5748
  this.header.fields.forEach(function (field, j) {
@@ -5260,13 +5754,14 @@
5260
5754
  var id_ = '';
5261
5755
  var class_ = _this7.header.classes[j];
5262
5756
  var style_ = '';
5757
+ var styleToAdd_ = '';
5263
5758
  var data_ = '';
5264
5759
  var rowspan_ = '';
5265
5760
  var colspan_ = '';
5266
5761
  var title_ = '';
5267
5762
  var column = _this7.columns[j];
5268
5763
 
5269
- if (_this7.fromHtml && typeof value_ === 'undefined') {
5764
+ if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
5270
5765
  if (!column.checkbox && !column.radio) {
5271
5766
  return;
5272
5767
  }
@@ -5282,11 +5777,21 @@
5282
5777
 
5283
5778
  if (column.escape) {
5284
5779
  value_ = Utils.escapeHTML(value_);
5285
- }
5780
+ } // Style concat
5781
+
5286
5782
 
5287
5783
  if (csses.concat([_this7.header.styles[j]]).length) {
5288
- style_ = " style=\"".concat(csses.concat([_this7.header.styles[j]]).join('; '), "\"");
5289
- } // handle td's id and class
5784
+ styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
5785
+ }
5786
+
5787
+ if (item["_".concat(field, "_style")]) {
5788
+ styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
5789
+ }
5790
+
5791
+ if (styleToAdd_) {
5792
+ style_ = " style=\"".concat(styleToAdd_, "\"");
5793
+ } // Style concat
5794
+ // handle id and class of td
5290
5795
 
5291
5796
 
5292
5797
  if (item["_".concat(field, "_id")]) {
@@ -5318,10 +5823,10 @@
5318
5823
  if (cellStyle.css) {
5319
5824
  var csses_ = [];
5320
5825
 
5321
- for (var _i6 = 0, _Object$entries5 = Object.entries(cellStyle.css); _i6 < _Object$entries5.length; _i6++) {
5322
- var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i6], 2),
5323
- _key3 = _Object$entries5$_i[0],
5324
- _value2 = _Object$entries5$_i[1];
5826
+ for (var _i10 = 0, _Object$entries9 = Object.entries(cellStyle.css); _i10 < _Object$entries9.length; _i10++) {
5827
+ var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
5828
+ _key3 = _Object$entries9$_i[0],
5829
+ _value2 = _Object$entries9$_i[1];
5325
5830
 
5326
5831
  csses_.push("".concat(_key3, ": ").concat(_value2));
5327
5832
  }
@@ -5330,12 +5835,17 @@
5330
5835
  }
5331
5836
 
5332
5837
  value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
5838
+ value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
5839
+
5840
+ if (_this7.searchText !== '' && _this7.options.searchHighlight) {
5841
+ value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], value.toString().replace(new RegExp("(".concat(_this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), ")"), 'gim'), '<mark>$1</mark>'));
5842
+ }
5333
5843
 
5334
5844
  if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
5335
- for (var _i7 = 0, _Object$entries6 = Object.entries(item["_".concat(field, "_data")]); _i7 < _Object$entries6.length; _i7++) {
5336
- var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i7], 2),
5337
- _k = _Object$entries6$_i[0],
5338
- _v = _Object$entries6$_i[1];
5845
+ for (var _i11 = 0, _Object$entries10 = Object.entries(item["_".concat(field, "_data")]); _i11 < _Object$entries10.length; _i11++) {
5846
+ var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
5847
+ _k = _Object$entries10$_i[0],
5848
+ _v = _Object$entries10$_i[1];
5339
5849
 
5340
5850
  // ignore data-index
5341
5851
  if (_k === 'index') {
@@ -5350,28 +5860,28 @@
5350
5860
  type = column.checkbox ? 'checkbox' : type;
5351
5861
  type = column.radio ? 'radio' : type;
5352
5862
  var c = column['class'] || '';
5353
- var isChecked = (value === true || value_ || value && value.checked) && value !== false;
5863
+ var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
5354
5864
  var isDisabled = !column.checkboxEnabled || value && value.disabled;
5355
5865
  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('');
5356
5866
  item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
5357
- } else {
5358
- value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
5867
+ } else if (_this7.options.cardView) {
5868
+ var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes, "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
5869
+ text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes, "\"").concat(style_, ">").concat(value, "</span></div>");
5359
5870
 
5360
- if (_this7.options.cardView) {
5361
- var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title\"".concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
5362
- text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value\">").concat(value, "</span></div>");
5363
-
5364
- if (_this7.options.smartDisplay && value === '') {
5365
- text = '<div class="card-view"></div>';
5366
- }
5367
- } else {
5368
- text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
5871
+ if (_this7.options.smartDisplay && value === '') {
5872
+ text = '<div class="card-view"></div>';
5369
5873
  }
5874
+ } else {
5875
+ text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
5370
5876
  }
5371
5877
 
5372
5878
  html.push(text);
5373
5879
  });
5374
5880
 
5881
+ if (detailViewTemplate && this.options.detailViewAlign === 'right') {
5882
+ html.push(detailViewTemplate);
5883
+ }
5884
+
5375
5885
  if (this.options.cardView) {
5376
5886
  html.push('</div></td>');
5377
5887
  }
@@ -5401,6 +5911,7 @@
5401
5911
  var rows = [];
5402
5912
  var trFragments = $(document.createDocumentFragment());
5403
5913
  var hasTr = false;
5914
+ this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
5404
5915
 
5405
5916
  for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
5406
5917
  var item = data[i];
@@ -5418,28 +5929,26 @@
5418
5929
 
5419
5930
 
5420
5931
  if (!hasTr) {
5421
- 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>"));
5932
+ 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>"));
5933
+ } else if (!this.options.virtualScroll) {
5934
+ this.$body.html(trFragments);
5422
5935
  } else {
5423
- if (!this.options.virtualScroll) {
5424
- this.$body.html(trFragments);
5425
- } else {
5426
- if (this.virtualScroll) {
5427
- this.virtualScroll.destroy();
5428
- }
5936
+ if (this.virtualScroll) {
5937
+ this.virtualScroll.destroy();
5938
+ }
5429
5939
 
5430
- this.virtualScroll = new VirtualScroll({
5431
- rows: rows,
5432
- fixedScroll: fixedScroll,
5433
- scrollEl: this.$tableBody[0],
5434
- contentEl: this.$body[0],
5435
- itemHeight: this.options.virtualScrollItemHeight,
5436
- callback: function callback() {
5437
- _this8.fitHeader();
5940
+ this.virtualScroll = new VirtualScroll({
5941
+ rows: rows,
5942
+ fixedScroll: fixedScroll,
5943
+ scrollEl: this.$tableBody[0],
5944
+ contentEl: this.$body[0],
5945
+ itemHeight: this.options.virtualScrollItemHeight,
5946
+ callback: function callback() {
5947
+ _this8.fitHeader();
5438
5948
 
5439
- _this8.initBodyEvent();
5440
- }
5441
- });
5442
- }
5949
+ _this8.initBodyEvent();
5950
+ }
5951
+ });
5443
5952
  }
5444
5953
 
5445
5954
  if (!fixedScroll) {
@@ -5474,7 +5983,7 @@
5474
5983
 
5475
5984
  var fields = _this9.getVisibleFields();
5476
5985
 
5477
- var field = fields[_this9.options.detailView && _this9.options.detailViewIcon && !_this9.options.cardView ? index - 1 : index];
5986
+ var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
5478
5987
  var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
5479
5988
  var value = Utils.getItemField(item, field, _this9.options.escape);
5480
5989
 
@@ -5537,11 +6046,9 @@
5537
6046
  return;
5538
6047
  }
5539
6048
 
5540
- if (_this9.options.detailView && !_this9.options.cardView) {
5541
- fieldIndex += 1;
5542
- }
6049
+ fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
5543
6050
 
5544
- var _loop = function _loop(key) {
6051
+ var _loop2 = function _loop2(key) {
5545
6052
  if (!events.hasOwnProperty(key)) {
5546
6053
  return "continue";
5547
6054
  }
@@ -5564,9 +6071,9 @@
5564
6071
  };
5565
6072
 
5566
6073
  for (var key in events) {
5567
- var _ret = _loop(key);
6074
+ var _ret2 = _loop2(key);
5568
6075
 
5569
- if (_ret === "continue") continue;
6076
+ if (_ret2 === "continue") continue;
5570
6077
  }
5571
6078
  });
5572
6079
  }
@@ -5613,6 +6120,38 @@
5613
6120
  }
5614
6121
  }
5615
6122
 
6123
+ if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
6124
+ return !column.searchable;
6125
+ }).length) {
6126
+ params.searchable = [];
6127
+ var _iteratorNormalCompletion2 = true;
6128
+ var _didIteratorError2 = false;
6129
+ var _iteratorError2 = undefined;
6130
+
6131
+ try {
6132
+ for (var _iterator2 = this.columns[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
6133
+ var column = _step2.value;
6134
+
6135
+ if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
6136
+ params.searchable.push(column.field);
6137
+ }
6138
+ }
6139
+ } catch (err) {
6140
+ _didIteratorError2 = true;
6141
+ _iteratorError2 = err;
6142
+ } finally {
6143
+ try {
6144
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
6145
+ _iterator2.return();
6146
+ }
6147
+ } finally {
6148
+ if (_didIteratorError2) {
6149
+ throw _iteratorError2;
6150
+ }
6151
+ }
6152
+ }
6153
+ }
6154
+
5616
6155
  if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
5617
6156
  params.filter = JSON.stringify(this.filterColumnsPartial, null);
5618
6157
  }
@@ -5686,7 +6225,7 @@
5686
6225
  this.searchText = '';
5687
6226
 
5688
6227
  if (this.options.searchText !== '') {
5689
- var $search = this.$toolbar.find('.search input');
6228
+ var $search = Utils.getSearchInput(this);
5690
6229
  $search.val(this.options.searchText);
5691
6230
  this.onSearch({
5692
6231
  currentTarget: $search,
@@ -5725,13 +6264,13 @@
5725
6264
  }, {
5726
6265
  key: "resetRows",
5727
6266
  value: function resetRows() {
5728
- var _iteratorNormalCompletion2 = true;
5729
- var _didIteratorError2 = false;
5730
- var _iteratorError2 = undefined;
6267
+ var _iteratorNormalCompletion3 = true;
6268
+ var _didIteratorError3 = false;
6269
+ var _iteratorError3 = undefined;
5731
6270
 
5732
6271
  try {
5733
- for (var _iterator2 = this.data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
5734
- var row = _step2.value;
6272
+ for (var _iterator3 = this.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
6273
+ var row = _step3.value;
5735
6274
  this.$selectAll.prop('checked', false);
5736
6275
  this.$selectItem.prop('checked', false);
5737
6276
 
@@ -5740,16 +6279,16 @@
5740
6279
  }
5741
6280
  }
5742
6281
  } catch (err) {
5743
- _didIteratorError2 = true;
5744
- _iteratorError2 = err;
6282
+ _didIteratorError3 = true;
6283
+ _iteratorError3 = err;
5745
6284
  } finally {
5746
6285
  try {
5747
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
5748
- _iterator2.return();
6286
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
6287
+ _iterator3.return();
5749
6288
  }
5750
6289
  } finally {
5751
- if (_didIteratorError2) {
5752
- throw _iteratorError2;
6290
+ if (_didIteratorError3) {
6291
+ throw _iteratorError3;
5753
6292
  }
5754
6293
  }
5755
6294
  }
@@ -5759,7 +6298,7 @@
5759
6298
  }, {
5760
6299
  key: "trigger",
5761
6300
  value: function trigger(_name) {
5762
- var _this$options;
6301
+ var _this$options, _this$options2;
5763
6302
 
5764
6303
  var name = "".concat(_name, ".bs.table");
5765
6304
 
@@ -5767,11 +6306,17 @@
5767
6306
  args[_key4 - 1] = arguments[_key4];
5768
6307
  }
5769
6308
 
5770
- (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, args);
6309
+ (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
6310
+
6311
+ this.$el.trigger($.Event(name, {
6312
+ sender: this
6313
+ }), args);
6314
+
6315
+ (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
5771
6316
 
5772
- this.$el.trigger($.Event(name), args);
5773
- this.options.onAll(name, args);
5774
- this.$el.trigger($.Event('all.bs.table'), [name, args]);
6317
+ this.$el.trigger($.Event('all.bs.table', {
6318
+ sender: this
6319
+ }), [name, args]);
5775
6320
  }
5776
6321
  }, {
5777
6322
  key: "resetHeader",
@@ -5841,25 +6386,22 @@
5841
6386
  $tr = $tr.next();
5842
6387
  }
5843
6388
 
6389
+ var trLength = $tr.find('> *').length;
5844
6390
  $tr.find('> *').each(function (i, el) {
5845
6391
  var $this = $(el);
5846
- var index = i;
5847
6392
 
5848
- if (_this14.options.detailView && _this14.options.detailViewIcon && !_this14.options.cardView) {
5849
- if (i === 0) {
6393
+ if (Utils.hasDetailViewIcon(_this14.options)) {
6394
+ if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
5850
6395
  var $thDetail = $ths.filter('.detail');
5851
6396
 
5852
6397
  var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
5853
6398
 
5854
6399
  $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
6400
+ return;
5855
6401
  }
5856
-
5857
- index = i - 1;
5858
6402
  }
5859
6403
 
5860
- if (index === -1) {
5861
- return;
5862
- }
6404
+ var index = i - Utils.getDetailViewIndexOffset(_this14.options);
5863
6405
 
5864
6406
  var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
5865
6407
 
@@ -5883,25 +6425,30 @@
5883
6425
 
5884
6426
  var data = this.getData();
5885
6427
  var html = [];
6428
+ var detailTemplate = '';
5886
6429
 
5887
- if (!this.options.cardView && this.options.detailView && this.options.detailViewIcon) {
5888
- html.push('<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>');
6430
+ if (Utils.hasDetailViewIcon(this.options)) {
6431
+ detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
5889
6432
  }
5890
6433
 
5891
- var _iteratorNormalCompletion3 = true;
5892
- var _didIteratorError3 = false;
5893
- var _iteratorError3 = undefined;
6434
+ if (detailTemplate && this.options.detailViewAlign !== 'right') {
6435
+ html.push(detailTemplate);
6436
+ }
6437
+
6438
+ var _iteratorNormalCompletion4 = true;
6439
+ var _didIteratorError4 = false;
6440
+ var _iteratorError4 = undefined;
5894
6441
 
5895
6442
  try {
5896
- for (var _iterator3 = this.columns[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
5897
- var column = _step3.value;
6443
+ for (var _iterator4 = this.columns[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
6444
+ var column = _step4.value;
5898
6445
  var falign = '';
5899
6446
  var valign = '';
5900
6447
  var csses = [];
5901
6448
  var style = {};
5902
6449
  var class_ = Utils.sprintf(' class="%s"', column['class']);
5903
6450
 
5904
- if (!column.visible) {
6451
+ if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
5905
6452
  continue;
5906
6453
  }
5907
6454
 
@@ -5914,12 +6461,12 @@
5914
6461
  style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
5915
6462
 
5916
6463
  if (style && style.css) {
5917
- for (var _i8 = 0, _Object$entries7 = Object.entries(style.css); _i8 < _Object$entries7.length; _i8++) {
5918
- var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
5919
- key = _Object$entries7$_i[0],
5920
- value = _Object$entries7$_i[1];
6464
+ for (var _i12 = 0, _Object$entries11 = Object.entries(style.css); _i12 < _Object$entries11.length; _i12++) {
6465
+ var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
6466
+ key = _Object$entries11$_i[0],
6467
+ _value3 = _Object$entries11$_i[1];
5921
6468
 
5922
- csses.push("".concat(key, ": ").concat(value));
6469
+ csses.push("".concat(key, ": ").concat(_value3));
5923
6470
  }
5924
6471
  }
5925
6472
 
@@ -5927,29 +6474,50 @@
5927
6474
  class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
5928
6475
  }
5929
6476
 
5930
- html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')), '>');
6477
+ html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
6478
+ var colspan = 0;
6479
+
6480
+ if (this.footerData && this.footerData.length > 0) {
6481
+ colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
6482
+ }
6483
+
6484
+ if (colspan) {
6485
+ html.push(" colspan=\"".concat(colspan, "\" "));
6486
+ }
6487
+
6488
+ html.push('>');
5931
6489
  html.push('<div class="th-inner">');
5932
- html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data], this.footerData[0] && this.footerData[0][column.field] || ''));
6490
+ var value = '';
6491
+
6492
+ if (this.footerData && this.footerData.length > 0) {
6493
+ value = this.footerData[0][column.field] || '';
6494
+ }
6495
+
6496
+ html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
5933
6497
  html.push('</div>');
5934
6498
  html.push('<div class="fht-cell"></div>');
5935
6499
  html.push('</div>');
5936
6500
  html.push('</th>');
5937
6501
  }
5938
6502
  } catch (err) {
5939
- _didIteratorError3 = true;
5940
- _iteratorError3 = err;
6503
+ _didIteratorError4 = true;
6504
+ _iteratorError4 = err;
5941
6505
  } finally {
5942
6506
  try {
5943
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
5944
- _iterator3.return();
6507
+ if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
6508
+ _iterator4.return();
5945
6509
  }
5946
6510
  } finally {
5947
- if (_didIteratorError3) {
5948
- throw _iteratorError3;
6511
+ if (_didIteratorError4) {
6512
+ throw _iteratorError4;
5949
6513
  }
5950
6514
  }
5951
6515
  }
5952
6516
 
6517
+ if (detailTemplate && this.options.detailViewAlign === 'right') {
6518
+ html.push(detailTemplate);
6519
+ }
6520
+
5953
6521
  if (!this.options.height && !this.$tableFooter.length) {
5954
6522
  this.$el.append('<tfoot><tr></tr></tfoot>');
5955
6523
  this.$tableFooter = this.$el.find('tfoot');
@@ -5973,32 +6541,27 @@
5973
6541
  var fixedBody = this.$tableBody.get(0);
5974
6542
  var scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
5975
6543
  this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
5976
- var visibleFields = this.getVisibleFields();
5977
6544
  var $ths = this.$tableFooter.find('th');
5978
6545
  var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
6546
+ $ths.find('.fht-cell').width('auto');
5979
6547
 
5980
6548
  while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
5981
6549
  $tr = $tr.next();
5982
6550
  }
5983
6551
 
6552
+ var trLength = $tr.find('> *').length;
5984
6553
  $tr.find('> *').each(function (i, el) {
5985
6554
  var $this = $(el);
5986
- var index = i;
5987
6555
 
5988
- if (_this15.options.detailView && !_this15.options.cardView) {
5989
- if (i === 0) {
6556
+ if (Utils.hasDetailViewIcon(_this15.options)) {
6557
+ if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
5990
6558
  var $thDetail = $ths.filter('.detail');
5991
6559
 
5992
6560
  var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
5993
6561
 
5994
6562
  $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
6563
+ return;
5995
6564
  }
5996
-
5997
- index = i - 1;
5998
- }
5999
-
6000
- if (index === -1) {
6001
- return;
6002
6565
  }
6003
6566
 
6004
6567
  var $th = $ths.eq(i);
@@ -6032,13 +6595,13 @@
6032
6595
  key: "getVisibleFields",
6033
6596
  value: function getVisibleFields() {
6034
6597
  var visibleFields = [];
6035
- var _iteratorNormalCompletion4 = true;
6036
- var _didIteratorError4 = false;
6037
- var _iteratorError4 = undefined;
6598
+ var _iteratorNormalCompletion5 = true;
6599
+ var _didIteratorError5 = false;
6600
+ var _iteratorError5 = undefined;
6038
6601
 
6039
6602
  try {
6040
- for (var _iterator4 = this.header.fields[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
6041
- var field = _step4.value;
6603
+ for (var _iterator5 = this.header.fields[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
6604
+ var field = _step5.value;
6042
6605
  var column = this.columns[this.fieldsColumnsIndex[field]];
6043
6606
 
6044
6607
  if (!column || !column.visible) {
@@ -6048,16 +6611,16 @@
6048
6611
  visibleFields.push(field);
6049
6612
  }
6050
6613
  } catch (err) {
6051
- _didIteratorError4 = true;
6052
- _iteratorError4 = err;
6614
+ _didIteratorError5 = true;
6615
+ _iteratorError5 = err;
6053
6616
  } finally {
6054
6617
  try {
6055
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
6056
- _iterator4.return();
6618
+ if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
6619
+ _iterator5.return();
6057
6620
  }
6058
6621
  } finally {
6059
- if (_didIteratorError4) {
6060
- throw _iteratorError4;
6622
+ if (_didIteratorError5) {
6623
+ throw _iteratorError5;
6061
6624
  }
6062
6625
  }
6063
6626
  }
@@ -6095,9 +6658,11 @@
6095
6658
  }, {
6096
6659
  key: "getData",
6097
6660
  value: function getData(params) {
6661
+ var _this17 = this;
6662
+
6098
6663
  var data = this.options.data;
6099
6664
 
6100
- if ((this.searchText || this.options.customSearch || this.options.sortName || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
6665
+ if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || !Utils.isEmptyObject(this.filterColumns) || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
6101
6666
  data = this.data;
6102
6667
  }
6103
6668
 
@@ -6112,24 +6677,32 @@
6112
6677
  });
6113
6678
  }
6114
6679
 
6680
+ if (params && params.formatted) {
6681
+ data.forEach(function (row) {
6682
+ for (var _i13 = 0, _Object$entries12 = Object.entries(row); _i13 < _Object$entries12.length; _i13++) {
6683
+ var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
6684
+ key = _Object$entries12$_i[0],
6685
+ value = _Object$entries12$_i[1];
6686
+
6687
+ var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
6688
+
6689
+ if (!column) {
6690
+ return;
6691
+ }
6692
+
6693
+ row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
6694
+ }
6695
+ });
6696
+ }
6697
+
6115
6698
  return data;
6116
6699
  }
6117
6700
  }, {
6118
6701
  key: "getSelections",
6119
6702
  value: function getSelections() {
6120
- var _this17 = this;
6121
-
6122
- // fix #2424: from html with checkbox
6123
- return this.data.filter(function (row) {
6124
- return row[_this17.header.stateField] === true;
6125
- });
6126
- }
6127
- }, {
6128
- key: "getAllSelections",
6129
- value: function getAllSelections() {
6130
6703
  var _this18 = this;
6131
6704
 
6132
- return this.options.data.filter(function (row) {
6705
+ return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
6133
6706
  return row[_this18.header.stateField] === true;
6134
6707
  });
6135
6708
  }
@@ -6141,10 +6714,8 @@
6141
6714
 
6142
6715
  if (this.options.pagination && this.options.sidePagination === 'server') {
6143
6716
  this.options.totalRows = data[this.options.totalField];
6144
- }
6145
-
6146
- if (this.options.pagination && this.options.sidePagination === 'server') {
6147
6717
  this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
6718
+ this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
6148
6719
  }
6149
6720
 
6150
6721
  fixedScroll = data.fixedScroll;
@@ -6175,34 +6746,30 @@
6175
6746
  }, {
6176
6747
  key: "remove",
6177
6748
  value: function remove(params) {
6178
- var len = this.options.data.length;
6179
- var i;
6180
- var row;
6749
+ var removed = 0;
6181
6750
 
6182
- if (!params.hasOwnProperty('field') || !params.hasOwnProperty('values')) {
6183
- return;
6184
- }
6751
+ for (var i = this.options.data.length - 1; i >= 0; i--) {
6752
+ var row = this.options.data[i];
6185
6753
 
6186
- for (i = len - 1; i >= 0; i--) {
6187
- row = this.options.data[i];
6188
-
6189
- if (!row.hasOwnProperty(params.field)) {
6754
+ if (!row.hasOwnProperty(params.field) && params.field !== '$index') {
6190
6755
  continue;
6191
6756
  }
6192
6757
 
6193
- if (params.values.includes(row[params.field])) {
6758
+ if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(row[params.field])) {
6759
+ removed++;
6194
6760
  this.options.data.splice(i, 1);
6195
-
6196
- if (this.options.sidePagination === 'server') {
6197
- this.options.totalRows -= 1;
6198
- }
6199
6761
  }
6200
6762
  }
6201
6763
 
6202
- if (len === this.options.data.length) {
6764
+ if (!removed) {
6203
6765
  return;
6204
6766
  }
6205
6767
 
6768
+ if (this.options.sidePagination === 'server') {
6769
+ this.options.totalRows -= removed;
6770
+ this.data = _toConsumableArray(this.options.data);
6771
+ }
6772
+
6206
6773
  this.initSearch();
6207
6774
  this.initPagination();
6208
6775
  this.initSort();
@@ -6235,20 +6802,18 @@
6235
6802
  key: "updateRow",
6236
6803
  value: function updateRow(params) {
6237
6804
  var allParams = Array.isArray(params) ? params : [params];
6238
- var _iteratorNormalCompletion5 = true;
6239
- var _didIteratorError5 = false;
6240
- var _iteratorError5 = undefined;
6805
+ var _iteratorNormalCompletion6 = true;
6806
+ var _didIteratorError6 = false;
6807
+ var _iteratorError6 = undefined;
6241
6808
 
6242
6809
  try {
6243
- for (var _iterator5 = allParams[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
6244
- var _params = _step5.value;
6810
+ for (var _iterator6 = allParams[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
6811
+ var _params = _step6.value;
6245
6812
 
6246
6813
  if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
6247
6814
  continue;
6248
6815
  }
6249
6816
 
6250
- $.extend(this.options.data[_params.index], _params.row);
6251
-
6252
6817
  if (_params.hasOwnProperty('replace') && _params.replace) {
6253
6818
  this.options.data[_params.index] = _params.row;
6254
6819
  } else {
@@ -6256,16 +6821,16 @@
6256
6821
  }
6257
6822
  }
6258
6823
  } catch (err) {
6259
- _didIteratorError5 = true;
6260
- _iteratorError5 = err;
6824
+ _didIteratorError6 = true;
6825
+ _iteratorError6 = err;
6261
6826
  } finally {
6262
6827
  try {
6263
- if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
6264
- _iterator5.return();
6828
+ if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
6829
+ _iterator6.return();
6265
6830
  }
6266
6831
  } finally {
6267
- if (_didIteratorError5) {
6268
- throw _iteratorError5;
6832
+ if (_didIteratorError6) {
6833
+ throw _iteratorError6;
6269
6834
  }
6270
6835
  }
6271
6836
  }
@@ -6321,13 +6886,13 @@
6321
6886
  key: "updateByUniqueId",
6322
6887
  value: function updateByUniqueId(params) {
6323
6888
  var allParams = Array.isArray(params) ? params : [params];
6324
- var _iteratorNormalCompletion6 = true;
6325
- var _didIteratorError6 = false;
6326
- var _iteratorError6 = undefined;
6889
+ var _iteratorNormalCompletion7 = true;
6890
+ var _didIteratorError7 = false;
6891
+ var _iteratorError7 = undefined;
6327
6892
 
6328
6893
  try {
6329
- for (var _iterator6 = allParams[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
6330
- var _params2 = _step6.value;
6894
+ for (var _iterator7 = allParams[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
6895
+ var _params2 = _step7.value;
6331
6896
 
6332
6897
  if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
6333
6898
  continue;
@@ -6346,16 +6911,16 @@
6346
6911
  }
6347
6912
  }
6348
6913
  } catch (err) {
6349
- _didIteratorError6 = true;
6350
- _iteratorError6 = err;
6914
+ _didIteratorError7 = true;
6915
+ _iteratorError7 = err;
6351
6916
  } finally {
6352
6917
  try {
6353
- if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
6354
- _iterator6.return();
6918
+ if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
6919
+ _iterator7.return();
6355
6920
  }
6356
6921
  } finally {
6357
- if (_didIteratorError6) {
6358
- throw _iteratorError6;
6922
+ if (_didIteratorError7) {
6923
+ throw _iteratorError7;
6359
6924
  }
6360
6925
  }
6361
6926
  }
@@ -6379,6 +6944,11 @@
6379
6944
  return;
6380
6945
  }
6381
6946
 
6947
+ if (this.options.sidePagination === 'server') {
6948
+ this.options.totalRows -= 1;
6949
+ this.data = _toConsumableArray(this.options.data);
6950
+ }
6951
+
6382
6952
  this.initSearch();
6383
6953
  this.initPagination();
6384
6954
  this.initBody(true);
@@ -6404,10 +6974,6 @@
6404
6974
  value: function updateCellByUniqueId(params) {
6405
6975
  var _this19 = this;
6406
6976
 
6407
- if (!params.hasOwnProperty('id') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
6408
- return;
6409
- }
6410
-
6411
6977
  var allParams = Array.isArray(params) ? params : [params];
6412
6978
  allParams.forEach(function (_ref6) {
6413
6979
  var id = _ref6.id,
@@ -6463,12 +7029,8 @@
6463
7029
  this.hiddenRows.splice(index, 1);
6464
7030
  }
6465
7031
 
6466
- if (visible) {
6467
- this.updatePagination();
6468
- } else {
6469
- this.initBody(true);
6470
- this.initPagination();
6471
- }
7032
+ this.initBody(true);
7033
+ this.initPagination();
6472
7034
  }
6473
7035
  }, {
6474
7036
  key: "getHiddenRows",
@@ -6476,34 +7038,35 @@
6476
7038
  if (show) {
6477
7039
  this.initHiddenRows();
6478
7040
  this.initBody(true);
7041
+ this.initPagination();
6479
7042
  return;
6480
7043
  }
6481
7044
 
6482
7045
  var data = this.getData();
6483
7046
  var rows = [];
6484
- var _iteratorNormalCompletion7 = true;
6485
- var _didIteratorError7 = false;
6486
- var _iteratorError7 = undefined;
7047
+ var _iteratorNormalCompletion8 = true;
7048
+ var _didIteratorError8 = false;
7049
+ var _iteratorError8 = undefined;
6487
7050
 
6488
7051
  try {
6489
- for (var _iterator7 = data[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
6490
- var row = _step7.value;
7052
+ for (var _iterator8 = data[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
7053
+ var row = _step8.value;
6491
7054
 
6492
7055
  if (this.hiddenRows.includes(row)) {
6493
7056
  rows.push(row);
6494
7057
  }
6495
7058
  }
6496
7059
  } catch (err) {
6497
- _didIteratorError7 = true;
6498
- _iteratorError7 = err;
7060
+ _didIteratorError8 = true;
7061
+ _iteratorError8 = err;
6499
7062
  } finally {
6500
7063
  try {
6501
- if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
6502
- _iterator7.return();
7064
+ if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
7065
+ _iterator8.return();
6503
7066
  }
6504
7067
  } finally {
6505
- if (_didIteratorError7) {
6506
- throw _iteratorError7;
7068
+ if (_didIteratorError8) {
7069
+ throw _iteratorError8;
6507
7070
  }
6508
7071
  }
6509
7072
  }
@@ -6593,13 +7156,13 @@
6593
7156
  value: function _toggleAllColumns(visible) {
6594
7157
  var _this23 = this;
6595
7158
 
6596
- var _iteratorNormalCompletion8 = true;
6597
- var _didIteratorError8 = false;
6598
- var _iteratorError8 = undefined;
7159
+ var _iteratorNormalCompletion9 = true;
7160
+ var _didIteratorError9 = false;
7161
+ var _iteratorError9 = undefined;
6599
7162
 
6600
7163
  try {
6601
- for (var _iterator8 = this.columns.slice().reverse()[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
6602
- var column = _step8.value;
7164
+ for (var _iterator9 = this.columns.slice().reverse()[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
7165
+ var column = _step9.value;
6603
7166
 
6604
7167
  if (column.switchable) {
6605
7168
  if (!visible && this.options.showColumns && this.getVisibleColumns().length === this.options.minimumCountColumns) {
@@ -6610,16 +7173,16 @@
6610
7173
  }
6611
7174
  }
6612
7175
  } catch (err) {
6613
- _didIteratorError8 = true;
6614
- _iteratorError8 = err;
7176
+ _didIteratorError9 = true;
7177
+ _iteratorError9 = err;
6615
7178
  } finally {
6616
7179
  try {
6617
- if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
6618
- _iterator8.return();
7180
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
7181
+ _iterator9.return();
6619
7182
  }
6620
7183
  } finally {
6621
- if (_didIteratorError8) {
6622
- throw _iteratorError8;
7184
+ if (_didIteratorError9) {
7185
+ throw _iteratorError9;
6623
7186
  }
6624
7187
  }
6625
7188
  }
@@ -6657,11 +7220,7 @@
6657
7220
  var i;
6658
7221
  var j;
6659
7222
  var $tr = this.$body.find('>tr');
6660
-
6661
- if (this.options.detailView && !this.options.cardView) {
6662
- col += 1;
6663
- }
6664
-
7223
+ col += Utils.getDetailViewIndexOffset(this.options);
6665
7224
  var $td = $tr.eq(row).find('>td').eq(col);
6666
7225
 
6667
7226
  if (row < 0 || col < 0 || row >= this.data.length) {
@@ -6693,6 +7252,7 @@
6693
7252
  this.$selectAll.add(this.$selectAll_).prop('checked', checked);
6694
7253
  this.$selectItem.filter(':enabled').prop('checked', checked);
6695
7254
  this.updateRows();
7255
+ this.updateSelected();
6696
7256
  var rowsAfter = this.getSelections();
6697
7257
 
6698
7258
  if (checked) {
@@ -6733,26 +7293,26 @@
6733
7293
  var row = this.data[index];
6734
7294
 
6735
7295
  if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
6736
- var _iteratorNormalCompletion9 = true;
6737
- var _didIteratorError9 = false;
6738
- var _iteratorError9 = undefined;
7296
+ var _iteratorNormalCompletion10 = true;
7297
+ var _didIteratorError10 = false;
7298
+ var _iteratorError10 = undefined;
6739
7299
 
6740
7300
  try {
6741
- for (var _iterator9 = this.options.data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
6742
- var r = _step9.value;
7301
+ for (var _iterator10 = this.options.data[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {
7302
+ var r = _step10.value;
6743
7303
  r[this.header.stateField] = false;
6744
7304
  }
6745
7305
  } catch (err) {
6746
- _didIteratorError9 = true;
6747
- _iteratorError9 = err;
7306
+ _didIteratorError10 = true;
7307
+ _iteratorError10 = err;
6748
7308
  } finally {
6749
7309
  try {
6750
- if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
6751
- _iterator9.return();
7310
+ if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
7311
+ _iterator10.return();
6752
7312
  }
6753
7313
  } finally {
6754
- if (_didIteratorError9) {
6755
- throw _iteratorError9;
7314
+ if (_didIteratorError10) {
7315
+ throw _iteratorError10;
6756
7316
  }
6757
7317
  }
6758
7318
  }
@@ -6764,9 +7324,12 @@
6764
7324
 
6765
7325
  if (this.options.multipleSelectRow) {
6766
7326
  if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
6767
- var indexes = [this.multipleSelectRowLastSelectedIndex, index].sort();
7327
+ var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
7328
+ _ref9 = _slicedToArray(_ref8, 2),
7329
+ fromIndex = _ref9[0],
7330
+ toIndex = _ref9[1];
6768
7331
 
6769
- for (var i = indexes[0] + 1; i < indexes[1]; i++) {
7332
+ for (var i = fromIndex + 1; i < toIndex; i++) {
6770
7333
  this.data[i][this.header.stateField] = true;
6771
7334
  this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
6772
7335
  }
@@ -6885,6 +7448,11 @@
6885
7448
  this.$tableContainer.css('height', '');
6886
7449
  this.$tableContainer.css('width', '');
6887
7450
  } else if (this.options.height) {
7451
+ if (this.$tableBorder) {
7452
+ this.$tableBorder.css('width', '');
7453
+ this.$tableBorder.css('height', '');
7454
+ }
7455
+
6888
7456
  var toolbarHeight = this.$toolbar.outerHeight(true);
6889
7457
  var paginationHeight = this.$pagination.outerHeight(true);
6890
7458
  var height = this.options.height - toolbarHeight - paginationHeight;
@@ -6892,7 +7460,7 @@
6892
7460
  var tableHeight = $bodyTable.outerHeight();
6893
7461
  this.$tableContainer.css('height', "".concat(height, "px"));
6894
7462
 
6895
- if (this.$tableBorder) {
7463
+ if (this.$tableBorder && $bodyTable.is(':visible')) {
6896
7464
  var tableBorderHeight = height - tableHeight - 2;
6897
7465
 
6898
7466
  if (this.$tableBody[0].scrollWidth - this.$tableBody.innerWidth()) {
@@ -6920,12 +7488,22 @@
6920
7488
  }, {
6921
7489
  key: "showLoading",
6922
7490
  value: function showLoading() {
6923
- this.$tableLoading.css('display', 'flex');
7491
+ this.$tableLoading.toggleClass('open', true);
7492
+ var fontSize = this.options.loadingFontSize;
7493
+
7494
+ if (this.options.loadingFontSize === 'auto') {
7495
+ fontSize = this.$tableLoading.width() * 0.04;
7496
+ fontSize = Math.max(12, fontSize);
7497
+ fontSize = Math.min(32, fontSize);
7498
+ fontSize = "".concat(fontSize, "px");
7499
+ }
7500
+
7501
+ this.$tableLoading.find('.loading-text').css('font-size', fontSize);
6924
7502
  }
6925
7503
  }, {
6926
7504
  key: "hideLoading",
6927
7505
  value: function hideLoading() {
6928
- this.$tableLoading.css('display', 'none');
7506
+ this.$tableLoading.toggleClass('open', false);
6929
7507
  }
6930
7508
  }, {
6931
7509
  key: "togglePagination",
@@ -6933,7 +7511,7 @@
6933
7511
  this.options.pagination = !this.options.pagination;
6934
7512
  var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
6935
7513
  var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
6936
- this.$toolbar.find('button[name="paginationSwitch"]').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon) + ' ' + text);
7514
+ this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
6937
7515
  this.updatePagination();
6938
7516
  }
6939
7517
  }, {
@@ -6949,14 +7527,14 @@
6949
7527
  this.initHeader();
6950
7528
  var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
6951
7529
  var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
6952
- this.$toolbar.find('button[name="toggle"]').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon) + ' ' + text);
7530
+ this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
6953
7531
  this.initBody();
6954
7532
  this.trigger('toggle', this.options.cardView);
6955
7533
  }
6956
7534
  }, {
6957
7535
  key: "resetSearch",
6958
7536
  value: function resetSearch(text) {
6959
- var $search = this.$toolbar.find('.search input');
7537
+ var $search = Utils.getSearchInput(this);
6960
7538
  $search.val(text || '');
6961
7539
  this.onSearch({
6962
7540
  currentTarget: $search
@@ -6974,10 +7552,6 @@
6974
7552
  }, {
6975
7553
  key: "scrollTo",
6976
7554
  value: function scrollTo(params) {
6977
- if (typeof params === 'undefined') {
6978
- return this.$tableBody.scrollTop();
6979
- }
6980
-
6981
7555
  var options = {
6982
7556
  unit: 'px',
6983
7557
  value: 0
@@ -6987,7 +7561,7 @@
6987
7561
  options = Object.assign(options, params);
6988
7562
  } else if (typeof params === 'string' && params === 'bottom') {
6989
7563
  options.value = this.$tableBody[0].scrollHeight;
6990
- } else if (typeof params === 'string') {
7564
+ } else if (typeof params === 'string' || typeof params === 'number') {
6991
7565
  options.value = params;
6992
7566
  }
6993
7567
 
@@ -7005,7 +7579,7 @@
7005
7579
  }, {
7006
7580
  key: "getScrollPosition",
7007
7581
  value: function getScrollPosition() {
7008
- return this.scrollTo();
7582
+ return this.$tableBody.scrollTop();
7009
7583
  }
7010
7584
  }, {
7011
7585
  key: "selectPage",
@@ -7069,6 +7643,17 @@
7069
7643
 
7070
7644
  this.trigger('expand-row', index, row, $element);
7071
7645
  }
7646
+ }, {
7647
+ key: "expandRowByUniqueId",
7648
+ value: function expandRowByUniqueId(uniqueId) {
7649
+ var row = this.getRowByUniqueId(uniqueId);
7650
+
7651
+ if (!row) {
7652
+ return;
7653
+ }
7654
+
7655
+ this.expandRow(this.data.indexOf(row));
7656
+ }
7072
7657
  }, {
7073
7658
  key: "collapseRow",
7074
7659
  value: function collapseRow(index) {
@@ -7086,6 +7671,17 @@
7086
7671
  this.trigger('collapse-row', index, row, $tr.next());
7087
7672
  $tr.next().remove();
7088
7673
  }
7674
+ }, {
7675
+ key: "collapseRowByUniqueId",
7676
+ value: function collapseRowByUniqueId(uniqueId) {
7677
+ var row = this.getRowByUniqueId(uniqueId);
7678
+
7679
+ if (!row) {
7680
+ return;
7681
+ }
7682
+
7683
+ this.collapseRow(this.data.indexOf(row));
7684
+ }
7089
7685
  }, {
7090
7686
  key: "expandAllRows",
7091
7687
  value: function expandAllRows() {
@@ -7114,13 +7710,13 @@
7114
7710
  this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape ? Utils.escapeHTML(params.title) : params.title;
7115
7711
 
7116
7712
  if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
7117
- var header = this.options.height !== undefined ? this.$tableHeader : this.$header;
7118
- header.find('th[data-field]').each(function (i, el) {
7713
+ this.$header.find('th[data-field]').each(function (i, el) {
7119
7714
  if ($(el).data('field') === params.field) {
7120
7715
  $($(el).find('.th-inner')[0]).text(params.title);
7121
7716
  return false;
7122
7717
  }
7123
7718
  });
7719
+ this.resetView();
7124
7720
  }
7125
7721
  }
7126
7722
  }, {
@@ -7186,7 +7782,9 @@
7186
7782
  }
7187
7783
 
7188
7784
  if (!data) {
7189
- $(el).data('bootstrap.table', data = new $.BootstrapTable(el, options));
7785
+ data = new $.BootstrapTable(el, options);
7786
+ $(el).data('bootstrap.table', data);
7787
+ data.init();
7190
7788
  }
7191
7789
  });
7192
7790
  return typeof value === 'undefined' ? this : value;