datatables.net-searchbuilder-bs4
Version:
SearchBuilder for DataTables with styling for [Bootstrap4](https://getbootstrap.com/docs/4.6/getting-started/introduction/)
70 lines (61 loc) • 1.78 kB
JavaScript
/*! SearchBuilder Bootstrap 4 styling 2.0.0 for DataTables
* Copyright (c) SpryMedia Ltd - datatables.net/license
*/
(function(factory){
if (typeof define === 'function' && define.amd) {
// AMD
define(['datatables.net-bs4', 'datatables.net-searchbuilder'], function (dt) {
return factory(window, document, dt);
});
}
else if (typeof exports === 'object') {
// CommonJS
var cjsRequires = function (root) {
if (! root.DataTable) {
require('datatables.net-bs4')(root);
}
if (! window.DataTable.SearchBuilder) {
require('datatables.net-searchbuilder')(root);
}
};
if (typeof window === 'undefined') {
module.exports = function (root) {
if (! root) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
cjsRequires(root);
return factory(root, root.document, root.DataTable);
};
}
else {
cjsRequires(window);
module.exports = factory(window, window.document, window.DataTable);
}
}
else {
// Browser
factory(window, document, window.DataTable);
}
}(function(window, document, DataTable) {
;
Object.assign(DataTable.SearchBuilder.classes, {
clearAll: 'btn btn-light dtsb-clearAll'
});
Object.assign(DataTable.Group.classes, {
add: 'btn btn-light dtsb-add',
clearGroup: 'btn btn-light dtsb-clearGroup',
logic: 'btn btn-light dtsb-logic',
search: 'btn btn-light dtsb-search'
});
Object.assign(DataTable.Criteria.classes, {
condition: 'form-control dtsb-condition',
data: 'form-control dtsb-data',
delete: 'btn btn-light dtsb-delete',
left: 'btn btn-light dtsb-left',
right: 'btn btn-light dtsb-right',
value: 'form-control dtsb-value'
});
return DataTable;
}));