searchPanes.bootstrap.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. (function (factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. // AMD
  4. define(['jquery', 'datatables.net-bs', 'datatables.net-searchpanes'], function ($) {
  5. return factory($);
  6. });
  7. }
  8. else if (typeof exports === 'object') {
  9. // CommonJS
  10. module.exports = function (root, $) {
  11. if (!root) {
  12. root = window;
  13. }
  14. if (!$ || !$.fn.dataTable) {
  15. // eslint-disable-next-line @typescript-eslint/no-var-requires
  16. $ = require('datatables.net-bs')(root, $).$;
  17. }
  18. if (!$.fn.dataTable.SearchPanes) {
  19. // eslint-disable-next-line @typescript-eslint/no-var-requires
  20. require('datatables.net-searchpanes')(root, $);
  21. }
  22. return factory($);
  23. };
  24. }
  25. else {
  26. // Browser
  27. factory(jQuery);
  28. }
  29. }(function ($) {
  30. 'use strict';
  31. var dataTable = $.fn.dataTable;
  32. $.extend(true, dataTable.SearchPane.classes, {
  33. buttonGroup: 'btn-group',
  34. disabledButton: 'disabled',
  35. narrow: 'col narrow',
  36. narrowSub: 'row',
  37. pane: {
  38. container: 'table'
  39. },
  40. paneButton: 'btn btn-light',
  41. pill: 'badge badge-pill badge-light pill',
  42. search: 'col-sm form-control search',
  43. searchCont: 'input-group dtsp-searchCont',
  44. searchLabelCont: 'input-group-btn',
  45. subRow1: 'dtsp-subRow1 text-right',
  46. subRow2: 'dtsp-subRow2 text-right',
  47. table: 'table table-condensed'
  48. });
  49. $.extend(true, dataTable.SearchPanes.classes, {
  50. clearAll: 'dtsp-clearAll btn btn-light',
  51. collapseAll: 'dtsp-collapseAll btn btn-light',
  52. disabledButton: 'disabled',
  53. showAll: 'dtsp-showAll btn btn-light'
  54. });
  55. return dataTable.searchPanes;
  56. }));