bootstrap-table-rails 1.17.0 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b898319b463ba70ddec9e98f42845384effb9dd5ba9438a9f09e786fc15a57d3
4
- data.tar.gz: d476a6957f53b56fa5a61f34fc22e56a858c3a9ea59a1b95895aaa4b51fb107b
3
+ metadata.gz: 59d15ed96ead3be8d94f44b9d045fbfeb7ad4e49244dc1626b7a0d552769ded4
4
+ data.tar.gz: a500774fede49a87493d76ba5d1c35b60a49e53a3b5e8d01b08ed1517fb37312
5
5
  SHA512:
6
- metadata.gz: a894c1b5784d00baba0f46014a2b4f9fe8b89c5aa7c08a27b32d063d9d357ced592c2e1d14f47a7a6a3cbf5603439587226423eb6478b4cf27b1e2996bfaa2a9
7
- data.tar.gz: 1e3810cf26cd7aa539ce698c48c1e493ff300aec4a7985dcbacaf280b117efae6194045aaaa0d1cab2f98a1b0118864ecc4dc2bb218f0b56bca0f4f2b027a63f
6
+ metadata.gz: d07a4e0f3009503287af9b6a0b6656a08a649cd22efeee66419a1a6f224d147d814538d09f5993288e6ab48283d7b186b862b2965964bc7bd25a06255f7f866a
7
+ data.tar.gz: da9c092833db3a2ae904d0caa5e435beaa621e9759fb5f31f3bd49c28a11771e3ef5f0dd31ea96e976839a6f1d90557b25b4daaaa516f647138559189192d287
@@ -1,7 +1,7 @@
1
1
  module Bootstrap
2
2
  module Table
3
3
  module Rails
4
- VERSION = "1.17.0"
4
+ VERSION = "1.17.1"
5
5
  end
6
6
  end
7
7
  end
@@ -2046,6 +2046,10 @@ function _nonIterableSpread() {
2046
2046
  var $ = window.jQuery;
2047
2047
 
2048
2048
  var deepCopy = function deepCopy(arg) {
2049
+ if (arg === undefined) {
2050
+ return arg;
2051
+ }
2052
+
2049
2053
  return $.extend(true, Array.isArray(arg) ? [] : {}, arg);
2050
2054
  };
2051
2055
 
@@ -2052,6 +2052,10 @@
2052
2052
  var $ = window.jQuery;
2053
2053
 
2054
2054
  var deepCopy = function deepCopy(arg) {
2055
+ if (arg === undefined) {
2056
+ return arg;
2057
+ }
2058
+
2055
2059
  return $.extend(true, Array.isArray(arg) ? [] : {}, arg);
2056
2060
  };
2057
2061
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author zhixin wen <wenzhixin2010@gmail.com>
3
- * version: 1.17.0
3
+ * version: 1.17.1
4
4
  * https://github.com/wenzhixin/bootstrap-table/
5
5
  */
6
6
  .bootstrap-table .fixed-table-toolbar::after {
@@ -2851,7 +2851,7 @@
2851
2851
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2852
2852
  }
2853
2853
 
2854
- var VERSION = '1.17.0';
2854
+ var VERSION = '1.17.1';
2855
2855
  var bootstrapVersion = 4;
2856
2856
 
2857
2857
  try {
@@ -3104,6 +3104,7 @@
3104
3104
  footerStyle: function footerStyle(column) {
3105
3105
  return {};
3106
3106
  },
3107
+ searchAccentNeutralise: false,
3107
3108
  showColumns: false,
3108
3109
  showColumnsToggleAll: false,
3109
3110
  showColumnsSearch: false,
@@ -3148,7 +3149,6 @@
3148
3149
  buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
3149
3150
  buttonsClass: CONSTANTS.classes.buttons,
3150
3151
  icons: CONSTANTS.icons,
3151
- html: CONSTANTS.html,
3152
3152
  iconSize: undefined,
3153
3153
  iconsPrefix: CONSTANTS.iconsPrefix,
3154
3154
  // glyphicon or fa(font-awesome)
@@ -3405,6 +3405,70 @@
3405
3405
  }
3406
3406
  });
3407
3407
 
3408
+ var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
3409
+
3410
+
3411
+
3412
+
3413
+
3414
+
3415
+ var nativeEndsWith = ''.endsWith;
3416
+ var min$5 = Math.min;
3417
+
3418
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
3419
+ // https://github.com/zloirock/core-js/pull/702
3420
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
3421
+ var descriptor = getOwnPropertyDescriptor$3(String.prototype, 'endsWith');
3422
+ return descriptor && !descriptor.writable;
3423
+ }();
3424
+
3425
+ // `String.prototype.endsWith` method
3426
+ // https://tc39.github.io/ecma262/#sec-string.prototype.endswith
3427
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
3428
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
3429
+ var that = String(requireObjectCoercible(this));
3430
+ notARegexp(searchString);
3431
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
3432
+ var len = toLength(that.length);
3433
+ var end = endPosition === undefined ? len : min$5(toLength(endPosition), len);
3434
+ var search = String(searchString);
3435
+ return nativeEndsWith
3436
+ ? nativeEndsWith.call(that, search, end)
3437
+ : that.slice(end - search.length, end) === search;
3438
+ }
3439
+ });
3440
+
3441
+ var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
3442
+
3443
+
3444
+
3445
+
3446
+
3447
+
3448
+ var nativeStartsWith = ''.startsWith;
3449
+ var min$6 = Math.min;
3450
+
3451
+ var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith');
3452
+ // https://github.com/zloirock/core-js/pull/702
3453
+ var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
3454
+ var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'startsWith');
3455
+ return descriptor && !descriptor.writable;
3456
+ }();
3457
+
3458
+ // `String.prototype.startsWith` method
3459
+ // https://tc39.github.io/ecma262/#sec-string.prototype.startswith
3460
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
3461
+ startsWith: function startsWith(searchString /* , position = 0 */) {
3462
+ var that = String(requireObjectCoercible(this));
3463
+ notARegexp(searchString);
3464
+ var index = toLength(min$6(arguments.length > 1 ? arguments[1] : undefined, that.length));
3465
+ var search = String(searchString);
3466
+ return nativeStartsWith
3467
+ ? nativeStartsWith.call(that, search, index)
3468
+ : that.slice(index, index + search.length) === search;
3469
+ }
3470
+ });
3471
+
3408
3472
  var Utils = {
3409
3473
  // it only does '%s', and return '' when arguments are undefined
3410
3474
  sprintf: function sprintf(_str) {
@@ -3549,6 +3613,9 @@
3549
3613
  }
3550
3614
  }
3551
3615
  },
3616
+ normalizeAccent: function normalizeAccent(string) {
3617
+ return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
3618
+ },
3552
3619
  updateFieldGroup: function updateFieldGroup(columns) {
3553
3620
  var _ref;
3554
3621
 
@@ -3904,6 +3971,40 @@
3904
3971
  },
3905
3972
  hasDetailViewIcon: function hasDetailViewIcon(options) {
3906
3973
  return options.detailView && options.detailViewIcon && !options.cardView;
3974
+ },
3975
+ checkAutoMergeCells: function checkAutoMergeCells(data) {
3976
+ var _iteratorNormalCompletion9 = true;
3977
+ var _didIteratorError9 = false;
3978
+ var _iteratorError9 = undefined;
3979
+
3980
+ try {
3981
+ for (var _iterator9 = data[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
3982
+ var row = _step9.value;
3983
+
3984
+ for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
3985
+ var key = _Object$keys[_i4];
3986
+
3987
+ if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
3988
+ return true;
3989
+ }
3990
+ }
3991
+ }
3992
+ } catch (err) {
3993
+ _didIteratorError9 = true;
3994
+ _iteratorError9 = err;
3995
+ } finally {
3996
+ try {
3997
+ if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
3998
+ _iterator9.return();
3999
+ }
4000
+ } finally {
4001
+ if (_didIteratorError9) {
4002
+ throw _iteratorError9;
4003
+ }
4004
+ }
4005
+ }
4006
+
4007
+ return false;
3907
4008
  }
3908
4009
  };
3909
4010
 
@@ -4430,11 +4531,15 @@
4430
4531
  } else if (type === 'prepend') {
4431
4532
  this.options.data = [].concat(data).concat(this.options.data);
4432
4533
  } else {
4433
- this.options.data = data || this.options.data;
4534
+ data = data || this.options.data;
4535
+ this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
4434
4536
  }
4435
4537
 
4436
- this.data = this.options.data;
4437
- this.unsortedData = _toConsumableArray(this.data);
4538
+ this.data = _toConsumableArray(this.options.data);
4539
+
4540
+ if (this.options.sortReset) {
4541
+ this.unsortedData = _toConsumableArray(this.data);
4542
+ }
4438
4543
 
4439
4544
  if (this.options.sidePagination === 'server') {
4440
4545
  return;
@@ -4495,8 +4600,8 @@
4495
4600
  _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
4496
4601
  }, 250);
4497
4602
  }
4498
- } else {
4499
- this.data = this.unsortedData;
4603
+ } else if (this.options.sortReset) {
4604
+ this.data = _toConsumableArray(this.unsortedData);
4500
4605
  }
4501
4606
  }
4502
4607
  }, {
@@ -4584,7 +4689,7 @@
4584
4689
  html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"\n aria-label=\"Columns\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
4585
4690
 
4586
4691
  if (opts.showColumnsSearch) {
4587
- 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())));
4692
+ html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
4588
4693
  html.push(_this4.constants.html.toolbarDropdownSeparator);
4589
4694
  }
4590
4695
 
@@ -4720,7 +4825,7 @@
4720
4825
  });
4721
4826
 
4722
4827
  if (opts.showColumnsSearch) {
4723
- var $columnsSearch = $keepOpen.find('#columnsSearch');
4828
+ var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
4724
4829
  var $listItems = $keepOpen.find('.dropdown-item-marker');
4725
4830
  $columnsSearch.on('keyup paste change', function (_ref4) {
4726
4831
  var currentTarget = _ref4.currentTarget;
@@ -4889,7 +4994,7 @@
4889
4994
  }
4890
4995
 
4891
4996
  return true;
4892
- }) : this.options.data;
4997
+ }) : _toConsumableArray(this.options.data);
4893
4998
  }
4894
4999
 
4895
5000
  var visibleFields = this.getVisibleFields();
@@ -4914,6 +5019,10 @@
4914
5019
  }
4915
5020
  } else {
4916
5021
  value = item[key];
5022
+ }
5023
+
5024
+ if (_this5.options.searchAccentNeutralise) {
5025
+ value = Utils.normalizeAccent(value);
4917
5026
  } // Fix #142: respect searchFormatter boolean
4918
5027
 
4919
5028
 
@@ -4973,7 +5082,11 @@
4973
5082
 
4974
5083
  return false;
4975
5084
  }) : this.data;
4976
- this.unsortedData = _toConsumableArray(this.data);
5085
+
5086
+ if (this.options.sortReset) {
5087
+ this.unsortedData = _toConsumableArray(this.data);
5088
+ }
5089
+
4977
5090
  this.initSort();
4978
5091
  }
4979
5092
  }
@@ -5394,7 +5507,7 @@
5394
5507
  var title_ = '';
5395
5508
  var column = _this7.columns[j];
5396
5509
 
5397
- if (_this7.fromHtml && typeof value_ === 'undefined') {
5510
+ if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
5398
5511
  if (!column.checkbox && !column.radio) {
5399
5512
  return;
5400
5513
  }
@@ -5533,6 +5646,7 @@
5533
5646
  var rows = [];
5534
5647
  var trFragments = $(document.createDocumentFragment());
5535
5648
  var hasTr = false;
5649
+ this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
5536
5650
 
5537
5651
  for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
5538
5652
  var item = data[i];
@@ -1105,7 +1105,9 @@
1105
1105
  }, {
1106
1106
  key: "updateCopyButton",
1107
1107
  value: function updateCopyButton() {
1108
- this.$copyButton.prop('disabled', !this.getSelections().length);
1108
+ if (this.options.showCopyRows) {
1109
+ this.$copyButton.prop('disabled', !this.getSelections().length);
1110
+ }
1109
1111
  }
1110
1112
  }]);
1111
1113
 
@@ -2655,6 +2655,8 @@
2655
2655
  }, {
2656
2656
  key: "initSearch",
2657
2657
  value: function initSearch() {
2658
+ var _this2 = this;
2659
+
2658
2660
  var that = this;
2659
2661
  var fp = $.isEmptyObject(that.filterColumnsPartial) ? null : that.filterColumnsPartial;
2660
2662
 
@@ -2695,9 +2697,17 @@
2695
2697
  return;
2696
2698
  }
2697
2699
 
2700
+ if (_this2.options.searchAccentNeutralise) {
2701
+ objectValue = Utils$1.normalizeAccent(objectValue);
2702
+ }
2703
+
2698
2704
  tmpItemIsExpected = that.isValueExpected(fval, objectValue, thisColumn, key);
2699
2705
  });
2700
2706
  } else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
2707
+ if (_this2.options.searchAccentNeutralise) {
2708
+ value = Utils$1.normalizeAccent(value);
2709
+ }
2710
+
2701
2711
  tmpItemIsExpected = that.isValueExpected(fval, value, thisColumn, key);
2702
2712
  }
2703
2713
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-table-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Chiu
@@ -62,7 +62,6 @@ files:
62
62
  - vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js
63
63
  - vendor/assets/javascripts/bootstrap-table/bootstrap-table.css
64
64
  - vendor/assets/javascripts/bootstrap-table/bootstrap-table.js
65
- - vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js
66
65
  - vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js
67
66
  - vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js
68
67
  - vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js