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.
4 lines
1.8 KiB
4 lines
1.8 KiB
2 years ago
|
/*! DataTables Bootstrap 4 integration
|
||
|
* ©2011-2017 SpryMedia Ltd - datatables.net/license
|
||
|
*/
|
||
|
import $ from"jquery";import DataTable from"datatables.net";$.extend(!0,DataTable.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),$.extend(DataTable.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),DataTable.ext.renderer.pageButton.bootstrap=function(i,a,d,e,n,c){function p(a,e){function t(a){a.preventDefault(),$(a.currentTarget).hasClass("disabled")||u.page()==a.data.action||u.page(a.data.action).draw("page")}for(var s,o,r=0,l=e.length;r<l;r++)if(o=e[r],Array.isArray(o))p(a,o);else{switch(m=b="",o){case"ellipsis":b="…",m="disabled";break;case"first":b=f.sFirst,m=o+(0<n?"":" disabled");break;case"previous":b=f.sPrevious,m=o+(0<n?"":" disabled");break;case"next":b=f.sNext,m=o+(n<c-1?"":" disabled");break;case"last":b=f.sLast,m=o+(n<c-1?"":" disabled");break;default:b=o+1,m=n===o?"active":""}b&&(s=$("<li>",{class:g.sPageButton+" "+m,id:0===d&&"string"==typeof o?i.sTableId+"_"+o:null}).append($("<a>",{href:"#","aria-controls":i.sTableId,"aria-label":x[o],"data-dt-idx":o,tabindex:i.iTabIndex,class:"page-link"}).html(b)).appendTo(a),i.oApi._fnBindAction(s,{action:o},t))}}var b,m,t,u=new DataTable.Api(i),g=i.oClasses,f=i.oLanguage.oPaginate,x=i.oLanguage.oAria.paginate||{};try{t=$(a).find(document.activeElement).data("dt-idx")}catch(a){}p($(a).empty().html('<ul class="pagination"/>').children("ul"),e),void 0!==t&&$(a).find("[data-dt-idx="+t+"]").trigger("focus")};export default DataTable;
|