@fileverse-dev/dsheet 4.0.2 → 4.0.3-import-compaction.0
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/editor/utils/import-compaction.d.ts +25 -0
- package/dist/{executeStringFunction-BQvE7aeV.js → executeStringFunction-C1C2F-4h.js} +15 -13
- package/dist/formula.js +1 -1
- package/dist/{index-Bw9u774w.js → index-Be1UXKhA.js} +3472 -3382
- package/dist/index.es.js +6 -6
- package/dist/sheet-engine/core/api/common.d.ts +1 -0
- package/dist/sheet-engine/core/types.d.ts +2 -0
- package/dist/sheet-engine/react/components/Workbook/api.d.ts +1 -0
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -0
- package/dist/{use-xlsx-import-impl-KgnUKKnW.js → use-xlsx-import-impl-B_KWT6Kk.js} +74 -74
- package/dist/{xlsx-export-impl-BXPAAWnu.js → xlsx-export-impl-1Lzcuf9K.js} +300 -298
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as s,
|
|
2
|
-
import { cr as k, cs as V, ct as y, cy as z, bo as P, e as U, f as X, l as _, a as B, d7 as
|
|
1
|
+
import { C as s, b as t, d as o, S as r, f as l, g as d, h as n, T as i, j as S, k as c, l as h, n as m, o as p, p as C, q as u, s as E, t as F, u as g, v as x, w as R, x as f, z as w, A, B as I, D as L, E as T, F as v, G as b, H as D } from "./index-Be1UXKhA.js";
|
|
2
|
+
import { cr as k, cs as V, ct as y, cy as z, bo as P, e as U, f as X, l as _, a as B, d7 as G, d8 as H, b7 as O, d9 as j, da as q, de as J, df as K, dh as N, I as W, dw as Y, dW as Z, b0 as Q } from "./executeStringFunction-C1C2F-4h.js";
|
|
3
3
|
import { FLVURL as ee } from "@fileverse-dev/formulajs";
|
|
4
4
|
import { E as se, S as te } from "./constants-Cdz6oSCq.js";
|
|
5
5
|
export {
|
|
@@ -34,10 +34,10 @@ export {
|
|
|
34
34
|
F as handleExportToCSV,
|
|
35
35
|
g as handleExportToJSON,
|
|
36
36
|
x as handleExportToXLSX,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
G as handleFreeze,
|
|
38
|
+
H as handleHorizontalAlign,
|
|
39
|
+
O as handleLink,
|
|
40
|
+
j as handleMerge,
|
|
41
41
|
R as handlePasteByClick,
|
|
42
42
|
q as handleSort,
|
|
43
43
|
J as handleTextSize,
|
|
@@ -56,6 +56,7 @@ export declare function getSheetWithLatestCelldata(ctx: Context, options?: Commo
|
|
|
56
56
|
luckysheet_conditionformat_save?: any[];
|
|
57
57
|
luckysheet_alternateformat_save?: any[];
|
|
58
58
|
dataVerification?: any;
|
|
59
|
+
dataVerificationDefs?: any[];
|
|
59
60
|
conditionRules?: import('../types').ConditionRulesProps;
|
|
60
61
|
hyperlink?: Record<string, import('..').HyperlinkEntry | import('..').HyperlinkEntry[]>;
|
|
61
62
|
dynamicArray_compute?: any;
|
|
@@ -246,6 +246,8 @@ export type Sheet = {
|
|
|
246
246
|
luckysheet_conditionformat_save?: any[];
|
|
247
247
|
luckysheet_alternateformat_save?: any[];
|
|
248
248
|
dataVerification?: any;
|
|
249
|
+
/** Interned dataVerification entries; per-cell map may hold numeric refs into this list. */
|
|
250
|
+
dataVerificationDefs?: any[];
|
|
249
251
|
conditionRules?: ConditionRulesProps;
|
|
250
252
|
hyperlink?: Record<string, HyperlinkEntry | HyperlinkEntry[]>;
|
|
251
253
|
dynamicArray_compute?: any;
|
|
@@ -119,6 +119,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
119
119
|
luckysheet_conditionformat_save?: any[];
|
|
120
120
|
luckysheet_alternateformat_save?: any[];
|
|
121
121
|
dataVerification?: any;
|
|
122
|
+
dataVerificationDefs?: any[];
|
|
122
123
|
conditionRules?: import('../../../core/types').ConditionRulesProps;
|
|
123
124
|
hyperlink?: Record<string, import('../../../core').HyperlinkEntry | import('../../../core').HyperlinkEntry[]>;
|
|
124
125
|
dynamicArray_compute?: any;
|
|
@@ -120,6 +120,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
120
120
|
luckysheet_conditionformat_save?: any[];
|
|
121
121
|
luckysheet_alternateformat_save?: any[];
|
|
122
122
|
dataVerification?: any;
|
|
123
|
+
dataVerificationDefs?: any[];
|
|
123
124
|
conditionRules?: import('../../../core/types').ConditionRulesProps;
|
|
124
125
|
hyperlink?: Record<string, import('../../../core').HyperlinkEntry | import('../../../core').HyperlinkEntry[]>;
|
|
125
126
|
dynamicArray_compute?: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as et } from "./executeStringFunction-
|
|
1
|
+
import { g as et } from "./executeStringFunction-C1C2F-4h.js";
|
|
2
2
|
import * as Ge from "yjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
3
|
+
import { i as tt, c as rt, m as nt, y as at, r as it } from "./index-Be1UXKhA.js";
|
|
4
|
+
import { n as ct } from "./xlsx-hyperlink-inline-DzewAypN.js";
|
|
5
5
|
import { toast as ze } from "@fileverse/ui";
|
|
6
6
|
var Je = { exports: {} };
|
|
7
7
|
(function(y) {
|
|
@@ -326,7 +326,7 @@ var Je = { exports: {} };
|
|
|
326
326
|
var c = Math.pow(10, a);
|
|
327
327
|
return "" + Math.round(f * c) / c;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function I(f, a) {
|
|
330
330
|
var c = f - Math.floor(f), k = Math.pow(10, a);
|
|
331
331
|
return a < ("" + Math.round(c * k)).length ? 0 : Math.round(c * k);
|
|
332
332
|
}
|
|
@@ -359,7 +359,7 @@ var Je = { exports: {} };
|
|
|
359
359
|
return W + P(j, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
|
|
360
360
|
if (s = a.match(/^#{1,3},##0(\.?)$/)) return W + oe(Z(j, 0));
|
|
361
361
|
if (s = a.match(/^#,##0\.([#0]*0)$/))
|
|
362
|
-
return c < 0 ? "-" + $(f, a, -c) : oe("" + (Math.floor(c) + Y(c, s[1].length))) + "." + F(
|
|
362
|
+
return c < 0 ? "-" + $(f, a, -c) : oe("" + (Math.floor(c) + Y(c, s[1].length))) + "." + F(I(c, s[1].length), s[1].length);
|
|
363
363
|
if (s = a.match(/^#,#*,#0/)) return $(f, a.replace(/^#,#*,/, ""), c);
|
|
364
364
|
if (s = a.match(/^([0#]+)(\\?-([0#]+))+$/))
|
|
365
365
|
return l = C($(f, a.replace(/[\\-]/g, ""), c)), O = 0, C(C(a.replace(/\\/g, "")).replace(/[0#]/g, function(q) {
|
|
@@ -380,7 +380,7 @@ var Je = { exports: {} };
|
|
|
380
380
|
return A(a.substr(0, be) + l + a.substr(a.length - Ce));
|
|
381
381
|
}
|
|
382
382
|
if (s = a.match(/^00,000\.([#0]*0)$/))
|
|
383
|
-
return O =
|
|
383
|
+
return O = I(c, s[1].length), c < 0 ? "-" + $(f, a, -c) : oe(E(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(q) {
|
|
384
384
|
return "00," + (q.length < 3 ? F(0, 3 - q.length) : "") + q;
|
|
385
385
|
}) + "." + F(O, s[1].length);
|
|
386
386
|
switch (a) {
|
|
@@ -609,8 +609,8 @@ var Je = { exports: {} };
|
|
|
609
609
|
i[i.length] = { t: "t", v: o }, ++r;
|
|
610
610
|
break;
|
|
611
611
|
case "\\":
|
|
612
|
-
var
|
|
613
|
-
i[i.length] = { t: Y, v:
|
|
612
|
+
var I = t.charAt(++r), Y = I === "(" || I === ")" ? I : "t";
|
|
613
|
+
i[i.length] = { t: Y, v: I }, ++r;
|
|
614
614
|
break;
|
|
615
615
|
case "_":
|
|
616
616
|
i[i.length] = { t: "t", v: " " }, r += 2;
|
|
@@ -901,8 +901,8 @@ var Je = { exports: {} };
|
|
|
901
901
|
};
|
|
902
902
|
g(u), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = u);
|
|
903
903
|
})(Je);
|
|
904
|
-
var
|
|
905
|
-
const De = /* @__PURE__ */ et(
|
|
904
|
+
var ot = Je.exports;
|
|
905
|
+
const De = /* @__PURE__ */ et(ot), Be = [
|
|
906
906
|
"228, 232, 237",
|
|
907
907
|
// Light Gray
|
|
908
908
|
"219, 233, 236",
|
|
@@ -927,35 +927,35 @@ const De = /* @__PURE__ */ et(it), Be = [
|
|
|
927
927
|
// Cyan
|
|
928
928
|
"244, 239, 234"
|
|
929
929
|
// Cream
|
|
930
|
-
], qe = Be[0],
|
|
930
|
+
], qe = Be[0], lt = [
|
|
931
931
|
["true", "false"],
|
|
932
932
|
["yes", "no"],
|
|
933
933
|
["1", "0"]
|
|
934
934
|
];
|
|
935
|
-
function
|
|
935
|
+
function st(y, u) {
|
|
936
936
|
const g = y.toLowerCase(), p = u.toLowerCase();
|
|
937
|
-
return
|
|
937
|
+
return lt.some(([w, C]) => g === w && p === C);
|
|
938
938
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
939
|
+
const ut = 200;
|
|
940
|
+
function ht() {
|
|
941
941
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `sheet-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function ft(y, u) {
|
|
944
944
|
if (!u.has(y)) return y;
|
|
945
945
|
let g = 1, p = `${y} (${g})`;
|
|
946
946
|
for (; u.has(p); )
|
|
947
947
|
g += 1, p = `${y} (${g})`;
|
|
948
948
|
return p;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function gt(y) {
|
|
951
951
|
if (!Array.isArray(y) || y.length === 0) return null;
|
|
952
952
|
const u = y.map((p) => String((p == null ? void 0 : p.v) ?? "")).join("");
|
|
953
953
|
return u.trim() ? u : null;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function dt(y) {
|
|
956
956
|
return y ? "TRUE" : "FALSE";
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function bt(y) {
|
|
959
959
|
let u = !1, g = 0;
|
|
960
960
|
const p = () => {
|
|
961
961
|
if (u) return !0;
|
|
@@ -967,7 +967,7 @@ function gt(y) {
|
|
|
967
967
|
) ? !1 : (C.recalculateAllFormulas(), u = !0, !0);
|
|
968
968
|
}, w = () => {
|
|
969
969
|
var C, S;
|
|
970
|
-
p() || (g += 1, g <
|
|
970
|
+
p() || (g += 1, g < ut ? requestAnimationFrame(w) : ((S = (C = y.current) == null ? void 0 : C.recalculateAllFormulas) == null || S.call(C), u = !0));
|
|
971
971
|
};
|
|
972
972
|
requestAnimationFrame(() => requestAnimationFrame(w));
|
|
973
973
|
for (const C of [120, 400, 1200])
|
|
@@ -975,7 +975,7 @@ function gt(y) {
|
|
|
975
975
|
u || p();
|
|
976
976
|
}, C);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function mt(y) {
|
|
979
979
|
return y <= 0 ? qe : y > Be.length ? Array(y).fill(qe).join(", ") : Be.slice(0, y).join(", ");
|
|
980
980
|
}
|
|
981
981
|
function je(y) {
|
|
@@ -988,13 +988,13 @@ function je(y) {
|
|
|
988
988
|
const C = parseInt(p, 10) - 1, S = w - 1;
|
|
989
989
|
return { row: C, col: S };
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function pt(y, u) {
|
|
992
992
|
const g = je(y);
|
|
993
993
|
if (!g) return null;
|
|
994
994
|
const { row: p, col: w } = g, C = `${p}_${w}`, S = Array.isArray(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", F = S.split(",").map((le) => le.trim()).filter(Boolean);
|
|
995
995
|
let R = u.type === "list" ? "dropdown" : u.type || "dropdown", B = S, ee = "";
|
|
996
|
-
u.type === "list" && F.length === 2 &&
|
|
997
|
-
const ke = R === "checkbox" ? 1 : B ? B.split(",").length : 0, D =
|
|
996
|
+
u.type === "list" && F.length === 2 && st(F[0], F[1]) && (R = "checkbox", B = F[0], ee = F[1]);
|
|
997
|
+
const ke = R === "checkbox" ? 1 : B ? B.split(",").length : 0, D = mt(ke || 1), Z = {
|
|
998
998
|
type: R,
|
|
999
999
|
type2: "",
|
|
1000
1000
|
rangeTxt: y,
|
|
@@ -1010,7 +1010,7 @@ function bt(y, u) {
|
|
|
1010
1010
|
};
|
|
1011
1011
|
return { rowColKey: C, entry: Z };
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function wt(y) {
|
|
1014
1014
|
const u = y.split(":"), g = je(u[0].trim());
|
|
1015
1015
|
if (!g) return null;
|
|
1016
1016
|
const p = u.length > 1 ? je(u[1].trim()) : g;
|
|
@@ -1019,13 +1019,13 @@ function mt(y) {
|
|
|
1019
1019
|
column: [Math.min(g.col, p.col), Math.max(g.col, p.col)]
|
|
1020
1020
|
} : null;
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) =>
|
|
1022
|
+
function yt(y) {
|
|
1023
|
+
return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => wt(u)).filter(
|
|
1024
1024
|
(u) => !!u
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
1027
|
function Xe(y) {
|
|
1028
|
-
const u =
|
|
1028
|
+
const u = yt(y);
|
|
1029
1029
|
return u.length ? u.map((g) => {
|
|
1030
1030
|
const [p, w] = g.row, [C, S] = g.column;
|
|
1031
1031
|
return {
|
|
@@ -1089,12 +1089,12 @@ function Pe(y) {
|
|
|
1089
1089
|
const p = u.match(/'([^']*)'/);
|
|
1090
1090
|
return p ? p[1] ?? "" : "";
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function kt(y) {
|
|
1093
1093
|
if (!y || typeof y != "string") return null;
|
|
1094
1094
|
const u = y.trim().toUpperCase(), g = Qe(y) || Pe(y);
|
|
1095
1095
|
return g ? u.includes("SEARCH(") ? u.includes("ISERROR(SEARCH(") || u.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : u.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : u.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : u.includes("EXACT(") || u.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function _t(y, u, g) {
|
|
1098
1098
|
const p = (y || "").toLowerCase();
|
|
1099
1099
|
if (p === "cellis") {
|
|
1100
1100
|
const w = (u || "").toLowerCase();
|
|
@@ -1151,10 +1151,10 @@ function yt(y, u, g) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
return null;
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function At(y, u) {
|
|
1155
1155
|
if (!u.type) return null;
|
|
1156
1156
|
let g = (u.text ?? "").trim();
|
|
1157
|
-
const p = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, w = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") &&
|
|
1157
|
+
const p = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, w = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && kt(p);
|
|
1158
1158
|
if (w) {
|
|
1159
1159
|
const B = Xe(y);
|
|
1160
1160
|
if (!B) return null;
|
|
@@ -1176,7 +1176,7 @@ function kt(y, u) {
|
|
|
1176
1176
|
};
|
|
1177
1177
|
}
|
|
1178
1178
|
(u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = Qe(p), g || (g = Pe(p)));
|
|
1179
|
-
const C =
|
|
1179
|
+
const C = _t(u.type, u.operator, {
|
|
1180
1180
|
percent: u.percent,
|
|
1181
1181
|
bottom: u.bottom,
|
|
1182
1182
|
rank: u.rank,
|
|
@@ -1208,7 +1208,7 @@ function kt(y, u) {
|
|
|
1208
1208
|
conditionValue: S
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
|
-
async function
|
|
1211
|
+
async function Et({
|
|
1212
1212
|
sheetEditorRef: y,
|
|
1213
1213
|
ydocRef: u,
|
|
1214
1214
|
setForceSheetRender: g,
|
|
@@ -1249,9 +1249,9 @@ async function vt({
|
|
|
1249
1249
|
const _ = t[0];
|
|
1250
1250
|
if (_.state === "frozen") {
|
|
1251
1251
|
const A = _.xSplit || 0, P = _.ySplit || 0;
|
|
1252
|
-
let
|
|
1253
|
-
A > 0 && P > 0 ?
|
|
1254
|
-
type:
|
|
1252
|
+
let I = null;
|
|
1253
|
+
A > 0 && P > 0 ? I = "rangeBoth" : P > 0 ? I = "rangeRow" : A > 0 && (I = "rangeColumn"), I && (Me[te] = {
|
|
1254
|
+
type: I,
|
|
1255
1255
|
range: {
|
|
1256
1256
|
row_focus: P - 1,
|
|
1257
1257
|
column_focus: A - 1
|
|
@@ -1261,9 +1261,9 @@ async function vt({
|
|
|
1261
1261
|
}
|
|
1262
1262
|
const e = {};
|
|
1263
1263
|
Q.eachRow({ includeEmpty: !1 }, (_, A) => {
|
|
1264
|
-
_.eachCell({ includeEmpty: !1 }, (P,
|
|
1264
|
+
_.eachCell({ includeEmpty: !1 }, (P, I) => {
|
|
1265
1265
|
var se, K, v;
|
|
1266
|
-
const Y = `${A - 1}_${
|
|
1266
|
+
const Y = `${A - 1}_${I - 1}`;
|
|
1267
1267
|
P.hyperlink && (he[Y] = [
|
|
1268
1268
|
{
|
|
1269
1269
|
linkType: "webpage",
|
|
@@ -1303,7 +1303,7 @@ async function vt({
|
|
|
1303
1303
|
if (i && typeof i == "object") {
|
|
1304
1304
|
const _ = {};
|
|
1305
1305
|
for (const [A, P] of Object.entries(i)) {
|
|
1306
|
-
const Y =
|
|
1306
|
+
const Y = pt(A, P);
|
|
1307
1307
|
Y && (_[Y.rowColKey] = Y.entry);
|
|
1308
1308
|
}
|
|
1309
1309
|
Object.keys(_).length > 0 && (Ee[te] = _);
|
|
@@ -1312,8 +1312,8 @@ async function vt({
|
|
|
1312
1312
|
if (Array.isArray(o) && o.length > 0) {
|
|
1313
1313
|
const _ = [];
|
|
1314
1314
|
for (const A of o) {
|
|
1315
|
-
const P = A.ref,
|
|
1316
|
-
for (const Y of
|
|
1315
|
+
const P = A.ref, I = A.rules || [];
|
|
1316
|
+
for (const Y of I) {
|
|
1317
1317
|
const E = Y;
|
|
1318
1318
|
console.log("[XLSX CF RAW]", {
|
|
1319
1319
|
ref: P,
|
|
@@ -1327,7 +1327,7 @@ async function vt({
|
|
|
1327
1327
|
rank: E.rank,
|
|
1328
1328
|
aboveAverage: E.aboveAverage
|
|
1329
1329
|
});
|
|
1330
|
-
const $ = E.type ?
|
|
1330
|
+
const $ = E.type ? At(P, E) : null;
|
|
1331
1331
|
$ ? console.log("[XLSX CF MAPPED] accepted", $) : console.log("[XLSX CF MAPPED] skipped", {
|
|
1332
1332
|
ref: P,
|
|
1333
1333
|
type: E.type,
|
|
@@ -1364,17 +1364,17 @@ async function vt({
|
|
|
1364
1364
|
}
|
|
1365
1365
|
const te = u.current.getArray(p), he = Array.from(te), t = /* @__PURE__ */ new Map();
|
|
1366
1366
|
ie = ie.map((o, r) => {
|
|
1367
|
-
var $, G, se, K, v, f, a, c, k, l, s, O, L, j, W, N, be, Ce, me, q, pe, We,
|
|
1367
|
+
var $, G, se, K, v, f, a, c, k, l, s, O, L, j, W, N, be, Ce, me, q, pe, We, Ie, Ue, Ye;
|
|
1368
1368
|
const h = ($ = o == null ? void 0 : o.celldata) == null ? void 0 : $[o.celldata.length - 1], x = (h == null ? void 0 : h.r) ?? 0, d = (h == null ? void 0 : h.c) ?? 0;
|
|
1369
|
-
if (o.row = Math.max(x, 500), o.column = Math.max(d, 36), o.id || (o.id = ((G = D == null ? void 0 : D.generateSheetId) == null ? void 0 : G.call(D)) ?? ((se = y.current) == null ? void 0 : se.getSettings().generateSheetId()) ??
|
|
1369
|
+
if (o.row = Math.max(x, 500), o.column = Math.max(d, 36), o.id || (o.id = ((G = D == null ? void 0 : D.generateSheetId) == null ? void 0 : G.call(D)) ?? ((se = y.current) == null ? void 0 : se.getSettings().generateSheetId()) ?? ht()), Me[r] && (o.frozen = Me[r]), ye[r] && (o.hyperlink = {
|
|
1370
1370
|
...o.hyperlink || {},
|
|
1371
1371
|
...ye[r]
|
|
1372
1372
|
}), (K = o.config) != null && K.columnlen) {
|
|
1373
1373
|
const b = {};
|
|
1374
1374
|
Object.entries(o.config.columnlen).forEach(
|
|
1375
1375
|
([V, T]) => {
|
|
1376
|
-
const
|
|
1377
|
-
b[V] = Math.round(
|
|
1376
|
+
const U = (Number(T) - 5) / 8 + 0.83;
|
|
1377
|
+
b[V] = Math.round(U * 7 + 5);
|
|
1378
1378
|
}
|
|
1379
1379
|
), o.config.columnlen = b;
|
|
1380
1380
|
}
|
|
@@ -1391,8 +1391,8 @@ async function vt({
|
|
|
1391
1391
|
const b = Math.round(
|
|
1392
1392
|
Number(o.defaultRowHeight) || 21
|
|
1393
1393
|
), V = {};
|
|
1394
|
-
Object.entries(o.config.rowlen).forEach(([T,
|
|
1395
|
-
Math.abs(Math.round(Number(
|
|
1394
|
+
Object.entries(o.config.rowlen).forEach(([T, U]) => {
|
|
1395
|
+
Math.abs(Math.round(Number(U)) - b) > 1 && (V[T] = Number(U));
|
|
1396
1396
|
}), o.config.rowlen = V;
|
|
1397
1397
|
}
|
|
1398
1398
|
if ((a = o.config) != null && a.customHeight) {
|
|
@@ -1400,8 +1400,8 @@ async function vt({
|
|
|
1400
1400
|
Object.keys(o.config.rowlen || {})
|
|
1401
1401
|
), V = {};
|
|
1402
1402
|
Object.entries(o.config.customHeight).forEach(
|
|
1403
|
-
([T,
|
|
1404
|
-
b.has(T) && Number(
|
|
1403
|
+
([T, U]) => {
|
|
1404
|
+
b.has(T) && Number(U) === 1 && (V[T] = 1);
|
|
1405
1405
|
}
|
|
1406
1406
|
), o.config.customHeight = V;
|
|
1407
1407
|
}
|
|
@@ -1418,11 +1418,11 @@ async function vt({
|
|
|
1418
1418
|
V
|
|
1419
1419
|
);
|
|
1420
1420
|
}
|
|
1421
|
-
const A = ye[r], P = Se[r],
|
|
1421
|
+
const A = ye[r], P = Se[r], I = [], Y = (b, V) => {
|
|
1422
1422
|
const T = `${b}_${V}`;
|
|
1423
1423
|
Y._seen == null && (Y._seen = /* @__PURE__ */ new Set());
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1424
|
+
const U = Y._seen;
|
|
1425
|
+
U.has(T) || (U.add(T), I.push({ r: b, c: V, id: o.id }));
|
|
1426
1426
|
}, E = (j = o.config) != null && j.merge ? /* @__PURE__ */ new Map() : null;
|
|
1427
1427
|
if (o.celldata)
|
|
1428
1428
|
for (const b of o.celldata) {
|
|
@@ -1445,12 +1445,12 @@ async function vt({
|
|
|
1445
1445
|
}
|
|
1446
1446
|
if (A != null && A[V] && !b.v.f) {
|
|
1447
1447
|
const H = A[V][0];
|
|
1448
|
-
H &&
|
|
1448
|
+
H && ct(
|
|
1449
1449
|
b.v,
|
|
1450
1450
|
H
|
|
1451
1451
|
);
|
|
1452
1452
|
}
|
|
1453
|
-
const T = (N = b.v.ct) == null ? void 0 : N.fa,
|
|
1453
|
+
const T = (N = b.v.ct) == null ? void 0 : N.fa, U = typeof T == "string" ? T.trim().toLowerCase() : "", re = U === "general" || ((be = b.v.ct) == null ? void 0 : be.t) === "g", ue = U === "@" || ((Ce = b.v.ct) == null ? void 0 : Ce.t) === "s";
|
|
1454
1454
|
if (T && !t.has(T) && t.set(T, De.is_date(T)), !b.v.f && T && t.get(T)) {
|
|
1455
1455
|
const H = typeof b.v.v == "string" ? parseFloat(b.v.v) : b.v.v;
|
|
1456
1456
|
if (typeof H == "number" && !isNaN(H))
|
|
@@ -1476,14 +1476,14 @@ async function vt({
|
|
|
1476
1476
|
}
|
|
1477
1477
|
} else !b.v.f && typeof b.v.v == "number" && isFinite(b.v.v) && ((me = b.v.ct) == null ? void 0 : me.t) !== "s" && ((q = b.v.ct) == null ? void 0 : q.t) !== "d" && b.v.ht == null && (b.v.ht = 2);
|
|
1478
1478
|
if (!b.v.f && (b.v.m === void 0 || b.v.m === null) && ((pe = b.v.ct) == null ? void 0 : pe.t) !== "d") {
|
|
1479
|
-
const H =
|
|
1479
|
+
const H = gt((We = b.v.ct) == null ? void 0 : We.s), X = b.v.v;
|
|
1480
1480
|
if (!(X == null || String(X).trim() === ""))
|
|
1481
1481
|
if (H != null)
|
|
1482
1482
|
b.v.m = H;
|
|
1483
1483
|
else if (typeof X == "boolean")
|
|
1484
|
-
b.v.m =
|
|
1484
|
+
b.v.m = dt(X);
|
|
1485
1485
|
else if (typeof X == "number" && isFinite(X)) {
|
|
1486
|
-
const ne = (
|
|
1486
|
+
const ne = (Ie = b.v.ct) == null ? void 0 : Ie.fa;
|
|
1487
1487
|
if (typeof ne == "string" && ne && t.get(ne) === !1)
|
|
1488
1488
|
try {
|
|
1489
1489
|
b.v.m = De.format(ne, X);
|
|
@@ -1501,29 +1501,29 @@ async function vt({
|
|
|
1501
1501
|
for (let V = 0; V < b.length; V++) {
|
|
1502
1502
|
const T = b[V];
|
|
1503
1503
|
if (Array.isArray(T))
|
|
1504
|
-
for (let
|
|
1505
|
-
const re = T[
|
|
1504
|
+
for (let U = 0; U < T.length; U++) {
|
|
1505
|
+
const re = T[U];
|
|
1506
1506
|
if (!re || typeof re != "object" || !re.f) continue;
|
|
1507
1507
|
const ue = String(re.f);
|
|
1508
|
-
ue.startsWith("=") || (re.f = `=${ue}`), ((
|
|
1508
|
+
ue.startsWith("=") || (re.f = `=${ue}`), ((Ue = re.ct) == null ? void 0 : Ue.t) !== "d" && (re.ct = { ...re.ct ?? {}, t: "str" }, Y(V, U));
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
if (o.calcChain =
|
|
1512
|
+
if (o.calcChain = I, E && ((Ye = o.config) != null && Ye.merge) && o.celldata)
|
|
1513
1513
|
for (const b of Object.values(o.config.merge)) {
|
|
1514
|
-
const { r: V, c: T, rs:
|
|
1515
|
-
for (let ue = 0; ue <
|
|
1514
|
+
const { r: V, c: T, rs: U, cs: re } = b;
|
|
1515
|
+
for (let ue = 0; ue < U; ue++)
|
|
1516
1516
|
for (let H = 0; H < re; H++) {
|
|
1517
1517
|
const X = `${V + ue}_${T + H}`, fe = ue === 0 && H === 0;
|
|
1518
1518
|
let ne = E.get(X);
|
|
1519
|
-
ne ? (ne.v || (ne.v = {}), ne.v.mc = fe ? { r: V, c: T, rs:
|
|
1519
|
+
ne ? (ne.v || (ne.v = {}), ne.v.mc = fe ? { r: V, c: T, rs: U, cs: re } : { r: V, c: T }) : (ne = {
|
|
1520
1520
|
r: V + ue,
|
|
1521
1521
|
c: T + H,
|
|
1522
|
-
v: fe ? { mc: { r: V, c: T, rs:
|
|
1522
|
+
v: fe ? { mc: { r: V, c: T, rs: U, cs: re } } : { mc: { r: V, c: T } }
|
|
1523
1523
|
}, o.celldata.push(ne), E.set(X, ne));
|
|
1524
1524
|
}
|
|
1525
1525
|
}
|
|
1526
|
-
return o;
|
|
1526
|
+
return tt(o), rt(o), o;
|
|
1527
1527
|
}), console.log("[xlsx-import] parsed sheets data", {
|
|
1528
1528
|
fileName: le.name,
|
|
1529
1529
|
sheetCount: ie.length,
|
|
@@ -1537,7 +1537,7 @@ async function vt({
|
|
|
1537
1537
|
).filter(Boolean)
|
|
1538
1538
|
);
|
|
1539
1539
|
ie.forEach((r) => {
|
|
1540
|
-
const h = r.name ?? "", x =
|
|
1540
|
+
const h = r.name ?? "", x = ft(h, o);
|
|
1541
1541
|
x !== h && (r.name = x), o.add(x);
|
|
1542
1542
|
}), e = [...he, ...ie];
|
|
1543
1543
|
} else
|
|
@@ -1545,17 +1545,17 @@ async function vt({
|
|
|
1545
1545
|
if (e = e.map((o, r) => (o.order = r, o)), u.current.transact(() => {
|
|
1546
1546
|
ke !== "merge-current-dsheet" && te.delete(0, te.length), e.forEach((o) => {
|
|
1547
1547
|
if (o instanceof Ge.Map) return;
|
|
1548
|
-
const r =
|
|
1548
|
+
const r = nt(o);
|
|
1549
1549
|
te.push([r()]);
|
|
1550
1550
|
});
|
|
1551
1551
|
}), u != null && u.current) {
|
|
1552
|
-
const o = u.current.getArray(p), r =
|
|
1552
|
+
const o = u.current.getArray(p), r = at(o);
|
|
1553
1553
|
w.current = r, g((h) => h + 1);
|
|
1554
1554
|
}
|
|
1555
1555
|
setTimeout(() => {
|
|
1556
1556
|
R == null || R();
|
|
1557
|
-
}, 200), D != null && D.headless ||
|
|
1558
|
-
const m =
|
|
1557
|
+
}, 200), D != null && D.headless || bt(y);
|
|
1558
|
+
const m = it((i = Q == null ? void 0 : Q.info) == null ? void 0 : i.name);
|
|
1559
1559
|
C == null || C(m), M();
|
|
1560
1560
|
}
|
|
1561
1561
|
);
|
|
@@ -1568,5 +1568,5 @@ async function vt({
|
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
1570
1570
|
export {
|
|
1571
|
-
|
|
1571
|
+
Et as runXlsxFileUpload
|
|
1572
1572
|
};
|