bootstrap-table-rails 1.18.0 → 1.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bootstrap-table-rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +132 -131
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +9 -6
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +96 -99
  6. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +5 -1
  7. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +2 -2
  8. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +1 -1
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +6 -6
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +5 -5
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +2 -0
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +4 -11
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +31 -19
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/utils.js +21 -10
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +8 -0
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +14 -10
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +5 -7
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +43 -47
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +26 -3
  20. data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +8 -9
  21. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +87 -57
  22. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +13 -4
  23. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +3 -0
  24. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +2 -2
  25. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +10 -9
  26. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +1 -1
  27. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +1 -1
  28. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +1 -1
  29. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +1 -1
  30. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +1 -1
  31. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +1 -1
  32. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +2 -2
  33. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +1 -1
  34. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +1 -1
  35. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +2 -2
  36. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +19 -19
  37. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +17 -17
  38. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +1 -1
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +1 -1
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +1 -1
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +1 -1
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +14 -14
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +1 -1
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +1 -1
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +1 -1
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +1 -1
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +1 -1
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +1 -1
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +1 -1
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +1 -1
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +1 -1
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +1 -1
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +1 -1
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +23 -22
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +1 -1
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +1 -1
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +1 -1
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +20 -20
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +1 -1
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +1 -1
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +1 -1
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +1 -1
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +1 -1
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +1 -1
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +1 -1
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +1 -1
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +1 -1
  68. data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +10 -5
  69. data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +8 -5
  70. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +13 -5
  71. data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +8 -2
  72. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +13 -5
  73. data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +8 -2
  74. data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +8 -5
  75. metadata +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author zhixin wen <wenzhixin2010@gmail.com>
3
- * version: 1.18.0
3
+ * version: 1.18.1
4
4
  * https://github.com/wenzhixin/bootstrap-table/
5
5
  */
6
6
  .bootstrap-table .fixed-table-toolbar::after {
@@ -141,6 +141,10 @@
141
141
  text-align: left !important;
142
142
  }
143
143
 
144
+ .bootstrap-table .fixed-table-container .table tbody tr .card-view .card-view-value {
145
+ width: 100%;
146
+ }
147
+
144
148
  .bootstrap-table .fixed-table-container .table .bs-checkbox {
145
149
  text-align: center;
146
150
  }
@@ -298,11 +302,6 @@
298
302
  margin: 0;
299
303
  }
300
304
 
301
- .bootstrap-table .fixed-table-pagination > .pagination ul.pagination a {
302
- padding: 6px 12px;
303
- line-height: 1.428571429;
304
- }
305
-
306
305
  .bootstrap-table .fixed-table-pagination > .pagination ul.pagination li.page-intermediate a {
307
306
  color: #c8c8c8;
308
307
  }
@@ -331,6 +330,10 @@
331
330
  overflow-y: scroll;
332
331
  }
333
332
 
333
+ .bootstrap-table.bootstrap4 .pagination-lg .page-link, .bootstrap-table.bootstrap5 .pagination-lg .page-link {
334
+ padding: .5rem 1rem;
335
+ }
336
+
334
337
  /* calculate scrollbar width */
335
338
  div.fixed-table-scroll-inner {
336
339
  width: 100%;
@@ -2946,7 +2946,9 @@
2946
2946
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2947
2947
  }
2948
2948
 
2949
- var VERSION = '1.18.0';
2949
+ /* eslint-disable no-unused-vars */
2950
+
2951
+ var VERSION = '1.18.1';
2950
2952
  var bootstrapVersion = 4;
2951
2953
 
2952
2954
  try {
@@ -3413,7 +3415,7 @@
3413
3415
  field: undefined,
3414
3416
  title: undefined,
3415
3417
  titleTooltip: undefined,
3416
- 'class': undefined,
3418
+ class: undefined,
3417
3419
  width: undefined,
3418
3420
  widthUnit: 'px',
3419
3421
  rowspan: undefined,
@@ -3819,9 +3821,7 @@
3819
3821
 
3820
3822
  return this.cachedWidth;
3821
3823
  },
3822
- calculateObjectValue: function calculateObjectValue(self, name) {
3823
- var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3824
- var defaultValue = arguments.length > 3 ? arguments[3] : undefined;
3824
+ calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
3825
3825
  var func = name;
3826
3826
 
3827
3827
  if (typeof name === 'string') {
@@ -4325,7 +4325,15 @@
4325
4325
  this.constants.theme = $.fn.bootstrapTable.theme;
4326
4326
  var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
4327
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, [], []);
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
+ }
4329
4337
  }
4330
4338
  }, {
4331
4339
  key: "initLocale",
@@ -4418,7 +4426,7 @@
4418
4426
 
4419
4427
  column.push($.extend({}, {
4420
4428
  title: $th.html(),
4421
- 'class': $th.attr('class'),
4429
+ class: $th.attr('class'),
4422
4430
  titleTooltip: $th.attr('title'),
4423
4431
  rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
4424
4432
  colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
@@ -4810,12 +4818,8 @@
4810
4818
 
4811
4819
  html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
4812
4820
 
4813
- if (typeof opts.icons === 'string') {
4814
- opts.icons = Utils.calculateObjectValue(null, opts.icons);
4815
- }
4816
-
4817
4821
  if (typeof opts.buttonsOrder === 'string') {
4818
- opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4822
+ opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
4819
4823
  }
4820
4824
 
4821
4825
  this.buttons = Object.assign(this.buttons, {
@@ -4881,7 +4885,7 @@
4881
4885
 
4882
4886
  var visibleColumns = 0;
4883
4887
 
4884
- _this4.columns.forEach(function (column, i) {
4888
+ _this4.columns.forEach(function (column) {
4885
4889
  if (column.visible) {
4886
4890
  visibleColumns++;
4887
4891
  }
@@ -4920,7 +4924,11 @@
4920
4924
  var buttonHtml = void 0;
4921
4925
 
4922
4926
  if (buttonConfig.hasOwnProperty('html')) {
4923
- buttonHtml = Utils.calculateObjectValue(opts, buttonConfig.html);
4927
+ if (typeof buttonConfig.html === 'function') {
4928
+ buttonHtml = buttonConfig.html();
4929
+ } else if (typeof buttonConfig.html === 'string') {
4930
+ buttonHtml = buttonConfig.html;
4931
+ }
4924
4932
  } else {
4925
4933
  buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
4926
4934
 
@@ -4930,19 +4938,18 @@
4930
4938
  attributeName = _Object$entries4$_i[0],
4931
4939
  value = _Object$entries4$_i[1];
4932
4940
 
4933
- buttonHtml += " ".concat(attributeName, "=\"").concat(Utils.calculateObjectValue(opts, value), "\"");
4941
+ buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
4934
4942
  }
4935
4943
  }
4936
4944
 
4937
4945
  buttonHtml += '>';
4938
4946
 
4939
4947
  if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
4940
- var icon = Utils.calculateObjectValue(opts, buttonConfig.icon);
4941
- buttonHtml += Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, icon) + ' ';
4948
+ buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
4942
4949
  }
4943
4950
 
4944
4951
  if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
4945
- buttonHtml += Utils.calculateObjectValue(opts, buttonConfig.text);
4952
+ buttonHtml += buttonConfig.text;
4946
4953
  }
4947
4954
 
4948
4955
  buttonHtml += '</button>';
@@ -5125,7 +5132,7 @@
5125
5132
  var $searchInput = Utils.getSearchInput(this);
5126
5133
 
5127
5134
  if (opts.showSearchButton) {
5128
- 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 () {
5129
5136
  clearTimeout(timeoutId); // doesn't matter if it's 0
5130
5137
 
5131
5138
  timeoutId = setTimeout(function () {
@@ -5217,11 +5224,11 @@
5217
5224
  var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
5218
5225
 
5219
5226
  if (typeof this.filterOptions.filterAlgorithm === 'function') {
5220
- this.data = this.options.data.filter(function (item, i) {
5227
+ this.data = this.options.data.filter(function (item) {
5221
5228
  return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
5222
5229
  });
5223
5230
  } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
5224
- this.data = f ? this.options.data.filter(function (item, i) {
5231
+ this.data = f ? this.options.data.filter(function (item) {
5225
5232
  var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
5226
5233
 
5227
5234
  if (filterAlgorithm === 'and') {
@@ -5431,7 +5438,7 @@
5431
5438
  html.push('<span class="page-list">');
5432
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])];
5433
5440
  pageList.forEach(function (page, i) {
5434
- if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows) {
5441
+ if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
5435
5442
  var active;
5436
5443
 
5437
5444
  if (allSelected) {
@@ -5496,14 +5503,12 @@
5496
5503
  if (from - 1 === max + 1) {
5497
5504
  i = from - 1;
5498
5505
  html.push(pageItem(i));
5499
- } else {
5500
- if (from - 1 > max) {
5501
- if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
5502
- i = Math.round((from - middleSize) / 2 + middleSize);
5503
- html.push(pageItem(i, ' page-intermediate'));
5504
- } else {
5505
- html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
5506
- }
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', '', '...'));
5507
5512
  }
5508
5513
  }
5509
5514
  }
@@ -5519,14 +5524,12 @@
5519
5524
  if (to + 1 === min - 1) {
5520
5525
  i = to + 1;
5521
5526
  html.push(pageItem(i));
5522
- } else {
5523
- if (min > to + 1) {
5524
- if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
5525
- i = Math.round((this.totalPages - middleSize - to) / 2 + to);
5526
- html.push(pageItem(i, ' page-intermediate'));
5527
- } else {
5528
- html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
5529
- }
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', '', '...'));
5530
5533
  }
5531
5534
  }
5532
5535
 
@@ -5663,7 +5666,8 @@
5663
5666
  this.options.pageNumber = +$(event.currentTarget).text();
5664
5667
  this.updatePagination(event);
5665
5668
  return false;
5666
- }
5669
+ } // eslint-disable-next-line no-unused-vars
5670
+
5667
5671
  }, {
5668
5672
  key: "initRow",
5669
5673
  value: function initRow(item, i, data, trFragments) {
@@ -5831,9 +5835,10 @@
5831
5835
  }
5832
5836
 
5833
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;
5834
5839
 
5835
5840
  if (_this7.searchText !== '' && _this7.options.searchHighlight) {
5836
- value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], value.replace(new RegExp('(' + _this7.searchText + ')', 'gim'), '<mark>$1</mark>'));
5841
+ value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], value.toString().replace(new RegExp("(".concat(_this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), ")"), 'gim'), '<mark>$1</mark>'));
5837
5842
  }
5838
5843
 
5839
5844
  if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
@@ -5859,19 +5864,15 @@
5859
5864
  var isDisabled = !column.checkboxEnabled || value && value.disabled;
5860
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('');
5861
5866
  item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
5862
- } else {
5863
- value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
5864
-
5865
- if (_this7.options.cardView) {
5866
- var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title\"".concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
5867
- text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value\">").concat(value, "</span></div>");
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>");
5868
5870
 
5869
- if (_this7.options.smartDisplay && value === '') {
5870
- text = '<div class="card-view"></div>';
5871
- }
5872
- } else {
5873
- 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>';
5874
5873
  }
5874
+ } else {
5875
+ text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
5875
5876
  }
5876
5877
 
5877
5878
  html.push(text);
@@ -5929,27 +5930,25 @@
5929
5930
 
5930
5931
  if (!hasTr) {
5931
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);
5932
5935
  } else {
5933
- if (!this.options.virtualScroll) {
5934
- this.$body.html(trFragments);
5935
- } else {
5936
- if (this.virtualScroll) {
5937
- this.virtualScroll.destroy();
5938
- }
5936
+ if (this.virtualScroll) {
5937
+ this.virtualScroll.destroy();
5938
+ }
5939
5939
 
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();
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();
5948
5948
 
5949
- _this8.initBodyEvent();
5950
- }
5951
- });
5952
- }
5949
+ _this8.initBodyEvent();
5950
+ }
5951
+ });
5953
5952
  }
5954
5953
 
5955
5954
  if (!fixedScroll) {
@@ -6479,7 +6478,7 @@
6479
6478
  var colspan = 0;
6480
6479
 
6481
6480
  if (this.footerData && this.footerData.length > 0) {
6482
- colspan = this.footerData[0]['_' + column.field + '_colspan'] || 0;
6481
+ colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
6483
6482
  }
6484
6483
 
6485
6484
  if (colspan) {
@@ -6542,7 +6541,6 @@
6542
6541
  var fixedBody = this.$tableBody.get(0);
6543
6542
  var scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
6544
6543
  this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
6545
- var visibleFields = this.getVisibleFields();
6546
6544
  var $ths = this.$tableFooter.find('th');
6547
6545
  var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
6548
6546
  $ths.find('.fht-cell').width('auto');
@@ -6704,7 +6702,7 @@
6704
6702
  value: function getSelections() {
6705
6703
  var _this18 = this;
6706
6704
 
6707
- return this.options.data.filter(function (row) {
6705
+ return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
6708
6706
  return row[_this18.header.stateField] === true;
6709
6707
  });
6710
6708
  }
@@ -6748,39 +6746,30 @@
6748
6746
  }, {
6749
6747
  key: "remove",
6750
6748
  value: function remove(params) {
6751
- var len = this.options.data.length;
6752
- var i;
6753
- var row;
6754
-
6755
- if (!params.hasOwnProperty('field') || !params.hasOwnProperty('values')) {
6756
- return;
6757
- }
6749
+ var removed = 0;
6758
6750
 
6759
- for (i = len - 1; i >= 0; i--) {
6760
- var exists = false;
6761
- row = this.options.data[i];
6751
+ for (var i = this.options.data.length - 1; i >= 0; i--) {
6752
+ var row = this.options.data[i];
6762
6753
 
6763
6754
  if (!row.hasOwnProperty(params.field) && params.field !== '$index') {
6764
6755
  continue;
6765
- } else if (!row.hasOwnProperty(params.field) && params.field === '$index') {
6766
- exists = params.values.includes(i);
6767
- } else {
6768
- exists = params.values.includes(row[params.field]);
6769
6756
  }
6770
6757
 
6771
- if (exists) {
6758
+ if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(row[params.field])) {
6759
+ removed++;
6772
6760
  this.options.data.splice(i, 1);
6773
-
6774
- if (this.options.sidePagination === 'server') {
6775
- this.options.totalRows -= 1;
6776
- }
6777
6761
  }
6778
6762
  }
6779
6763
 
6780
- if (len === this.options.data.length) {
6764
+ if (!removed) {
6781
6765
  return;
6782
6766
  }
6783
6767
 
6768
+ if (this.options.sidePagination === 'server') {
6769
+ this.options.totalRows -= removed;
6770
+ this.data = _toConsumableArray(this.options.data);
6771
+ }
6772
+
6784
6773
  this.initSearch();
6785
6774
  this.initPagination();
6786
6775
  this.initSort();
@@ -6955,6 +6944,11 @@
6955
6944
  return;
6956
6945
  }
6957
6946
 
6947
+ if (this.options.sidePagination === 'server') {
6948
+ this.options.totalRows -= 1;
6949
+ this.data = _toConsumableArray(this.options.data);
6950
+ }
6951
+
6958
6952
  this.initSearch();
6959
6953
  this.initPagination();
6960
6954
  this.initBody(true);
@@ -7296,7 +7290,7 @@
7296
7290
  key: "_toggleCheck",
7297
7291
  value: function _toggleCheck(checked, index) {
7298
7292
  var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
7299
- var row = this.options.data[index];
7293
+ var row = this.data[index];
7300
7294
 
7301
7295
  if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
7302
7296
  var _iteratorNormalCompletion10 = true;
@@ -7330,9 +7324,12 @@
7330
7324
 
7331
7325
  if (this.options.multipleSelectRow) {
7332
7326
  if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
7333
- 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];
7334
7331
 
7335
- for (var i = indexes[0] + 1; i < indexes[1]; i++) {
7332
+ for (var i = fromIndex + 1; i < toIndex; i++) {
7336
7333
  this.data[i][this.header.stateField] = true;
7337
7334
  this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
7338
7335
  }
@@ -7514,7 +7511,7 @@
7514
7511
  this.options.pagination = !this.options.pagination;
7515
7512
  var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
7516
7513
  var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
7517
- 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));
7518
7515
  this.updatePagination();
7519
7516
  }
7520
7517
  }, {
@@ -7530,7 +7527,7 @@
7530
7527
  this.initHeader();
7531
7528
  var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
7532
7529
  var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
7533
- 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));
7534
7531
  this.initBody();
7535
7532
  this.trigger('toggle', this.options.cardView);
7536
7533
  }
@@ -7713,13 +7710,13 @@
7713
7710
  this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape ? Utils.escapeHTML(params.title) : params.title;
7714
7711
 
7715
7712
  if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
7716
- var header = this.options.height !== undefined ? this.$tableHeader : this.$header;
7717
- header.find('th[data-field]').each(function (i, el) {
7713
+ this.$header.find('th[data-field]').each(function (i, el) {
7718
7714
  if ($(el).data('field') === params.field) {
7719
7715
  $($(el).find('.th-inner')[0]).text(params.title);
7720
7716
  return false;
7721
7717
  }
7722
7718
  });
7719
+ this.resetView();
7723
7720
  }
7724
7721
  }
7725
7722
  }, {
@@ -1581,7 +1581,11 @@
1581
1581
 
1582
1582
  function _updateHistoryState(table, _prefix) {
1583
1583
  var params = {};
1584
- params["".concat(_prefix, "page")] = table.options.pageNumber, params["".concat(_prefix, "size")] = table.options.pageSize, params["".concat(_prefix, "order")] = table.options.sortOrder, params["".concat(_prefix, "sort")] = table.options.sortName, params["".concat(_prefix, "search")] = table.options.searchText;
1584
+ params["".concat(_prefix, "page")] = table.options.pageNumber;
1585
+ params["".concat(_prefix, "size")] = table.options.pageSize;
1586
+ params["".concat(_prefix, "order")] = table.options.sortOrder;
1587
+ params["".concat(_prefix, "sort")] = table.options.sortName;
1588
+ params["".concat(_prefix, "search")] = table.options.searchText;
1585
1589
  window.history.pushState({}, '', _buildUrl(params));
1586
1590
  }
1587
1591
 
@@ -1101,8 +1101,8 @@
1101
1101
  if (this.options.autoRefresh) {
1102
1102
  this.buttons = Object.assign(this.buttons, {
1103
1103
  autoRefresh: {
1104
- 'html': "\n <button class=\"auto-refresh ".concat(this.constants.buttonsClass, "\n ").concat(this.options.autoRefreshStatus ? " ".concat(this.constants.classes.buttonActive) : '', "\"\n type=\"button\" name=\"autoRefresh\" title=\"").concat(this.options.formatAutoRefresh(), "\">\n ").concat(this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.autoRefresh) : '', "\n ").concat(this.options.showButtonText ? this.options.formatAutoRefresh() : '', "\n </button>\n "),
1105
- 'event': this.toggleAutoRefresh
1104
+ html: "\n <button class=\"auto-refresh ".concat(this.constants.buttonsClass, "\n ").concat(this.options.autoRefreshStatus ? " ".concat(this.constants.classes.buttonActive) : '', "\"\n type=\"button\" name=\"autoRefresh\" title=\"").concat(this.options.formatAutoRefresh(), "\">\n ").concat(this.options.showButtonIcons ? Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.autoRefresh) : '', "\n ").concat(this.options.showButtonText ? this.options.formatAutoRefresh() : '', "\n </button>\n "),
1105
+ event: this.toggleAutoRefresh
1106
1106
  }
1107
1107
  });
1108
1108
  }
@@ -2438,7 +2438,7 @@
2438
2438
 
2439
2439
  switch (that.options.cookieStorage) {
2440
2440
  case 'cookieStorage':
2441
- document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ';SameSite=' + that.options.cookieSameSite].join('');
2441
+ document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
2442
2442
  break;
2443
2443
 
2444
2444
  case 'localStorage':
@@ -1084,7 +1084,7 @@
1084
1084
  try {
1085
1085
  document.execCommand('copy');
1086
1086
  } catch (e) {
1087
- console.log('Oops, unable to copy');
1087
+ console.warn('Oops, unable to copy');
1088
1088
  }
1089
1089
 
1090
1090
  $(textField).remove();
@@ -1117,12 +1117,12 @@
1117
1117
  if (this.options.showCopyRows && this.header.stateField) {
1118
1118
  this.buttons = Object.assign(this.buttons, {
1119
1119
  copyRows: {
1120
- 'text': this.options.formatCopyRows(),
1121
- 'icon': this.options.icons.copy,
1122
- 'event': this.copyColumnsToClipboard,
1123
- 'attributes': {
1120
+ text: this.options.formatCopyRows(),
1121
+ icon: this.options.icons.copy,
1122
+ event: this.copyColumnsToClipboard,
1123
+ attributes: {
1124
1124
  'aria-label': this.options.formatCopyRows(),
1125
- 'title': this.options.formatCopyRows()
1125
+ title: this.options.formatCopyRows()
1126
1126
  }
1127
1127
  }
1128
1128
  });
@@ -1136,12 +1136,12 @@
1136
1136
  if (this.options.customView && this.options.showCustomViewButton) {
1137
1137
  this.buttons = Object.assign(this.buttons, {
1138
1138
  customView: {
1139
- 'text': this.options.formatToggleCustomView(),
1140
- 'icon': this.options.icons.customView,
1141
- 'event': this.toggleCustomView,
1142
- 'attributes': {
1139
+ text: this.options.formatToggleCustomView(),
1140
+ icon: this.options.icons.customView,
1141
+ event: this.toggleCustomView,
1142
+ attributes: {
1143
1143
  'aria-label': this.options.formatToggleCustomView(),
1144
- 'title': this.options.formatToggleCustomView()
1144
+ title: this.options.formatToggleCustomView()
1145
1145
  }
1146
1146
  }
1147
1147
  });
@@ -2219,6 +2219,8 @@
2219
2219
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2220
2220
  }
2221
2221
 
2222
+ /* eslint-disable no-unused-vars */
2223
+
2222
2224
  /**
2223
2225
  * @author zhixin wen <wenzhixin2010@gmail.com>
2224
2226
  * extensions: https://github.com/vitalets/x-editable
@@ -2453,6 +2453,7 @@
2453
2453
  $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
2454
2454
  $.fn.bootstrapTable.methods.push('exportTable');
2455
2455
  $.extend($.fn.bootstrapTable.defaults, {
2456
+ // eslint-disable-next-line no-unused-vars
2456
2457
  onExportSaved: function onExportSaved(exportedRows) {
2457
2458
  return false;
2458
2459
  }
@@ -2479,12 +2480,10 @@
2479
2480
  _this = this;
2480
2481
 
2481
2482
  var o = this.options;
2483
+ var exportTypes = o.exportTypes;
2482
2484
  this.showToolbar = this.showToolbar || o.showExport;
2483
- var $btnGroup = this.$toolbar.find('>.columns');
2484
2485
 
2485
2486
  if (this.options.showExport) {
2486
- var exportTypes = o.exportTypes;
2487
-
2488
2487
  if (typeof exportTypes === 'string') {
2489
2488
  var types = exportTypes.slice(1, -1).replace(/ /g, '').split(',');
2490
2489
  exportTypes = types.map(function (t) {
@@ -2500,8 +2499,8 @@
2500
2499
  }
2501
2500
 
2502
2501
  this.buttons = Object.assign(this.buttons, {
2503
- 'export': {
2504
- 'html': exportTypes.length === 1 ? "\n <div class=\"export ".concat(this.constants.classes.buttonsDropdown, "\"\n data-type=\"").concat(exportTypes[0], "\">\n <button class=\"").concat(this.constants.buttonsClass, "\"\n aria-label=\"Export\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n </button>\n </div>\n ") : "\n <div class=\"export ".concat(this.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\"\n aria-label=\"Export\"\n data-toggle=\"dropdown\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n </div>\n ")
2502
+ export: {
2503
+ html: exportTypes.length === 1 ? "\n <div class=\"export ".concat(this.constants.classes.buttonsDropdown, "\"\n data-type=\"").concat(exportTypes[0], "\">\n <button class=\"").concat(this.constants.buttonsClass, "\"\n aria-label=\"Export\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n </button>\n </div>\n ") : "\n <div class=\"export ".concat(this.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\"\n aria-label=\"Export\"\n data-toggle=\"dropdown\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n </div>\n ")
2505
2504
  }
2506
2505
  });
2507
2506
  }
@@ -2580,12 +2579,6 @@
2580
2579
  return;
2581
2580
  }
2582
2581
 
2583
- if ($.fn.bootstrapTable.theme === 'foundation') {
2584
- this.$export.find('.dropdown-pane').attr('id', 'toolbar-export-id');
2585
- } else if ($.fn.bootstrapTable.theme === 'materialize') {
2586
- this.$export.find('.dropdown-content').attr('id', 'toolbar-export-id');
2587
- }
2588
-
2589
2582
  if (_get(_getPrototypeOf(_class.prototype), "handleToolbar", this)) {
2590
2583
  _get(_getPrototypeOf(_class.prototype), "handleToolbar", this).call(this);
2591
2584
  }