@ianicdev/datatables2 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{dataTables-CkBI8wxE.js → dataTables-CIvZI-Uz.js} +316 -314
- package/dist/{dataTables-CYFQqYSf.cjs → dataTables-ChWvPnrJ.cjs} +2 -2
- package/dist/datatables.cjs +1 -1
- package/dist/datatables.js +1 -1
- package/dist/exporttocsv-CUWOZ1Z_.js +88 -0
- package/dist/exporttocsv-RZvZEhmM.cjs +6 -0
- package/dist/filesaver-DK4OWeXC.cjs +1 -0
- package/dist/filesaver-hxbVqAA5.js +75 -0
- package/dist/index-BF1Hip7a.cjs +27 -0
- package/dist/index-BN_IomNn.js +11697 -0
- package/dist/{index.es-DldeG7kk.js → index.es-01MggsOI.js} +4 -3
- package/dist/{index.es-rgFLSO3a.cjs → index.es-BUcLX0bw.cjs} +6 -6
- package/dist/jspdf-BBjiUHJr.cjs +244 -0
- package/dist/jspdf-D2fltdCT.js +9159 -0
- package/dist/printjs-D_W5E6Tg.cjs +1 -0
- package/dist/printjs-DloSJk7-.js +689 -0
- package/dist/sortablejs-DFlpjwso.cjs +6 -0
- package/dist/sortablejs-oSzf6C5Q.js +1260 -0
- package/dist/xlsx-70x3xVy4.cjs +128 -0
- package/dist/xlsx-F0a4dQhU.js +15887 -0
- package/package.json +9 -13
- package/dist/index-BLNs0fpx.js +0 -48531
- package/dist/index-awitzv1o.cjs +0 -345
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var h;
|
|
2
|
+
(function(e) {
|
|
3
|
+
e.csv = "text/csv", e.tsv = "text/tab-separated-values", e.plain = "text/plain";
|
|
4
|
+
})(h || (h = {}));
|
|
5
|
+
var u = (e) => e, a = (e) => e, d = u, f = u, l = u, b = u, v = u, S = { fieldSeparator: ",", decimalSeparator: ".", quoteStrings: !0, quoteCharacter: '"', showTitle: !1, title: "My Generated Report", filename: "generated", showColumnHeaders: !0, useTextFile: !1, fileExtension: "csv", mediaType: h.csv, useBom: !0, columnHeaders: [], useKeysAsHeaders: !1, boolDisplay: { true: "TRUE", false: "FALSE" }, replaceUndefinedWith: "" }, C = `\r
|
|
6
|
+
`, O = "\uFEFF", y = (e) => Object.assign({}, S, e);
|
|
7
|
+
class F extends Error {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
super(t), this.name = "CsvGenerationError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class j extends Error {
|
|
13
|
+
constructor(t) {
|
|
14
|
+
super(t), this.name = "EmptyHeadersError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class q extends Error {
|
|
18
|
+
constructor(t) {
|
|
19
|
+
super(t), this.name = "CsvDownloadEnvironmentError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class A extends Error {
|
|
23
|
+
constructor(t) {
|
|
24
|
+
super(t), this.name = "UnsupportedDataFormatError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
var T = function(e, t) {
|
|
28
|
+
return t == '"' && e.indexOf('"') > -1 ? e.replace(/"/g, '""') : e;
|
|
29
|
+
}, H = (e) => b(typeof e == "object" ? e.key : e), L = (e) => v(typeof e == "object" ? e.displayLabel : e), U = (e, ...t) => t.reduce((r, n) => n(r), e), B = (e) => (t) => e.useBom ? f(a(t) + O) : t, D = (e) => (t) => e.showTitle ? m(f(a(t) + e.title))(l("")) : t, m = (e) => (t) => f(a(e) + a(t) + C), x = (e) => (t, r) => k(e)(l(a(t) + a(r))), k = (e) => (t) => u(a(t) + e.fieldSeparator), R = (e, t) => (r) => {
|
|
30
|
+
if (!e.showColumnHeaders) return r;
|
|
31
|
+
if (t.length < 1) throw new j("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");
|
|
32
|
+
let n = l("");
|
|
33
|
+
for (let o = 0; o < t.length; o++) {
|
|
34
|
+
const i = L(t[o]);
|
|
35
|
+
n = x(e)(n, g(e, a(i)));
|
|
36
|
+
}
|
|
37
|
+
return n = l(a(n).slice(0, -1)), m(r)(n);
|
|
38
|
+
}, G = (e, t, r) => (n) => {
|
|
39
|
+
let o = n;
|
|
40
|
+
for (var i = 0; i < r.length; i++) {
|
|
41
|
+
let s = l("");
|
|
42
|
+
for (let p = 0; p < t.length; p++) {
|
|
43
|
+
const w = H(t[p]), E = r[i][a(w)];
|
|
44
|
+
s = x(e)(s, g(e, E));
|
|
45
|
+
}
|
|
46
|
+
s = l(a(s).slice(0, -1)), o = m(o)(s);
|
|
47
|
+
}
|
|
48
|
+
return o;
|
|
49
|
+
}, I = (e) => +e === e && (!isFinite(e) || !!(e % 1)), K = (e, t) => {
|
|
50
|
+
if (I(t)) {
|
|
51
|
+
if (e.decimalSeparator === "locale") return d(t.toLocaleString());
|
|
52
|
+
if (e.decimalSeparator) return d(t.toString().replace(".", e.decimalSeparator));
|
|
53
|
+
}
|
|
54
|
+
return d(t.toString());
|
|
55
|
+
}, c = (e, t) => {
|
|
56
|
+
let r = t;
|
|
57
|
+
return (e.quoteStrings || e.fieldSeparator && t.indexOf(e.fieldSeparator) > -1 || e.quoteCharacter && t.indexOf(e.quoteCharacter) > -1 || t.indexOf(`
|
|
58
|
+
`) > -1 || t.indexOf("\r") > -1) && (r = e.quoteCharacter + T(t, e.quoteCharacter) + e.quoteCharacter), d(r);
|
|
59
|
+
}, M = (e, t) => {
|
|
60
|
+
const r = t ? "true" : "false";
|
|
61
|
+
return d(e.boolDisplay[r]);
|
|
62
|
+
}, P = (e, t) => typeof t > "u" && e.replaceUndefinedWith !== void 0 ? c(e, e.replaceUndefinedWith + "") : t === null ? c(e, "null") : c(e, ""), g = (e, t) => {
|
|
63
|
+
if (typeof t == "number") return K(e, t);
|
|
64
|
+
if (typeof t == "string") return c(e, t);
|
|
65
|
+
if (typeof t == "boolean" && e.boolDisplay) return M(e, t);
|
|
66
|
+
if (t === null || typeof t > "u") return P(e, t);
|
|
67
|
+
throw new A(`
|
|
68
|
+
typeof ${typeof t} isn't supported. Only number, string, boolean, null and undefined are supported.
|
|
69
|
+
Please convert the data in your object to one of those before generating the CSV.
|
|
70
|
+
`);
|
|
71
|
+
}, z = (e) => (t) => {
|
|
72
|
+
const r = y(e), n = r.useKeysAsHeaders ? Object.keys(t[0]) : r.columnHeaders;
|
|
73
|
+
let o = U(f(""), B(r), D(r), R(r, n), G(r, n, t));
|
|
74
|
+
if (a(o).length < 1) throw new F("Output is empty. Is your data formatted correctly?");
|
|
75
|
+
return o;
|
|
76
|
+
}, V = (e) => (t) => {
|
|
77
|
+
const r = y(e), n = a(t), o = r.useTextFile ? "text/plain" : r.mediaType;
|
|
78
|
+
return new Blob([n], { type: `${o};charset=utf8;` });
|
|
79
|
+
}, N = (e) => (t) => {
|
|
80
|
+
if (!window) throw new q("Downloading only supported in a browser environment.");
|
|
81
|
+
const r = V(e)(t), n = y(e), o = n.useTextFile ? "txt" : n.fileExtension, i = `${n.filename}.${o}`, s = document.createElement("a");
|
|
82
|
+
s.download = i, s.href = URL.createObjectURL(r), s.setAttribute("visibility", "hidden"), document.body.appendChild(s), s.click(), document.body.removeChild(s);
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
z as B,
|
|
86
|
+
y as G,
|
|
87
|
+
N as L
|
|
88
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var y;(function(e){e.csv="text/csv",e.tsv="text/tab-separated-values",e.plain="text/plain"})(y||(y={}));var u=e=>e,a=e=>e,d=u,f=u,l=u,b=u,v=u,S={fieldSeparator:",",decimalSeparator:".",quoteStrings:!0,quoteCharacter:'"',showTitle:!1,title:"My Generated Report",filename:"generated",showColumnHeaders:!0,useTextFile:!1,fileExtension:"csv",mediaType:y.csv,useBom:!0,columnHeaders:[],useKeysAsHeaders:!1,boolDisplay:{true:"TRUE",false:"FALSE"},replaceUndefinedWith:""},C=`\r
|
|
2
|
+
`,O="\uFEFF",p=e=>Object.assign({},S,e);class F extends Error{constructor(t){super(t),this.name="CsvGenerationError"}}class j extends Error{constructor(t){super(t),this.name="EmptyHeadersError"}}class q extends Error{constructor(t){super(t),this.name="CsvDownloadEnvironmentError"}}class A extends Error{constructor(t){super(t),this.name="UnsupportedDataFormatError"}}var T=function(e,t){return t=='"'&&e.indexOf('"')>-1?e.replace(/"/g,'""'):e},H=e=>b(typeof e=="object"?e.key:e),L=e=>v(typeof e=="object"?e.displayLabel:e),U=(e,...t)=>t.reduce((r,n)=>n(r),e),B=e=>t=>e.useBom?f(a(t)+O):t,D=e=>t=>e.showTitle?m(f(a(t)+e.title))(l("")):t,m=e=>t=>f(a(e)+a(t)+C),g=e=>(t,r)=>k(e)(l(a(t)+a(r))),k=e=>t=>u(a(t)+e.fieldSeparator),R=(e,t)=>r=>{if(!e.showColumnHeaders)return r;if(t.length<1)throw new j("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");let n=l("");for(let o=0;o<t.length;o++){const s=L(t[o]);n=g(e)(n,w(e,a(s)))}return n=l(a(n).slice(0,-1)),m(r)(n)},G=(e,t,r)=>n=>{let o=n;for(var s=0;s<r.length;s++){let i=l("");for(let h=0;h<t.length;h++){const x=H(t[h]),E=r[s][a(x)];i=g(e)(i,w(e,E))}i=l(a(i).slice(0,-1)),o=m(o)(i)}return o},I=e=>+e===e&&(!isFinite(e)||!!(e%1)),K=(e,t)=>{if(I(t)){if(e.decimalSeparator==="locale")return d(t.toLocaleString());if(e.decimalSeparator)return d(t.toString().replace(".",e.decimalSeparator))}return d(t.toString())},c=(e,t)=>{let r=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(`
|
|
3
|
+
`)>-1||t.indexOf("\r")>-1)&&(r=e.quoteCharacter+T(t,e.quoteCharacter)+e.quoteCharacter),d(r)},M=(e,t)=>{const r=t?"true":"false";return d(e.boolDisplay[r])},P=(e,t)=>typeof t>"u"&&e.replaceUndefinedWith!==void 0?c(e,e.replaceUndefinedWith+""):t===null?c(e,"null"):c(e,""),w=(e,t)=>{if(typeof t=="number")return K(e,t);if(typeof t=="string")return c(e,t);if(typeof t=="boolean"&&e.boolDisplay)return M(e,t);if(t===null||typeof t>"u")return P(e,t);throw new A(`
|
|
4
|
+
typeof ${typeof t} isn't supported. Only number, string, boolean, null and undefined are supported.
|
|
5
|
+
Please convert the data in your object to one of those before generating the CSV.
|
|
6
|
+
`)},V=e=>t=>{const r=p(e),n=r.useKeysAsHeaders?Object.keys(t[0]):r.columnHeaders;let o=U(f(""),B(r),D(r),R(r,n),G(r,n,t));if(a(o).length<1)throw new F("Output is empty. Is your data formatted correctly?");return o},z=e=>t=>{const r=p(e),n=a(t),o=r.useTextFile?"text/plain":r.mediaType;return new Blob([n],{type:`${o};charset=utf8;`})},N=e=>t=>{if(!window)throw new q("Downloading only supported in a browser environment.");const r=z(e)(t),n=p(e),o=n.useTextFile?"txt":n.fileExtension,s=`${n.filename}.${o}`,i=document.createElement("a");i.download=s,i.href=URL.createObjectURL(r),i.setAttribute("visibility","hidden"),document.body.appendChild(i),i.click(),document.body.removeChild(i)};exports.BW=V;exports.G=p;exports.LW=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./printjs-D_W5E6Tg.cjs");var f={exports:{}},R=f.exports,j;function L(){return j||(j=1,function(b,S){(function(v,i){i()})(R,function(){function v(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){l(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function m(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function c(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof u.commonjsGlobal=="object"&&u.commonjsGlobal.global===u.commonjsGlobal?u.commonjsGlobal:void 0,w=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(e,t,r){var n=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?c(o):m(o.href)?i(e,t,r):c(o,o.target="_blank")):(o.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(o.href)},4e4),setTimeout(function(){c(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(v(e,r),t);else if(m(e))i(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){c(n)})}}:function(e,t,r,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,r);var o=e.type==="application/octet-stream",E=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&E||w)&&typeof FileReader<"u"){var d=new FileReader;d.onloadend=function(){var s=d.result;s=y?s:s.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=s:location=s,n=null},d.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,p=h.createObjectURL(e);n?n.location=p:location.href=p,n=null,setTimeout(function(){h.revokeObjectURL(p)},4e4)}});a.saveAs=l.saveAs=l,b.exports=l})}(f)),f.exports}exports.requireFileSaver_min=L;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { c as u } from "./printjs-DloSJk7-.js";
|
|
2
|
+
var f = { exports: {} }, j = f.exports, E;
|
|
3
|
+
function A() {
|
|
4
|
+
return E || (E = 1, function(R, L) {
|
|
5
|
+
(function(v, i) {
|
|
6
|
+
i();
|
|
7
|
+
})(j, function() {
|
|
8
|
+
function v(e, t) {
|
|
9
|
+
return typeof t > "u" ? t = { autoBom: !1 } : typeof t != "object" && (console.warn("Deprecated: Expected third argument to be a object"), t = { autoBom: !t }), t.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
|
|
10
|
+
}
|
|
11
|
+
function i(e, t, r) {
|
|
12
|
+
var n = new XMLHttpRequest();
|
|
13
|
+
n.open("GET", e), n.responseType = "blob", n.onload = function() {
|
|
14
|
+
l(n.response, t, r);
|
|
15
|
+
}, n.onerror = function() {
|
|
16
|
+
console.error("could not download file");
|
|
17
|
+
}, n.send();
|
|
18
|
+
}
|
|
19
|
+
function m(e) {
|
|
20
|
+
var t = new XMLHttpRequest();
|
|
21
|
+
t.open("HEAD", e, !1);
|
|
22
|
+
try {
|
|
23
|
+
t.send();
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
return 200 <= t.status && 299 >= t.status;
|
|
27
|
+
}
|
|
28
|
+
function c(e) {
|
|
29
|
+
try {
|
|
30
|
+
e.dispatchEvent(new MouseEvent("click"));
|
|
31
|
+
} catch {
|
|
32
|
+
var t = document.createEvent("MouseEvents");
|
|
33
|
+
t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(t);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof u == "object" && u.global === u ? u : void 0, w = a.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), l = a.saveAs || (typeof window != "object" || window !== a ? function() {
|
|
37
|
+
} : "download" in HTMLAnchorElement.prototype && !w ? function(e, t, r) {
|
|
38
|
+
var n = a.URL || a.webkitURL, o = document.createElement("a");
|
|
39
|
+
t = t || e.name || "download", o.download = t, o.rel = "noopener", typeof e == "string" ? (o.href = e, o.origin === location.origin ? c(o) : m(o.href) ? i(e, t, r) : c(o, o.target = "_blank")) : (o.href = n.createObjectURL(e), setTimeout(function() {
|
|
40
|
+
n.revokeObjectURL(o.href);
|
|
41
|
+
}, 4e4), setTimeout(function() {
|
|
42
|
+
c(o);
|
|
43
|
+
}, 0));
|
|
44
|
+
} : "msSaveOrOpenBlob" in navigator ? function(e, t, r) {
|
|
45
|
+
if (t = t || e.name || "download", typeof e != "string") navigator.msSaveOrOpenBlob(v(e, r), t);
|
|
46
|
+
else if (m(e)) i(e, t, r);
|
|
47
|
+
else {
|
|
48
|
+
var n = document.createElement("a");
|
|
49
|
+
n.href = e, n.target = "_blank", setTimeout(function() {
|
|
50
|
+
c(n);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
} : function(e, t, r, n) {
|
|
54
|
+
if (n = n || open("", "_blank"), n && (n.document.title = n.document.body.innerText = "downloading..."), typeof e == "string") return i(e, t, r);
|
|
55
|
+
var o = e.type === "application/octet-stream", b = /constructor/i.test(a.HTMLElement) || a.safari, y = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
56
|
+
if ((y || o && b || w) && typeof FileReader < "u") {
|
|
57
|
+
var d = new FileReader();
|
|
58
|
+
d.onloadend = function() {
|
|
59
|
+
var s = d.result;
|
|
60
|
+
s = y ? s : s.replace(/^data:[^;]*;/, "data:attachment/file;"), n ? n.location.href = s : location = s, n = null;
|
|
61
|
+
}, d.readAsDataURL(e);
|
|
62
|
+
} else {
|
|
63
|
+
var h = a.URL || a.webkitURL, p = h.createObjectURL(e);
|
|
64
|
+
n ? n.location = p : location.href = p, n = null, setTimeout(function() {
|
|
65
|
+
h.revokeObjectURL(p);
|
|
66
|
+
}, 4e4);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
a.saveAs = l.saveAs = l, R.exports = l;
|
|
70
|
+
});
|
|
71
|
+
}(f)), f.exports;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
A as r
|
|
75
|
+
};
|