@umriss-ui/table 0.46.0 → 0.47.1
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/CHANGELOG.md +22 -2
- package/dist/index.d.ts +79 -4
- package/dist/table.js +1362 -1329
- package/dist/xlsx.js +16 -16
- package/docs/llms-full.md +245 -36
- package/package.json +5 -5
package/dist/xlsx.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const x = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
-
`, y = "http://schemas.openxmlformats.org/", I = `${y}spreadsheetml/2006/main`, w = `${y}package/2006/relationships`, g = `${y}officeDocument/2006/relationships`, D = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4
|
-
function
|
|
5
|
-
return e.replace(/[[\]
|
|
3
|
+
`, y = "http://schemas.openxmlformats.org/", I = `${y}spreadsheetml/2006/main`, w = `${y}package/2006/relationships`, g = `${y}officeDocument/2006/relationships`, D = /[^\t\n\r --�\u{10000}-\u{10FFFF}]/gu, N = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4
|
+
function R(e) {
|
|
5
|
+
return e.replace(/[[\]:*?/\\\u0000-\u001f]/g, "").slice(0, 31).replace(D, "") || "Sheet1";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function C(e, t) {
|
|
8
8
|
return [
|
|
9
9
|
{
|
|
10
10
|
name: "[Content_Types].xml",
|
|
@@ -16,7 +16,7 @@ function R(e, t) {
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
name: "xl/workbook.xml",
|
|
19
|
-
text: `${x}<workbook xmlns="${I}" xmlns:r="${g}"><sheets><sheet name="${
|
|
19
|
+
text: `${x}<workbook xmlns="${I}" xmlns:r="${g}"><sheets><sheet name="${N(R(e))}" sheetId="1" r:id="rId1"/></sheets></workbook>`
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
name: "xl/_rels/workbook.xml.rels",
|
|
@@ -30,21 +30,21 @@ function R(e, t) {
|
|
|
30
30
|
{ name: "xl/worksheets/sheet1.xml", text: t }
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const A = (e) => ({
|
|
34
34
|
year: e.getFullYear(),
|
|
35
35
|
month: e.getMonth(),
|
|
36
36
|
day: e.getDate(),
|
|
37
37
|
hours: e.getHours(),
|
|
38
38
|
minutes: e.getMinutes(),
|
|
39
39
|
seconds: e.getSeconds()
|
|
40
|
-
}),
|
|
40
|
+
}), E = (e) => (e.getTime() % 1e3 + 1e3) % 1e3, O = (e, t) => {
|
|
41
41
|
for (const n of e)
|
|
42
42
|
if (n instanceof Date && !Number.isNaN(n.getTime())) {
|
|
43
43
|
const r = t(n);
|
|
44
|
-
if (r.hours + r.minutes + r.seconds +
|
|
44
|
+
if (r.hours + r.minutes + r.seconds + E(n) !== 0) return !1;
|
|
45
45
|
}
|
|
46
46
|
return !0;
|
|
47
|
-
}, T = 1048576, b = 16384, F = 32767,
|
|
47
|
+
}, T = 1048576, b = 16384, F = 32767, _ = 864e5, X = Date.UTC(1899, 11, 30), L = 61;
|
|
48
48
|
function k(e) {
|
|
49
49
|
let t = "";
|
|
50
50
|
for (e += 1; e > 0; e = Math.floor((e - 1) / 26)) t = String.fromCharCode(65 + (e - 1) % 26) + t;
|
|
@@ -52,18 +52,18 @@ function k(e) {
|
|
|
52
52
|
}
|
|
53
53
|
const M = (e, t) => {
|
|
54
54
|
const n = t(e);
|
|
55
|
-
return (Date.UTC(n.year, n.month, n.day, n.hours, n.minutes, n.seconds,
|
|
55
|
+
return (Date.UTC(n.year, n.month, n.day, n.hours, n.minutes, n.seconds, E(e)) - X) / _;
|
|
56
56
|
};
|
|
57
57
|
function U(e) {
|
|
58
|
-
let t = e.replace(
|
|
59
|
-
return t.length > F && (t = t.slice(0, F), /[\uD800-\uDBFF]$/.test(t) && (t = t.slice(0, -1))),
|
|
58
|
+
let t = e.replace(D, "");
|
|
59
|
+
return t.length > F && (t = t.slice(0, F), /[\uD800-\uDBFF]$/.test(t) && (t = t.slice(0, -1))), N(t);
|
|
60
60
|
}
|
|
61
61
|
const $ = (e, t) => `<c r="${e}" t="inlineStr"><is><t xml:space="preserve">${U(t)}</t></is></c>`;
|
|
62
|
-
function P(e, t =
|
|
62
|
+
function P(e, t = A) {
|
|
63
63
|
const { columns: n, rows: r } = e;
|
|
64
64
|
if (n.length > b) throw new RangeError(`A worksheet holds at most ${b.toLocaleString("en")} columns.`);
|
|
65
65
|
if (r.length + 1 > T) throw new RangeError(`A worksheet holds at most ${T.toLocaleString("en")} rows.`);
|
|
66
|
-
const p = n.map((l, m) =>
|
|
66
|
+
const p = n.map((l, m) => O(r.map((f) => f[m]), t) ? 1 : 2), u = n.map((l, m) => l.width === void 0 ? "" : `<col min="${m + 1}" max="${m + 1}" width="${l.width / 7 + 1}" customWidth="1"/>`).join(""), c = `<row r="1">${n.map((l, m) => $(`${k(m)}1`, l.label)).join("")}</row>`, s = r.map((l, m) => {
|
|
67
67
|
const f = m + 2;
|
|
68
68
|
let i = "";
|
|
69
69
|
for (let d = 0; d < l.length; d++) {
|
|
@@ -74,7 +74,7 @@ function P(e, t = C) {
|
|
|
74
74
|
else if (typeof a == "string") i += $(o, a);
|
|
75
75
|
else if (a instanceof Date && !Number.isNaN(a.getTime())) {
|
|
76
76
|
const h = M(a, t);
|
|
77
|
-
h >=
|
|
77
|
+
h >= L ? i += `<c r="${o}" s="${p[d]}"><v>${h}</v></c>` : i += $(o, a.toISOString());
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
return i ? `<row r="${f}">${i}</row>` : `<row r="${f}"/>`;
|
|
@@ -121,7 +121,7 @@ function z(e) {
|
|
|
121
121
|
const W = {
|
|
122
122
|
extension: "xlsx",
|
|
123
123
|
mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
124
|
-
write: (e, { wording: t, wallClock: n }) => z(
|
|
124
|
+
write: (e, { wording: t, wallClock: n }) => z(C(t.exportSheetName, P(e, n)))
|
|
125
125
|
};
|
|
126
126
|
export {
|
|
127
127
|
W as xlsx
|