1/*! DataTables Bootstrap 5 integration 2 * © SpryMedia Ltd - datatables.net/license 3 */ 4 5(function (factory) { 6 if (typeof define === 'function' && define.amd) { 7 // AMD 8 define(['jquery', 'datatables.net'], function ($) { 9 return factory($, window, document); 10 }); 11 } 12 else if (typeof exports === 'object') { 13 // CommonJS 14 var jq = require('jquery'); 15 var cjsRequires = function (root, $) { 16 if (!$.fn.dataTable) { 17 require('datatables.net')(root, $); 18 } 19 }; 20 21 if (typeof window === 'undefined') { 22 module.exports = function (root, $) { 23 if (!root) { 24 // CommonJS environments without a window global must pass a 25 // root. This will give an error otherwise 26 root = window; 27 } 28 29 if (!$) { 30 $ = jq(root); 31 } 32 33 cjsRequires(root, $); 34 return factory($, root, root.document); 35 }; 36 } 37 else { 38 cjsRequires(window, jq); 39 module.exports = factory(jq, window, window.document); 40 } 41 } 42 else { 43 // Browser 44 factory(jQuery, window, document); 45 } 46}(function ($, window, document) { 47 'use strict'; 48 var DataTable = $.fn.dataTable; 49 50 51 52 /** 53 * DataTables integration for Bootstrap 5. 54 * 55 * This file sets the defaults and adds options to DataTables to style its 56 * controls using Bootstrap. See https://datatables.net/manual/styling/bootstrap 57 * for further information. 58 */ 59 60 /* Set the defaults for DataTables initialisation */ 61 $.extend(true, DataTable.defaults, { 62 renderer: 'bootstrap' 63 }); 64 65 66 /* Default class modification */ 67 $.extend(true, DataTable.ext.classes, { 68 container: "dt-container dt-bootstrap5", 69 search: { 70 input: "form-control form-control-sm" 71 }, 72 length: { 73 select: "form-select form-select-sm" 74 }, 75 processing: { 76 container: "dt-processing card" 77 }, 78 layout: { 79 row: 'row mt-2 justify-content-between', 80 cell: 'd-md-flex justify-content-between align-items-center', 81 tableCell: 'col-12', 82 start: 'dt-layout-start col-md-auto me-auto', 83 end: 'dt-layout-end col-md-auto ms-auto', 84 full: 'dt-layout-full col-md' 85 } 86 }); 87 88 89 /* Bootstrap paging button renderer */ 90 DataTable.ext.renderer.pagingButton.bootstrap = function (settings, buttonType, content, active, disabled) { 91 var btnClasses = ['dt-paging-button', 'page-item']; 92 93 if (active) { 94 btnClasses.push('active'); 95 } 96 97 if (disabled) { 98 btnClasses.push('disabled') 99 } 100 101 var li = $('<li>').addClass(btnClasses.join(' ')); 102 var a = $('<button>', { 103 'class': 'page-link', 104 role: 'link', 105 type: 'button' 106 }) 107 .html(content) 108 .appendTo(li); 109 110 return { 111 display: li, 112 clicker: a 113 }; 114 }; 115 116 DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls) { 117 return $('<ul/>').addClass('pagination').append(buttonEls); 118 }; 119 120 121 return DataTable; 122}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.