bootstrap-table-toolbar.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.object.assign.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.string.trim.js'), require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.object.assign.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.string.trim.js', 'jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(null, null, null, null, null, null, null, null, null, null, null, null, null, global.jQuery));
  5. })(this, (function (es_array_concat_js, es_array_filter_js, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_object_assign_js, es_object_entries_js, es_object_toString_js, es_regexp_exec_js, es_string_includes_js, es_string_search_js, es_string_trim_js, $) { 'use strict';
  6. function _arrayLikeToArray(r, a) {
  7. (null == a || a > r.length) && (a = r.length);
  8. for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  9. return n;
  10. }
  11. function _arrayWithHoles(r) {
  12. if (Array.isArray(r)) return r;
  13. }
  14. function _arrayWithoutHoles(r) {
  15. if (Array.isArray(r)) return _arrayLikeToArray(r);
  16. }
  17. function _assertThisInitialized(e) {
  18. if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  19. return e;
  20. }
  21. function _callSuper(t, o, e) {
  22. return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
  23. }
  24. function _classCallCheck(a, n) {
  25. if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
  26. }
  27. function _defineProperties(e, r) {
  28. for (var t = 0; t < r.length; t++) {
  29. var o = r[t];
  30. o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
  31. }
  32. }
  33. function _createClass(e, r, t) {
  34. return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
  35. writable: !1
  36. }), e;
  37. }
  38. function _createForOfIteratorHelper(r, e) {
  39. var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  40. if (!t) {
  41. if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
  42. t && (r = t);
  43. var n = 0,
  44. F = function () {};
  45. return {
  46. s: F,
  47. n: function () {
  48. return n >= r.length ? {
  49. done: !0
  50. } : {
  51. done: !1,
  52. value: r[n++]
  53. };
  54. },
  55. e: function (r) {
  56. throw r;
  57. },
  58. f: F
  59. };
  60. }
  61. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  62. }
  63. var o,
  64. a = !0,
  65. u = !1;
  66. return {
  67. s: function () {
  68. t = t.call(r);
  69. },
  70. n: function () {
  71. var r = t.next();
  72. return a = r.done, r;
  73. },
  74. e: function (r) {
  75. u = !0, o = r;
  76. },
  77. f: function () {
  78. try {
  79. a || null == t.return || t.return();
  80. } finally {
  81. if (u) throw o;
  82. }
  83. }
  84. };
  85. }
  86. function _get() {
  87. return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
  88. var p = _superPropBase(e, t);
  89. if (p) {
  90. var n = Object.getOwnPropertyDescriptor(p, t);
  91. return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
  92. }
  93. }, _get.apply(null, arguments);
  94. }
  95. function _getPrototypeOf(t) {
  96. return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
  97. return t.__proto__ || Object.getPrototypeOf(t);
  98. }, _getPrototypeOf(t);
  99. }
  100. function _inherits(t, e) {
  101. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
  102. t.prototype = Object.create(e && e.prototype, {
  103. constructor: {
  104. value: t,
  105. writable: !0,
  106. configurable: !0
  107. }
  108. }), Object.defineProperty(t, "prototype", {
  109. writable: !1
  110. }), e && _setPrototypeOf(t, e);
  111. }
  112. function _isNativeReflectConstruct() {
  113. try {
  114. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  115. } catch (t) {}
  116. return (_isNativeReflectConstruct = function () {
  117. return !!t;
  118. })();
  119. }
  120. function _iterableToArray(r) {
  121. if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
  122. }
  123. function _iterableToArrayLimit(r, l) {
  124. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  125. if (null != t) {
  126. var e,
  127. n,
  128. i,
  129. u,
  130. a = [],
  131. f = !0,
  132. o = !1;
  133. try {
  134. if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
  135. } catch (r) {
  136. o = !0, n = r;
  137. } finally {
  138. try {
  139. if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
  140. } finally {
  141. if (o) throw n;
  142. }
  143. }
  144. return a;
  145. }
  146. }
  147. function _nonIterableRest() {
  148. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  149. }
  150. function _nonIterableSpread() {
  151. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  152. }
  153. function _possibleConstructorReturn(t, e) {
  154. if (e && ("object" == typeof e || "function" == typeof e)) return e;
  155. if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
  156. return _assertThisInitialized(t);
  157. }
  158. function _setPrototypeOf(t, e) {
  159. return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
  160. return t.__proto__ = e, t;
  161. }, _setPrototypeOf(t, e);
  162. }
  163. function _slicedToArray(r, e) {
  164. return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
  165. }
  166. function _superPropBase(t, o) {
  167. for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
  168. return t;
  169. }
  170. function _toConsumableArray(r) {
  171. return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  172. }
  173. function _toPrimitive(t, r) {
  174. if ("object" != typeof t || !t) return t;
  175. var e = t[Symbol.toPrimitive];
  176. if (void 0 !== e) {
  177. var i = e.call(t, r );
  178. if ("object" != typeof i) return i;
  179. throw new TypeError("@@toPrimitive must return a primitive value.");
  180. }
  181. return (String )(t);
  182. }
  183. function _toPropertyKey(t) {
  184. var i = _toPrimitive(t, "string");
  185. return "symbol" == typeof i ? i : i + "";
  186. }
  187. function _unsupportedIterableToArray(r, a) {
  188. if (r) {
  189. if ("string" == typeof r) return _arrayLikeToArray(r, a);
  190. var t = {}.toString.call(r).slice(8, -1);
  191. return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  192. }
  193. }
  194. /**
  195. * @author: aperez <aperez@datadec.es>
  196. * @version: v2.0.0
  197. *
  198. * @update Dennis Hernández
  199. * @update zhixin wen <wenzhixin2010@gmail.com>
  200. */
  201. var Utils = $.fn.bootstrapTable.utils;
  202. var theme = {
  203. bootstrap3: {
  204. icons: {
  205. advancedSearchIcon: 'glyphicon-chevron-down'
  206. },
  207. classes: {},
  208. html: {
  209. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button class=\"close toolbar-modal-close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <h4 class=\"modal-title toolbar-modal-title\"></h4>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
  210. }
  211. },
  212. bootstrap4: {
  213. icons: {
  214. advancedSearchIcon: 'fa-chevron-down'
  215. },
  216. classes: {},
  217. html: {
  218. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title toolbar-modal-title\"></h4>\n <button class=\"close toolbar-modal-close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
  219. }
  220. },
  221. bootstrap5: {
  222. icons: {
  223. advancedSearchIcon: 'bi-chevron-down'
  224. },
  225. classes: {
  226. formGroup: 'mb-3'
  227. },
  228. html: {
  229. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title toolbar-modal-title\"></h5>\n <button class=\"btn-close toolbar-modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body toolbar-modal-body\"></div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <button class=\"btn btn-%s toolbar-modal-close\"></button>\n </div>\n </div>\n </div>\n </div>\n "
  230. }
  231. },
  232. bulma: {
  233. icons: {
  234. advancedSearchIcon: 'fa-chevron-down'
  235. },
  236. classes: {},
  237. html: {
  238. modal: "\n <div class=\"modal\" id=\"avdSearchModal_%s\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title toolbar-modal-title\"></p>\n <button class=\"delete toolbar-modal-close\"></button>\n </header>\n <section class=\"modal-card-body toolbar-modal-body\"></section>\n <footer class=\"modal-card-foot toolbar-modal-footer\">\n <button class=\"button button-%s toolbar-modal-close\"></button>\n </footer>\n </div>\n </div>\n "
  239. }
  240. },
  241. foundation: {
  242. icons: {
  243. advancedSearchIcon: 'fa-chevron-down'
  244. },
  245. classes: {},
  246. html: {
  247. modal: "\n <div class=\"reveal\" id=\"avdSearchModal_%s\" data-reveal>\n <h1 class=\"toolbar-modal-title\"></h1>\n <div class=\"toolbar-modal-body\"></div>\n <button class=\"close-button toolbar-modal-close\" data-close aria-label=\"Close modal\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"toolbar-modal-footer\">\n <button class=\"button button-%s toolbar-modal-close\"></button>\n </div>\n </div>\n "
  248. }
  249. },
  250. materialize: {
  251. icons: {
  252. advancedSearchIcon: 'expand_more'
  253. },
  254. classes: {},
  255. html: {
  256. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal\">\n <div class=\"modal-content\">\n <h4 class=\"toolbar-modal-title\"></h4>\n <div class=\"toolbar-modal-body\"></div>\n </div>\n <div class=\"modal-footer toolbar-modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-green btn-flat btn-%s toolbar-modal-close\"></a>\n </div>\n </div>\n "
  257. }
  258. },
  259. semantic: {
  260. icons: {
  261. advancedSearchIcon: 'fa-chevron-down'
  262. },
  263. classes: {},
  264. html: {
  265. modal: "\n <div class=\"ui modal\" id=\"avdSearchModal_%s\">\n <i class=\"close icon toolbar-modal-close\"></i>\n <div class=\"header toolbar-modal-title\"\"></div>\n <div class=\"image content ui form toolbar-modal-body\"></div>\n <div class=\"actions toolbar-modal-footer\">\n <div class=\"ui black deny button button-%s toolbar-modal-close\"></div>\n </div>\n </div>\n "
  266. }
  267. }
  268. }[$.fn.bootstrapTable.theme];
  269. Object.assign($.fn.bootstrapTable.defaults, {
  270. advancedSearch: false,
  271. idForm: 'advancedSearch',
  272. actionForm: '',
  273. idTable: undefined,
  274. // eslint-disable-next-line no-unused-vars
  275. onColumnAdvancedSearch: function onColumnAdvancedSearch(field, text) {
  276. return false;
  277. }
  278. });
  279. Object.assign($.fn.bootstrapTable.defaults.icons, {
  280. advancedSearchIcon: theme.icons.advancedSearchIcon
  281. });
  282. Object.assign($.fn.bootstrapTable.events, {
  283. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  284. });
  285. Object.assign($.fn.bootstrapTable.locales, {
  286. formatAdvancedSearch: function formatAdvancedSearch() {
  287. return 'Advanced search';
  288. },
  289. formatAdvancedCloseButton: function formatAdvancedCloseButton() {
  290. return 'Close';
  291. }
  292. });
  293. Object.assign($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  294. $.BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  295. function _class() {
  296. _classCallCheck(this, _class);
  297. return _callSuper(this, _class, arguments);
  298. }
  299. _inherits(_class, _$$BootstrapTable);
  300. return _createClass(_class, [{
  301. key: "initToolbar",
  302. value: function initToolbar() {
  303. this.showToolbar = this.showToolbar || this.options.search && this.options.advancedSearch && this.options.idTable;
  304. if (this.showToolbar) {
  305. this.buttons = Object.assign(this.buttons, {
  306. advancedSearch: {
  307. text: this.options.formatAdvancedSearch(),
  308. icon: this.options.icons.advancedSearchIcon,
  309. event: this.showAdvancedSearch,
  310. attributes: {
  311. 'aria-label': this.options.formatAdvancedSearch(),
  312. title: this.options.formatAdvancedSearch()
  313. }
  314. }
  315. });
  316. if (Utils.isEmptyObject(this.filterColumnsPartial)) {
  317. this.filterColumnsPartial = {};
  318. }
  319. }
  320. _get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
  321. }
  322. }, {
  323. key: "showAdvancedSearch",
  324. value: function showAdvancedSearch() {
  325. var _this = this;
  326. this.$toolbarModal = $("#avdSearchModal_".concat(this.options.idTable));
  327. if (this.$toolbarModal.length <= 0) {
  328. $('body').append(Utils.sprintf(theme.html.modal, this.options.idTable, this.options.buttonsClass));
  329. this.$toolbarModal = $("#avdSearchModal_".concat(this.options.idTable));
  330. this.$toolbarModal.find('.toolbar-modal-close').off('click').on('click', function () {
  331. return _this.hideToolbarModal();
  332. });
  333. }
  334. this.initToolbarModalBody();
  335. this.showToolbarModal();
  336. }
  337. }, {
  338. key: "initToolbarModalBody",
  339. value: function initToolbarModalBody() {
  340. var _this2 = this;
  341. this.$toolbarModal.find('.toolbar-modal-title').html(this.options.formatAdvancedSearch());
  342. this.$toolbarModal.find('.toolbar-modal-footer .toolbar-modal-close').html(this.options.formatAdvancedCloseButton());
  343. this.$toolbarModal.find('.toolbar-modal-body').html(this.createToolbarForm()).off('keyup blur', 'input').on('keyup blur', 'input', function (e) {
  344. _this2.onColumnAdvancedSearch(e);
  345. });
  346. }
  347. }, {
  348. key: "showToolbarModal",
  349. value: function showToolbarModal() {
  350. var theme = $.fn.bootstrapTable.theme;
  351. if (['bootstrap3', 'bootstrap4'].includes(theme)) {
  352. this.$toolbarModal.modal();
  353. } else if (theme === 'bootstrap5') {
  354. if (!this.toolbarModal) {
  355. this.toolbarModal = new window.bootstrap.Modal(this.$toolbarModal[0], {});
  356. }
  357. this.toolbarModal.show();
  358. } else if (theme === 'bulma') {
  359. this.$toolbarModal.toggleClass('is-active');
  360. } else if (theme === 'foundation') {
  361. if (!this.toolbarModal) {
  362. this.toolbarModal = new window.Foundation.Reveal(this.$toolbarModal);
  363. }
  364. this.toolbarModal.open();
  365. } else if (theme === 'materialize') {
  366. this.$toolbarModal.modal().modal('open');
  367. } else if (theme === 'semantic') {
  368. this.$toolbarModal.modal('show');
  369. }
  370. }
  371. }, {
  372. key: "hideToolbarModal",
  373. value: function hideToolbarModal() {
  374. var theme = $.fn.bootstrapTable.theme;
  375. if (['bootstrap3', 'bootstrap4'].includes(theme)) {
  376. this.$toolbarModal.modal('hide');
  377. } else if (theme === 'bootstrap5') {
  378. this.toolbarModal.hide();
  379. } else if (theme === 'bulma') {
  380. $('html').toggleClass('is-clipped');
  381. this.$toolbarModal.toggleClass('is-active');
  382. } else if (theme === 'foundation') {
  383. this.toolbarModal.close();
  384. } else if (theme === 'materialize') {
  385. this.$toolbarModal.modal('open');
  386. } else if (theme === 'semantic') {
  387. this.$toolbarModal.modal('close');
  388. }
  389. if (this.options.sidePagination === 'server') {
  390. this.options.pageNumber = 1;
  391. this.updatePagination();
  392. this.trigger('column-advanced-search', this.filterColumnsPartial);
  393. }
  394. }
  395. }, {
  396. key: "createToolbarForm",
  397. value: function createToolbarForm() {
  398. var html = ["<form class=\"form-horizontal toolbar-model-form\" action=\"".concat(this.options.actionForm, "\">")];
  399. var _iterator = _createForOfIteratorHelper(this.columns),
  400. _step;
  401. try {
  402. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  403. var column = _step.value;
  404. if (!column.checkbox && column.visible && column.searchable) {
  405. var title = $('<div/>').html(column.title).text().trim();
  406. var value = this.filterColumnsPartial[column.field] || '';
  407. html.push("\n <div class=\"form-group row ".concat(theme.classes.formGroup || '', "\">\n <label class=\"col-sm-4 control-label\">").concat(title, "</label>\n <div class=\"col-sm-6\">\n <input type=\"text\" class=\"form-control ").concat(this.constants.classes.input, "\"\n name=\"").concat(column.field, "\" placeholder=\"").concat(title, "\" value=\"").concat(value, "\">\n </div>\n </div>\n "));
  408. }
  409. }
  410. } catch (err) {
  411. _iterator.e(err);
  412. } finally {
  413. _iterator.f();
  414. }
  415. html.push('</form>');
  416. return html.join('');
  417. }
  418. }, {
  419. key: "initSearch",
  420. value: function initSearch() {
  421. var _this3 = this;
  422. _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
  423. if (!this.options.advancedSearch || this.options.sidePagination === 'server') {
  424. return;
  425. }
  426. var fp = Utils.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  427. this.data = fp ? this.data.filter(function (item, i) {
  428. for (var _i = 0, _Object$entries = Object.entries(fp); _i < _Object$entries.length; _i++) {
  429. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  430. key = _Object$entries$_i[0],
  431. v = _Object$entries$_i[1];
  432. var val = v.toLowerCase();
  433. var value = item[key];
  434. var index = _this3.header.fields.indexOf(key);
  435. value = Utils.calculateObjectValue(_this3.header, _this3.header.formatters[index], [value, item, i], value);
  436. if (!(index !== -1 && (typeof value === 'string' || typeof value === 'number') && "".concat(value).toLowerCase().includes(val))) {
  437. return false;
  438. }
  439. }
  440. return true;
  441. }) : this.data;
  442. this.unsortedData = _toConsumableArray(this.data);
  443. }
  444. }, {
  445. key: "onColumnAdvancedSearch",
  446. value: function onColumnAdvancedSearch(e) {
  447. var text = $(e.currentTarget).val().trim();
  448. var field = $(e.currentTarget).attr('name');
  449. if (text) {
  450. this.filterColumnsPartial[field] = text;
  451. } else {
  452. delete this.filterColumnsPartial[field];
  453. }
  454. if (this.options.sidePagination !== 'server') {
  455. this.options.pageNumber = 1;
  456. this.initSearch();
  457. this.updatePagination();
  458. this.trigger('column-advanced-search', field, text);
  459. }
  460. }
  461. }]);
  462. }($.BootstrapTable);
  463. }));