AdminLTE/plugins/datatables-searchpanes/js/searchPanes.bootstrap4.js
2020-11-24 09:38:21 +01:00

59 lines
1.9 KiB
JavaScript

(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'datatables.net-bs4', 'datatables.net-searchpanes'], function ($) {
return factory($, window, document);
});
}
else if (typeof exports === 'object') {
// CommonJS
module.exports = function (root, $) {
if (!root) {
root = window;
}
if (!$ || !$.fn.dataTable) {
$ = require('datatables.net-bs4')(root, $).$;
}
console.log($.fn.dataTable);
if (!$.fn.dataTable.SearchPanes) {
console.log("not present");
require('datatables.net-searchpanes')(root, $);
}
return factory($, root, root.document);
};
}
else {
// Browser
factory(jQuery, window, document);
}
}(function ($, window, document) {
'use strict';
var DataTable = $.fn.dataTable;
$.extend(true, DataTable.SearchPane.classes, {
buttonGroup: 'btn-group col justify-content-end',
disabledButton: 'disabled',
dull: '',
narrow: 'col',
pane: {
container: 'table'
},
paneButton: 'btn btn-light',
pill: 'pill badge badge-pill badge-secondary',
search: 'col-sm form-control search',
searchCont: 'input-group col-sm',
searchLabelCont: 'input-group-append',
subRow1: 'dtsp-subRow1',
subRow2: 'dtsp-subRow2',
table: 'table table-sm table-borderless',
topRow: 'dtsp-topRow row'
});
$.extend(true, DataTable.SearchPanes.classes, {
clearAll: 'dtsp-clearAll col-auto btn btn-light',
container: 'dtsp-searchPanes',
panes: 'dtsp-panes dtsp-container',
title: 'dtsp-title col',
titleRow: 'dtsp-titleRow row'
});
return DataTable.searchPanes;
}));