searchPanes.bootstrap5.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*! Bootstrap 5 integration for DataTables' SearchPanes
  2. * ©2016 SpryMedia Ltd - datatables.net/license
  3. */
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. // AMD
  7. define(['jquery', 'datatables.net-bs5', 'datatables.net-searchpanes'], function ($) {
  8. return factory($);
  9. });
  10. }
  11. else if (typeof exports === 'object') {
  12. // CommonJS
  13. module.exports = function (root, $) {
  14. if (!root) {
  15. root = window;
  16. }
  17. if (!$ || !$.fn.dataTable) {
  18. // eslint-disable-next-line @typescript-eslint/no-var-requires
  19. $ = require('datatables.net-bs5')(root, $).$;
  20. }
  21. if (!$.fn.dataTable.SearchPanes) {
  22. // eslint-disable-next-line @typescript-eslint/no-var-requires
  23. require('datatables.net-searchpanes')(root, $);
  24. }
  25. return factory($);
  26. };
  27. }
  28. else {
  29. // Browser
  30. factory(jQuery);
  31. }
  32. }(function ($) {
  33. 'use strict';
  34. var dataTable = $.fn.dataTable;
  35. $.extend(true, dataTable.SearchPane.classes, {
  36. buttonGroup: 'btn-group',
  37. disabledButton: 'disabled',
  38. narrow: 'col',
  39. pane: {
  40. container: 'table'
  41. },
  42. paneButton: 'btn btn-light',
  43. pill: 'badge rounded-pill bg-secondary',
  44. search: 'form-control search',
  45. table: 'table table-sm table-borderless',
  46. topRow: 'dtsp-topRow'
  47. });
  48. $.extend(true, dataTable.SearchPanes.classes, {
  49. clearAll: 'dtsp-clearAll btn btn-light',
  50. collapseAll: 'dtsp-collapseAll btn btn-light',
  51. container: 'dtsp-searchPanes',
  52. disabledButton: 'disabled',
  53. panes: 'dtsp-panes dtsp-panesContainer',
  54. showAll: 'dtsp-showAll btn btn-light',
  55. title: 'dtsp-title',
  56. titleRow: 'dtsp-titleRow'
  57. });
  58. return dataTable.searchPanes;
  59. }));