dataTables.bootstrap5.min.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*!
  2. DataTables Bootstrap 5 integration
  3. 2020 SpryMedia Ltd - datatables.net/license
  4. */
  5. var $jscomp = $jscomp || {};
  6. $jscomp.scope = {};
  7. $jscomp.findInternal = function(a, b, c) {
  8. a instanceof String && (a = String(a));
  9. for (var e = a.length, d = 0; d < e; d++) {
  10. var f = a[d];
  11. if (b.call(c, f, d, a)) return {
  12. i: d,
  13. v: f
  14. }
  15. }
  16. return {
  17. i: -1,
  18. v: void 0
  19. }
  20. };
  21. $jscomp.ASSUME_ES5 = !1;
  22. $jscomp.ASSUME_NO_NATIVE_MAP = !1;
  23. $jscomp.ASSUME_NO_NATIVE_SET = !1;
  24. $jscomp.SIMPLE_FROUND_POLYFILL = !1;
  25. $jscomp.ISOLATE_POLYFILLS = !1;
  26. $jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
  27. if (a == Array.prototype || a == Object.prototype) return a;
  28. a[b] = c.value;
  29. return a
  30. };
  31. $jscomp.getGlobal = function(a) {
  32. a = ["object" == typeof globalThis && globalThis, a, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global];
  33. for (var b = 0; b < a.length; ++b) {
  34. var c = a[b];
  35. if (c && c.Math == Math) return c
  36. }
  37. throw Error("Cannot find global object");
  38. };
  39. $jscomp.global = $jscomp.getGlobal(this);
  40. $jscomp.IS_SYMBOL_NATIVE = "function" === typeof Symbol && "symbol" === typeof Symbol("x");
  41. $jscomp.TRUST_ES6_POLYFILLS = !$jscomp.ISOLATE_POLYFILLS || $jscomp.IS_SYMBOL_NATIVE;
  42. $jscomp.polyfills = {};
  43. $jscomp.propertyToPolyfillSymbol = {};
  44. $jscomp.POLYFILL_PREFIX = "$jscp$";
  45. var $jscomp$lookupPolyfilledValue = function(a, b) {
  46. var c = $jscomp.propertyToPolyfillSymbol[b];
  47. if (null == c) return a[b];
  48. c = a[c];
  49. return void 0 !== c ? c : a[b]
  50. };
  51. $jscomp.polyfill = function(a, b, c, e) {
  52. b && ($jscomp.ISOLATE_POLYFILLS ? $jscomp.polyfillIsolated(a, b, c, e) : $jscomp.polyfillUnisolated(a, b, c, e))
  53. };
  54. $jscomp.polyfillUnisolated = function(a, b, c, e) {
  55. c = $jscomp.global;
  56. a = a.split(".");
  57. for (e = 0; e < a.length - 1; e++) {
  58. var d = a[e];
  59. if (!(d in c)) return;
  60. c = c[d]
  61. }
  62. a = a[a.length - 1];
  63. e = c[a];
  64. b = b(e);
  65. b != e && null != b && $jscomp.defineProperty(c, a, {
  66. configurable: !0,
  67. writable: !0,
  68. value: b
  69. })
  70. };
  71. $jscomp.polyfillIsolated = function(a, b, c, e) {
  72. var d = a.split(".");
  73. a = 1 === d.length;
  74. e = d[0];
  75. e = !a && e in $jscomp.polyfills ? $jscomp.polyfills : $jscomp.global;
  76. for (var f = 0; f < d.length - 1; f++) {
  77. var l = d[f];
  78. if (!(l in e)) return;
  79. e = e[l]
  80. }
  81. d = d[d.length - 1];
  82. c = $jscomp.IS_SYMBOL_NATIVE && "es6" === c ? e[d] : null;
  83. b = b(c);
  84. null != b && (a ? $jscomp.defineProperty($jscomp.polyfills, d, {
  85. configurable: !0,
  86. writable: !0,
  87. value: b
  88. }) : b !== c && ($jscomp.propertyToPolyfillSymbol[d] = $jscomp.IS_SYMBOL_NATIVE ? $jscomp.global.Symbol(d) : $jscomp.POLYFILL_PREFIX + d, d = $jscomp.propertyToPolyfillSymbol[d], $jscomp.defineProperty(e, d, {
  89. configurable: !0,
  90. writable: !0,
  91. value: b
  92. })))
  93. };
  94. $jscomp.polyfill("Array.prototype.find", function(a) {
  95. return a ? a : function(b, c) {
  96. return $jscomp.findInternal(this, b, c).v
  97. }
  98. }, "es6", "es3");
  99. (function(a) {
  100. "function" === typeof define && define.amd ? define(["jquery", "datatables.net"], function(b) {
  101. return a(b, window, document)
  102. }) : "object" === typeof exports ? module.exports = function(b, c) {
  103. b || (b = window);
  104. c && c.fn.dataTable || (c = require("datatables.net")(b, c).$);
  105. return a(c, b, b.document)
  106. } : a(jQuery, window, document)
  107. })(function(a, b, c, e) {
  108. var d = a.fn.dataTable;
  109. a.extend(!0, d.defaults, {
  110. 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>>",
  111. renderer: "bootstrap"
  112. });
  113. a.extend(d.ext.classes, {
  114. sWrapper: "dataTables_wrapper dt-bootstrap5",
  115. sFilterInput: "form-control form-control-sm",
  116. sLengthSelect: "form-select form-select-sm",
  117. sProcessing: "dataTables_processing card",
  118. sPageButton: "paginate_button page-item"
  119. });
  120. d.ext.renderer.pageButton.bootstrap = function(f, l, A, B, m, t) {
  121. var u = new d.Api(f),
  122. C = f.oClasses,
  123. n = f.oLanguage.oPaginate,
  124. D = f.oLanguage.oAria.paginate || {},
  125. h, k, v = 0,
  126. y = function(q, w) {
  127. var x, E = function(p) {
  128. p.preventDefault();
  129. a(p.currentTarget).hasClass("disabled") || u.page() == p.data.action || u.page(p.data.action).draw("page")
  130. };
  131. var r = 0;
  132. for (x = w.length; r < x; r++) {
  133. var g = w[r];
  134. if (Array.isArray(g)) y(q, g);
  135. else {
  136. k = h = "";
  137. switch (g) {
  138. case "ellipsis":
  139. h = "&#x2026;";
  140. k = "disabled";
  141. break;
  142. case "first":
  143. h = n.sFirst;
  144. k = g + (0 < m ? "" : " disabled");
  145. break;
  146. case "previous":
  147. h = n.sPrevious;
  148. k = g + (0 < m ? "" : " disabled");
  149. break;
  150. case "next":
  151. h = n.sNext;
  152. k = g + (m < t - 1 ? "" : " disabled");
  153. break;
  154. case "last":
  155. h = n.sLast;
  156. k = g + (m < t - 1 ? "" : " disabled");
  157. break;
  158. default:
  159. h = g + 1, k = m === g ? "active" : ""
  160. }
  161. if (h) {
  162. var F = a("<li>", {
  163. "class": C.sPageButton + " " + k,
  164. id: 0 === A && "string" === typeof g ? f.sTableId + "_" + g : null
  165. }).append(a("<a>", {
  166. href: "#",
  167. "aria-controls": f.sTableId,
  168. "aria-label": D[g],
  169. "data-dt-idx": v,
  170. tabindex: f.iTabIndex,
  171. "class": "page-link"
  172. }).html(h)).appendTo(q);
  173. f.oApi._fnBindAction(F, {
  174. action: g
  175. }, E);
  176. v++
  177. }
  178. }
  179. }
  180. };
  181. try {
  182. var z = a(l).find(c.activeElement).data("dt-idx")
  183. } catch (q) {}
  184. y(a(l).empty().html('<ul class="pagination"/>').children("ul"), B);
  185. z !== e && a(l).find("[data-dt-idx=" + z + "]").trigger("focus")
  186. };
  187. return d
  188. });