You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

searchPanes.bootstrap4.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. (function (factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. // AMD
  4. define(['jquery', 'datatables.net-bs4', 'datatables.net-searchpanes'], function ($) {
  5. return factory($, window, document);
  6. });
  7. } else if (typeof exports === 'object') {
  8. // CommonJS
  9. module.exports = function (root, $) {
  10. if (!root) {
  11. root = window;
  12. }
  13. if (!$ || !$.fn.dataTable) {
  14. $ = require('datatables.net-bs4')(root, $).$;
  15. }
  16. console.log($.fn.dataTable);
  17. if (!$.fn.dataTable.SearchPanes) {
  18. console.log("not present");
  19. require('datatables.net-searchpanes')(root, $);
  20. }
  21. return factory($, root, root.document);
  22. };
  23. } else {
  24. // Browser
  25. factory(jQuery, window, document);
  26. }
  27. }(function ($, window, document) {
  28. 'use strict';
  29. var DataTable = $.fn.dataTable;
  30. $.extend(true, DataTable.SearchPane.classes, {
  31. buttonGroup: 'btn-group col justify-content-end',
  32. disabledButton: 'disabled',
  33. dull: '',
  34. narrow: 'col',
  35. pane: {
  36. container: 'table'
  37. },
  38. paneButton: 'btn btn-light',
  39. pill: 'pill badge badge-pill badge-secondary',
  40. search: 'col-sm form-control search',
  41. searchCont: 'input-group col-sm',
  42. searchLabelCont: 'input-group-append',
  43. subRow1: 'dtsp-subRow1',
  44. subRow2: 'dtsp-subRow2',
  45. table: 'table table-sm table-borderless',
  46. topRow: 'dtsp-topRow row'
  47. });
  48. $.extend(true, DataTable.SearchPanes.classes, {
  49. clearAll: 'dtsp-clearAll col-auto btn btn-light',
  50. container: 'dtsp-searchPanes',
  51. panes: 'dtsp-panes dtsp-container',
  52. title: 'dtsp-title col',
  53. titleRow: 'dtsp-titleRow row'
  54. });
  55. return DataTable.searchPanes;
  56. }));