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, 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
 
@@ -945,43 +945,54 @@
945
945
  }
946
946
  });
947
947
 
948
- var nativeJoin = [].join;
949
-
950
- var ES3_STRINGS = indexedObject != Object;
951
- var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
952
-
953
- // `Array.prototype.join` method
954
- // https://tc39.github.io/ecma262/#sec-array.prototype.join
955
- _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
956
- join: function join(separator) {
957
- return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
958
- }
959
- });
960
-
961
- var test = [];
962
- var nativeSort = test.sort;
948
+ var nativeAssign = Object.assign;
949
+ var defineProperty = Object.defineProperty;
950
+
951
+ // `Object.assign` method
952
+ // https://tc39.github.io/ecma262/#sec-object.assign
953
+ var objectAssign = !nativeAssign || fails(function () {
954
+ // should have correct order of operations (Edge bug)
955
+ if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
956
+ enumerable: true,
957
+ get: function () {
958
+ defineProperty(this, 'b', {
959
+ value: 3,
960
+ enumerable: false
961
+ });
962
+ }
963
+ }), { b: 2 })).b !== 1) return true;
964
+ // should work with symbols and should have deterministic property order (V8 bug)
965
+ var A = {};
966
+ var B = {};
967
+ // eslint-disable-next-line no-undef
968
+ var symbol = Symbol();
969
+ var alphabet = 'abcdefghijklmnopqrst';
970
+ A[symbol] = 7;
971
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
972
+ return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
973
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
974
+ var T = toObject(target);
975
+ var argumentsLength = arguments.length;
976
+ var index = 1;
977
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
978
+ var propertyIsEnumerable = objectPropertyIsEnumerable.f;
979
+ while (argumentsLength > index) {
980
+ var S = indexedObject(arguments[index++]);
981
+ var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
982
+ var length = keys.length;
983
+ var j = 0;
984
+ var key;
985
+ while (length > j) {
986
+ key = keys[j++];
987
+ if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
988
+ }
989
+ } return T;
990
+ } : nativeAssign;
963
991
 
964
- // IE8-
965
- var FAILS_ON_UNDEFINED = fails(function () {
966
- test.sort(undefined);
967
- });
968
- // V8 bug
969
- var FAILS_ON_NULL = fails(function () {
970
- test.sort(null);
971
- });
972
- // Old WebKit
973
- var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
974
-
975
- var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
976
-
977
- // `Array.prototype.sort` method
978
- // https://tc39.github.io/ecma262/#sec-array.prototype.sort
979
- _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
980
- sort: function sort(comparefn) {
981
- return comparefn === undefined
982
- ? nativeSort.call(toObject(this))
983
- : nativeSort.call(toObject(this), aFunction$1(comparefn));
984
- }
992
+ // `Object.assign` method
993
+ // https://tc39.github.io/ecma262/#sec-object.assign
994
+ _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
995
+ assign: objectAssign
985
996
  });
986
997
 
987
998
  var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
@@ -995,11 +1006,11 @@
995
1006
  });
996
1007
 
997
1008
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
998
- var test$1 = {};
1009
+ var test = {};
999
1010
 
1000
- test$1[TO_STRING_TAG] = 'z';
1011
+ test[TO_STRING_TAG] = 'z';
1001
1012
 
1002
- var toStringTagSupport = String(test$1) === '[object z]';
1013
+ var toStringTagSupport = String(test) === '[object z]';
1003
1014
 
1004
1015
  var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1005
1016
  // ES3 wrong here
@@ -1071,11 +1082,11 @@
1071
1082
 
1072
1083
  var nativeParseInt = global_1.parseInt;
1073
1084
  var hex = /^[+-]?0[Xx]/;
1074
- var FORCED$2 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
1085
+ var FORCED$1 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
1075
1086
 
1076
1087
  // `parseInt` method
1077
1088
  // https://tc39.github.io/ecma262/#sec-parseint-string-radix
1078
- var _parseInt = FORCED$2 ? function parseInt(string, radix) {
1089
+ var _parseInt = FORCED$1 ? function parseInt(string, radix) {
1079
1090
  var S = trim(String(string));
1080
1091
  return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
1081
1092
  } : nativeParseInt;
@@ -1271,6 +1282,255 @@
1271
1282
  }
1272
1283
  });
1273
1284
 
1285
+ var non = '\u200B\u0085\u180E';
1286
+
1287
+ // check that a method works with the correct list
1288
+ // of whitespaces and has a correct name
1289
+ var forcedStringTrimMethod = function (METHOD_NAME) {
1290
+ return fails(function () {
1291
+ return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
1292
+ });
1293
+ };
1294
+
1295
+ var $trim = stringTrim.trim;
1296
+
1297
+
1298
+ // `String.prototype.trim` method
1299
+ // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1300
+ _export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1301
+ trim: function trim() {
1302
+ return $trim(this);
1303
+ }
1304
+ });
1305
+
1306
+ // iterable DOM collections
1307
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1308
+ var domIterables = {
1309
+ CSSRuleList: 0,
1310
+ CSSStyleDeclaration: 0,
1311
+ CSSValueList: 0,
1312
+ ClientRectList: 0,
1313
+ DOMRectList: 0,
1314
+ DOMStringList: 0,
1315
+ DOMTokenList: 1,
1316
+ DataTransferItemList: 0,
1317
+ FileList: 0,
1318
+ HTMLAllCollection: 0,
1319
+ HTMLCollection: 0,
1320
+ HTMLFormElement: 0,
1321
+ HTMLSelectElement: 0,
1322
+ MediaList: 0,
1323
+ MimeTypeArray: 0,
1324
+ NamedNodeMap: 0,
1325
+ NodeList: 1,
1326
+ PaintRequestList: 0,
1327
+ Plugin: 0,
1328
+ PluginArray: 0,
1329
+ SVGLengthList: 0,
1330
+ SVGNumberList: 0,
1331
+ SVGPathSegList: 0,
1332
+ SVGPointList: 0,
1333
+ SVGStringList: 0,
1334
+ SVGTransformList: 0,
1335
+ SourceBufferList: 0,
1336
+ StyleSheetList: 0,
1337
+ TextTrackCueList: 0,
1338
+ TextTrackList: 0,
1339
+ TouchList: 0
1340
+ };
1341
+
1342
+ var $forEach = arrayIteration.forEach;
1343
+
1344
+
1345
+ // `Array.prototype.forEach` method implementation
1346
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1347
+ var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
1348
+ return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1349
+ } : [].forEach;
1350
+
1351
+ for (var COLLECTION_NAME in domIterables) {
1352
+ var Collection = global_1[COLLECTION_NAME];
1353
+ var CollectionPrototype = Collection && Collection.prototype;
1354
+ // some Chrome versions have non-configurable methods on DOMTokenList
1355
+ if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1356
+ createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
1357
+ } catch (error) {
1358
+ CollectionPrototype.forEach = arrayForEach;
1359
+ }
1360
+ }
1361
+
1362
+ function _typeof(obj) {
1363
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1364
+ _typeof = function (obj) {
1365
+ return typeof obj;
1366
+ };
1367
+ } else {
1368
+ _typeof = function (obj) {
1369
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1370
+ };
1371
+ }
1372
+
1373
+ return _typeof(obj);
1374
+ }
1375
+
1376
+ function _classCallCheck(instance, Constructor) {
1377
+ if (!(instance instanceof Constructor)) {
1378
+ throw new TypeError("Cannot call a class as a function");
1379
+ }
1380
+ }
1381
+
1382
+ function _defineProperties(target, props) {
1383
+ for (var i = 0; i < props.length; i++) {
1384
+ var descriptor = props[i];
1385
+ descriptor.enumerable = descriptor.enumerable || false;
1386
+ descriptor.configurable = true;
1387
+ if ("value" in descriptor) descriptor.writable = true;
1388
+ Object.defineProperty(target, descriptor.key, descriptor);
1389
+ }
1390
+ }
1391
+
1392
+ function _createClass(Constructor, protoProps, staticProps) {
1393
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1394
+ if (staticProps) _defineProperties(Constructor, staticProps);
1395
+ return Constructor;
1396
+ }
1397
+
1398
+ function _inherits(subClass, superClass) {
1399
+ if (typeof superClass !== "function" && superClass !== null) {
1400
+ throw new TypeError("Super expression must either be null or a function");
1401
+ }
1402
+
1403
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1404
+ constructor: {
1405
+ value: subClass,
1406
+ writable: true,
1407
+ configurable: true
1408
+ }
1409
+ });
1410
+ if (superClass) _setPrototypeOf(subClass, superClass);
1411
+ }
1412
+
1413
+ function _getPrototypeOf(o) {
1414
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
1415
+ return o.__proto__ || Object.getPrototypeOf(o);
1416
+ };
1417
+ return _getPrototypeOf(o);
1418
+ }
1419
+
1420
+ function _setPrototypeOf(o, p) {
1421
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
1422
+ o.__proto__ = p;
1423
+ return o;
1424
+ };
1425
+
1426
+ return _setPrototypeOf(o, p);
1427
+ }
1428
+
1429
+ function _assertThisInitialized(self) {
1430
+ if (self === void 0) {
1431
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1432
+ }
1433
+
1434
+ return self;
1435
+ }
1436
+
1437
+ function _possibleConstructorReturn(self, call) {
1438
+ if (call && (typeof call === "object" || typeof call === "function")) {
1439
+ return call;
1440
+ }
1441
+
1442
+ return _assertThisInitialized(self);
1443
+ }
1444
+
1445
+ function _superPropBase(object, property) {
1446
+ while (!Object.prototype.hasOwnProperty.call(object, property)) {
1447
+ object = _getPrototypeOf(object);
1448
+ if (object === null) break;
1449
+ }
1450
+
1451
+ return object;
1452
+ }
1453
+
1454
+ function _get(target, property, receiver) {
1455
+ if (typeof Reflect !== "undefined" && Reflect.get) {
1456
+ _get = Reflect.get;
1457
+ } else {
1458
+ _get = function _get(target, property, receiver) {
1459
+ var base = _superPropBase(target, property);
1460
+
1461
+ if (!base) return;
1462
+ var desc = Object.getOwnPropertyDescriptor(base, property);
1463
+
1464
+ if (desc.get) {
1465
+ return desc.get.call(receiver);
1466
+ }
1467
+
1468
+ return desc.value;
1469
+ };
1470
+ }
1471
+
1472
+ return _get(target, property, receiver || target);
1473
+ }
1474
+
1475
+ function _toConsumableArray(arr) {
1476
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
1477
+ }
1478
+
1479
+ function _arrayWithoutHoles(arr) {
1480
+ if (Array.isArray(arr)) {
1481
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
1482
+
1483
+ return arr2;
1484
+ }
1485
+ }
1486
+
1487
+ function _iterableToArray(iter) {
1488
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
1489
+ }
1490
+
1491
+ function _nonIterableSpread() {
1492
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
1493
+ }
1494
+
1495
+ var nativeJoin = [].join;
1496
+
1497
+ var ES3_STRINGS = indexedObject != Object;
1498
+ var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
1499
+
1500
+ // `Array.prototype.join` method
1501
+ // https://tc39.github.io/ecma262/#sec-array.prototype.join
1502
+ _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
1503
+ join: function join(separator) {
1504
+ return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
1505
+ }
1506
+ });
1507
+
1508
+ var test$1 = [];
1509
+ var nativeSort = test$1.sort;
1510
+
1511
+ // IE8-
1512
+ var FAILS_ON_UNDEFINED = fails(function () {
1513
+ test$1.sort(undefined);
1514
+ });
1515
+ // V8 bug
1516
+ var FAILS_ON_NULL = fails(function () {
1517
+ test$1.sort(null);
1518
+ });
1519
+ // Old WebKit
1520
+ var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
1521
+
1522
+ var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
1523
+
1524
+ // `Array.prototype.sort` method
1525
+ // https://tc39.github.io/ecma262/#sec-array.prototype.sort
1526
+ _export({ target: 'Array', proto: true, forced: FORCED$2 }, {
1527
+ sort: function sort(comparefn) {
1528
+ return comparefn === undefined
1529
+ ? nativeSort.call(toObject(this))
1530
+ : nativeSort.call(toObject(this), aFunction$1(comparefn));
1531
+ }
1532
+ });
1533
+
1274
1534
  var SPECIES$2 = wellKnownSymbol('species');
1275
1535
 
1276
1536
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
@@ -1709,685 +1969,540 @@
1709
1969
  }
1710
1970
  A.push(S.slice(p));
1711
1971
  return A;
1712
- }
1713
- ];
1714
- }, !SUPPORTS_Y);
1715
-
1716
- var non = '\u200B\u0085\u180E';
1717
-
1718
- // check that a method works with the correct list
1719
- // of whitespaces and has a correct name
1720
- var forcedStringTrimMethod = function (METHOD_NAME) {
1721
- return fails(function () {
1722
- return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
1723
- });
1724
- };
1725
-
1726
- var $trim = stringTrim.trim;
1727
-
1728
-
1729
- // `String.prototype.trim` method
1730
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1731
- _export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1732
- trim: function trim() {
1733
- return $trim(this);
1734
- }
1735
- });
1736
-
1737
- // iterable DOM collections
1738
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1739
- var domIterables = {
1740
- CSSRuleList: 0,
1741
- CSSStyleDeclaration: 0,
1742
- CSSValueList: 0,
1743
- ClientRectList: 0,
1744
- DOMRectList: 0,
1745
- DOMStringList: 0,
1746
- DOMTokenList: 1,
1747
- DataTransferItemList: 0,
1748
- FileList: 0,
1749
- HTMLAllCollection: 0,
1750
- HTMLCollection: 0,
1751
- HTMLFormElement: 0,
1752
- HTMLSelectElement: 0,
1753
- MediaList: 0,
1754
- MimeTypeArray: 0,
1755
- NamedNodeMap: 0,
1756
- NodeList: 1,
1757
- PaintRequestList: 0,
1758
- Plugin: 0,
1759
- PluginArray: 0,
1760
- SVGLengthList: 0,
1761
- SVGNumberList: 0,
1762
- SVGPathSegList: 0,
1763
- SVGPointList: 0,
1764
- SVGStringList: 0,
1765
- SVGTransformList: 0,
1766
- SourceBufferList: 0,
1767
- StyleSheetList: 0,
1768
- TextTrackCueList: 0,
1769
- TextTrackList: 0,
1770
- TouchList: 0
1771
- };
1772
-
1773
- var $forEach = arrayIteration.forEach;
1774
-
1775
-
1776
- // `Array.prototype.forEach` method implementation
1777
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
1778
- var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
1779
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1780
- } : [].forEach;
1781
-
1782
- for (var COLLECTION_NAME in domIterables) {
1783
- var Collection = global_1[COLLECTION_NAME];
1784
- var CollectionPrototype = Collection && Collection.prototype;
1785
- // some Chrome versions have non-configurable methods on DOMTokenList
1786
- if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1787
- createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
1788
- } catch (error) {
1789
- CollectionPrototype.forEach = arrayForEach;
1790
- }
1791
- }
1792
-
1793
- function _typeof(obj) {
1794
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1795
- _typeof = function (obj) {
1796
- return typeof obj;
1797
- };
1798
- } else {
1799
- _typeof = function (obj) {
1800
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1801
- };
1802
- }
1803
-
1804
- return _typeof(obj);
1805
- }
1806
-
1807
- function _classCallCheck(instance, Constructor) {
1808
- if (!(instance instanceof Constructor)) {
1809
- throw new TypeError("Cannot call a class as a function");
1810
- }
1811
- }
1812
-
1813
- function _defineProperties(target, props) {
1814
- for (var i = 0; i < props.length; i++) {
1815
- var descriptor = props[i];
1816
- descriptor.enumerable = descriptor.enumerable || false;
1817
- descriptor.configurable = true;
1818
- if ("value" in descriptor) descriptor.writable = true;
1819
- Object.defineProperty(target, descriptor.key, descriptor);
1820
- }
1821
- }
1822
-
1823
- function _createClass(Constructor, protoProps, staticProps) {
1824
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1825
- if (staticProps) _defineProperties(Constructor, staticProps);
1826
- return Constructor;
1827
- }
1828
-
1829
- function _inherits(subClass, superClass) {
1830
- if (typeof superClass !== "function" && superClass !== null) {
1831
- throw new TypeError("Super expression must either be null or a function");
1832
- }
1833
-
1834
- subClass.prototype = Object.create(superClass && superClass.prototype, {
1835
- constructor: {
1836
- value: subClass,
1837
- writable: true,
1838
- configurable: true
1839
- }
1840
- });
1841
- if (superClass) _setPrototypeOf(subClass, superClass);
1842
- }
1843
-
1844
- function _getPrototypeOf(o) {
1845
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
1846
- return o.__proto__ || Object.getPrototypeOf(o);
1847
- };
1848
- return _getPrototypeOf(o);
1849
- }
1850
-
1851
- function _setPrototypeOf(o, p) {
1852
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
1853
- o.__proto__ = p;
1854
- return o;
1855
- };
1856
-
1857
- return _setPrototypeOf(o, p);
1858
- }
1859
-
1860
- function _assertThisInitialized(self) {
1861
- if (self === void 0) {
1862
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1863
- }
1864
-
1865
- return self;
1866
- }
1867
-
1868
- function _possibleConstructorReturn(self, call) {
1869
- if (call && (typeof call === "object" || typeof call === "function")) {
1870
- return call;
1871
- }
1872
-
1873
- return _assertThisInitialized(self);
1874
- }
1875
-
1876
- function _superPropBase(object, property) {
1877
- while (!Object.prototype.hasOwnProperty.call(object, property)) {
1878
- object = _getPrototypeOf(object);
1879
- if (object === null) break;
1880
- }
1881
-
1882
- return object;
1883
- }
1884
-
1885
- function _get(target, property, receiver) {
1886
- if (typeof Reflect !== "undefined" && Reflect.get) {
1887
- _get = Reflect.get;
1888
- } else {
1889
- _get = function _get(target, property, receiver) {
1890
- var base = _superPropBase(target, property);
1891
-
1892
- if (!base) return;
1893
- var desc = Object.getOwnPropertyDescriptor(base, property);
1894
-
1895
- if (desc.get) {
1896
- return desc.get.call(receiver);
1897
- }
1972
+ }
1973
+ ];
1974
+ }, !SUPPORTS_Y);
1898
1975
 
1899
- return desc.value;
1900
- };
1976
+ var Utils = $.fn.bootstrapTable.utils;
1977
+ var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
1978
+ function getOptionsFromSelectControl(selectControl) {
1979
+ return selectControl.get(selectControl.length - 1).options;
1980
+ }
1981
+ function getControlContainer(that) {
1982
+ if (that.options.filterControlContainer) {
1983
+ return $("".concat(that.options.filterControlContainer));
1901
1984
  }
1902
1985
 
1903
- return _get(target, property, receiver || target);
1986
+ return that.$header;
1904
1987
  }
1988
+ function getSearchControls(that) {
1989
+ return getControlContainer(that).find(searchControls);
1990
+ }
1991
+ function hideUnusedSelectOptions(selectControl, uniqueValues) {
1992
+ var options = getOptionsFromSelectControl(selectControl);
1905
1993
 
1906
- /**
1907
- * @author: Dennis Hernández
1908
- * @webSite: http://djhvscf.github.io/Blog
1909
- * @version: v2.2.0
1910
- */
1911
-
1912
- var Utils = $.fn.bootstrapTable.utils;
1913
- var UtilsFilterControl = {
1914
- getOptionsFromSelectControl: function getOptionsFromSelectControl(selectControl) {
1915
- return selectControl.get(selectControl.length - 1).options;
1916
- },
1917
- getControlContainer: function getControlContainer() {
1918
- if (UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer) {
1919
- return $("".concat(UtilsFilterControl.bootstrapTableInstance.options.filterControlContainer));
1994
+ for (var i = 0; i < options.length; i++) {
1995
+ if (options[i].value !== '') {
1996
+ if (!uniqueValues.hasOwnProperty(options[i].value)) {
1997
+ selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
1998
+ } else {
1999
+ selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
2000
+ }
1920
2001
  }
2002
+ }
2003
+ }
2004
+ function existOptionInSelectControl(selectControl, value) {
2005
+ var options = getOptionsFromSelectControl(selectControl);
1921
2006
 
1922
- return UtilsFilterControl.getCurrentHeader(UtilsFilterControl.bootstrapTableInstance);
1923
- },
1924
- getSearchControls: function getSearchControls(scope) {
1925
- var header = UtilsFilterControl.getControlContainer();
1926
- var searchControls = UtilsFilterControl.getCurrentSearchControls(scope);
1927
- return header.find(searchControls);
1928
- },
1929
- hideUnusedSelectOptions: function hideUnusedSelectOptions(selectControl, uniqueValues) {
1930
- var options = UtilsFilterControl.getOptionsFromSelectControl(selectControl);
1931
-
1932
- for (var i = 0; i < options.length; i++) {
1933
- if (options[i].value !== '') {
1934
- if (!uniqueValues.hasOwnProperty(options[i].value)) {
1935
- selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
1936
- } else {
1937
- selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
1938
- }
1939
- }
2007
+ for (var i = 0; i < options.length; i++) {
2008
+ if (options[i].value === Utils.unescapeHTML(value.toString())) {
2009
+ // The value is not valid to add
2010
+ return true;
1940
2011
  }
1941
- },
1942
- addOptionToSelectControl: function addOptionToSelectControl(selectControl, _value, text, selected) {
1943
- var value = $.trim(_value);
1944
- var $selectControl = $(selectControl.get(selectControl.length - 1));
2012
+ } // If we get here, the value is valid to add
1945
2013
 
1946
- if (!UtilsFilterControl.existOptionInSelectControl(selectControl, value)) {
1947
- var option = $("<option value=\"".concat(value, "\">").concat(text, "</option>"));
1948
2014
 
1949
- if (value === selected) {
1950
- option.attr('selected', true);
1951
- }
2015
+ return false;
2016
+ }
2017
+ function addOptionToSelectControl(selectControl, _value, text, selected) {
2018
+ var value = _value === undefined || _value === null ? '' : _value.toString().trim();
2019
+ var $selectControl = $(selectControl.get(selectControl.length - 1));
2020
+
2021
+ if (!existOptionInSelectControl(selectControl, value)) {
2022
+ var option = $("<option value=\"".concat(value, "\">").concat(text, "</option>"));
1952
2023
 
1953
- $selectControl.append(option);
2024
+ if (value === selected) {
2025
+ option.attr('selected', true);
1954
2026
  }
1955
- },
1956
- sortSelectControl: function sortSelectControl(selectControl, orderBy) {
1957
- var $selectControl = $(selectControl.get(selectControl.length - 1));
1958
- var $opts = $selectControl.find('option:gt(0)');
2027
+
2028
+ $selectControl.append(option);
2029
+ }
2030
+ }
2031
+ function sortSelectControl(selectControl, orderBy) {
2032
+ var $selectControl = $(selectControl.get(selectControl.length - 1));
2033
+ var $opts = $selectControl.find('option:gt(0)');
2034
+
2035
+ if (orderBy !== 'server') {
1959
2036
  $opts.sort(function (a, b) {
1960
2037
  return Utils.sort(a.textContent, b.textContent, orderBy === 'desc' ? -1 : 1);
1961
2038
  });
1962
- $selectControl.find('option:gt(0)').remove();
1963
- $selectControl.append($opts);
1964
- },
1965
- existOptionInSelectControl: function existOptionInSelectControl(selectControl, value) {
1966
- var options = UtilsFilterControl.getOptionsFromSelectControl(selectControl);
2039
+ }
1967
2040
 
1968
- for (var i = 0; i < options.length; i++) {
1969
- if (options[i].value === value.toString()) {
1970
- // The value is not valid to add
1971
- return true;
2041
+ $selectControl.find('option:gt(0)').remove();
2042
+ $selectControl.append($opts);
2043
+ }
2044
+ function fixHeaderCSS(_ref) {
2045
+ var $tableHeader = _ref.$tableHeader;
2046
+ $tableHeader.css('height', '89px');
2047
+ }
2048
+ function getElementClass($element) {
2049
+ return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
2050
+ }
2051
+ function getCursorPosition(el) {
2052
+ if (Utils.isIEBrowser()) {
2053
+ if ($(el).is('input[type=text]')) {
2054
+ var pos = 0;
2055
+
2056
+ if ('selectionStart' in el) {
2057
+ pos = el.selectionStart;
2058
+ } else if ('selection' in document) {
2059
+ el.focus();
2060
+ var Sel = document.selection.createRange();
2061
+ var SelLength = document.selection.createRange().text.length;
2062
+ Sel.moveStart('character', -el.value.length);
2063
+ pos = Sel.text.length - SelLength;
1972
2064
  }
1973
- } // If we get here, the value is valid to add
1974
2065
 
1975
-
1976
- return false;
1977
- },
1978
- fixHeaderCSS: function fixHeaderCSS(_ref) {
1979
- var $tableHeader = _ref.$tableHeader;
1980
- $tableHeader.css('height', '77px');
1981
- },
1982
- getCurrentHeader: function getCurrentHeader(_ref2) {
1983
- var $header = _ref2.$header,
1984
- options = _ref2.options,
1985
- $tableHeader = _ref2.$tableHeader;
1986
- var header = $header;
1987
-
1988
- if (options.height) {
1989
- header = $tableHeader;
2066
+ return pos;
1990
2067
  }
1991
2068
 
1992
- return header;
1993
- },
1994
- getCurrentSearchControls: function getCurrentSearchControls(_ref3) {
1995
- var options = _ref3.options;
1996
- var searchControls = 'select, input';
2069
+ return -1;
2070
+ }
1997
2071
 
1998
- if (options.height) {
1999
- searchControls = 'table select, table input';
2072
+ return -1;
2073
+ }
2074
+ function setCursorPosition(el) {
2075
+ $(el).val(el.value);
2076
+ }
2077
+ function copyValues(that) {
2078
+ var searchControls = getSearchControls(that);
2079
+ that.options.valuesFilterControl = [];
2080
+ searchControls.each(function () {
2081
+ var $field = $(this);
2082
+
2083
+ if (that.options.height) {
2084
+ var fieldClass = getElementClass($field);
2085
+ $field = $(".fixed-table-header .".concat(fieldClass));
2000
2086
  }
2001
2087
 
2002
- return searchControls;
2003
- },
2004
- getCursorPosition: function getCursorPosition(el) {
2005
- if (Utils.isIEBrowser()) {
2006
- if ($(el).is('input[type=text]')) {
2007
- var pos = 0;
2008
-
2009
- if ('selectionStart' in el) {
2010
- pos = el.selectionStart;
2011
- } else if ('selection' in document) {
2012
- el.focus();
2013
- var Sel = document.selection.createRange();
2014
- var SelLength = document.selection.createRange().text.length;
2015
- Sel.moveStart('character', -el.value.length);
2016
- pos = Sel.text.length - SelLength;
2088
+ that.options.valuesFilterControl.push({
2089
+ field: $field.closest('[data-field]').data('field'),
2090
+ value: $field.val(),
2091
+ position: getCursorPosition($field.get(0)),
2092
+ hasFocus: $field.is(':focus')
2093
+ });
2094
+ });
2095
+ }
2096
+ function setValues(that) {
2097
+ var field = null;
2098
+ var result = [];
2099
+ var searchControls = getSearchControls(that);
2100
+
2101
+ if (that.options.valuesFilterControl.length > 0) {
2102
+ // Callback to apply after settings fields values
2103
+ var fieldToFocusCallback = null;
2104
+ searchControls.each(function (i, el) {
2105
+ var $this = $(el);
2106
+ field = $this.closest('[data-field]').data('field');
2107
+ result = that.options.valuesFilterControl.filter(function (valueObj) {
2108
+ return valueObj.field === field;
2109
+ });
2110
+
2111
+ if (result.length > 0) {
2112
+ if ($this.is('[type=radio]')) {
2113
+ return;
2017
2114
  }
2018
2115
 
2019
- return pos;
2116
+ $this.val(result[0].value);
2117
+
2118
+ if (result[0].hasFocus && result[0].value !== '') {
2119
+ // set callback if the field had the focus.
2120
+ fieldToFocusCallback = function (fieldToFocus, carretPosition) {
2121
+ // Closure here to capture the field and cursor position
2122
+ var closedCallback = function closedCallback() {
2123
+ fieldToFocus.focus();
2124
+ setCursorPosition(fieldToFocus);
2125
+ };
2126
+
2127
+ return closedCallback;
2128
+ }($this.get(0), result[0].position);
2129
+ }
2020
2130
  }
2131
+ }); // Callback call.
2021
2132
 
2022
- return -1;
2133
+ if (fieldToFocusCallback !== null) {
2134
+ fieldToFocusCallback();
2023
2135
  }
2136
+ }
2137
+ }
2138
+ function collectBootstrapCookies() {
2139
+ var cookies = [];
2140
+ var foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
2141
+ var foundLocalStorage = localStorage;
2024
2142
 
2025
- return -1;
2026
- },
2027
- setCursorPosition: function setCursorPosition(el) {
2028
- $(el).val(el.value);
2029
- },
2030
- copyValues: function copyValues(that) {
2031
- var searchControls = UtilsFilterControl.getSearchControls(that);
2032
- that.options.valuesFilterControl = [];
2033
- searchControls.each(function () {
2034
- that.options.valuesFilterControl.push({
2035
- field: $(this).closest('[data-field]').data('field'),
2036
- value: $(this).val(),
2037
- position: UtilsFilterControl.getCursorPosition($(this).get(0)),
2038
- hasFocus: $(this).is(':focus')
2039
- });
2040
- });
2041
- },
2042
- setValues: function setValues(that) {
2043
- var field = null;
2044
- var result = [];
2045
- var searchControls = UtilsFilterControl.getSearchControls(that);
2046
-
2047
- if (that.options.valuesFilterControl.length > 0) {
2048
- // Callback to apply after settings fields values
2049
- var fieldToFocusCallback = null;
2050
- searchControls.each(function (index, ele) {
2051
- field = $(this).closest('[data-field]').data('field');
2052
- result = that.options.valuesFilterControl.filter(function (valueObj) {
2053
- return valueObj.field === field;
2054
- });
2143
+ if (foundCookies) {
2144
+ $.each(foundCookies, function (i, _cookie) {
2145
+ var cookie = _cookie;
2055
2146
 
2056
- if (result.length > 0) {
2057
- $(this).val(result[0].value);
2147
+ if (/./.test(cookie)) {
2148
+ cookie = cookie.split('.').pop();
2149
+ }
2058
2150
 
2059
- if (result[0].hasFocus && result[0].value !== '') {
2060
- // set callback if the field had the focus.
2061
- fieldToFocusCallback = function (fieldToFocus, carretPosition) {
2062
- // Closure here to capture the field and cursor position
2063
- var closedCallback = function closedCallback() {
2064
- fieldToFocus.focus();
2065
- UtilsFilterControl.setCursorPosition(fieldToFocus, carretPosition);
2066
- };
2151
+ if ($.inArray(cookie, cookies) === -1) {
2152
+ cookies.push(cookie);
2153
+ }
2154
+ });
2155
+ }
2067
2156
 
2068
- return closedCallback;
2069
- }($(this).get(0), result[0].position);
2070
- }
2071
- }
2072
- }); // Callback call.
2157
+ if (foundLocalStorage) {
2158
+ for (var i = 0; i < foundLocalStorage.length; i++) {
2159
+ var cookie = foundLocalStorage.key(i);
2073
2160
 
2074
- if (fieldToFocusCallback !== null) {
2075
- fieldToFocusCallback();
2161
+ if (/./.test(cookie)) {
2162
+ cookie = cookie.split('.').pop();
2163
+ }
2164
+
2165
+ if (!cookies.includes(cookie)) {
2166
+ cookies.push(cookie);
2076
2167
  }
2077
2168
  }
2078
- },
2079
- collectBootstrapCookies: function collectBootstrapCookies() {
2080
- var cookies = [];
2081
- var foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
2082
- var foundLocalStorage = localStorage;
2169
+ }
2170
+
2171
+ return cookies;
2172
+ }
2173
+ function escapeID(id) {
2174
+ // eslint-disable-next-line no-useless-escape
2175
+ return String(id).replace(/([:.\[\],])/g, '\\$1');
2176
+ }
2177
+ function isColumnSearchableViaSelect(_ref2) {
2178
+ var filterControl = _ref2.filterControl,
2179
+ searchable = _ref2.searchable;
2180
+ return filterControl && filterControl.toLowerCase() === 'select' && searchable;
2181
+ }
2182
+ function isFilterDataNotGiven(_ref3) {
2183
+ var filterData = _ref3.filterData;
2184
+ return filterData === undefined || filterData.toLowerCase() === 'column';
2185
+ }
2186
+ function hasSelectControlElement(selectControl) {
2187
+ return selectControl && selectControl.length > 0;
2188
+ }
2189
+ function initFilterSelectControls(that) {
2190
+ var data = that.data;
2191
+ var z = that.options.pagination ? that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows : that.pageTo;
2192
+ $.each(that.header.fields, function (j, field) {
2193
+ var column = that.columns[that.fieldsColumnsIndex[field]];
2194
+ var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
2195
+
2196
+ if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
2197
+ if (selectControl.get(selectControl.length - 1).options.length === 0) {
2198
+ // Added the default option
2199
+ addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
2200
+ }
2201
+
2202
+ var uniqueValues = {};
2083
2203
 
2084
- if (foundCookies) {
2085
- $.each(foundCookies, function (i, _cookie) {
2086
- var cookie = _cookie;
2204
+ for (var i = 0; i < z; i++) {
2205
+ // Added a new value
2206
+ var fieldValue = data[i][field];
2207
+ var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
2208
+ var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
2087
2209
 
2088
- if (/./.test(cookie)) {
2089
- cookie = cookie.split('.').pop();
2210
+ if (column.filterDataCollector) {
2211
+ formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
2090
2212
  }
2091
2213
 
2092
- if ($.inArray(cookie, cookies) === -1) {
2093
- cookies.push(cookie);
2214
+ if (column.searchFormatter) {
2215
+ fieldValue = formattedValue;
2094
2216
  }
2095
- });
2096
- }
2097
2217
 
2098
- if (foundLocalStorage) {
2099
- for (var i = 0; i < foundLocalStorage.length; i++) {
2100
- var cookie = foundLocalStorage.key(i);
2218
+ uniqueValues[formattedValue] = fieldValue;
2101
2219
 
2102
- if (/./.test(cookie)) {
2103
- cookie = cookie.split('.').pop();
2104
- }
2220
+ if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
2221
+ formattedValue.forEach(function (value) {
2222
+ addOptionToSelectControl(selectControl, value, value, column.filterDefault);
2223
+ });
2224
+ continue;
2225
+ } // eslint-disable-next-line guard-for-in
2105
2226
 
2106
- if (!cookies.includes(cookie)) {
2107
- cookies.push(cookie);
2108
- }
2109
- }
2110
- }
2111
2227
 
2112
- return cookies;
2113
- },
2114
- escapeID: function escapeID(id) {
2115
- // eslint-disable-next-line no-useless-escape
2116
- return String(id).replace(/([:.\[\],])/g, '\\$1');
2117
- },
2118
- isColumnSearchableViaSelect: function isColumnSearchableViaSelect(_ref4) {
2119
- var filterControl = _ref4.filterControl,
2120
- searchable = _ref4.searchable;
2121
- return filterControl && filterControl.toLowerCase() === 'select' && searchable;
2122
- },
2123
- isFilterDataNotGiven: function isFilterDataNotGiven(_ref5) {
2124
- var filterData = _ref5.filterData;
2125
- return filterData === undefined || filterData.toLowerCase() === 'column';
2126
- },
2127
- hasSelectControlElement: function hasSelectControlElement(selectControl) {
2128
- return selectControl && selectControl.length > 0;
2129
- },
2130
- initFilterSelectControls: function initFilterSelectControls(that) {
2131
- var data = that.data;
2132
- var z = that.options.pagination ? that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows : that.pageTo;
2133
- $.each(that.header.fields, function (j, field) {
2134
- var column = that.columns[that.fieldsColumnsIndex[field]];
2135
- var selectControl = UtilsFilterControl.getControlContainer().find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
2136
-
2137
- if (UtilsFilterControl.isColumnSearchableViaSelect(column) && UtilsFilterControl.isFilterDataNotGiven(column) && UtilsFilterControl.hasSelectControlElement(selectControl)) {
2138
- if (selectControl.get(selectControl.length - 1).options.length === 0) {
2139
- // Added the default option
2140
- UtilsFilterControl.addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
2228
+ for (var key in uniqueValues) {
2229
+ addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
2141
2230
  }
2231
+ }
2142
2232
 
2143
- var uniqueValues = {};
2233
+ sortSelectControl(selectControl, column.filterOrderBy);
2144
2234
 
2145
- for (var i = 0; i < z; i++) {
2146
- // Added a new value
2147
- var fieldValue = data[i][field];
2148
- var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
2149
- var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
2235
+ if (that.options.hideUnusedSelectOptions) {
2236
+ hideUnusedSelectOptions(selectControl, uniqueValues);
2237
+ }
2238
+ }
2239
+ });
2240
+ }
2241
+ function getFilterDataMethod(objFilterDataMethod, searchTerm) {
2242
+ var keys = Object.keys(objFilterDataMethod);
2150
2243
 
2151
- if (column.filterDataCollector) {
2152
- formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
2153
- }
2244
+ for (var i = 0; i < keys.length; i++) {
2245
+ if (keys[i] === searchTerm) {
2246
+ return objFilterDataMethod[searchTerm];
2247
+ }
2248
+ }
2154
2249
 
2155
- uniqueValues[formattedValue] = fieldValue;
2250
+ return null;
2251
+ }
2252
+ function createControls(that, header) {
2253
+ var addedFilterControl = false;
2254
+ var html;
2255
+ $.each(that.columns, function (_, column) {
2256
+ html = [];
2257
+
2258
+ if (!column.visible) {
2259
+ return;
2260
+ }
2156
2261
 
2157
- if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
2158
- formattedValue.forEach(function (value) {
2159
- UtilsFilterControl.addOptionToSelectControl(selectControl, value, value, column.filterDefault);
2160
- });
2161
- continue;
2162
- }
2262
+ if (!column.filterControl && !that.options.filterControlContainer) {
2263
+ html.push('<div class="no-filter-control"></div>');
2264
+ } else if (that.options.filterControlContainer) {
2265
+ var $filterControls = $(".bootstrap-table-filter-control-".concat(column.field));
2266
+ $.each($filterControls, function (_, filterControl) {
2267
+ var $filterControl = $(filterControl);
2163
2268
 
2164
- UtilsFilterControl.addOptionToSelectControl(selectControl, formattedValue, formattedValue, column.filterDefault);
2269
+ if (!$filterControl.is('[type=radio]')) {
2270
+ var placeholder = column.filterControlPlaceholder ? column.filterControlPlaceholder : '';
2271
+ $filterControl.attr('placeholder', placeholder).val(column.filterDefault);
2165
2272
  }
2166
2273
 
2167
- UtilsFilterControl.sortSelectControl(selectControl, column.filterOrderBy);
2274
+ $filterControl.attr('data-field', column.field);
2275
+ });
2276
+ addedFilterControl = true;
2277
+ } else {
2278
+ var nameControl = column.filterControl.toLowerCase();
2279
+ html.push('<div class="filter-control">');
2280
+ addedFilterControl = true;
2168
2281
 
2169
- if (that.options.hideUnusedSelectOptions) {
2170
- UtilsFilterControl.hideUnusedSelectOptions(selectControl, uniqueValues);
2171
- }
2282
+ if (column.searchable && that.options.filterTemplate[nameControl]) {
2283
+ html.push(that.options.filterTemplate[nameControl](that, column.field, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
2172
2284
  }
2173
- });
2174
- that.trigger('created-controls');
2175
- },
2176
- getFilterDataMethod: function getFilterDataMethod(objFilterDataMethod, searchTerm) {
2177
- var keys = Object.keys(objFilterDataMethod);
2285
+ }
2178
2286
 
2179
- for (var i = 0; i < keys.length; i++) {
2180
- if (keys[i] === searchTerm) {
2181
- return objFilterDataMethod[searchTerm];
2287
+ if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
2288
+ if ($.isEmptyObject(that.filterColumnsPartial)) {
2289
+ that.filterColumnsPartial = {};
2182
2290
  }
2291
+
2292
+ that.filterColumnsPartial[column.field] = column.filterDefault;
2183
2293
  }
2184
2294
 
2185
- return null;
2186
- },
2187
- createControls: function createControls(that, header) {
2188
- var addedFilterControl = false;
2189
- var html;
2190
- $.each(that.columns, function (i, column) {
2191
- html = [];
2295
+ $.each(header.find('th'), function (i, th) {
2296
+ var $th = $(th);
2192
2297
 
2193
- if (!column.visible) {
2194
- return;
2298
+ if ($th.data('field') === column.field) {
2299
+ $th.find('.fht-cell').append(html.join(''));
2300
+ return false;
2195
2301
  }
2302
+ });
2196
2303
 
2197
- if (!column.filterControl && !that.options.filterControlContainer) {
2198
- html.push('<div class="no-filter-control"></div>');
2199
- } else if (that.options.filterControlContainer) {
2200
- var $filterControl = $(".bootstrap-table-filter-control-".concat(column.field));
2201
- var placeholder = column.filterControlPlaceholder ? column.filterControlPlaceholder : '';
2202
- $filterControl.attr('placeholder', placeholder);
2203
- $filterControl.val(column.filterDefault);
2204
- $filterControl.attr('data-field', column.field);
2205
- addedFilterControl = true;
2304
+ if (column.filterData && column.filterData.toLowerCase() !== 'column') {
2305
+ var filterDataType = getFilterDataMethod(
2306
+ /* eslint-disable no-use-before-define */
2307
+ filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
2308
+ var filterDataSource;
2309
+ var selectControl;
2310
+
2311
+ if (filterDataType) {
2312
+ filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
2313
+ selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
2314
+ addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
2315
+ filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
2206
2316
  } else {
2207
- var nameControl = column.filterControl.toLowerCase();
2208
- html.push('<div class="filter-control">');
2209
- addedFilterControl = true;
2210
-
2211
- if (column.searchable && that.options.filterTemplate[nameControl]) {
2212
- html.push(that.options.filterTemplate[nameControl](that, column.field, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
2213
- }
2214
- }
2215
-
2216
- if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
2217
- if ($.isEmptyObject(that.filterColumnsPartial)) {
2218
- that.filterColumnsPartial = {};
2219
- }
2220
-
2221
- that.filterColumnsPartial[column.field] = column.filterDefault;
2317
+ throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
2222
2318
  }
2319
+ }
2320
+ });
2223
2321
 
2224
- $.each(header.children().children(), function (i, tr) {
2225
- var $tr = $(tr);
2322
+ if (addedFilterControl) {
2323
+ header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
2324
+ var currentTarget = _ref4.currentTarget,
2325
+ keyCode = _ref4.keyCode;
2326
+ syncControls(that); // Simulate enter key action from clear button
2226
2327
 
2227
- if ($tr.data('field') === column.field) {
2228
- $tr.find('.fht-cell').append(html.join(''));
2229
- return false;
2230
- }
2231
- });
2328
+ keyCode = obj ? obj.keyCode : keyCode;
2232
2329
 
2233
- if (column.filterData !== undefined && column.filterData.toLowerCase() !== 'column') {
2234
- var filterDataType = UtilsFilterControl.getFilterDataMethod(
2235
- /* eslint-disable no-use-before-define */
2236
- filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
2237
- var filterDataSource;
2238
- var selectControl;
2239
-
2240
- if (filterDataType !== null) {
2241
- filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
2242
- selectControl = UtilsFilterControl.getControlContainer().find(".bootstrap-table-filter-control-".concat(UtilsFilterControl.escapeID(column.field)));
2243
- UtilsFilterControl.addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault);
2244
- filterDataType(filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
2245
- } else {
2246
- throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
2247
- }
2330
+ if (that.options.searchOnEnterKey && keyCode !== 13) {
2331
+ return;
2248
2332
  }
2249
- });
2250
-
2251
- if (addedFilterControl) {
2252
- UtilsFilterControl.getControlContainer().off('keyup', 'input').on('keyup', 'input', function (_ref6, obj) {
2253
- var currentTarget = _ref6.currentTarget,
2254
- keyCode = _ref6.keyCode;
2255
- // Simulate enter key action from clear button
2256
- keyCode = obj ? obj.keyCode : keyCode;
2257
2333
 
2258
- if (that.options.searchOnEnterKey && keyCode !== 13) {
2259
- return;
2260
- }
2261
-
2262
- if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2263
- return;
2264
- }
2334
+ if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2335
+ return;
2336
+ }
2265
2337
 
2266
- var $currentTarget = $(currentTarget);
2338
+ var $currentTarget = $(currentTarget);
2267
2339
 
2268
- if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
2269
- return;
2270
- }
2340
+ if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
2341
+ return;
2342
+ }
2271
2343
 
2272
- clearTimeout(currentTarget.timeoutId || 0);
2273
- currentTarget.timeoutId = setTimeout(function () {
2274
- that.onColumnSearch({
2275
- currentTarget: currentTarget,
2276
- keyCode: keyCode
2277
- });
2278
- }, that.options.searchTimeOut);
2279
- });
2280
- UtilsFilterControl.getControlContainer().off('change', 'select').on('change', 'select', function (_ref7) {
2281
- var currentTarget = _ref7.currentTarget,
2282
- keyCode = _ref7.keyCode;
2344
+ clearTimeout(currentTarget.timeoutId || 0);
2345
+ currentTarget.timeoutId = setTimeout(function () {
2346
+ that.onColumnSearch({
2347
+ currentTarget: currentTarget,
2348
+ keyCode: keyCode
2349
+ });
2350
+ }, that.options.searchTimeOut);
2351
+ });
2352
+ header.off('change', 'select:not(".ms-offscreen")').on('change', 'select:not(".ms-offscreen")', function (_ref5) {
2353
+ var currentTarget = _ref5.currentTarget,
2354
+ keyCode = _ref5.keyCode;
2355
+ syncControls(that);
2356
+ var $select = $(currentTarget);
2357
+ var value = $select.val();
2358
+
2359
+ if (value && value.length > 0 && value.trim()) {
2360
+ $select.find('option[selected]').removeAttr('selected');
2361
+ $select.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
2362
+ } else {
2363
+ $select.find('option[selected]').removeAttr('selected');
2364
+ }
2283
2365
 
2284
- if (that.options.searchOnEnterKey && keyCode !== 13) {
2285
- return;
2286
- }
2366
+ clearTimeout(currentTarget.timeoutId || 0);
2367
+ currentTarget.timeoutId = setTimeout(function () {
2368
+ that.onColumnSearch({
2369
+ currentTarget: currentTarget,
2370
+ keyCode: keyCode
2371
+ });
2372
+ }, that.options.searchTimeOut);
2373
+ });
2374
+ header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
2375
+ var currentTarget = _ref6.currentTarget,
2376
+ keyCode = _ref6.keyCode;
2377
+ var $input = $(currentTarget);
2378
+ var oldValue = $input.val();
2287
2379
 
2288
- if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2289
- return;
2290
- }
2380
+ if (oldValue === '') {
2381
+ return;
2382
+ }
2291
2383
 
2292
- var $select = $(currentTarget);
2293
- var value = $select.val();
2384
+ setTimeout(function () {
2385
+ syncControls(that);
2386
+ var newValue = $input.val();
2294
2387
 
2295
- if ($.trim(value)) {
2296
- $select.find('option[selected]').removeAttr('selected');
2297
- $select.find('option[value="' + value + '"]').attr('selected', true);
2298
- } else {
2299
- $select.find('option[selected]').removeAttr('selected');
2388
+ if (newValue === '') {
2389
+ clearTimeout(currentTarget.timeoutId || 0);
2390
+ currentTarget.timeoutId = setTimeout(function () {
2391
+ that.onColumnSearch({
2392
+ currentTarget: currentTarget,
2393
+ keyCode: keyCode
2394
+ });
2395
+ }, that.options.searchTimeOut);
2300
2396
  }
2397
+ }, 1);
2398
+ });
2399
+ header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
2400
+ var currentTarget = _ref7.currentTarget,
2401
+ keyCode = _ref7.keyCode;
2402
+ clearTimeout(currentTarget.timeoutId || 0);
2403
+ currentTarget.timeoutId = setTimeout(function () {
2404
+ syncControls(that);
2405
+ that.onColumnSearch({
2406
+ currentTarget: currentTarget,
2407
+ keyCode: keyCode
2408
+ });
2409
+ }, that.options.searchTimeOut);
2410
+ });
2301
2411
 
2302
- clearTimeout(currentTarget.timeoutId || 0);
2303
- currentTarget.timeoutId = setTimeout(function () {
2304
- that.onColumnSearch({
2305
- currentTarget: currentTarget,
2306
- keyCode: keyCode
2307
- });
2308
- }, that.options.searchTimeOut);
2309
- });
2310
- header.off('mouseup', 'input').on('mouseup', 'input', function (_ref8) {
2311
- var currentTarget = _ref8.currentTarget,
2312
- keyCode = _ref8.keyCode;
2313
- var $input = $(currentTarget);
2314
- var oldValue = $input.val();
2412
+ if (header.find('.date-filter-control').length > 0) {
2413
+ $.each(that.columns, function (i, _ref8) {
2414
+ var filterDefault = _ref8.filterDefault,
2415
+ filterControl = _ref8.filterControl,
2416
+ field = _ref8.field,
2417
+ filterDatepickerOptions = _ref8.filterDatepickerOptions;
2315
2418
 
2316
- if (oldValue === '') {
2317
- return;
2318
- }
2419
+ if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
2420
+ var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field));
2421
+ $datepicker.datepicker(filterDatepickerOptions);
2319
2422
 
2320
- setTimeout(function () {
2321
- var newValue = $input.val();
2423
+ if (filterDefault) {
2424
+ $datepicker.datepicker('setDate', filterDefault);
2425
+ }
2322
2426
 
2323
- if (newValue === '') {
2427
+ $datepicker.on('changeDate', function (_ref9) {
2428
+ var currentTarget = _ref9.currentTarget,
2429
+ keyCode = _ref9.keyCode;
2324
2430
  clearTimeout(currentTarget.timeoutId || 0);
2325
2431
  currentTarget.timeoutId = setTimeout(function () {
2432
+ syncControls(that);
2326
2433
  that.onColumnSearch({
2327
2434
  currentTarget: currentTarget,
2328
2435
  keyCode: keyCode
2329
2436
  });
2330
2437
  }, that.options.searchTimeOut);
2331
- }
2332
- }, 1);
2438
+ });
2439
+ }
2333
2440
  });
2441
+ }
2334
2442
 
2335
- if (UtilsFilterControl.getControlContainer().find('.date-filter-control').length > 0) {
2336
- $.each(that.columns, function (i, _ref9) {
2337
- var filterControl = _ref9.filterControl,
2338
- field = _ref9.field,
2339
- filterDatepickerOptions = _ref9.filterDatepickerOptions;
2340
-
2341
- if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
2342
- UtilsFilterControl.getControlContainer().find(".date-filter-control.bootstrap-table-filter-control-".concat(field)).datepicker(filterDatepickerOptions).on('changeDate', function (_ref10) {
2343
- var currentTarget = _ref10.currentTarget,
2344
- keyCode = _ref10.keyCode;
2345
- clearTimeout(currentTarget.timeoutId || 0);
2346
- currentTarget.timeoutId = setTimeout(function () {
2347
- that.onColumnSearch({
2348
- currentTarget: currentTarget,
2349
- keyCode: keyCode
2350
- });
2351
- }, that.options.searchTimeOut);
2352
- });
2353
- }
2354
- });
2355
- }
2443
+ if (that.options.sidePagination !== 'server' && !that.options.height) {
2444
+ that.triggerSearch();
2445
+ }
2356
2446
 
2357
- if (that.options.sidePagination !== 'server') {
2358
- that.triggerSearch();
2359
- }
2360
- } else {
2361
- UtilsFilterControl.getControlContainer().find('.filterControl').hide();
2447
+ if (!that.options.filterControlVisible) {
2448
+ header.find('.filter-control, .no-filter-control').hide();
2362
2449
  }
2363
- },
2364
- getDirectionOfSelectOptions: function getDirectionOfSelectOptions(_alignment) {
2365
- var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
2450
+ } else {
2451
+ header.find('.filter-control, .no-filter-control').hide();
2452
+ }
2453
+
2454
+ that.trigger('created-controls');
2455
+ }
2456
+ function getDirectionOfSelectOptions(_alignment) {
2457
+ var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
2366
2458
 
2367
- switch (alignment) {
2368
- case 'left':
2369
- return 'ltr';
2459
+ switch (alignment) {
2460
+ case 'left':
2461
+ return 'ltr';
2370
2462
 
2371
- case 'right':
2372
- return 'rtl';
2463
+ case 'right':
2464
+ return 'rtl';
2373
2465
 
2374
- case 'auto':
2375
- return 'auto';
2466
+ case 'auto':
2467
+ return 'auto';
2376
2468
 
2377
- default:
2378
- return 'ltr';
2379
- }
2469
+ default:
2470
+ return 'ltr';
2380
2471
  }
2381
- };
2472
+ }
2473
+ function syncControls(that) {
2474
+ if (that.options.height) {
2475
+ var controlsTableHeader = that.$tableHeader.find(searchControls);
2476
+ that.$header.find(searchControls).each(function (_, control) {
2477
+ var $control = $(control);
2478
+ var controlClass = getElementClass($control);
2479
+ var foundControl = controlsTableHeader.filter(function (_, ele) {
2480
+ var eleClass = getElementClass($(ele));
2481
+ return controlClass === eleClass;
2482
+ });
2483
+
2484
+ if (foundControl.length === 0) {
2485
+ return;
2486
+ }
2487
+
2488
+ if ($control.is('select')) {
2489
+ $control.find('option:selected').removeAttr('selected');
2490
+ $control.find("option[value='".concat(foundControl.val(), "']")).attr('selected', true);
2491
+ } else {
2492
+ $control.val(foundControl.val());
2493
+ }
2494
+ });
2495
+ }
2496
+ }
2382
2497
  var filterDataMethods = {
2383
2498
  func: function func(filterDataSource, selectControl, filterOrderBy, selected) {
2384
- var variableValues = window[filterDataSource].apply();
2499
+ var variableValues = window[filterDataSource].apply(); // eslint-disable-next-line guard-for-in
2385
2500
 
2386
2501
  for (var key in variableValues) {
2387
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2502
+ addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2388
2503
  }
2389
2504
 
2390
- UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2505
+ sortSelectControl(selectControl, filterOrderBy);
2391
2506
  },
2392
2507
  obj: function obj(filterDataSource, selectControl, filterOrderBy, selected) {
2393
2508
  var objectKeys = filterDataSource.split('.');
@@ -2398,77 +2513,90 @@
2398
2513
  objectKeys.forEach(function (key) {
2399
2514
  variableValues = variableValues[key];
2400
2515
  });
2401
- }
2516
+ } // eslint-disable-next-line guard-for-in
2517
+
2402
2518
 
2403
2519
  for (var key in variableValues) {
2404
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2520
+ addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2405
2521
  }
2406
2522
 
2407
- UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2523
+ sortSelectControl(selectControl, filterOrderBy);
2408
2524
  },
2409
2525
  var: function _var(filterDataSource, selectControl, filterOrderBy, selected) {
2410
2526
  var variableValues = window[filterDataSource];
2527
+ var isArray = Array.isArray(variableValues);
2411
2528
 
2412
2529
  for (var key in variableValues) {
2413
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2530
+ if (isArray) {
2531
+ addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected);
2532
+ } else {
2533
+ addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2534
+ }
2414
2535
  }
2415
2536
 
2416
- UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2537
+ sortSelectControl(selectControl, filterOrderBy);
2417
2538
  },
2418
2539
  url: function url(filterDataSource, selectControl, filterOrderBy, selected) {
2419
2540
  $.ajax({
2420
2541
  url: filterDataSource,
2421
2542
  dataType: 'json',
2422
2543
  success: function success(data) {
2544
+ // eslint-disable-next-line guard-for-in
2423
2545
  for (var key in data) {
2424
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, data[key], selected);
2546
+ addOptionToSelectControl(selectControl, key, data[key], selected);
2425
2547
  }
2426
2548
 
2427
- UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2549
+ sortSelectControl(selectControl, filterOrderBy);
2428
2550
  }
2429
2551
  });
2430
2552
  },
2431
2553
  json: function json(filterDataSource, selectControl, filterOrderBy, selected) {
2432
- var variableValues = JSON.parse(filterDataSource);
2554
+ var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
2433
2555
 
2434
2556
  for (var key in variableValues) {
2435
- UtilsFilterControl.addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2557
+ addOptionToSelectControl(selectControl, key, variableValues[key], selected);
2436
2558
  }
2437
2559
 
2438
- UtilsFilterControl.sortSelectControl(selectControl, filterOrderBy);
2560
+ sortSelectControl(selectControl, filterOrderBy);
2439
2561
  }
2440
2562
  };
2563
+
2564
+ var Utils$1 = $.fn.bootstrapTable.utils;
2441
2565
  $.extend($.fn.bootstrapTable.defaults, {
2442
2566
  filterControl: false,
2567
+ filterControlVisible: true,
2568
+ // eslint-disable-next-line no-unused-vars
2443
2569
  onColumnSearch: function onColumnSearch(field, text) {
2444
2570
  return false;
2445
2571
  },
2446
2572
  onCreatedControls: function onCreatedControls() {
2447
- return true;
2573
+ return false;
2448
2574
  },
2449
2575
  alignmentSelectControlOptions: undefined,
2450
2576
  filterTemplate: {
2451
2577
  input: function input(that, field, placeholder, value) {
2452
- return Utils.sprintf('<input type="text" class="form-control bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
2578
+ return Utils$1.sprintf('<input type="search" class="form-control bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
2453
2579
  },
2454
- select: function select(_ref11, field) {
2455
- var options = _ref11.options;
2456
- return Utils.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%;" dir="%s"></select>', field, UtilsFilterControl.getDirectionOfSelectOptions(options.alignmentSelectControlOptions));
2580
+ select: function select(_ref, field) {
2581
+ var options = _ref.options;
2582
+ return Utils$1.sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%;" dir="%s"></select>', field, getDirectionOfSelectOptions(options.alignmentSelectControlOptions));
2457
2583
  },
2458
2584
  datepicker: function datepicker(that, field, value) {
2459
- return Utils.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', field, 'undefined' === typeof value ? '' : value);
2585
+ return Utils$1.sprintf('<input type="text" class="form-control date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', field, 'undefined' === typeof value ? '' : value);
2460
2586
  }
2461
2587
  },
2462
2588
  disableControlWhenSearch: false,
2463
2589
  searchOnEnterKey: false,
2590
+ showFilterControlSwitch: false,
2464
2591
  // internal variables
2465
2592
  valuesFilterControl: []
2466
2593
  });
2467
2594
  $.extend($.fn.bootstrapTable.columnDefaults, {
2468
2595
  filterControl: undefined,
2596
+ // input, select, datepicker
2469
2597
  filterDataCollector: undefined,
2470
2598
  filterData: undefined,
2471
- filterDatepickerOptions: undefined,
2599
+ filterDatepickerOptions: {},
2472
2600
  filterStrictSearch: false,
2473
2601
  filterStartsWithSearch: false,
2474
2602
  filterControlPlaceholder: '',
@@ -2483,7 +2611,26 @@
2483
2611
  $.extend($.fn.bootstrapTable.defaults.icons, {
2484
2612
  clear: {
2485
2613
  bootstrap3: 'glyphicon-trash icon-clear'
2486
- }[$.fn.bootstrapTable.theme] || 'fa-trash'
2614
+ }[$.fn.bootstrapTable.theme] || 'fa-trash',
2615
+ filterControlSwitchHide: {
2616
+ bootstrap3: 'glyphicon-zoom-out icon-zoom-out',
2617
+ materialize: 'zoom_out'
2618
+ }[$.fn.bootstrapTable.theme] || 'fa-search-minus',
2619
+ filterControlSwitchShow: {
2620
+ bootstrap3: 'glyphicon-zoom-in icon-zoom-in',
2621
+ materialize: 'zoom_in'
2622
+ }[$.fn.bootstrapTable.theme] || 'fa-search-plus'
2623
+ });
2624
+ $.extend($.fn.bootstrapTable.locales, {
2625
+ formatFilterControlSwitch: function formatFilterControlSwitch() {
2626
+ return 'Hide/Show controls';
2627
+ },
2628
+ formatFilterControlSwitchHide: function formatFilterControlSwitchHide() {
2629
+ return 'Hide controls';
2630
+ },
2631
+ formatFilterControlSwitchShow: function formatFilterControlSwitchShow() {
2632
+ return 'Show controls';
2633
+ }
2487
2634
  });
2488
2635
  $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
2489
2636
  $.extend($.fn.bootstrapTable.defaults, {
@@ -2493,6 +2640,7 @@
2493
2640
  });
2494
2641
  $.fn.bootstrapTable.methods.push('triggerSearch');
2495
2642
  $.fn.bootstrapTable.methods.push('clearFilterControl');
2643
+ $.fn.bootstrapTable.methods.push('toggleFilterControl');
2496
2644
 
2497
2645
  $.BootstrapTable =
2498
2646
  /*#__PURE__*/
@@ -2510,38 +2658,38 @@
2510
2658
  value: function init() {
2511
2659
  var _this = this;
2512
2660
 
2513
- UtilsFilterControl.bootstrapTableInstance = this; // Make sure that the filterControl option is set
2514
-
2661
+ // Make sure that the filterControl option is set
2515
2662
  if (this.options.filterControl) {
2516
- var that = this; // Make sure that the internal variables are set correctly
2517
-
2663
+ // Make sure that the internal variables are set correctly
2518
2664
  this.options.valuesFilterControl = [];
2519
2665
  this.$el.on('reset-view.bs.table', function () {
2520
2666
  // Create controls on $tableHeader if the height is set
2521
- if (!that.options.height) {
2667
+ if (!_this.options.height) {
2522
2668
  return;
2523
2669
  } // Avoid recreate the controls
2524
2670
 
2525
2671
 
2526
- if (UtilsFilterControl.getControlContainer().find('select').length > 0 || UtilsFilterControl.getControlContainer().find('input').length > 0) {
2672
+ var $controlContainer = getControlContainer(_this);
2673
+
2674
+ if ($controlContainer.find('select').length > 0 || $controlContainer.find('input:not([type="checkbox"]):not([type="radio"])').length > 0) {
2527
2675
  return;
2528
2676
  }
2529
2677
 
2530
- UtilsFilterControl.createControls(that, UtilsFilterControl.getControlContainer());
2678
+ createControls(_this, $controlContainer);
2531
2679
  }).on('post-header.bs.table', function () {
2532
- UtilsFilterControl.setValues(that);
2680
+ setValues(_this);
2533
2681
  }).on('post-body.bs.table', function () {
2534
- if (that.options.height && !that.options.filterControlContainer) {
2535
- UtilsFilterControl.fixHeaderCSS(that);
2682
+ if (_this.options.height && !_this.options.filterControlContainer) {
2683
+ fixHeaderCSS(_this);
2536
2684
  }
2537
2685
 
2538
2686
  _this.$tableLoading.css('top', _this.$header.outerHeight() + 1);
2539
2687
  }).on('column-switch.bs.table', function () {
2540
- UtilsFilterControl.setValues(that);
2688
+ setValues(_this);
2541
2689
  }).on('load-success.bs.table', function () {
2542
- that.enableControls(true);
2690
+ _this.enableControls(true);
2543
2691
  }).on('load-error.bs.table', function () {
2544
- that.enableControls(true);
2692
+ _this.enableControls(true);
2545
2693
  });
2546
2694
  }
2547
2695
 
@@ -2552,39 +2700,36 @@
2552
2700
  value: function initHeader() {
2553
2701
  _get(_getPrototypeOf(_class.prototype), "initHeader", this).call(this);
2554
2702
 
2555
- if (!this.options.filterControl) {
2703
+ if (!this.options.filterControl || this.options.height) {
2556
2704
  return;
2557
2705
  }
2558
2706
 
2559
- UtilsFilterControl.createControls(this, UtilsFilterControl.getControlContainer());
2707
+ createControls(this, getControlContainer(this));
2560
2708
  }
2561
2709
  }, {
2562
2710
  key: "initBody",
2563
2711
  value: function initBody() {
2564
2712
  _get(_getPrototypeOf(_class.prototype), "initBody", this).call(this);
2565
2713
 
2566
- UtilsFilterControl.initFilterSelectControls(this);
2714
+ syncControls(this);
2715
+ initFilterSelectControls(this);
2567
2716
  }
2568
2717
  }, {
2569
2718
  key: "initSearch",
2570
2719
  value: function initSearch() {
2720
+ var _this2 = this;
2721
+
2571
2722
  var that = this;
2572
2723
  var fp = $.isEmptyObject(that.filterColumnsPartial) ? null : that.filterColumnsPartial;
2573
2724
 
2574
- if (fp === null || Object.keys(fp).length <= 1) {
2575
- _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
2576
- }
2577
-
2578
- if (this.options.sidePagination === 'server') {
2579
- return;
2580
- }
2725
+ _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
2581
2726
 
2582
- if (fp === null) {
2727
+ if (this.options.sidePagination === 'server' || fp === null) {
2583
2728
  return;
2584
2729
  } // Check partial column filter
2585
2730
 
2586
2731
 
2587
- that.data = fp ? that.options.data.filter(function (item, i) {
2732
+ that.data = fp ? that.data.filter(function (item, i) {
2588
2733
  var itemIsExpected = [];
2589
2734
  var keys1 = Object.keys(item);
2590
2735
  var keys2 = Object.keys(fp);
@@ -2594,7 +2739,7 @@
2594
2739
  keys.forEach(function (key) {
2595
2740
  var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
2596
2741
  var fval = (fp[key] || '').toLowerCase();
2597
- var value = Utils.getItemField(item, key, false);
2742
+ var value = Utils$1.unescapeHTML(Utils$1.getItemField(item, key, false));
2598
2743
  var tmpItemIsExpected;
2599
2744
 
2600
2745
  if (fval === '') {
@@ -2608,58 +2753,24 @@
2608
2753
  if ($.inArray(key, that.header.fields) !== -1) {
2609
2754
  if (value === undefined || value === null) {
2610
2755
  tmpItemIsExpected = false;
2611
- } else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
2612
- if (thisColumn.filterStrictSearch) {
2613
- tmpItemIsExpected = value.toString().toLowerCase() === fval.toString().toLowerCase();
2614
- } else if (thisColumn.filterStartsWithSearch) {
2615
- tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(fval) === 0;
2616
- } else {
2617
- tmpItemIsExpected = "".concat(value).toLowerCase().includes(fval);
2618
- }
2619
-
2620
- var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
2621
- var matches = largerSmallerEqualsRegex.exec(fval);
2622
-
2623
- if (matches) {
2624
- var operator = matches[1] || "".concat(matches[5], "l");
2625
- var comparisonValue = matches[2] || matches[3];
2626
- var int = parseInt(value, 10);
2627
- var comparisonInt = parseInt(comparisonValue, 10);
2628
-
2629
- switch (operator) {
2630
- case '>':
2631
- case '<l':
2632
- tmpItemIsExpected = int > comparisonInt;
2633
- break;
2634
-
2635
- case '<':
2636
- case '>l':
2637
- tmpItemIsExpected = int < comparisonInt;
2638
- break;
2639
-
2640
- case '<=':
2641
- case '=<':
2642
- case '>=l':
2643
- case '=>l':
2644
- tmpItemIsExpected = int <= comparisonInt;
2645
- break;
2646
-
2647
- case '>=':
2648
- case '=>':
2649
- case '<=l':
2650
- case '=<l':
2651
- tmpItemIsExpected = int >= comparisonInt;
2652
- break;
2756
+ } else if (_typeof(value) === 'object') {
2757
+ value.forEach(function (objectValue) {
2758
+ if (tmpItemIsExpected) {
2759
+ return;
2653
2760
  }
2654
- }
2655
-
2656
- if (thisColumn.filterCustomSearch) {
2657
- var customSearchResult = Utils.calculateObjectValue(that, thisColumn.filterCustomSearch, [fval, value, key, that.options.data], true);
2658
2761
 
2659
- if (customSearchResult !== null) {
2660
- tmpItemIsExpected = customSearchResult;
2762
+ if (_this2.options.searchAccentNeutralise) {
2763
+ objectValue = Utils$1.normalizeAccent(objectValue);
2661
2764
  }
2765
+
2766
+ tmpItemIsExpected = that.isValueExpected(fval, objectValue, thisColumn, key);
2767
+ });
2768
+ } else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
2769
+ if (_this2.options.searchAccentNeutralise) {
2770
+ value = Utils$1.normalizeAccent(value);
2662
2771
  }
2772
+
2773
+ tmpItemIsExpected = that.isValueExpected(fval, value, thisColumn, key);
2663
2774
  }
2664
2775
  }
2665
2776
  }
@@ -2668,15 +2779,75 @@
2668
2779
  });
2669
2780
  return !itemIsExpected.includes(false);
2670
2781
  }) : that.data;
2782
+ that.unsortedData = _toConsumableArray(that.data);
2783
+ }
2784
+ }, {
2785
+ key: "isValueExpected",
2786
+ value: function isValueExpected(searchValue, value, column, key) {
2787
+ var tmpItemIsExpected = false;
2788
+
2789
+ if (column.filterStrictSearch) {
2790
+ tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase();
2791
+ } else if (column.filterStartsWithSearch) {
2792
+ tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(searchValue) === 0;
2793
+ } else {
2794
+ tmpItemIsExpected = "".concat(value).toLowerCase().includes(searchValue);
2795
+ }
2796
+
2797
+ var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
2798
+ var matches = largerSmallerEqualsRegex.exec(searchValue);
2799
+
2800
+ if (matches) {
2801
+ var operator = matches[1] || "".concat(matches[5], "l");
2802
+ var comparisonValue = matches[2] || matches[3];
2803
+ var int = parseInt(value, 10);
2804
+ var comparisonInt = parseInt(comparisonValue, 10);
2805
+
2806
+ switch (operator) {
2807
+ case '>':
2808
+ case '<l':
2809
+ tmpItemIsExpected = int > comparisonInt;
2810
+ break;
2811
+
2812
+ case '<':
2813
+ case '>l':
2814
+ tmpItemIsExpected = int < comparisonInt;
2815
+ break;
2816
+
2817
+ case '<=':
2818
+ case '=<':
2819
+ case '>=l':
2820
+ case '=>l':
2821
+ tmpItemIsExpected = int <= comparisonInt;
2822
+ break;
2823
+
2824
+ case '>=':
2825
+ case '=>':
2826
+ case '<=l':
2827
+ case '=<l':
2828
+ tmpItemIsExpected = int >= comparisonInt;
2829
+ break;
2830
+ }
2831
+ }
2832
+
2833
+ if (column.filterCustomSearch) {
2834
+ var customSearchResult = Utils$1.calculateObjectValue(this, column.filterCustomSearch, [searchValue, value, key, this.options.data], true);
2835
+
2836
+ if (customSearchResult !== null) {
2837
+ tmpItemIsExpected = customSearchResult;
2838
+ }
2839
+ }
2840
+
2841
+ return tmpItemIsExpected;
2671
2842
  }
2672
2843
  }, {
2673
2844
  key: "initColumnSearch",
2674
2845
  value: function initColumnSearch(filterColumnsDefaults) {
2675
- UtilsFilterControl.copyValues(this);
2846
+ copyValues(this);
2676
2847
 
2677
2848
  if (filterColumnsDefaults) {
2678
2849
  this.filterColumnsPartial = filterColumnsDefaults;
2679
- this.updatePagination();
2850
+ this.updatePagination(); // eslint-disable-next-line guard-for-in
2680
2851
 
2681
2852
  for (var filter in filterColumnsDefaults) {
2682
2853
  this.trigger('column-search', filter, filterColumnsDefaults[filter]);
@@ -2685,17 +2856,18 @@
2685
2856
  }
2686
2857
  }, {
2687
2858
  key: "onColumnSearch",
2688
- value: function onColumnSearch(_ref12) {
2689
- var currentTarget = _ref12.currentTarget,
2690
- keyCode = _ref12.keyCode;
2859
+ value: function onColumnSearch(_ref2) {
2860
+ var currentTarget = _ref2.currentTarget,
2861
+ keyCode = _ref2.keyCode;
2691
2862
 
2692
2863
  if ($.inArray(keyCode, [37, 38, 39, 40]) > -1) {
2693
2864
  return;
2694
2865
  }
2695
2866
 
2696
- UtilsFilterControl.copyValues(this);
2867
+ copyValues(this);
2697
2868
  var text = $.trim($(currentTarget).val());
2698
2869
  var $field = $(currentTarget).closest('[data-field]').data('field');
2870
+ this.trigger('column-search', $field, text);
2699
2871
 
2700
2872
  if ($.isEmptyObject(this.filterColumnsPartial)) {
2701
2873
  this.filterColumnsPartial = {};
@@ -2712,13 +2884,27 @@
2712
2884
  this.onSearch({
2713
2885
  currentTarget: currentTarget
2714
2886
  }, false);
2715
- this.trigger('column-search', $field, text);
2716
2887
  }
2717
2888
  }, {
2718
2889
  key: "initToolbar",
2719
2890
  value: function initToolbar() {
2891
+ this.showToolbar = this.showToolbar || this.options.showFilterControlSwitch;
2720
2892
  this.showSearchClearButton = this.options.filterControl && this.options.showSearchClearButton;
2721
2893
 
2894
+ if (this.options.showFilterControlSwitch) {
2895
+ this.buttons = Object.assign(this.buttons, {
2896
+ filterControlSwitch: {
2897
+ text: this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow(),
2898
+ icon: this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow,
2899
+ event: this.toggleFilterControl,
2900
+ attributes: {
2901
+ 'aria-label': this.options.formatFilterControlSwitch(),
2902
+ title: this.options.formatFilterControlSwitch()
2903
+ }
2904
+ }
2905
+ });
2906
+ }
2907
+
2722
2908
  _get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
2723
2909
  }
2724
2910
  }, {
@@ -2735,11 +2921,10 @@
2735
2921
  value: function clearFilterControl() {
2736
2922
  if (this.options.filterControl) {
2737
2923
  var that = this;
2738
- var cookies = UtilsFilterControl.collectBootstrapCookies();
2739
- var header = UtilsFilterControl.getCurrentHeader(that);
2740
- var table = header.closest('table');
2741
- var controls = header.find(UtilsFilterControl.getCurrentSearchControls(that));
2742
- var search = that.$toolbar.find('.search input');
2924
+ var cookies = collectBootstrapCookies();
2925
+ var table = this.$el.closest('table');
2926
+ var controls = getSearchControls(that);
2927
+ var search = Utils$1.getSearchInput(this);
2743
2928
  var hasValues = false;
2744
2929
  var timeoutId = 0;
2745
2930
  $.each(that.options.valuesFilterControl, function (i, item) {
@@ -2749,7 +2934,7 @@
2749
2934
  $.each(that.options.filterControls, function (i, item) {
2750
2935
  item.text = '';
2751
2936
  });
2752
- UtilsFilterControl.setValues(that); // clear cookies once the filters are clean
2937
+ setValues(that); // clear cookies once the filters are clean
2753
2938
 
2754
2939
  clearTimeout(timeoutId);
2755
2940
  timeoutId = setTimeout(function () {
@@ -2784,7 +2969,7 @@
2784
2969
 
2785
2970
 
2786
2971
  if (that.options.sortName !== table.data('sortName') || that.options.sortOrder !== table.data('sortOrder')) {
2787
- var sorter = header.find(Utils.sprintf('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
2972
+ var sorter = this.$header.find(Utils$1.sprintf('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
2788
2973
 
2789
2974
  if (sorter.length > 0) {
2790
2975
  that.onSort({
@@ -2799,7 +2984,7 @@
2799
2984
  }, {
2800
2985
  key: "triggerSearch",
2801
2986
  value: function triggerSearch() {
2802
- var searchControls = UtilsFilterControl.getSearchControls(this);
2987
+ var searchControls = getSearchControls(this);
2803
2988
  searchControls.each(function () {
2804
2989
  var el = $(this);
2805
2990
 
@@ -2814,7 +2999,7 @@
2814
2999
  key: "enableControls",
2815
3000
  value: function enableControls(enable) {
2816
3001
  if (this.options.disableControlWhenSearch && this.options.sidePagination === 'server') {
2817
- var searchControls = UtilsFilterControl.getSearchControls(this);
3002
+ var searchControls = getSearchControls(this);
2818
3003
 
2819
3004
  if (!enable) {
2820
3005
  searchControls.prop('disabled', 'disabled');
@@ -2823,6 +3008,23 @@
2823
3008
  }
2824
3009
  }
2825
3010
  }
3011
+ }, {
3012
+ key: "toggleFilterControl",
3013
+ value: function toggleFilterControl() {
3014
+ this.options.filterControlVisible = !this.options.filterControlVisible;
3015
+ var $filterControls = getControlContainer(this).find('.filter-control, .no-filter-control');
3016
+
3017
+ if (this.options.filterControlVisible) {
3018
+ $filterControls.show();
3019
+ } else {
3020
+ $filterControls.hide();
3021
+ this.clearFilterControl();
3022
+ }
3023
+
3024
+ var icon = this.options.showButtonIcons ? this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow : '';
3025
+ var text = this.options.showButtonText ? this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow() : '';
3026
+ this.$toolbar.find('>.columns').find('.filter-control-switch').html("".concat(Utils$1.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
3027
+ }
2826
3028
  }]);
2827
3029
 
2828
3030
  return _class;