dataTables.buttons.min.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*!
  2. Buttons for DataTables 1.6.4
  3. ©2016-2020 SpryMedia Ltd - datatables.net/license
  4. */
  5. (function (e) { "function" === typeof define && define.amd ? define(["jquery", "datatables.net"], function (A) { return e(A, window, document) }) : "object" === typeof exports ? module.exports = function (A, z) { A || (A = window); z && z.fn.dataTable || (z = require("datatables.net")(A, z).$); return e(z, A, A.document) } : e(jQuery, window, document) })(function (e, A, z, u) {
  6. function E(a, b, c) { e.fn.animate ? a.stop().fadeIn(b, c) : (a.css("display", "block"), c && c.call(a)) } function F(a, b, c) { e.fn.animate ? a.stop().fadeOut(b, c) : (a.css("display", "none"), c && c.call(a)) }
  7. function H(a, b) { a = new t.Api(a); b = b ? b : a.init().buttons || t.defaults.buttons; return (new w(a, b)).container() } var t = e.fn.dataTable, M = 0, N = 0, x = t.ext.buttons, w = function (a, b) {
  8. if (!(this instanceof w)) return function (c) { return (new w(c, a)).container() }; "undefined" === typeof b && (b = {}); !0 === b && (b = {}); Array.isArray(b) && (b = { buttons: b }); this.c = e.extend(!0, {}, w.defaults, b); b.buttons && (this.c.buttons = b.buttons); this.s = { dt: new t.Api(a), buttons: [], listenKeys: "", namespace: "dtb" + M++ }; this.dom = {
  9. container: e("<" + this.c.dom.container.tag +
  10. "/>").addClass(this.c.dom.container.className)
  11. }; this._constructor()
  12. }; e.extend(w.prototype, {
  13. action: function (a, b) { a = this._nodeToButton(a); if (b === u) return a.conf.action; a.conf.action = b; return this }, active: function (a, b) { var c = this._nodeToButton(a); a = this.c.dom.button.active; c = e(c.node); if (b === u) return c.hasClass(a); c.toggleClass(a, b === u ? !0 : b); return this }, add: function (a, b) {
  14. var c = this.s.buttons; if ("string" === typeof b) {
  15. b = b.split("-"); var d = this.s; c = 0; for (var h = b.length - 1; c < h; c++)d = d.buttons[1 * b[c]]; c = d.buttons;
  16. b = 1 * b[b.length - 1]
  17. } this._expandButton(c, a, d !== u, b); this._draw(); return this
  18. }, container: function () { return this.dom.container }, disable: function (a) { a = this._nodeToButton(a); e(a.node).addClass(this.c.dom.button.disabled).attr("disabled", !0); return this }, destroy: function () {
  19. e("body").off("keyup." + this.s.namespace); var a = this.s.buttons.slice(), b; var c = 0; for (b = a.length; c < b; c++)this.remove(a[c].node); this.dom.container.remove(); a = this.s.dt.settings()[0]; c = 0; for (b = a.length; c < b; c++)if (a.inst === this) {
  20. a.splice(c,
  21. 1); break
  22. } return this
  23. }, enable: function (a, b) { if (!1 === b) return this.disable(a); a = this._nodeToButton(a); e(a.node).removeClass(this.c.dom.button.disabled).removeAttr("disabled"); return this }, name: function () { return this.c.name }, node: function (a) { if (!a) return this.dom.container; a = this._nodeToButton(a); return e(a.node) }, processing: function (a, b) {
  24. var c = this.s.dt, d = this._nodeToButton(a); if (b === u) return e(d.node).hasClass("processing"); e(d.node).toggleClass("processing", b); e(c.table().node()).triggerHandler("buttons-processing.dt",
  25. [b, c.button(a), c, e(a), d.conf]); return this
  26. }, remove: function (a) { var b = this._nodeToButton(a), c = this._nodeToHost(a), d = this.s.dt; if (b.buttons.length) for (var h = b.buttons.length - 1; 0 <= h; h--)this.remove(b.buttons[h].node); b.conf.destroy && b.conf.destroy.call(d.button(a), d, e(a), b.conf); this._removeKey(b.conf); e(b.node).remove(); a = e.inArray(b, c); c.splice(a, 1); return this }, text: function (a, b) {
  27. var c = this._nodeToButton(a); a = this.c.dom.collection.buttonLiner; a = c.inCollection && a && a.tag ? a.tag : this.c.dom.buttonLiner.tag;
  28. var d = this.s.dt, h = e(c.node), f = function (k) { return "function" === typeof k ? k(d, h, c.conf) : k }; if (b === u) return f(c.conf.text); c.conf.text = b; a ? h.children(a).html(f(b)) : h.html(f(b)); return this
  29. }, _constructor: function () {
  30. var a = this, b = this.s.dt, c = b.settings()[0], d = this.c.buttons; c._buttons || (c._buttons = []); c._buttons.push({ inst: this, name: this.c.name }); for (var h = 0, f = d.length; h < f; h++)this.add(d[h]); b.on("destroy", function (k, g) { g === c && a.destroy() }); e("body").on("keyup." + this.s.namespace, function (k) {
  31. if (!z.activeElement ||
  32. z.activeElement === z.body) { var g = String.fromCharCode(k.keyCode).toLowerCase(); -1 !== a.s.listenKeys.toLowerCase().indexOf(g) && a._keypress(g, k) }
  33. })
  34. }, _addKey: function (a) { a.key && (this.s.listenKeys += e.isPlainObject(a.key) ? a.key.key : a.key) }, _draw: function (a, b) { a || (a = this.dom.container, b = this.s.buttons); a.children().detach(); for (var c = 0, d = b.length; c < d; c++)a.append(b[c].inserter), a.append(" "), b[c].buttons && b[c].buttons.length && this._draw(b[c].collection, b[c].buttons) }, _expandButton: function (a, b, c, d) {
  35. var h =
  36. this.s.dt, f = 0; b = Array.isArray(b) ? b : [b]; for (var k = 0, g = b.length; k < g; k++) { var m = this._resolveExtends(b[k]); if (m) if (Array.isArray(m)) this._expandButton(a, m, c, d); else { var l = this._buildButton(m, c); l && (d !== u && null !== d ? (a.splice(d, 0, l), d++) : a.push(l), l.conf.buttons && (l.collection = e("<" + this.c.dom.collection.tag + "/>"), l.conf._collection = l.collection, this._expandButton(l.buttons, l.conf.buttons, !0, d)), m.init && m.init.call(h.button(l.node), h, e(l.node), m), f++) } }
  37. }, _buildButton: function (a, b) {
  38. var c = this.c.dom.button,
  39. d = this.c.dom.buttonLiner, h = this.c.dom.collection, f = this.s.dt, k = function (n) { return "function" === typeof n ? n(f, l, a) : n }; b && h.button && (c = h.button); b && h.buttonLiner && (d = h.buttonLiner); if (a.available && !a.available(f, a)) return !1; var g = function (n, p, v, y) { y.action.call(p.button(v), n, p, v, y); e(p.table().node()).triggerHandler("buttons-action.dt", [p.button(v), p, v, y]) }; h = a.tag || c.tag; var m = a.clickBlurs === u ? !0 : a.clickBlurs, l = e("<" + h + "/>").addClass(c.className).attr("tabindex", this.s.dt.settings()[0].iTabIndex).attr("aria-controls",
  40. this.s.dt.table().node().id).on("click.dtb", function (n) { n.preventDefault(); !l.hasClass(c.disabled) && a.action && g(n, f, l, a); m && l.trigger("blur") }).on("keyup.dtb", function (n) { 13 === n.keyCode && !l.hasClass(c.disabled) && a.action && g(n, f, l, a) }); "a" === h.toLowerCase() && l.attr("href", "#"); "button" === h.toLowerCase() && l.attr("type", "button"); d.tag ? (h = e("<" + d.tag + "/>").html(k(a.text)).addClass(d.className), "a" === d.tag.toLowerCase() && h.attr("href", "#"), l.append(h)) : l.html(k(a.text)); !1 === a.enabled && l.addClass(c.disabled);
  41. a.className && l.addClass(a.className); a.titleAttr && l.attr("title", k(a.titleAttr)); a.attr && l.attr(a.attr); a.namespace || (a.namespace = ".dt-button-" + N++); d = (d = this.c.dom.buttonContainer) && d.tag ? e("<" + d.tag + "/>").addClass(d.className).append(l) : l; this._addKey(a); this.c.buttonCreated && (d = this.c.buttonCreated(a, d)); return { conf: a, node: l.get(0), inserter: d, buttons: [], inCollection: b, collection: null }
  42. }, _nodeToButton: function (a, b) {
  43. b || (b = this.s.buttons); for (var c = 0, d = b.length; c < d; c++) {
  44. if (b[c].node === a) return b[c];
  45. if (b[c].buttons.length) { var h = this._nodeToButton(a, b[c].buttons); if (h) return h }
  46. }
  47. }, _nodeToHost: function (a, b) { b || (b = this.s.buttons); for (var c = 0, d = b.length; c < d; c++) { if (b[c].node === a) return b; if (b[c].buttons.length) { var h = this._nodeToHost(a, b[c].buttons); if (h) return h } } }, _keypress: function (a, b) {
  48. if (!b._buttonsHandled) {
  49. var c = function (d) {
  50. for (var h = 0, f = d.length; h < f; h++) {
  51. var k = d[h].conf, g = d[h].node; k.key && (k.key === a ? (b._buttonsHandled = !0, e(g).click()) : !e.isPlainObject(k.key) || k.key.key !== a || k.key.shiftKey &&
  52. !b.shiftKey || k.key.altKey && !b.altKey || k.key.ctrlKey && !b.ctrlKey || k.key.metaKey && !b.metaKey || (b._buttonsHandled = !0, e(g).click())); d[h].buttons.length && c(d[h].buttons)
  53. }
  54. }; c(this.s.buttons)
  55. }
  56. }, _removeKey: function (a) { if (a.key) { var b = e.isPlainObject(a.key) ? a.key.key : a.key; a = this.s.listenKeys.split(""); b = e.inArray(b, a); a.splice(b, 1); this.s.listenKeys = a.join("") } }, _resolveExtends: function (a) {
  57. var b = this.s.dt, c, d = function (g) {
  58. for (var m = 0; !e.isPlainObject(g) && !Array.isArray(g);) {
  59. if (g === u) return; if ("function" ===
  60. typeof g) { if (g = g(b, a), !g) return !1 } else if ("string" === typeof g) { if (!x[g]) throw "Unknown button type: " + g; g = x[g] } m++; if (30 < m) throw "Buttons: Too many iterations";
  61. } return Array.isArray(g) ? g : e.extend({}, g)
  62. }; for (a = d(a); a && a.extend;) {
  63. if (!x[a.extend]) throw "Cannot extend unknown button type: " + a.extend; var h = d(x[a.extend]); if (Array.isArray(h)) return h; if (!h) return !1; var f = h.className; a = e.extend({}, h, a); f && a.className !== f && (a.className = f + " " + a.className); var k = a.postfixButtons; if (k) {
  64. a.buttons || (a.buttons = []);
  65. f = 0; for (c = k.length; f < c; f++)a.buttons.push(k[f]); a.postfixButtons = null
  66. } if (k = a.prefixButtons) { a.buttons || (a.buttons = []); f = 0; for (c = k.length; f < c; f++)a.buttons.splice(f, 0, k[f]); a.prefixButtons = null } a.extend = h.extend
  67. } return a
  68. }, _popover: function (a, b, c) {
  69. var d = this.c, h = e.extend({
  70. align: "button-left", autoClose: !1, background: !0, backgroundClassName: "dt-button-background", contentClassName: d.dom.collection.className, collectionLayout: "", collectionTitle: "", dropup: !1, fade: 400, rightAlignClassName: "dt-button-right",
  71. tag: d.dom.collection.tag
  72. }, c), f = b.node(), k = function () { F(e(".dt-button-collection"), h.fade, function () { e(this).detach() }); e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes()).attr("aria-expanded", "false"); e("div.dt-button-background").off("click.dtb-collection"); w.background(!1, h.backgroundClassName, h.fade, f); e("body").off(".dtb-collection"); b.off("buttons-action.b-internal") }; !1 === a && k(); c = e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes()); c.length && (f = c.eq(0), k());
  73. c = e("<div/>").addClass("dt-button-collection").addClass(h.collectionLayout).css("display", "none"); a = e(a).addClass(h.contentClassName).attr("role", "menu").appendTo(c); f.attr("aria-expanded", "true"); f.parents("body")[0] !== z.body && (f = z.body.lastChild); h.collectionTitle && c.prepend('<div class="dt-button-collection-title">' + h.collectionTitle + "</div>"); E(c.insertAfter(f), h.fade); d = e(b.table().container()); var g = c.css("position"); "dt-container" === h.align && (f = f.parent(), c.css("width", d.width())); if ("absolute" ===
  74. g && (c.hasClass(h.rightAlignClassName) || c.hasClass(h.leftAlignClassName) || "dt-container" === h.align)) {
  75. var m = f.position(); c.css({ top: m.top + f.outerHeight(), left: m.left }); var l = c.outerHeight(), n = d.offset().top + d.height(), p = m.top + f.outerHeight() + l; n = p - n; p = m.top - l; var v = d.offset().top, y = m.top - l - 5; (n > v - p || h.dropup) && -y < v && c.css("top", y); m = d.offset().left; d = d.width(); d = m + d; g = c.offset().left; var q = c.width(); q = g + q; var r = f.offset().left, B = f.outerWidth(); B = r + B; r = 0; c.hasClass(h.rightAlignClassName) ? (r = B - q, m > g +
  76. r && (g = m - (g + r), d -= q + r, r = g > d ? r + d : r + g)) : (r = m - g, d < q + r && (g = m - (g + r), d -= q + r, r = g > d ? r + d : r + g)); c.css("left", c.position().left + r)
  77. } else "absolute" === g ? (m = f.position(), c.css({ top: m.top + f.outerHeight(), left: m.left }), l = c.outerHeight(), g = f.offset().top, r = 0, r = f.offset().left, B = f.outerWidth(), B = r + B, g = c.offset().left, q = a.width(), q = g + q, y = m.top - l - 5, n = d.offset().top + d.height(), p = m.top + f.outerHeight() + l, n = p - n, p = m.top - l, v = d.offset().top, (n > v - p || h.dropup) && -y < v && c.css("top", y), r = "button-right" === h.align ? B - q : r - g, c.css("left",
  78. c.position().left + r)) : (g = c.height() / 2, g > e(A).height() / 2 && (g = e(A).height() / 2), c.css("marginTop", -1 * g)); h.background && w.background(!0, h.backgroundClassName, h.fade, f); e("div.dt-button-background").on("click.dtb-collection", function () { }); e("body").on("click.dtb-collection", function (C) { var I = e.fn.addBack ? "addBack" : "andSelf", J = e(C.target).parent()[0]; (!e(C.target).parents()[I]().filter(a).length && !e(J).hasClass("dt-buttons") || e(C.target).hasClass("dt-button-background")) && k() }).on("keyup.dtb-collection",
  79. function (C) { 27 === C.keyCode && k() }); h.autoClose && setTimeout(function () { b.on("buttons-action.b-internal", function (C, I, J, O) { O[0] !== f[0] && k() }) }, 0); e(c).trigger("buttons-popover.dt")
  80. }
  81. }); w.background = function (a, b, c, d) { c === u && (c = 400); d || (d = z.body); a ? E(e("<div/>").addClass(b).css("display", "none").insertAfter(d), c) : F(e("div." + b), c, function () { e(this).removeClass(b).remove() }) }; w.instanceSelector = function (a, b) {
  82. if (a === u || null === a) return e.map(b, function (f) { return f.inst }); var c = [], d = e.map(b, function (f) { return f.name }),
  83. h = function (f) { if (Array.isArray(f)) for (var k = 0, g = f.length; k < g; k++)h(f[k]); else "string" === typeof f ? -1 !== f.indexOf(",") ? h(f.split(",")) : (f = e.inArray(f.trim(), d), -1 !== f && c.push(b[f].inst)) : "number" === typeof f && c.push(b[f].inst) }; h(a); return c
  84. }; w.buttonSelector = function (a, b) {
  85. for (var c = [], d = function (g, m, l) { for (var n, p, v = 0, y = m.length; v < y; v++)if (n = m[v]) p = l !== u ? l + v : v + "", g.push({ node: n.node, name: n.conf.name, idx: p }), n.buttons && d(g, n.buttons, p + "-") }, h = function (g, m) {
  86. var l, n = []; d(n, m.s.buttons); var p = e.map(n, function (v) { return v.node });
  87. if (Array.isArray(g) || g instanceof e) for (p = 0, l = g.length; p < l; p++)h(g[p], m); else if (null === g || g === u || "*" === g) for (p = 0, l = n.length; p < l; p++)c.push({ inst: m, node: n[p].node }); else if ("number" === typeof g) c.push({ inst: m, node: m.s.buttons[g].node }); else if ("string" === typeof g) if (-1 !== g.indexOf(",")) for (n = g.split(","), p = 0, l = n.length; p < l; p++)h(n[p].trim(), m); else if (g.match(/^\d+(\-\d+)*$/)) p = e.map(n, function (v) { return v.idx }), c.push({ inst: m, node: n[e.inArray(g, p)].node }); else if (-1 !== g.indexOf(":name")) for (g = g.replace(":name",
  88. ""), p = 0, l = n.length; p < l; p++)n[p].name === g && c.push({ inst: m, node: n[p].node }); else e(p).filter(g).each(function () { c.push({ inst: m, node: this }) }); else "object" === typeof g && g.nodeName && (n = e.inArray(g, p), -1 !== n && c.push({ inst: m, node: p[n] }))
  89. }, f = 0, k = a.length; f < k; f++)h(b, a[f]); return c
  90. }; w.defaults = {
  91. buttons: ["copy", "excel", "csv", "pdf", "print"], name: "main", tabIndex: 0, dom: {
  92. container: { tag: "div", className: "dt-buttons" }, collection: { tag: "div", className: "" }, button: {
  93. tag: "ActiveXObject" in A ? "a" : "button", className: "dt-button",
  94. active: "active", disabled: "disabled"
  95. }, buttonLiner: { tag: "span", className: "" }
  96. }
  97. }; w.version = "1.6.4"; e.extend(x, {
  98. collection: { text: function (a) { return a.i18n("buttons.collection", "Collection") }, className: "buttons-collection", init: function (a, b, c) { b.attr("aria-expanded", !1) }, action: function (a, b, c, d) { a.stopPropagation(); d._collection.parents("body").length ? this.popover(!1, d) : this.popover(d._collection, d) }, attr: { "aria-haspopup": !0 } }, copy: function (a, b) {
  99. if (x.copyHtml5) return "copyHtml5"; if (x.copyFlash && x.copyFlash.available(a,
  100. b)) return "copyFlash"
  101. }, csv: function (a, b) { if (x.csvHtml5 && x.csvHtml5.available(a, b)) return "csvHtml5"; if (x.csvFlash && x.csvFlash.available(a, b)) return "csvFlash" }, excel: function (a, b) { if (x.excelHtml5 && x.excelHtml5.available(a, b)) return "excelHtml5"; if (x.excelFlash && x.excelFlash.available(a, b)) return "excelFlash" }, pdf: function (a, b) { if (x.pdfHtml5 && x.pdfHtml5.available(a, b)) return "pdfHtml5"; if (x.pdfFlash && x.pdfFlash.available(a, b)) return "pdfFlash" }, pageLength: function (a) {
  102. a = a.settings()[0].aLengthMenu; var b = Array.isArray(a[0]) ?
  103. a[0] : a, c = Array.isArray(a[0]) ? a[1] : a; return {
  104. extend: "collection", text: function (d) { return d.i18n("buttons.pageLength", { "-1": "Show all rows", _: "Show %d rows" }, d.page.len()) }, className: "buttons-page-length", autoClose: !0, buttons: e.map(b, function (d, h) { return { text: c[h], className: "button-page-length", action: function (f, k) { k.page.len(d).draw() }, init: function (f, k, g) { var m = this; k = function () { m.active(f.page.len() === d) }; f.on("length.dt" + g.namespace, k); k() }, destroy: function (f, k, g) { f.off("length.dt" + g.namespace) } } }),
  105. init: function (d, h, f) { var k = this; d.on("length.dt" + f.namespace, function () { k.text(f.text) }) }, destroy: function (d, h, f) { d.off("length.dt" + f.namespace) }
  106. }
  107. }
  108. }); t.Api.register("buttons()", function (a, b) { b === u && (b = a, a = u); this.selector.buttonGroup = a; var c = this.iterator(!0, "table", function (d) { if (d._buttons) return w.buttonSelector(w.instanceSelector(a, d._buttons), b) }, !0); c._groupSelector = a; return c }); t.Api.register("button()", function (a, b) { a = this.buttons(a, b); 1 < a.length && a.splice(1, a.length); return a }); t.Api.registerPlural("buttons().active()",
  109. "button().active()", function (a) { return a === u ? this.map(function (b) { return b.inst.active(b.node) }) : this.each(function (b) { b.inst.active(b.node, a) }) }); t.Api.registerPlural("buttons().action()", "button().action()", function (a) { return a === u ? this.map(function (b) { return b.inst.action(b.node) }) : this.each(function (b) { b.inst.action(b.node, a) }) }); t.Api.register(["buttons().enable()", "button().enable()"], function (a) { return this.each(function (b) { b.inst.enable(b.node, a) }) }); t.Api.register(["buttons().disable()",
  110. "button().disable()"], function () { return this.each(function (a) { a.inst.disable(a.node) }) }); t.Api.registerPlural("buttons().nodes()", "button().node()", function () { var a = e(); e(this.each(function (b) { a = a.add(b.inst.node(b.node)) })); return a }); t.Api.registerPlural("buttons().processing()", "button().processing()", function (a) { return a === u ? this.map(function (b) { return b.inst.processing(b.node) }) : this.each(function (b) { b.inst.processing(b.node, a) }) }); t.Api.registerPlural("buttons().text()", "button().text()", function (a) {
  111. return a ===
  112. u ? this.map(function (b) { return b.inst.text(b.node) }) : this.each(function (b) { b.inst.text(b.node, a) })
  113. }); t.Api.registerPlural("buttons().trigger()", "button().trigger()", function () { return this.each(function (a) { a.inst.node(a.node).trigger("click") }) }); t.Api.register("button().popover()", function (a, b) { return this.map(function (c) { return c.inst._popover(a, this.button(this[0].node), b) }) }); t.Api.register("buttons().containers()", function () {
  114. var a = e(), b = this._groupSelector; this.iterator(!0, "table", function (c) {
  115. if (c._buttons) {
  116. c =
  117. w.instanceSelector(b, c._buttons); for (var d = 0, h = c.length; d < h; d++)a = a.add(c[d].container())
  118. }
  119. }); return a
  120. }); t.Api.register("buttons().container()", function () { return this.containers().eq(0) }); t.Api.register("button().add()", function (a, b) { var c = this.context; c.length && (c = w.instanceSelector(this._groupSelector, c[0]._buttons), c.length && c[0].add(b, a)); return this.button(this._groupSelector, a) }); t.Api.register("buttons().destroy()", function () { this.pluck("inst").unique().each(function (a) { a.destroy() }); return this });
  121. t.Api.registerPlural("buttons().remove()", "buttons().remove()", function () { this.each(function (a) { a.inst.remove(a.node) }); return this }); var D; t.Api.register("buttons.info()", function (a, b, c) {
  122. var d = this; if (!1 === a) return this.off("destroy.btn-info"), F(e("#datatables_buttons_info"), 400, function () { e(this).remove() }), clearTimeout(D), D = null, this; D && clearTimeout(D); e("#datatables_buttons_info").length && e("#datatables_buttons_info").remove(); a = a ? "<h2>" + a + "</h2>" : ""; E(e('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(e("<div/>")["string" ===
  123. typeof b ? "html" : "append"](b)).css("display", "none").appendTo("body")); c !== u && 0 !== c && (D = setTimeout(function () { d.buttons.info(!1) }, c)); this.on("destroy.btn-info", function () { d.buttons.info(!1) }); return this
  124. }); t.Api.register("buttons.exportData()", function (a) { if (this.context.length) return P(new t.Api(this.context[0]), a) }); t.Api.register("buttons.exportInfo()", function (a) {
  125. a || (a = {}); var b = a; var c = "*" === b.filename && "*" !== b.title && b.title !== u && null !== b.title && "" !== b.title ? b.title : b.filename; "function" ===
  126. typeof c && (c = c()); c === u || null === c ? c = null : (-1 !== c.indexOf("*") && (c = c.replace("*", e("head > title").text()).trim()), c = c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, ""), (b = G(b.extension)) || (b = ""), c += b); b = G(a.title); b = null === b ? null : -1 !== b.indexOf("*") ? b.replace("*", e("head > title").text() || "Exported data") : b; return { filename: c, title: b, messageTop: K(this, a.message || a.messageTop, "top"), messageBottom: K(this, a.messageBottom, "bottom") }
  127. }); var G = function (a) {
  128. return null === a || a === u ? null : "function" === typeof a ?
  129. a() : a
  130. }, K = function (a, b, c) { b = G(b); if (null === b) return null; a = e("caption", a.table().container()).eq(0); return "*" === b ? a.css("caption-side") !== c ? null : a.length ? a.text() : "" : b }, L = e("<textarea/>")[0], P = function (a, b) {
  131. var c = e.extend(!0, {}, { rows: null, columns: "", modifier: { search: "applied", order: "applied" }, orthogonal: "display", stripHtml: !0, stripNewlines: !0, decodeEntities: !0, trim: !0, format: { header: function (q) { return d(q) }, footer: function (q) { return d(q) }, body: function (q) { return d(q) } }, customizeData: null }, b), d = function (q) {
  132. if ("string" !==
  133. typeof q) return q; q = q.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""); q = q.replace(/<!\-\-.*?\-\->/g, ""); c.stripHtml && (q = q.replace(/<([^>'"]*('[^']*'|"[^"]*")?)*>/g, "")); c.trim && (q = q.replace(/^\s+|\s+$/g, "")); c.stripNewlines && (q = q.replace(/\n/g, " ")); c.decodeEntities && (L.innerHTML = q, q = L.value); return q
  134. }; b = a.columns(c.columns).indexes().map(function (q) { var r = a.column(q).header(); return c.format.header(r.innerHTML, q, r) }).toArray(); var h = a.table().footer() ? a.columns(c.columns).indexes().map(function (q) {
  135. var r =
  136. a.column(q).footer(); return c.format.footer(r ? r.innerHTML : "", q, r)
  137. }).toArray() : null, f = e.extend({}, c.modifier); a.select && "function" === typeof a.select.info && f.selected === u && a.rows(c.rows, e.extend({ selected: !0 }, f)).any() && e.extend(f, { selected: !0 }); f = a.rows(c.rows, f).indexes().toArray(); var k = a.cells(f, c.columns); f = k.render(c.orthogonal).toArray(); k = k.nodes().toArray(); for (var g = b.length, m = [], l = 0, n = 0, p = 0 < g ? f.length / g : 0; n < p; n++) { for (var v = [g], y = 0; y < g; y++)v[y] = c.format.body(f[l], n, y, k[l]), l++; m[n] = v } b = {
  138. header: b,
  139. footer: h, body: m
  140. }; c.customizeData && c.customizeData(b); return b
  141. }; e.fn.dataTable.Buttons = w; e.fn.DataTable.Buttons = w; e(z).on("init.dt plugin-init.dt", function (a, b) { "dt" === a.namespace && (a = b.oInit.buttons || t.defaults.buttons) && !b._buttons && (new w(b, a)).container() }); t.ext.feature.push({ fnInit: H, cFeature: "B" }); t.ext.features && t.ext.features.register("buttons", H); return w
  142. });