@fileverse-dev/dsheet 3.0.0 → 3.0.1-yjs-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/dist/{constants-yStXQJiK.js → constants-Cdz6oSCq.js} +5 -7
- package/dist/constants.js +1 -1
- package/dist/editor/constants/shared-constants.d.ts +0 -2
- package/dist/editor/utils/config-ydoc-update.d.ts +20 -0
- package/dist/{executeStringFunction-C5hEkx9z.js → executeStringFunction-B2qjYgmE.js} +13459 -9239
- package/dist/formula.js +1 -1
- package/dist/{index-CBzFxleP.js → index-C7kCuqoG.js} +21253 -24580
- package/dist/index.es.js +42 -42
- package/dist/observability/publish-trace.d.ts +26 -0
- package/dist/sheet-engine/core/api/cell.d.ts +0 -20
- package/dist/sheet-engine/core/api/common.d.ts +2 -1
- package/dist/sheet-engine/core/api/index.d.ts +1 -0
- package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +15 -0
- package/dist/sheet-engine/core/api/sheet.d.ts +5 -0
- package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +1 -0
- package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +23 -0
- package/dist/sheet-engine/core/types.d.ts +3 -0
- package/dist/sheet-engine/core/utils/border-config-utils.d.ts +10 -0
- package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +8 -0
- package/dist/sheet-engine/core/utils/range-format.d.ts +43 -0
- package/dist/sheet-engine/react/components/Workbook/api.d.ts +8 -1
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +5 -1
- package/dist/{use-xlsx-import-impl-C_npga_I.js → use-xlsx-import-impl-BQsXcyKJ.js} +491 -477
- package/dist/{xlsx-export-impl-C2cU3lhm.js → xlsx-export-impl-BBux0CIG.js} +1106 -1106
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import * as
|
|
3
|
-
import { m as
|
|
4
|
-
import { n as
|
|
5
|
-
import { toast as
|
|
6
|
-
var
|
|
7
|
-
(function(
|
|
8
|
-
var
|
|
1
|
+
import { g as Qe } from "./executeStringFunction-B2qjYgmE.js";
|
|
2
|
+
import * as Ke from "yjs";
|
|
3
|
+
import { m as et, y as tt, r as rt } from "./index-C7kCuqoG.js";
|
|
4
|
+
import { n as nt } from "./xlsx-hyperlink-inline-DzewAypN.js";
|
|
5
|
+
import { toast as Ye } from "@fileverse/ui";
|
|
6
|
+
var Xe = { exports: {} };
|
|
7
|
+
(function(k) {
|
|
8
|
+
var s = {}, g = function(p) {
|
|
9
9
|
p.version = "0.11.2";
|
|
10
10
|
function v(t) {
|
|
11
11
|
for (var r = "", n = t.length - 1; n >= 0; ) r += t.charAt(n--);
|
|
@@ -15,11 +15,11 @@ var ze = { exports: {} };
|
|
|
15
15
|
for (var n = ""; n.length < r; ) n += t;
|
|
16
16
|
return n;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function T(t, r) {
|
|
19
19
|
var n = "" + t;
|
|
20
20
|
return n.length >= r ? n : $("0", r - n.length) + n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function D(t, r) {
|
|
23
23
|
var n = "" + t;
|
|
24
24
|
return n.length >= r ? n : $(" ", r - n.length) + n;
|
|
25
25
|
}
|
|
@@ -31,7 +31,7 @@ var ze = { exports: {} };
|
|
|
31
31
|
var n = "" + Math.round(t);
|
|
32
32
|
return n.length >= r ? n : $("0", r - n.length) + n;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function V(t, r) {
|
|
35
35
|
var n = "" + t;
|
|
36
36
|
return n.length >= r ? n : $("0", r - n.length) + n;
|
|
37
37
|
}
|
|
@@ -39,7 +39,7 @@ var ze = { exports: {} };
|
|
|
39
39
|
function re(t, r) {
|
|
40
40
|
if (t > ie || t < -ie) return J(t, r);
|
|
41
41
|
var n = Math.round(t);
|
|
42
|
-
return
|
|
42
|
+
return V(n, r);
|
|
43
43
|
}
|
|
44
44
|
function fe(t, r) {
|
|
45
45
|
return r = r || 0, t.length >= 7 + r && (t.charCodeAt(r) | 32) === 103 && (t.charCodeAt(r + 1) | 32) === 101 && (t.charCodeAt(r + 2) | 32) === 110 && (t.charCodeAt(r + 3) | 32) === 101 && (t.charCodeAt(r + 4) | 32) === 114 && (t.charCodeAt(r + 5) | 32) === 97 && (t.charCodeAt(r + 6) | 32) === 108;
|
|
@@ -85,25 +85,25 @@ var ze = { exports: {} };
|
|
|
85
85
|
var G = [];
|
|
86
86
|
G[5] = G[63] = '"$"#,##0_);\\("$"#,##0\\)', G[6] = G[64] = '"$"#,##0_);[Red]\\("$"#,##0\\)', G[7] = G[65] = '"$"#,##0.00_);\\("$"#,##0.00\\)', G[8] = G[66] = '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', G[41] = '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', G[42] = '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', G[43] = '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', G[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';
|
|
87
87
|
function we(t, r, n) {
|
|
88
|
-
for (var m = t < 0 ? -1 : 1, e = t * m,
|
|
89
|
-
e = 1 / (e -
|
|
90
|
-
if (
|
|
91
|
-
var
|
|
92
|
-
return [
|
|
88
|
+
for (var m = t < 0 ? -1 : 1, e = t * m, b = 0, a = 1, f = 0, C = 1, u = 0, y = 0, _ = Math.floor(e); u < r && (_ = Math.floor(e), f = _ * a + b, y = _ * u + C, !(e - _ < 5e-8)); )
|
|
89
|
+
e = 1 / (e - _), b = a, a = f, C = u, u = y;
|
|
90
|
+
if (y > r && (u > r ? (y = C, f = b) : (y = u, f = a)), !n) return [0, m * f, y];
|
|
91
|
+
var H = Math.floor(m * f / y);
|
|
92
|
+
return [H, m * f - H * y, y];
|
|
93
93
|
}
|
|
94
94
|
function ye(t, r, n) {
|
|
95
95
|
if (t > 2958465 || t < 0) return null;
|
|
96
|
-
var m = t | 0, e = Math.floor(86400 * (t - m)),
|
|
96
|
+
var m = t | 0, e = Math.floor(86400 * (t - m)), b = 0, a = [], f = { D: m, T: e, u: 86400 * (t - m) - e, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
|
|
97
97
|
if (Math.abs(f.u) < 1e-6 && (f.u = 0), r && r.date1904 && (m += 1462), f.u > 0.9999 && (f.u = 0, ++e == 86400 && (f.T = e = 0, ++m, ++f.D)), m === 60)
|
|
98
|
-
a = n ? [1317, 10, 29] : [1900, 2, 29],
|
|
98
|
+
a = n ? [1317, 10, 29] : [1900, 2, 29], b = 3;
|
|
99
99
|
else if (m === 0)
|
|
100
|
-
a = n ? [1317, 8, 29] : [1900, 1, 0],
|
|
100
|
+
a = n ? [1317, 8, 29] : [1900, 1, 0], b = 6;
|
|
101
101
|
else {
|
|
102
102
|
m > 60 && --m;
|
|
103
103
|
var C = new Date(1900, 0, 1);
|
|
104
|
-
C.setDate(C.getDate() + m - 1), a = [C.getFullYear(), C.getMonth() + 1, C.getDate()],
|
|
104
|
+
C.setDate(C.getDate() + m - 1), a = [C.getFullYear(), C.getMonth() + 1, C.getDate()], b = C.getDay(), m < 60 && (b = (b + 6) % 7), n && (b = Fe(C, a));
|
|
105
105
|
}
|
|
106
|
-
return f.y = a[0], f.m = a[1], f.d = a[2], f.S = e % 60, e = Math.floor(e / 60), f.M = e % 60, e = Math.floor(e / 60), f.H = e, f.q =
|
|
106
|
+
return f.y = a[0], f.m = a[1], f.d = a[2], f.S = e % 60, e = Math.floor(e / 60), f.M = e % 60, e = Math.floor(e / 60), f.H = e, f.q = b, f;
|
|
107
107
|
}
|
|
108
108
|
p.parse_date_code = ye;
|
|
109
109
|
var Se = new Date(1899, 11, 31, 0, 0, 0), Re = Se.getTime(), Le = new Date(1900, 2, 1, 0, 0, 0);
|
|
@@ -117,24 +117,24 @@ var ze = { exports: {} };
|
|
|
117
117
|
p._general_int = He;
|
|
118
118
|
var Te = /* @__PURE__ */ function() {
|
|
119
119
|
var r = /(?:\.0*|(\.\d*[1-9])0+)$/;
|
|
120
|
-
function n(
|
|
121
|
-
return
|
|
120
|
+
function n(u) {
|
|
121
|
+
return u.indexOf(".") == -1 ? u : u.replace(r, "$1");
|
|
122
122
|
}
|
|
123
123
|
var m = /(?:\.0*|(\.\d*[1-9])0+)[Ee]/, e = /(E[+-])(\d)$/;
|
|
124
|
-
function
|
|
125
|
-
return
|
|
124
|
+
function b(u) {
|
|
125
|
+
return u.indexOf("E") == -1 ? u : u.replace(m, "$1E").replace(e, "$10$2");
|
|
126
126
|
}
|
|
127
|
-
function a(
|
|
128
|
-
var
|
|
129
|
-
return
|
|
127
|
+
function a(u) {
|
|
128
|
+
var y = u < 0 ? 12 : 11, _ = n(u.toFixed(12));
|
|
129
|
+
return _.length <= y || (_ = u.toPrecision(10), _.length <= y) ? _ : u.toExponential(5);
|
|
130
130
|
}
|
|
131
|
-
function f(
|
|
132
|
-
var
|
|
133
|
-
return
|
|
131
|
+
function f(u) {
|
|
132
|
+
var y = n(u.toFixed(11));
|
|
133
|
+
return y.length > (u < 0 ? 12 : 11) || y === "0" || y === "-0" ? u.toPrecision(6) : y;
|
|
134
134
|
}
|
|
135
|
-
function C(
|
|
136
|
-
var
|
|
137
|
-
return
|
|
135
|
+
function C(u) {
|
|
136
|
+
var y = Math.floor(Math.log(Math.abs(u)) * Math.LOG10E), _;
|
|
137
|
+
return y >= -4 && y <= -1 ? _ = u.toPrecision(10 + y) : Math.abs(y) <= 9 ? _ = a(u) : y === 10 ? _ = u.toFixed(10).substr(0, 12) : _ = f(u), n(b(_.toUpperCase()));
|
|
138
138
|
}
|
|
139
139
|
return C;
|
|
140
140
|
}();
|
|
@@ -162,7 +162,7 @@ var ze = { exports: {} };
|
|
|
162
162
|
return t < 60 && (n = (n + 6) % 7), n;
|
|
163
163
|
}
|
|
164
164
|
function Ve(t, r, n, m) {
|
|
165
|
-
var e = "",
|
|
165
|
+
var e = "", b = 0, a = 0, f = n.y, C, u = 0;
|
|
166
166
|
switch (t) {
|
|
167
167
|
case 98:
|
|
168
168
|
f = n.y + 543;
|
|
@@ -170,10 +170,10 @@ var ze = { exports: {} };
|
|
|
170
170
|
switch (r.length) {
|
|
171
171
|
case 1:
|
|
172
172
|
case 2:
|
|
173
|
-
C = f % 100,
|
|
173
|
+
C = f % 100, u = 2;
|
|
174
174
|
break;
|
|
175
175
|
default:
|
|
176
|
-
C = f % 1e4,
|
|
176
|
+
C = f % 1e4, u = 4;
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
break;
|
|
@@ -181,7 +181,7 @@ var ze = { exports: {} };
|
|
|
181
181
|
switch (r.length) {
|
|
182
182
|
case 1:
|
|
183
183
|
case 2:
|
|
184
|
-
C = n.m,
|
|
184
|
+
C = n.m, u = r.length;
|
|
185
185
|
break;
|
|
186
186
|
case 3:
|
|
187
187
|
return Ae[n.m - 1][1];
|
|
@@ -195,7 +195,7 @@ var ze = { exports: {} };
|
|
|
195
195
|
switch (r.length) {
|
|
196
196
|
case 1:
|
|
197
197
|
case 2:
|
|
198
|
-
C = n.d,
|
|
198
|
+
C = n.d, u = r.length;
|
|
199
199
|
break;
|
|
200
200
|
case 3:
|
|
201
201
|
return Ce[n.q][0];
|
|
@@ -207,7 +207,7 @@ var ze = { exports: {} };
|
|
|
207
207
|
switch (r.length) {
|
|
208
208
|
case 1:
|
|
209
209
|
case 2:
|
|
210
|
-
C = 1 + (n.H + 11) % 12,
|
|
210
|
+
C = 1 + (n.H + 11) % 12, u = r.length;
|
|
211
211
|
break;
|
|
212
212
|
default:
|
|
213
213
|
throw "bad hour format: " + r;
|
|
@@ -217,7 +217,7 @@ var ze = { exports: {} };
|
|
|
217
217
|
switch (r.length) {
|
|
218
218
|
case 1:
|
|
219
219
|
case 2:
|
|
220
|
-
C = n.H,
|
|
220
|
+
C = n.H, u = r.length;
|
|
221
221
|
break;
|
|
222
222
|
default:
|
|
223
223
|
throw "bad hour format: " + r;
|
|
@@ -227,7 +227,7 @@ var ze = { exports: {} };
|
|
|
227
227
|
switch (r.length) {
|
|
228
228
|
case 1:
|
|
229
229
|
case 2:
|
|
230
|
-
C = n.M,
|
|
230
|
+
C = n.M, u = r.length;
|
|
231
231
|
break;
|
|
232
232
|
default:
|
|
233
233
|
throw "bad minute format: " + r;
|
|
@@ -235,7 +235,7 @@ var ze = { exports: {} };
|
|
|
235
235
|
break;
|
|
236
236
|
case 115:
|
|
237
237
|
if (r != "s" && r != "ss" && r != ".0" && r != ".00" && r != ".000") throw "bad second format: " + r;
|
|
238
|
-
return n.u === 0 && (r == "s" || r == "ss") ?
|
|
238
|
+
return n.u === 0 && (r == "s" || r == "ss") ? T(n.S, r.length) : (m >= 2 ? a = m === 3 ? 1e3 : 100 : a = m === 1 ? 10 : 1, b = Math.round(a * (n.S + n.u)), b >= 60 * a && (b = 0), r === "s" ? b === 0 ? "0" : "" + b / a : (e = T(b, 2 + m), r === "ss" ? e.substr(0, 2) : "." + e.substr(2, r.length - 1)));
|
|
239
239
|
case 90:
|
|
240
240
|
switch (r) {
|
|
241
241
|
case "[h]":
|
|
@@ -253,14 +253,14 @@ var ze = { exports: {} };
|
|
|
253
253
|
default:
|
|
254
254
|
throw "bad abstime format: " + r;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
u = r.length === 3 ? 1 : 2;
|
|
257
257
|
break;
|
|
258
258
|
case 101:
|
|
259
|
-
C = f,
|
|
259
|
+
C = f, u = 1;
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
return
|
|
262
|
+
var y = u > 0 ? T(C, u) : "";
|
|
263
|
+
return y;
|
|
264
264
|
}
|
|
265
265
|
function oe(t) {
|
|
266
266
|
var r = 3;
|
|
@@ -271,44 +271,44 @@ var ze = { exports: {} };
|
|
|
271
271
|
var ne = /* @__PURE__ */ function() {
|
|
272
272
|
var r = /%/g;
|
|
273
273
|
function n(h, i, c) {
|
|
274
|
-
var
|
|
275
|
-
return ne(h,
|
|
274
|
+
var A = i.replace(r, ""), o = i.length - A.length;
|
|
275
|
+
return ne(h, A, c * Math.pow(10, 2 * o)) + $("%", o);
|
|
276
276
|
}
|
|
277
277
|
function m(h, i, c) {
|
|
278
|
-
for (var
|
|
279
|
-
return ne(h, i.substr(0,
|
|
278
|
+
for (var A = i.length - 1; i.charCodeAt(A - 1) === 44; ) --A;
|
|
279
|
+
return ne(h, i.substr(0, A), c / Math.pow(10, 3 * (i.length - A)));
|
|
280
280
|
}
|
|
281
281
|
function e(h, i) {
|
|
282
|
-
var c,
|
|
282
|
+
var c, A = h.indexOf("E") - h.indexOf(".") - 1;
|
|
283
283
|
if (h.match(/^#+0.0E\+0$/)) {
|
|
284
284
|
if (i == 0) return "0.0E+0";
|
|
285
285
|
if (i < 0) return "-" + e(h, -i);
|
|
286
286
|
var o = h.indexOf(".");
|
|
287
287
|
o === -1 && (o = h.indexOf("E"));
|
|
288
|
-
var
|
|
289
|
-
if (
|
|
288
|
+
var l = Math.floor(Math.log(i) * Math.LOG10E) % o;
|
|
289
|
+
if (l < 0 && (l += o), c = (i / Math.pow(10, l)).toPrecision(A + 1 + (o + l) % o), c.indexOf("e") === -1) {
|
|
290
290
|
var E = Math.floor(Math.log(i) * Math.LOG10E);
|
|
291
|
-
for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length +
|
|
291
|
+
for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + l) : c += "E+" + (E - l); c.substr(0, 2) === "0."; )
|
|
292
292
|
c = c.charAt(0) + c.substr(2, o) + "." + c.substr(2 + o), c = c.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
|
|
293
293
|
c = c.replace(/\+-/, "-");
|
|
294
294
|
}
|
|
295
|
-
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(
|
|
296
|
-
return
|
|
295
|
+
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
|
|
296
|
+
return B + W + N.substr(0, (o + l) % o) + "." + N.substr(l) + "E";
|
|
297
297
|
});
|
|
298
|
-
} else c = i.toExponential(
|
|
298
|
+
} else c = i.toExponential(A);
|
|
299
299
|
return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
|
|
300
300
|
}
|
|
301
|
-
var
|
|
301
|
+
var b = /# (\?+)( ?)\/( ?)(\d+)/;
|
|
302
302
|
function a(h, i, c) {
|
|
303
|
-
var
|
|
304
|
-
return c + (
|
|
303
|
+
var A = parseInt(h[4], 10), o = Math.round(i * A), l = Math.floor(o / A), E = o - l * A, L = A;
|
|
304
|
+
return c + (l === 0 ? "" : "" + l) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : D(E, h[1].length) + h[2] + "/" + h[3] + T(L, h[4].length));
|
|
305
305
|
}
|
|
306
306
|
function f(h, i, c) {
|
|
307
307
|
return c + (i === 0 ? "" : "" + i) + $(" ", h[1].length + 2 + h[4].length);
|
|
308
308
|
}
|
|
309
|
-
var C = /^#*0*\.([0#]+)/,
|
|
310
|
-
function
|
|
311
|
-
for (var i = "", c,
|
|
309
|
+
var C = /^#*0*\.([0#]+)/, u = /\).*[0#]/, y = /\(###\) ###\\?-####/;
|
|
310
|
+
function _(h) {
|
|
311
|
+
for (var i = "", c, A = 0; A != h.length; ++A) switch (c = h.charCodeAt(A)) {
|
|
312
312
|
case 35:
|
|
313
313
|
break;
|
|
314
314
|
case 63:
|
|
@@ -322,74 +322,74 @@ var ze = { exports: {} };
|
|
|
322
322
|
}
|
|
323
323
|
return i;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function H(h, i) {
|
|
326
326
|
var c = Math.pow(10, i);
|
|
327
327
|
return "" + Math.round(h * c) / c;
|
|
328
328
|
}
|
|
329
329
|
function U(h, i) {
|
|
330
|
-
var c = h - Math.floor(h),
|
|
331
|
-
return i < ("" + Math.round(c *
|
|
330
|
+
var c = h - Math.floor(h), A = Math.pow(10, i);
|
|
331
|
+
return i < ("" + Math.round(c * A)).length ? 0 : Math.round(c * A);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function S(h, i) {
|
|
334
334
|
return i < ("" + Math.round((h - Math.floor(h)) * Math.pow(10, i))).length ? 1 : 0;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function R(h) {
|
|
337
337
|
return h < 2147483647 && h > -2147483648 ? "" + (h >= 0 ? h | 0 : h - 1 | 0) : "" + Math.floor(h);
|
|
338
338
|
}
|
|
339
339
|
function O(h, i, c) {
|
|
340
|
-
if (h.charCodeAt(0) === 40 && !i.match(
|
|
341
|
-
var
|
|
342
|
-
return c >= 0 ? O("n",
|
|
340
|
+
if (h.charCodeAt(0) === 40 && !i.match(u)) {
|
|
341
|
+
var A = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
|
|
342
|
+
return c >= 0 ? O("n", A, c) : "(" + O("n", A, -c) + ")";
|
|
343
343
|
}
|
|
344
344
|
if (i.charCodeAt(i.length - 1) === 44) return m(h, i, c);
|
|
345
345
|
if (i.indexOf("%") !== -1) return n(h, i, c);
|
|
346
346
|
if (i.indexOf("E") !== -1) return e(i, c);
|
|
347
347
|
if (i.charCodeAt(0) === 36) return "$" + O(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
|
|
348
|
-
var o,
|
|
349
|
-
if (i.match(/^00+$/)) return W + re(
|
|
348
|
+
var o, l, E, L, B = Math.abs(c), W = c < 0 ? "-" : "";
|
|
349
|
+
if (i.match(/^00+$/)) return W + re(B, i.length);
|
|
350
350
|
if (i.match(/^[#?]+$/))
|
|
351
|
-
return o = re(c, 0), o === "0" && (o = ""), o.length > i.length ? o :
|
|
352
|
-
if (
|
|
353
|
-
if (i.match(/^#+0+$/)) return W + re(
|
|
354
|
-
if (
|
|
355
|
-
return o =
|
|
356
|
-
return "." + pe + $("0",
|
|
351
|
+
return o = re(c, 0), o === "0" && (o = ""), o.length > i.length ? o : _(i.substr(0, i.length - o.length)) + o;
|
|
352
|
+
if (l = i.match(b)) return a(l, B, W);
|
|
353
|
+
if (i.match(/^#+0+$/)) return W + re(B, i.length - i.indexOf("0"));
|
|
354
|
+
if (l = i.match(C))
|
|
355
|
+
return o = H(c, l[1].length).replace(/^([^\.]+)$/, "$1." + _(l[1])).replace(/\.$/, "." + _(l[1])).replace(/\.(\d*)$/, function(z, pe) {
|
|
356
|
+
return "." + pe + $("0", _(l[1]).length - pe.length);
|
|
357
357
|
}), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
|
|
358
|
-
if (i = i.replace(/^#+([0.])/, "$1"),
|
|
359
|
-
return W +
|
|
360
|
-
if (
|
|
361
|
-
if (
|
|
362
|
-
return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) +
|
|
363
|
-
if (
|
|
364
|
-
if (
|
|
358
|
+
if (i = i.replace(/^#+([0.])/, "$1"), l = i.match(/^(0*)\.(#*)$/))
|
|
359
|
+
return W + H(B, l[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, l[1].length ? "0." : ".");
|
|
360
|
+
if (l = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(re(B, 0));
|
|
361
|
+
if (l = i.match(/^#,##0\.([#0]*0)$/))
|
|
362
|
+
return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + S(c, l[1].length))) + "." + T(U(c, l[1].length), l[1].length);
|
|
363
|
+
if (l = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
|
|
364
|
+
if (l = i.match(/^([0#]+)(\\?-([0#]+))+$/))
|
|
365
365
|
return o = v(O(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
|
|
366
366
|
return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
|
|
367
367
|
}));
|
|
368
|
-
if (i.match(
|
|
368
|
+
if (i.match(y))
|
|
369
369
|
return o = O(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
|
|
370
|
-
var
|
|
371
|
-
if (
|
|
372
|
-
return E = Math.min(
|
|
373
|
-
if (
|
|
374
|
-
return E = Math.min(Math.max(
|
|
375
|
-
if (
|
|
376
|
-
return o = re(c, 0), i.length <= o.length ? o :
|
|
377
|
-
if (
|
|
378
|
-
o = "" + c.toFixed(Math.min(
|
|
370
|
+
var N = "";
|
|
371
|
+
if (l = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
372
|
+
return E = Math.min(l[4].length, 7), L = we(B, Math.pow(10, E) - 1, !1), o = "" + W, N = ne("n", l[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), o += N + l[2] + "/" + l[3], N = I(L[2], E), N.length < l[4].length && (N = _(l[4].substr(l[4].length - N.length)) + N), o += N, o;
|
|
373
|
+
if (l = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
374
|
+
return E = Math.min(Math.max(l[1].length, l[4].length), 7), L = we(B, Math.pow(10, E) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? D(L[1], E) + l[2] + "/" + l[3] + I(L[2], E) : $(" ", 2 * E + 1 + l[2].length + l[3].length));
|
|
375
|
+
if (l = i.match(/^[#0?]+$/))
|
|
376
|
+
return o = re(c, 0), i.length <= o.length ? o : _(i.substr(0, i.length - o.length)) + o;
|
|
377
|
+
if (l = i.match(/^([#0?]+)\.([#0]+)$/)) {
|
|
378
|
+
o = "" + c.toFixed(Math.min(l[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
|
|
379
379
|
var be = i.indexOf(".") - E, ve = i.length - o.length - be;
|
|
380
|
-
return
|
|
380
|
+
return _(i.substr(0, be) + o + i.substr(i.length - ve));
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
383
|
-
return E = U(c,
|
|
384
|
-
return "00," + (z.length < 3 ?
|
|
385
|
-
}) + "." +
|
|
382
|
+
if (l = i.match(/^00,000\.([#0]*0)$/))
|
|
383
|
+
return E = U(c, l[1].length), c < 0 ? "-" + O(h, i, -c) : oe(R(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
|
|
384
|
+
return "00," + (z.length < 3 ? T(0, 3 - z.length) : "") + z;
|
|
385
|
+
}) + "." + T(E, l[1].length);
|
|
386
386
|
switch (i) {
|
|
387
387
|
case "###,##0.00":
|
|
388
388
|
return O(h, "#,##0.00", c);
|
|
389
389
|
case "###,###":
|
|
390
390
|
case "##,###":
|
|
391
391
|
case "#,###":
|
|
392
|
-
var me = oe(re(
|
|
392
|
+
var me = oe(re(B, 0));
|
|
393
393
|
return me !== "0" ? W + me : "";
|
|
394
394
|
case "###,###.00":
|
|
395
395
|
return O(h, "###,##0.00", c).replace(/^0\./, ".");
|
|
@@ -399,91 +399,91 @@ var ze = { exports: {} };
|
|
|
399
399
|
throw new Error("unsupported format |" + i + "|");
|
|
400
400
|
}
|
|
401
401
|
function se(h, i, c) {
|
|
402
|
-
for (var
|
|
403
|
-
return ne(h, i.substr(0,
|
|
402
|
+
for (var A = i.length - 1; i.charCodeAt(A - 1) === 44; ) --A;
|
|
403
|
+
return ne(h, i.substr(0, A), c / Math.pow(10, 3 * (i.length - A)));
|
|
404
404
|
}
|
|
405
405
|
function ue(h, i, c) {
|
|
406
|
-
var
|
|
407
|
-
return ne(h,
|
|
406
|
+
var A = i.replace(r, ""), o = i.length - A.length;
|
|
407
|
+
return ne(h, A, c * Math.pow(10, 2 * o)) + $("%", o);
|
|
408
408
|
}
|
|
409
409
|
function Z(h, i) {
|
|
410
|
-
var c,
|
|
410
|
+
var c, A = h.indexOf("E") - h.indexOf(".") - 1;
|
|
411
411
|
if (h.match(/^#+0.0E\+0$/)) {
|
|
412
412
|
if (i == 0) return "0.0E+0";
|
|
413
413
|
if (i < 0) return "-" + Z(h, -i);
|
|
414
414
|
var o = h.indexOf(".");
|
|
415
415
|
o === -1 && (o = h.indexOf("E"));
|
|
416
|
-
var
|
|
417
|
-
if (
|
|
416
|
+
var l = Math.floor(Math.log(i) * Math.LOG10E) % o;
|
|
417
|
+
if (l < 0 && (l += o), c = (i / Math.pow(10, l)).toPrecision(A + 1 + (o + l) % o), !c.match(/[Ee]/)) {
|
|
418
418
|
var E = Math.floor(Math.log(i) * Math.LOG10E);
|
|
419
|
-
c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length +
|
|
419
|
+
c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + l) : c += "E+" + (E - l), c = c.replace(/\+-/, "-");
|
|
420
420
|
}
|
|
421
|
-
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(
|
|
422
|
-
return
|
|
421
|
+
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
|
|
422
|
+
return B + W + N.substr(0, (o + l) % o) + "." + N.substr(l) + "E";
|
|
423
423
|
});
|
|
424
|
-
} else c = i.toExponential(
|
|
424
|
+
} else c = i.toExponential(A);
|
|
425
425
|
return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
|
|
426
426
|
}
|
|
427
427
|
function x(h, i, c) {
|
|
428
|
-
if (h.charCodeAt(0) === 40 && !i.match(
|
|
429
|
-
var
|
|
430
|
-
return c >= 0 ? x("n",
|
|
428
|
+
if (h.charCodeAt(0) === 40 && !i.match(u)) {
|
|
429
|
+
var A = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
|
|
430
|
+
return c >= 0 ? x("n", A, c) : "(" + x("n", A, -c) + ")";
|
|
431
431
|
}
|
|
432
432
|
if (i.charCodeAt(i.length - 1) === 44) return se(h, i, c);
|
|
433
433
|
if (i.indexOf("%") !== -1) return ue(h, i, c);
|
|
434
434
|
if (i.indexOf("E") !== -1) return Z(i, c);
|
|
435
435
|
if (i.charCodeAt(0) === 36) return "$" + x(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
|
|
436
|
-
var o,
|
|
437
|
-
if (i.match(/^00+$/)) return W +
|
|
436
|
+
var o, l, E, L, B = Math.abs(c), W = c < 0 ? "-" : "";
|
|
437
|
+
if (i.match(/^00+$/)) return W + T(B, i.length);
|
|
438
438
|
if (i.match(/^[#?]+$/))
|
|
439
|
-
return o = "" + c, c === 0 && (o = ""), o.length > i.length ? o :
|
|
440
|
-
if (
|
|
441
|
-
if (i.match(/^#+0+$/)) return W +
|
|
442
|
-
if (
|
|
443
|
-
return o = ("" + c).replace(/^([^\.]+)$/, "$1." +
|
|
444
|
-
return "." + pe + $("0",
|
|
439
|
+
return o = "" + c, c === 0 && (o = ""), o.length > i.length ? o : _(i.substr(0, i.length - o.length)) + o;
|
|
440
|
+
if (l = i.match(b)) return f(l, B, W);
|
|
441
|
+
if (i.match(/^#+0+$/)) return W + T(B, i.length - i.indexOf("0"));
|
|
442
|
+
if (l = i.match(C))
|
|
443
|
+
return o = ("" + c).replace(/^([^\.]+)$/, "$1." + _(l[1])).replace(/\.$/, "." + _(l[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
|
|
444
|
+
return "." + pe + $("0", _(l[1]).length - pe.length);
|
|
445
445
|
}), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
|
|
446
|
-
if (i = i.replace(/^#+([0.])/, "$1"),
|
|
447
|
-
return W + ("" +
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0",
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
446
|
+
if (i = i.replace(/^#+([0.])/, "$1"), l = i.match(/^(0*)\.(#*)$/))
|
|
447
|
+
return W + ("" + B).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, l[1].length ? "0." : ".");
|
|
448
|
+
if (l = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + B);
|
|
449
|
+
if (l = i.match(/^#,##0\.([#0]*0)$/))
|
|
450
|
+
return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", l[1].length);
|
|
451
|
+
if (l = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
|
|
452
|
+
if (l = i.match(/^([0#]+)(\\?-([0#]+))+$/))
|
|
453
453
|
return o = v(x(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
|
|
454
454
|
return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
|
|
455
455
|
}));
|
|
456
|
-
if (i.match(
|
|
456
|
+
if (i.match(y))
|
|
457
457
|
return o = x(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
|
|
458
|
-
var
|
|
459
|
-
if (
|
|
460
|
-
return E = Math.min(
|
|
461
|
-
if (
|
|
462
|
-
return E = Math.min(Math.max(
|
|
463
|
-
if (
|
|
464
|
-
return o = "" + c, i.length <= o.length ? o :
|
|
465
|
-
if (
|
|
466
|
-
o = "" + c.toFixed(Math.min(
|
|
458
|
+
var N = "";
|
|
459
|
+
if (l = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
460
|
+
return E = Math.min(l[4].length, 7), L = we(B, Math.pow(10, E) - 1, !1), o = "" + W, N = ne("n", l[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), o += N + l[2] + "/" + l[3], N = I(L[2], E), N.length < l[4].length && (N = _(l[4].substr(l[4].length - N.length)) + N), o += N, o;
|
|
461
|
+
if (l = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
462
|
+
return E = Math.min(Math.max(l[1].length, l[4].length), 7), L = we(B, Math.pow(10, E) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? D(L[1], E) + l[2] + "/" + l[3] + I(L[2], E) : $(" ", 2 * E + 1 + l[2].length + l[3].length));
|
|
463
|
+
if (l = i.match(/^[#0?]+$/))
|
|
464
|
+
return o = "" + c, i.length <= o.length ? o : _(i.substr(0, i.length - o.length)) + o;
|
|
465
|
+
if (l = i.match(/^([#0]+)\.([#0]+)$/)) {
|
|
466
|
+
o = "" + c.toFixed(Math.min(l[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
|
|
467
467
|
var be = i.indexOf(".") - E, ve = i.length - o.length - be;
|
|
468
|
-
return
|
|
468
|
+
return _(i.substr(0, be) + o + i.substr(i.length - ve));
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
470
|
+
if (l = i.match(/^00,000\.([#0]*0)$/))
|
|
471
471
|
return c < 0 ? "-" + x(h, i, -c) : oe("" + c).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
|
|
472
|
-
return "00," + (z.length < 3 ?
|
|
473
|
-
}) + "." +
|
|
472
|
+
return "00," + (z.length < 3 ? T(0, 3 - z.length) : "") + z;
|
|
473
|
+
}) + "." + T(0, l[1].length);
|
|
474
474
|
switch (i) {
|
|
475
475
|
case "###,###":
|
|
476
476
|
case "##,###":
|
|
477
477
|
case "#,###":
|
|
478
|
-
var me = oe("" +
|
|
478
|
+
var me = oe("" + B);
|
|
479
479
|
return me !== "0" ? W + me : "";
|
|
480
480
|
default:
|
|
481
|
-
if (i.match(/\.[0#?]*$/)) return x(h, i.slice(0, i.lastIndexOf(".")), c) +
|
|
481
|
+
if (i.match(/\.[0#?]*$/)) return x(h, i.slice(0, i.lastIndexOf(".")), c) + _(i.slice(i.lastIndexOf(".")));
|
|
482
482
|
}
|
|
483
483
|
throw new Error("unsupported format |" + i + "|");
|
|
484
484
|
}
|
|
485
|
-
return function(i, c,
|
|
486
|
-
return (
|
|
485
|
+
return function(i, c, A) {
|
|
486
|
+
return (A | 0) === A ? x(i, c, A) : O(i, c, A);
|
|
487
487
|
};
|
|
488
488
|
}();
|
|
489
489
|
function ke(t) {
|
|
@@ -598,19 +598,19 @@ var ze = { exports: {} };
|
|
|
598
598
|
}
|
|
599
599
|
p.is_date = xe;
|
|
600
600
|
function $e(t, r, n, m) {
|
|
601
|
-
for (var e = [],
|
|
601
|
+
for (var e = [], b = "", a = 0, f = "", C = "t", u, y, _, H = "H"; a < t.length; )
|
|
602
602
|
switch (f = t.charAt(a)) {
|
|
603
603
|
case "G":
|
|
604
604
|
if (!fe(t, a)) throw new Error("unrecognized character " + f + " in " + t);
|
|
605
605
|
e[e.length] = { t: "G", v: "General" }, a += 7;
|
|
606
606
|
break;
|
|
607
607
|
case '"':
|
|
608
|
-
for (
|
|
609
|
-
e[e.length] = { t: "t", v:
|
|
608
|
+
for (b = ""; (_ = t.charCodeAt(++a)) !== 34 && a < t.length; ) b += String.fromCharCode(_);
|
|
609
|
+
e[e.length] = { t: "t", v: b }, ++a;
|
|
610
610
|
break;
|
|
611
611
|
case "\\":
|
|
612
|
-
var U = t.charAt(++a),
|
|
613
|
-
e[e.length] = { t:
|
|
612
|
+
var U = t.charAt(++a), S = U === "(" || U === ")" ? U : "t";
|
|
613
|
+
e[e.length] = { t: S, v: U }, ++a;
|
|
614
614
|
break;
|
|
615
615
|
case "_":
|
|
616
616
|
e[e.length] = { t: "t", v: " " }, a += 2;
|
|
@@ -621,7 +621,7 @@ var ze = { exports: {} };
|
|
|
621
621
|
case "B":
|
|
622
622
|
case "b":
|
|
623
623
|
if (t.charAt(a + 1) === "1" || t.charAt(a + 1) === "2") {
|
|
624
|
-
if (
|
|
624
|
+
if (u == null && (u = ye(r, n, t.charAt(a + 1) === "2"), u == null))
|
|
625
625
|
return "";
|
|
626
626
|
e[e.length] = { t: "X", v: t.substr(a, 2) }, C = f, a += 2;
|
|
627
627
|
break;
|
|
@@ -640,41 +640,41 @@ var ze = { exports: {} };
|
|
|
640
640
|
case "s":
|
|
641
641
|
case "e":
|
|
642
642
|
case "g":
|
|
643
|
-
if (r < 0 ||
|
|
643
|
+
if (r < 0 || u == null && (u = ye(r, n), u == null))
|
|
644
644
|
return "";
|
|
645
|
-
for (
|
|
646
|
-
f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f =
|
|
645
|
+
for (b = f; ++a < t.length && t.charAt(a).toLowerCase() === f; ) b += f;
|
|
646
|
+
f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f = H), e[e.length] = { t: f, v: b }, C = f;
|
|
647
647
|
break;
|
|
648
648
|
case "A":
|
|
649
649
|
case "a":
|
|
650
650
|
case "上":
|
|
651
|
-
var
|
|
652
|
-
if (
|
|
653
|
-
e[e.length] =
|
|
651
|
+
var R = { t: f, v: f };
|
|
652
|
+
if (u == null && (u = ye(r, n)), t.substr(a, 3).toUpperCase() === "A/P" ? (u != null && (R.v = u.H >= 12 ? "P" : "A"), R.t = "T", H = "h", a += 3) : t.substr(a, 5).toUpperCase() === "AM/PM" ? (u != null && (R.v = u.H >= 12 ? "PM" : "AM"), R.t = "T", a += 5, H = "h") : t.substr(a, 5).toUpperCase() === "上午/下午" ? (u != null && (R.v = u.H >= 12 ? "下午" : "上午"), R.t = "T", a += 5, H = "h") : (R.t = "t", ++a), u == null && R.t === "T") return "";
|
|
653
|
+
e[e.length] = R, C = f;
|
|
654
654
|
break;
|
|
655
655
|
case "[":
|
|
656
|
-
for (
|
|
657
|
-
if (
|
|
658
|
-
if (
|
|
659
|
-
if (
|
|
656
|
+
for (b = f; t.charAt(a++) !== "]" && a < t.length; ) b += t.charAt(a);
|
|
657
|
+
if (b.slice(-1) !== "]") throw 'unterminated "[" block: |' + b + "|";
|
|
658
|
+
if (b.match(_e)) {
|
|
659
|
+
if (u == null && (u = ye(r, n), u == null))
|
|
660
660
|
return "";
|
|
661
|
-
e[e.length] = { t: "Z", v:
|
|
662
|
-
} else
|
|
661
|
+
e[e.length] = { t: "Z", v: b.toLowerCase() }, C = b.charAt(1);
|
|
662
|
+
} else b.indexOf("$") > -1 && (b = (b.match(/\$([^-\[\]]*)/) || [])[1] || "$", xe(t) || (e[e.length] = { t: "t", v: b }));
|
|
663
663
|
break;
|
|
664
664
|
case ".":
|
|
665
|
-
if (
|
|
666
|
-
for (
|
|
667
|
-
e[e.length] = { t: "s", v:
|
|
665
|
+
if (u != null) {
|
|
666
|
+
for (b = f; ++a < t.length && (f = t.charAt(a)) === "0"; ) b += f;
|
|
667
|
+
e[e.length] = { t: "s", v: b };
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
670
670
|
case "0":
|
|
671
671
|
case "#":
|
|
672
|
-
for (
|
|
673
|
-
e[e.length] = { t: "n", v:
|
|
672
|
+
for (b = f; ++a < t.length && "0#?.,E+-%".indexOf(f = t.charAt(a)) > -1; ) b += f;
|
|
673
|
+
e[e.length] = { t: "n", v: b };
|
|
674
674
|
break;
|
|
675
675
|
case "?":
|
|
676
|
-
for (
|
|
677
|
-
e[e.length] = { t: f, v:
|
|
676
|
+
for (b = f; t.charAt(++a) === f; ) b += f;
|
|
677
|
+
e[e.length] = { t: f, v: b }, C = f;
|
|
678
678
|
break;
|
|
679
679
|
case "*":
|
|
680
680
|
++a, (t.charAt(a) == " " || t.charAt(a) == "*") && ++a;
|
|
@@ -692,8 +692,8 @@ var ze = { exports: {} };
|
|
|
692
692
|
case "7":
|
|
693
693
|
case "8":
|
|
694
694
|
case "9":
|
|
695
|
-
for (
|
|
696
|
-
e[e.length] = { t: "D", v:
|
|
695
|
+
for (b = f; a < t.length && "0123456789".indexOf(t.charAt(++a)) > -1; ) b += t.charAt(a);
|
|
696
|
+
e[e.length] = { t: "D", v: b };
|
|
697
697
|
break;
|
|
698
698
|
case " ":
|
|
699
699
|
e[e.length] = { t: f, v: f }, ++a;
|
|
@@ -711,7 +711,7 @@ var ze = { exports: {} };
|
|
|
711
711
|
switch (e[a].t) {
|
|
712
712
|
case "h":
|
|
713
713
|
case "H":
|
|
714
|
-
e[a].t =
|
|
714
|
+
e[a].t = H, C = "h", O < 1 && (O = 1);
|
|
715
715
|
break;
|
|
716
716
|
case "s":
|
|
717
717
|
(ue = e[a].v.match(/\.0+$/)) && (se = Math.max(se, ue[0].length - 1)), O < 3 && (O = 3);
|
|
@@ -733,10 +733,10 @@ var ze = { exports: {} };
|
|
|
733
733
|
case 0:
|
|
734
734
|
break;
|
|
735
735
|
case 1:
|
|
736
|
-
|
|
736
|
+
u.u >= 0.5 && (u.u = 0, ++u.S), u.S >= 60 && (u.S = 0, ++u.M), u.M >= 60 && (u.M = 0, ++u.H);
|
|
737
737
|
break;
|
|
738
738
|
case 2:
|
|
739
|
-
|
|
739
|
+
u.u >= 0.5 && (u.u = 0, ++u.S), u.S >= 60 && (u.S = 0, ++u.M);
|
|
740
740
|
break;
|
|
741
741
|
}
|
|
742
742
|
var Z = "", x;
|
|
@@ -760,7 +760,7 @@ var ze = { exports: {} };
|
|
|
760
760
|
case "e":
|
|
761
761
|
case "b":
|
|
762
762
|
case "Z":
|
|
763
|
-
e[a].v = Ve(e[a].t.charCodeAt(0), e[a].v,
|
|
763
|
+
e[a].v = Ve(e[a].t.charCodeAt(0), e[a].v, u, se), e[a].t = "t";
|
|
764
764
|
break;
|
|
765
765
|
case "n":
|
|
766
766
|
case "?":
|
|
@@ -775,35 +775,35 @@ var ze = { exports: {} };
|
|
|
775
775
|
var h = "", i, c;
|
|
776
776
|
if (Z.length > 0) {
|
|
777
777
|
Z.charCodeAt(0) == 40 ? (i = r < 0 && Z.charCodeAt(0) === 45 ? -r : r, c = ne("n", Z, i)) : (i = r < 0 && m > 1 ? -r : r, c = ne("n", Z, i), i < 0 && e[0] && e[0].t == "t" && (c = c.substr(1), e[0].v = "-" + e[0].v)), x = c.length - 1;
|
|
778
|
-
var
|
|
778
|
+
var A = e.length;
|
|
779
779
|
for (a = 0; a < e.length; ++a) if (e[a] != null && e[a].t != "t" && e[a].v.indexOf(".") > -1) {
|
|
780
|
-
|
|
780
|
+
A = a;
|
|
781
781
|
break;
|
|
782
782
|
}
|
|
783
783
|
var o = e.length;
|
|
784
|
-
if (
|
|
784
|
+
if (A === e.length && c.indexOf("E") === -1) {
|
|
785
785
|
for (a = e.length - 1; a >= 0; --a)
|
|
786
786
|
e[a] == null || "n?".indexOf(e[a].t) === -1 || (x >= e[a].v.length - 1 ? (x -= e[a].v.length, e[a].v = c.substr(x + 1, e[a].v.length)) : x < 0 ? e[a].v = "" : (e[a].v = c.substr(0, x + 1), x = -1), e[a].t = "t", o = a);
|
|
787
787
|
x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v);
|
|
788
|
-
} else if (
|
|
789
|
-
for (x = c.indexOf(".") - 1, a =
|
|
788
|
+
} else if (A !== e.length && c.indexOf("E") === -1) {
|
|
789
|
+
for (x = c.indexOf(".") - 1, a = A; a >= 0; --a)
|
|
790
790
|
if (!(e[a] == null || "n?".indexOf(e[a].t) === -1)) {
|
|
791
|
-
for (
|
|
792
|
-
x >= 0 && (e[a].v.charAt(
|
|
791
|
+
for (y = e[a].v.indexOf(".") > -1 && a === A ? e[a].v.indexOf(".") - 1 : e[a].v.length - 1, h = e[a].v.substr(y + 1); y >= 0; --y)
|
|
792
|
+
x >= 0 && (e[a].v.charAt(y) === "0" || e[a].v.charAt(y) === "#") && (h = c.charAt(x--) + h);
|
|
793
793
|
e[a].v = h, e[a].t = "t", o = a;
|
|
794
794
|
}
|
|
795
|
-
for (x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v), x = c.indexOf(".") + 1, a =
|
|
796
|
-
if (!(e[a] == null || "n?(".indexOf(e[a].t) === -1 && a !==
|
|
797
|
-
for (
|
|
795
|
+
for (x >= 0 && o < e.length && (e[o].v = c.substr(0, x + 1) + e[o].v), x = c.indexOf(".") + 1, a = A; a < e.length; ++a)
|
|
796
|
+
if (!(e[a] == null || "n?(".indexOf(e[a].t) === -1 && a !== A)) {
|
|
797
|
+
for (y = e[a].v.indexOf(".") > -1 && a === A ? e[a].v.indexOf(".") + 1 : 0, h = e[a].v.substr(0, y); y < e[a].v.length; ++y)
|
|
798
798
|
x < c.length && (h += c.charAt(x++));
|
|
799
799
|
e[a].v = h, e[a].t = "t", o = a;
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
for (a = 0; a < e.length; ++a) e[a] != null && "n?".indexOf(e[a].t) > -1 && (i = m > 1 && r < 0 && a > 0 && e[a - 1].v === "-" ? -r : r, e[a].v = ne(e[a].t, e[a].v, i), e[a].t = "t");
|
|
804
|
-
var
|
|
805
|
-
for (a = 0; a !== e.length; ++a) e[a] != null && (
|
|
806
|
-
return
|
|
804
|
+
var l = "";
|
|
805
|
+
for (a = 0; a !== e.length; ++a) e[a] != null && (l += e[a].v);
|
|
806
|
+
return l;
|
|
807
807
|
}
|
|
808
808
|
p._eval = $e;
|
|
809
809
|
var Me = /\[[=<>]/, X = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
|
|
@@ -832,7 +832,7 @@ var ze = { exports: {} };
|
|
|
832
832
|
}
|
|
833
833
|
return !1;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function te(t, r) {
|
|
836
836
|
var n = ke(t), m = n.length, e = n[m - 1].indexOf("@");
|
|
837
837
|
if (m < 4 && e > -1 && --m, n.length > 4) throw new Error("cannot find right format for |" + n.join("|") + "|");
|
|
838
838
|
if (typeof r != "number") return [4, n.length === 4 || e > -1 ? n[n.length - 1] : "@"];
|
|
@@ -847,13 +847,13 @@ var ze = { exports: {} };
|
|
|
847
847
|
n = e > -1 ? [n[0], n[1], n[0], n[2]] : [n[0], n[1], n[2], "@"];
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
850
|
-
var
|
|
851
|
-
if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m,
|
|
850
|
+
var b = r > 0 ? n[0] : r < 0 ? n[1] : n[2];
|
|
851
|
+
if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, b];
|
|
852
852
|
if (n[0].match(Me) != null || n[1].match(Me) != null) {
|
|
853
853
|
var a = n[0].match(X), f = n[1].match(X);
|
|
854
854
|
return ae(r, a) ? [m, n[0]] : ae(r, f) ? [m, n[1]] : [m, n[a != null && f != null ? 2 : 1]];
|
|
855
855
|
}
|
|
856
|
-
return [m,
|
|
856
|
+
return [m, b];
|
|
857
857
|
}
|
|
858
858
|
function de(t, r, n) {
|
|
859
859
|
n == null && (n = {});
|
|
@@ -868,7 +868,7 @@ var ze = { exports: {} };
|
|
|
868
868
|
}
|
|
869
869
|
if (fe(m, 0)) return ge(r, n);
|
|
870
870
|
r instanceof Date && (r = Ne(r, n.date1904));
|
|
871
|
-
var e =
|
|
871
|
+
var e = te(m, r);
|
|
872
872
|
if (fe(e[1])) return ge(r, n);
|
|
873
873
|
if (r === !0) r = "TRUE";
|
|
874
874
|
else if (r === !1) r = "FALSE";
|
|
@@ -899,10 +899,10 @@ var ze = { exports: {} };
|
|
|
899
899
|
r[n] !== void 0 && le(r[n], n);
|
|
900
900
|
}, p.init_table = Ee, p.format = de;
|
|
901
901
|
};
|
|
902
|
-
g(
|
|
903
|
-
})(
|
|
904
|
-
var
|
|
905
|
-
const Pe = /* @__PURE__ */
|
|
902
|
+
g(s), typeof DO_NOT_EXPORT_SSF > "u" && (k.exports = s);
|
|
903
|
+
})(Xe);
|
|
904
|
+
var at = Xe.exports;
|
|
905
|
+
const Pe = /* @__PURE__ */ Qe(at), je = [
|
|
906
906
|
"228, 232, 237",
|
|
907
907
|
// Light Gray
|
|
908
908
|
"219, 233, 236",
|
|
@@ -927,99 +927,99 @@ const Pe = /* @__PURE__ */ Ze(rt), Be = [
|
|
|
927
927
|
// Cyan
|
|
928
928
|
"244, 239, 234"
|
|
929
929
|
// Cream
|
|
930
|
-
],
|
|
930
|
+
], Ge = je[0], it = [
|
|
931
931
|
["true", "false"],
|
|
932
932
|
["yes", "no"],
|
|
933
933
|
["1", "0"]
|
|
934
934
|
];
|
|
935
|
-
function
|
|
936
|
-
const g =
|
|
937
|
-
return
|
|
935
|
+
function ct(k, s) {
|
|
936
|
+
const g = k.toLowerCase(), w = s.toLowerCase();
|
|
937
|
+
return it.some(([p, v]) => g === p && w === v);
|
|
938
938
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
939
|
+
const ot = 200;
|
|
940
|
+
function lt() {
|
|
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
|
|
944
|
-
if (!Array.isArray(
|
|
945
|
-
const
|
|
946
|
-
return
|
|
943
|
+
function st(k) {
|
|
944
|
+
if (!Array.isArray(k) || k.length === 0) return null;
|
|
945
|
+
const s = k.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
|
|
946
|
+
return s.trim() ? s : null;
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
948
|
+
function ut(k) {
|
|
949
|
+
return k ? "TRUE" : "FALSE";
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
let
|
|
951
|
+
function ht(k) {
|
|
952
|
+
let s = !1, g = 0;
|
|
953
953
|
const w = () => {
|
|
954
|
-
if (
|
|
955
|
-
const v =
|
|
954
|
+
if (s) return !0;
|
|
955
|
+
const v = k.current;
|
|
956
956
|
if (!(v != null && v.getWorkbookContext) || !v.recalculateAllFormulas) return !1;
|
|
957
|
-
const $ = v.getWorkbookContext(),
|
|
958
|
-
return !(
|
|
957
|
+
const $ = v.getWorkbookContext(), T = $ == null ? void 0 : $.luckysheetfile;
|
|
958
|
+
return !(T != null && T.length) || !T.some(
|
|
959
959
|
(I) => Array.isArray(I.data) && I.data.length > 0
|
|
960
|
-
) ? !1 : (v.recalculateAllFormulas(),
|
|
960
|
+
) ? !1 : (v.recalculateAllFormulas(), s = !0, !0);
|
|
961
961
|
}, p = () => {
|
|
962
962
|
var v, $;
|
|
963
|
-
w() || (g += 1, g <
|
|
963
|
+
w() || (g += 1, g < ot ? requestAnimationFrame(p) : (($ = (v = k.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), s = !0));
|
|
964
964
|
};
|
|
965
965
|
requestAnimationFrame(() => requestAnimationFrame(p));
|
|
966
966
|
for (const v of [120, 400, 1200])
|
|
967
967
|
window.setTimeout(() => {
|
|
968
|
-
|
|
968
|
+
s || w();
|
|
969
969
|
}, v);
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
return
|
|
971
|
+
function ft(k) {
|
|
972
|
+
return k <= 0 ? Ge : k > je.length ? Array(k).fill(Ge).join(", ") : je.slice(0, k).join(", ");
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
977
|
-
const g =
|
|
974
|
+
function Be(k) {
|
|
975
|
+
const s = k.match(/^([A-Z]+)(\d+)$/i);
|
|
976
|
+
if (!s) return null;
|
|
977
|
+
const g = s[1].toUpperCase(), w = s[2];
|
|
978
978
|
let p = 0;
|
|
979
|
-
for (let
|
|
980
|
-
p = p * 26 + (g.charCodeAt(
|
|
979
|
+
for (let T = 0; T < g.length; T++)
|
|
980
|
+
p = p * 26 + (g.charCodeAt(T) - 64);
|
|
981
981
|
const v = parseInt(w, 10) - 1, $ = p - 1;
|
|
982
982
|
return { row: v, col: $ };
|
|
983
983
|
}
|
|
984
|
-
function
|
|
985
|
-
const g =
|
|
984
|
+
function gt(k, s) {
|
|
985
|
+
const g = Be(k);
|
|
986
986
|
if (!g) return null;
|
|
987
|
-
const { row: w, col: p } = g, v = `${w}_${p}`, $ = Array.isArray(
|
|
988
|
-
let
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
type:
|
|
987
|
+
const { row: w, col: p } = g, v = `${w}_${p}`, $ = Array.isArray(s.formulae) && s.formulae.length > 0 ? String(s.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", T = $.split(",").map((fe) => fe.trim()).filter(Boolean);
|
|
988
|
+
let D = s.type === "list" ? "dropdown" : s.type || "dropdown", I = $, J = "";
|
|
989
|
+
s.type === "list" && T.length === 2 && ct(T[0], T[1]) && (D = "checkbox", I = T[0], J = T[1]);
|
|
990
|
+
const V = D === "checkbox" ? 1 : I ? I.split(",").length : 0, ie = ft(V || 1), re = {
|
|
991
|
+
type: D,
|
|
992
992
|
type2: "",
|
|
993
|
-
rangeTxt:
|
|
993
|
+
rangeTxt: k,
|
|
994
994
|
value1: I,
|
|
995
995
|
value2: J,
|
|
996
996
|
validity: "",
|
|
997
997
|
remote: !1,
|
|
998
|
-
prohibitInput:
|
|
999
|
-
hintShow: !!
|
|
1000
|
-
hintValue:
|
|
998
|
+
prohibitInput: s.type === "list",
|
|
999
|
+
hintShow: !!s.showInputMessage,
|
|
1000
|
+
hintValue: s.prompt ?? "",
|
|
1001
1001
|
color: ie,
|
|
1002
1002
|
checked: !1
|
|
1003
1003
|
};
|
|
1004
1004
|
return { rowColKey: v, entry: re };
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const
|
|
1006
|
+
function dt(k) {
|
|
1007
|
+
const s = k.split(":"), g = Be(s[0].trim());
|
|
1008
1008
|
if (!g) return null;
|
|
1009
|
-
const w =
|
|
1009
|
+
const w = s.length > 1 ? Be(s[1].trim()) : g;
|
|
1010
1010
|
return w ? {
|
|
1011
1011
|
row: [Math.min(g.row, w.row), Math.max(g.row, w.row)],
|
|
1012
1012
|
column: [Math.min(g.col, w.col), Math.max(g.col, w.col)]
|
|
1013
1013
|
} : null;
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1016
|
-
return String(
|
|
1017
|
-
(
|
|
1015
|
+
function bt(k) {
|
|
1016
|
+
return String(k || "").split(/[,\s]+/).map((s) => s.trim()).filter(Boolean).map((s) => dt(s)).filter(
|
|
1017
|
+
(s) => !!s
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
return
|
|
1020
|
+
function ze(k) {
|
|
1021
|
+
const s = bt(k);
|
|
1022
|
+
return s.length ? s.map((g) => {
|
|
1023
1023
|
const [w, p] = g.row, [v, $] = g.column;
|
|
1024
1024
|
return {
|
|
1025
1025
|
left: 0,
|
|
@@ -1038,9 +1038,9 @@ function Ye(y) {
|
|
|
1038
1038
|
};
|
|
1039
1039
|
}) : null;
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1042
|
-
var $,
|
|
1043
|
-
const
|
|
1041
|
+
function qe(k) {
|
|
1042
|
+
var $, T;
|
|
1043
|
+
const s = {
|
|
1044
1044
|
textColor: "#000000",
|
|
1045
1045
|
cellColor: "#ffffff",
|
|
1046
1046
|
bold: !1,
|
|
@@ -1048,16 +1048,16 @@ function Ge(y) {
|
|
|
1048
1048
|
underline: !1,
|
|
1049
1049
|
strikethrough: !1
|
|
1050
1050
|
};
|
|
1051
|
-
if (!
|
|
1052
|
-
const g =
|
|
1053
|
-
let p =
|
|
1051
|
+
if (!k) return s;
|
|
1052
|
+
const g = k.font, w = k.fill;
|
|
1053
|
+
let p = s.textColor, v = s.cellColor;
|
|
1054
1054
|
if (($ = g == null ? void 0 : g.color) != null && $.argb) {
|
|
1055
|
-
const
|
|
1056
|
-
p = "#" + (
|
|
1055
|
+
const D = g.color.argb;
|
|
1056
|
+
p = "#" + (D.length >= 6 ? D.slice(-6) : D);
|
|
1057
1057
|
}
|
|
1058
|
-
if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((
|
|
1059
|
-
const
|
|
1060
|
-
v = "#" + (
|
|
1058
|
+
if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((T = w.fgColor) != null && T.argb)) {
|
|
1059
|
+
const D = w.fgColor.argb;
|
|
1060
|
+
v = "#" + (D.length >= 6 ? D.slice(-6) : D);
|
|
1061
1061
|
}
|
|
1062
1062
|
return {
|
|
1063
1063
|
textColor: p,
|
|
@@ -1068,33 +1068,33 @@ function Ge(y) {
|
|
|
1068
1068
|
strikethrough: !1
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1072
|
-
if (!
|
|
1073
|
-
const
|
|
1071
|
+
function Ze(k) {
|
|
1072
|
+
if (!k || typeof k != "string") return "";
|
|
1073
|
+
const s = k.trim().replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").replace(/^=/, ""), g = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
|
|
1074
1074
|
if (g) return (g[1] ?? "").replace(/""/g, '"');
|
|
1075
|
-
const w =
|
|
1075
|
+
const w = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
|
|
1076
1076
|
return w ? w[1] ?? "" : "";
|
|
1077
1077
|
}
|
|
1078
|
-
function De(
|
|
1079
|
-
if (!
|
|
1080
|
-
const
|
|
1078
|
+
function De(k) {
|
|
1079
|
+
if (!k || typeof k != "string") return "";
|
|
1080
|
+
const s = k.trim().replace(/"/g, '"').replace(/'/g, "'").replace(/^=/, ""), g = s.match(/"((?:[^"]|"")*)"/);
|
|
1081
1081
|
if (g) return (g[1] ?? "").replace(/""/g, '"');
|
|
1082
|
-
const w =
|
|
1082
|
+
const w = s.match(/'([^']*)'/);
|
|
1083
1083
|
return w ? w[1] ?? "" : "";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
if (!
|
|
1087
|
-
const
|
|
1088
|
-
return g ?
|
|
1085
|
+
function mt(k) {
|
|
1086
|
+
if (!k || typeof k != "string") return null;
|
|
1087
|
+
const s = k.trim().toUpperCase(), g = Ze(k) || De(k);
|
|
1088
|
+
return g ? s.includes("SEARCH(") ? s.includes("ISERROR(SEARCH(") || s.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : s.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : s.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : s.includes("EXACT(") || s.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const w = (
|
|
1090
|
+
function pt(k, s, g) {
|
|
1091
|
+
const w = (k || "").toLowerCase();
|
|
1092
1092
|
if (w === "cellis") {
|
|
1093
|
-
const p = (
|
|
1093
|
+
const p = (s || "").toLowerCase();
|
|
1094
1094
|
return p === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : p === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : p === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : p === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : p === "equal" ? { conditionName: "equal", conditionValue: [] } : p === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : p === "between" ? { conditionName: "between", conditionValue: [] } : p === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
|
|
1095
1095
|
}
|
|
1096
1096
|
if (w === "containstext" || w === "notcontainstext" || w === "beginswith" || w === "endswith" || w === "containsblanks" || w === "notcontainsblanks") {
|
|
1097
|
-
const p = (
|
|
1097
|
+
const p = (s ?? "").toLowerCase();
|
|
1098
1098
|
if (w === "containsblanks" || p === "containsblanks")
|
|
1099
1099
|
return { conditionName: "empty", conditionValue: [""] };
|
|
1100
1100
|
if (w === "notcontainsblanks" || p === "notcontainsblanks")
|
|
@@ -1144,14 +1144,14 @@ function bt(y, u, g) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
return null;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
if (!
|
|
1149
|
-
let g = (
|
|
1150
|
-
const w = Array.isArray(
|
|
1147
|
+
function wt(k, s) {
|
|
1148
|
+
if (!s.type) return null;
|
|
1149
|
+
let g = (s.text ?? "").trim();
|
|
1150
|
+
const w = Array.isArray(s.formulae) && s.formulae[0] ? String(s.formulae[0]) : void 0, p = (s.type.toLowerCase() === "expression" || s.type.toLowerCase() === "customformula") && mt(w);
|
|
1151
1151
|
if (p) {
|
|
1152
|
-
const I =
|
|
1152
|
+
const I = ze(k);
|
|
1153
1153
|
if (!I) return null;
|
|
1154
|
-
const J =
|
|
1154
|
+
const J = qe(s.style);
|
|
1155
1155
|
return {
|
|
1156
1156
|
type: "default",
|
|
1157
1157
|
cellrange: I,
|
|
@@ -1168,51 +1168,51 @@ function mt(y, u) {
|
|
|
1168
1168
|
conditionValue: p.conditionValue
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
1171
|
-
(
|
|
1172
|
-
const v =
|
|
1173
|
-
percent:
|
|
1174
|
-
bottom:
|
|
1175
|
-
rank:
|
|
1176
|
-
aboveAverage:
|
|
1177
|
-
text: g ||
|
|
1178
|
-
timePeriod:
|
|
1171
|
+
(s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith") && !g && (g = Ze(w), g || (g = De(w)));
|
|
1172
|
+
const v = pt(s.type, s.operator, {
|
|
1173
|
+
percent: s.percent,
|
|
1174
|
+
bottom: s.bottom,
|
|
1175
|
+
rank: s.rank,
|
|
1176
|
+
aboveAverage: s.aboveAverage,
|
|
1177
|
+
text: g || s.text,
|
|
1178
|
+
timePeriod: s.timePeriod
|
|
1179
1179
|
});
|
|
1180
1180
|
if (!v) return null;
|
|
1181
1181
|
let $;
|
|
1182
|
-
|
|
1182
|
+
s.type === "cellIs" && Array.isArray(s.formulae) && s.formulae.length > 0 ? $ = s.formulae.map((I) => String(I ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith" ? $ = g ? [g] : De(w) ? [De(w)] : [] : $ = v.conditionValue.map(
|
|
1183
1183
|
(I) => I == null ? "" : String(I)
|
|
1184
1184
|
);
|
|
1185
|
-
const
|
|
1186
|
-
if (!
|
|
1187
|
-
const
|
|
1185
|
+
const T = ze(k);
|
|
1186
|
+
if (!T) return null;
|
|
1187
|
+
const D = qe(s.style);
|
|
1188
1188
|
return {
|
|
1189
1189
|
type: "default",
|
|
1190
|
-
cellrange:
|
|
1190
|
+
cellrange: T,
|
|
1191
1191
|
format: {
|
|
1192
|
-
textColor:
|
|
1193
|
-
cellColor:
|
|
1194
|
-
bold:
|
|
1195
|
-
italic:
|
|
1196
|
-
underline:
|
|
1197
|
-
strikethrough:
|
|
1192
|
+
textColor: D.textColor,
|
|
1193
|
+
cellColor: D.cellColor,
|
|
1194
|
+
bold: D.bold,
|
|
1195
|
+
italic: D.italic,
|
|
1196
|
+
underline: D.underline,
|
|
1197
|
+
strikethrough: D.strikethrough
|
|
1198
1198
|
},
|
|
1199
1199
|
conditionName: v.conditionName,
|
|
1200
1200
|
conditionRange: [],
|
|
1201
1201
|
conditionValue: $
|
|
1202
1202
|
};
|
|
1203
1203
|
}
|
|
1204
|
-
async function
|
|
1205
|
-
sheetEditorRef:
|
|
1206
|
-
ydocRef:
|
|
1204
|
+
async function xt({
|
|
1205
|
+
sheetEditorRef: k,
|
|
1206
|
+
ydocRef: s,
|
|
1207
1207
|
setForceSheetRender: g,
|
|
1208
1208
|
dsheetId: w,
|
|
1209
1209
|
currentDataRef: p,
|
|
1210
1210
|
updateDocumentTitle: v,
|
|
1211
1211
|
filterToastShown: $,
|
|
1212
|
-
setFilterToastShown:
|
|
1213
|
-
},
|
|
1212
|
+
setFilterToastShown: T
|
|
1213
|
+
}, D, I, J, V) {
|
|
1214
1214
|
var Ee, ce;
|
|
1215
|
-
const ie =
|
|
1215
|
+
const ie = D == null ? void 0 : D.target;
|
|
1216
1216
|
if (!((Ee = ie == null ? void 0 : ie.files) != null && Ee.length) && !I)
|
|
1217
1217
|
return Promise.resolve();
|
|
1218
1218
|
const re = ((ce = ie == null ? void 0 : ie.files) == null ? void 0 : ce[0]) || I, fe = {}, Ce = {};
|
|
@@ -1236,55 +1236,55 @@ async function _t({
|
|
|
1236
1236
|
const ke = (ne = (oe = (Ve = (Fe = ge.model) == null ? void 0 : Fe.styles) == null ? void 0 : Ve.fonts) == null ? void 0 : oe[0]) == null ? void 0 : ne.size, _e = {}, xe = {}, $e = {}, Me = {};
|
|
1237
1237
|
ge.eachSheet((X, ae) => {
|
|
1238
1238
|
var a, f, C;
|
|
1239
|
-
const
|
|
1239
|
+
const te = ae - 1, de = {}, le = X.views;
|
|
1240
1240
|
if (le && le.length > 0) {
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1243
|
-
const
|
|
1244
|
-
let
|
|
1245
|
-
|
|
1246
|
-
type:
|
|
1241
|
+
const u = le[0];
|
|
1242
|
+
if (u.state === "frozen") {
|
|
1243
|
+
const y = u.xSplit || 0, _ = u.ySplit || 0;
|
|
1244
|
+
let H = null;
|
|
1245
|
+
y > 0 && _ > 0 ? H = "rangeBoth" : _ > 0 ? H = "rangeRow" : y > 0 && (H = "rangeColumn"), H && (xe[te] = {
|
|
1246
|
+
type: H,
|
|
1247
1247
|
range: {
|
|
1248
|
-
row_focus:
|
|
1249
|
-
column_focus:
|
|
1248
|
+
row_focus: _ - 1,
|
|
1249
|
+
column_focus: y - 1
|
|
1250
1250
|
}
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
const t = {};
|
|
1255
|
-
X.eachRow({ includeEmpty: !1 }, (
|
|
1256
|
-
|
|
1255
|
+
X.eachRow({ includeEmpty: !1 }, (u, y) => {
|
|
1256
|
+
u.eachCell({ includeEmpty: !1 }, (_, H) => {
|
|
1257
1257
|
var se, ue, Z;
|
|
1258
|
-
const U = `${
|
|
1259
|
-
|
|
1258
|
+
const U = `${y - 1}_${H - 1}`;
|
|
1259
|
+
_.hyperlink && (de[U] = [
|
|
1260
1260
|
{
|
|
1261
1261
|
linkType: "webpage",
|
|
1262
|
-
linkAddress:
|
|
1262
|
+
linkAddress: _.hyperlink
|
|
1263
1263
|
}
|
|
1264
1264
|
]);
|
|
1265
|
-
const
|
|
1266
|
-
if (
|
|
1267
|
-
|
|
1268
|
-
const x =
|
|
1269
|
-
if (x && (O.fs = x),
|
|
1270
|
-
const h =
|
|
1265
|
+
const S = (se = _.style) == null ? void 0 : se.font, R = (ue = _.style) == null ? void 0 : ue.fill, O = {};
|
|
1266
|
+
if (S) {
|
|
1267
|
+
S.bold && (O.bl = 1), S.italic && (O.it = 1), S.underline && (O.un = 1);
|
|
1268
|
+
const x = S.size ?? ke;
|
|
1269
|
+
if (x && (O.fs = x), S.name && (O.ff = S.name), (Z = S.color) != null && Z.argb) {
|
|
1270
|
+
const h = S.color.argb, i = "#" + h.substring(h.length - 6);
|
|
1271
1271
|
O.fc = i;
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
if ((
|
|
1275
|
-
const x =
|
|
1274
|
+
if ((R == null ? void 0 : R.type) === "pattern" && R.pattern === "solid" && R.fgColor && R.fgColor.argb) {
|
|
1275
|
+
const x = R.fgColor.argb, h = "#" + x.substring(x.length - 6);
|
|
1276
1276
|
O.bg = h;
|
|
1277
1277
|
}
|
|
1278
1278
|
Object.keys(O).length > 0 && (t[U] = O);
|
|
1279
1279
|
});
|
|
1280
|
-
}), Object.keys(de).length > 0 && (_e[
|
|
1280
|
+
}), Object.keys(de).length > 0 && (_e[te] = de), Object.keys(t).length > 0 && ($e[te] = t);
|
|
1281
1281
|
const r = He(X, ge);
|
|
1282
|
-
r.length > 0 && (Me[
|
|
1282
|
+
r.length > 0 && (Me[te] = r);
|
|
1283
1283
|
const n = X.tables;
|
|
1284
|
-
n && Object.keys(n).length > 0 && ((a =
|
|
1285
|
-
|
|
1284
|
+
n && Object.keys(n).length > 0 && ((a = V == null ? void 0 : V.onWarning) == null || a.call(
|
|
1285
|
+
V,
|
|
1286
1286
|
"Tables are not fully supported. Table styles will not be applied."
|
|
1287
|
-
),
|
|
1287
|
+
), V != null && V.suppressUiWarnings || Ye({
|
|
1288
1288
|
title: "Tables are not fully supported",
|
|
1289
1289
|
description: "Table styles will not be applied",
|
|
1290
1290
|
variant: "warning",
|
|
@@ -1293,48 +1293,48 @@ async function _t({
|
|
|
1293
1293
|
}));
|
|
1294
1294
|
const m = (f = X.dataValidations) == null ? void 0 : f.model;
|
|
1295
1295
|
if (m && typeof m == "object") {
|
|
1296
|
-
const
|
|
1297
|
-
for (const [
|
|
1298
|
-
const U =
|
|
1299
|
-
U && (
|
|
1296
|
+
const u = {};
|
|
1297
|
+
for (const [y, _] of Object.entries(m)) {
|
|
1298
|
+
const U = gt(y, _);
|
|
1299
|
+
U && (u[U.rowColKey] = U.entry);
|
|
1300
1300
|
}
|
|
1301
|
-
Object.keys(
|
|
1301
|
+
Object.keys(u).length > 0 && (fe[te] = u);
|
|
1302
1302
|
}
|
|
1303
1303
|
const e = X.conditionalFormattings;
|
|
1304
1304
|
if (Array.isArray(e) && e.length > 0) {
|
|
1305
|
-
const
|
|
1306
|
-
for (const
|
|
1307
|
-
const
|
|
1308
|
-
for (const U of
|
|
1309
|
-
const
|
|
1305
|
+
const u = [];
|
|
1306
|
+
for (const y of e) {
|
|
1307
|
+
const _ = y.ref, H = y.rules || [];
|
|
1308
|
+
for (const U of H) {
|
|
1309
|
+
const S = U;
|
|
1310
1310
|
console.log("[XLSX CF RAW]", {
|
|
1311
|
-
ref:
|
|
1312
|
-
type:
|
|
1313
|
-
operator:
|
|
1314
|
-
formulae:
|
|
1315
|
-
text:
|
|
1316
|
-
timePeriod:
|
|
1317
|
-
percent:
|
|
1318
|
-
bottom:
|
|
1319
|
-
rank:
|
|
1320
|
-
aboveAverage:
|
|
1311
|
+
ref: _,
|
|
1312
|
+
type: S.type,
|
|
1313
|
+
operator: S.operator,
|
|
1314
|
+
formulae: S.formulae,
|
|
1315
|
+
text: S.text,
|
|
1316
|
+
timePeriod: S.timePeriod,
|
|
1317
|
+
percent: S.percent,
|
|
1318
|
+
bottom: S.bottom,
|
|
1319
|
+
rank: S.rank,
|
|
1320
|
+
aboveAverage: S.aboveAverage
|
|
1321
1321
|
});
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
ref:
|
|
1325
|
-
type:
|
|
1326
|
-
operator:
|
|
1327
|
-
formulae:
|
|
1328
|
-
text:
|
|
1329
|
-
}),
|
|
1322
|
+
const R = S.type ? wt(_, S) : null;
|
|
1323
|
+
R ? console.log("[XLSX CF MAPPED] accepted", R) : console.log("[XLSX CF MAPPED] skipped", {
|
|
1324
|
+
ref: _,
|
|
1325
|
+
type: S.type,
|
|
1326
|
+
operator: S.operator,
|
|
1327
|
+
formulae: S.formulae,
|
|
1328
|
+
text: S.text
|
|
1329
|
+
}), R && u.push(R);
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
|
-
|
|
1332
|
+
u.length > 0 && (Ce[te] = u);
|
|
1333
1333
|
}
|
|
1334
|
-
X.autoFilter && (Ae || (Ae = !0, (C =
|
|
1335
|
-
|
|
1334
|
+
X.autoFilter && (Ae || (Ae = !0, (C = V == null ? void 0 : V.onWarning) == null || C.call(
|
|
1335
|
+
V,
|
|
1336
1336
|
"Filters are not supported in imported files."
|
|
1337
|
-
)), $ || (
|
|
1337
|
+
)), $ || (T(!0), V != null && V.suppressUiWarnings || Ye({
|
|
1338
1338
|
title: "Filters are not supported in imported files",
|
|
1339
1339
|
variant: "warning",
|
|
1340
1340
|
showCloseButton: !0,
|
|
@@ -1345,161 +1345,175 @@ async function _t({
|
|
|
1345
1345
|
function(X) {
|
|
1346
1346
|
var m;
|
|
1347
1347
|
let ae = X.sheets;
|
|
1348
|
-
if (ae.forEach((e,
|
|
1349
|
-
const a = fe[
|
|
1348
|
+
if (ae.forEach((e, b) => {
|
|
1349
|
+
const a = fe[b];
|
|
1350
1350
|
a && Object.keys(a).length > 0 && (e.dataVerification = a);
|
|
1351
|
-
const f = Ce[
|
|
1351
|
+
const f = Ce[b];
|
|
1352
1352
|
e.luckysheet_conditionformat_save = Array.isArray(f) && f.length > 0 ? f : [];
|
|
1353
|
-
}), !
|
|
1353
|
+
}), !s.current) {
|
|
1354
1354
|
console.error("ydocRef.current is null");
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1358
|
-
ae = ae.map((e,
|
|
1359
|
-
var
|
|
1360
|
-
const a = (
|
|
1361
|
-
if (e.row = Math.max(f, 500), e.column = Math.max(C, 36), e.id || (e.id = ((
|
|
1357
|
+
const te = s.current.getArray(w), de = Array.from(te), le = /* @__PURE__ */ new Map();
|
|
1358
|
+
ae = ae.map((e, b) => {
|
|
1359
|
+
var R, O, se, ue, Z, x, h, i, c, A, o, l, E, L, B, W, N, be, ve, me, z, pe, We, Ie, Ue;
|
|
1360
|
+
const a = (R = e == null ? void 0 : e.celldata) == null ? void 0 : R[e.celldata.length - 1], f = (a == null ? void 0 : a.r) ?? 0, C = (a == null ? void 0 : a.c) ?? 0;
|
|
1361
|
+
if (e.row = Math.max(f, 500), e.column = Math.max(C, 36), e.id || (e.id = ((O = V == null ? void 0 : V.generateSheetId) == null ? void 0 : O.call(V)) ?? ((se = k.current) == null ? void 0 : se.getSettings().generateSheetId()) ?? lt()), xe[b] && (e.frozen = xe[b]), _e[b] && (e.hyperlink = {
|
|
1362
1362
|
...e.hyperlink || {},
|
|
1363
|
-
..._e[
|
|
1364
|
-
}), (
|
|
1365
|
-
const
|
|
1363
|
+
..._e[b]
|
|
1364
|
+
}), (ue = e.config) != null && ue.columnlen) {
|
|
1365
|
+
const d = {};
|
|
1366
1366
|
Object.entries(e.config.columnlen).forEach(
|
|
1367
|
-
([P,
|
|
1368
|
-
const Y = (Number(
|
|
1369
|
-
|
|
1367
|
+
([P, F]) => {
|
|
1368
|
+
const Y = (Number(F) - 5) / 8 + 0.83;
|
|
1369
|
+
d[P] = Math.round(Y * 7 + 5);
|
|
1370
1370
|
}
|
|
1371
|
-
), e.config.columnlen =
|
|
1371
|
+
), e.config.columnlen = d;
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1373
|
+
const u = Math.round(
|
|
1374
|
+
Number(e.defaultColWidth) || 73
|
|
1375
|
+
);
|
|
1376
|
+
if ((Z = e.config) != null && Z.columnlen) {
|
|
1377
|
+
const d = {};
|
|
1378
|
+
Object.entries(e.config.columnlen).forEach(([P, F]) => {
|
|
1379
|
+
Math.abs(Math.round(Number(F)) - u) > 1 && (d[P] = Number(F));
|
|
1380
|
+
}), e.config.columnlen = d;
|
|
1381
|
+
}
|
|
1382
|
+
if ((x = e.config) != null && x.rowlen) {
|
|
1383
|
+
const d = Math.round(
|
|
1375
1384
|
Number(e.defaultRowHeight) || 21
|
|
1376
1385
|
), P = {};
|
|
1377
|
-
Object.entries(e.config.rowlen).forEach(([
|
|
1378
|
-
Math.abs(Math.round(Number(Y)) -
|
|
1386
|
+
Object.entries(e.config.rowlen).forEach(([F, Y]) => {
|
|
1387
|
+
Math.abs(Math.round(Number(Y)) - d) > 1 && (P[F] = Number(Y));
|
|
1379
1388
|
}), e.config.rowlen = P;
|
|
1380
1389
|
}
|
|
1381
|
-
if ((
|
|
1382
|
-
const
|
|
1390
|
+
if ((h = e.config) != null && h.customHeight) {
|
|
1391
|
+
const d = new Set(
|
|
1383
1392
|
Object.keys(e.config.rowlen || {})
|
|
1384
1393
|
), P = {};
|
|
1385
1394
|
Object.entries(e.config.customHeight).forEach(
|
|
1386
|
-
([
|
|
1387
|
-
|
|
1395
|
+
([F, Y]) => {
|
|
1396
|
+
d.has(F) && Number(Y) === 1 && (P[F] = 1);
|
|
1388
1397
|
}
|
|
1389
1398
|
), e.config.customHeight = P;
|
|
1390
1399
|
}
|
|
1391
|
-
if (Me[
|
|
1392
|
-
const
|
|
1393
|
-
(
|
|
1400
|
+
if (Me[b]) {
|
|
1401
|
+
const d = Number(e.defaultColWidth) || Number(
|
|
1402
|
+
(A = (c = (i = k.current) == null ? void 0 : i.getSettings) == null ? void 0 : c.call(i)) == null ? void 0 : A.defaultColWidth
|
|
1394
1403
|
) || 99, P = Number(e.defaultRowHeight) || Number(
|
|
1395
|
-
(
|
|
1404
|
+
(E = (l = (o = k.current) == null ? void 0 : o.getSettings) == null ? void 0 : l.call(o)) == null ? void 0 : E.defaultRowHeight
|
|
1396
1405
|
) || 21;
|
|
1397
1406
|
e.images = Te(
|
|
1398
|
-
Me[
|
|
1407
|
+
Me[b],
|
|
1399
1408
|
e,
|
|
1400
|
-
|
|
1409
|
+
d,
|
|
1401
1410
|
P
|
|
1402
1411
|
);
|
|
1403
1412
|
}
|
|
1404
|
-
const
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
const Y =
|
|
1408
|
-
Y.has(
|
|
1409
|
-
},
|
|
1413
|
+
const y = _e[b], _ = $e[b], H = [], U = (d, P) => {
|
|
1414
|
+
const F = `${d}_${P}`;
|
|
1415
|
+
U._seen == null && (U._seen = /* @__PURE__ */ new Set());
|
|
1416
|
+
const Y = U._seen;
|
|
1417
|
+
Y.has(F) || (Y.add(F), H.push({ r: d, c: P, id: e.id }));
|
|
1418
|
+
}, S = (L = e.config) != null && L.merge ? /* @__PURE__ */ new Map() : null;
|
|
1410
1419
|
if (e.celldata)
|
|
1411
|
-
for (const
|
|
1412
|
-
const P = `${
|
|
1413
|
-
if (
|
|
1420
|
+
for (const d of e.celldata) {
|
|
1421
|
+
const P = `${d.r}_${d.c}`;
|
|
1422
|
+
if (S == null || S.set(
|
|
1414
1423
|
P,
|
|
1415
|
-
|
|
1416
|
-
),
|
|
1417
|
-
if (
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1424
|
+
d
|
|
1425
|
+
), d.v) {
|
|
1426
|
+
if (d.v.f) {
|
|
1427
|
+
const j = String(d.v.f);
|
|
1428
|
+
j.startsWith("=") || (d.v.f = `=${j}`);
|
|
1420
1429
|
}
|
|
1421
|
-
if (
|
|
1422
|
-
const
|
|
1423
|
-
if (!!(
|
|
1424
|
-
const { fc:
|
|
1425
|
-
Object.assign(
|
|
1430
|
+
if (d.v.f && ((B = d.v.ct) == null ? void 0 : B.t) !== "d" && (d.v.ct = { ...d.v.ct ?? {}, t: "str" }, U(d.r, d.c)), _ != null && _[P]) {
|
|
1431
|
+
const j = _[P];
|
|
1432
|
+
if (!!(y != null && y[P])) {
|
|
1433
|
+
const { fc: ee, un: Oe, ...Je } = j;
|
|
1434
|
+
Object.assign(d.v, Je);
|
|
1426
1435
|
} else
|
|
1427
|
-
Object.assign(
|
|
1436
|
+
Object.assign(d.v, j);
|
|
1428
1437
|
}
|
|
1429
|
-
if (
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1438
|
+
if (y != null && y[P] && !d.v.f) {
|
|
1439
|
+
const j = y[P][0];
|
|
1440
|
+
j && nt(
|
|
1441
|
+
d.v,
|
|
1442
|
+
j
|
|
1434
1443
|
);
|
|
1435
1444
|
}
|
|
1436
|
-
const
|
|
1437
|
-
if (
|
|
1438
|
-
const
|
|
1439
|
-
if (typeof
|
|
1445
|
+
const F = (W = d.v.ct) == null ? void 0 : W.fa, Y = typeof F == "string" ? F.trim().toLowerCase() : "", K = Y === "general" || ((N = d.v.ct) == null ? void 0 : N.t) === "g", he = Y === "@" || ((be = d.v.ct) == null ? void 0 : be.t) === "s";
|
|
1446
|
+
if (F && !le.has(F) && le.set(F, Pe.is_date(F)), !d.v.f && F && le.get(F)) {
|
|
1447
|
+
const j = typeof d.v.v == "string" ? parseFloat(d.v.v) : d.v.v;
|
|
1448
|
+
if (typeof j == "number" && !isNaN(j))
|
|
1440
1449
|
try {
|
|
1441
|
-
|
|
1450
|
+
d.v.v = j, d.v.m = Pe.format(F, j), d.v.ct = { ...d.v.ct, t: "d" };
|
|
1442
1451
|
} catch {
|
|
1443
1452
|
}
|
|
1444
|
-
} else if (!
|
|
1445
|
-
const
|
|
1453
|
+
} else if (!d.v.f && typeof d.v.v == "string" && !he && !K) {
|
|
1454
|
+
const j = d.v.v.trim();
|
|
1446
1455
|
if (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/.test(
|
|
1447
|
-
|
|
1456
|
+
j
|
|
1448
1457
|
)) {
|
|
1449
|
-
const
|
|
1450
|
-
if (!isFinite(
|
|
1458
|
+
const ee = Number(j);
|
|
1459
|
+
if (!isFinite(ee))
|
|
1451
1460
|
continue;
|
|
1452
|
-
if (
|
|
1453
|
-
|
|
1461
|
+
if (d.v.v = ee, d.v.ht == null && (d.v.ht = 2), !F)
|
|
1462
|
+
d.v.m = String(ee);
|
|
1454
1463
|
else
|
|
1455
1464
|
try {
|
|
1456
|
-
|
|
1465
|
+
d.v.m = Pe.format(F, ee);
|
|
1457
1466
|
} catch {
|
|
1458
1467
|
}
|
|
1459
1468
|
}
|
|
1460
|
-
} else !
|
|
1461
|
-
if (!
|
|
1462
|
-
const
|
|
1469
|
+
} else !d.v.f && typeof d.v.v == "number" && isFinite(d.v.v) && ((ve = d.v.ct) == null ? void 0 : ve.t) !== "s" && ((me = d.v.ct) == null ? void 0 : me.t) !== "d" && d.v.ht == null && (d.v.ht = 2);
|
|
1470
|
+
if (!d.v.f && (d.v.m === void 0 || d.v.m === null) && ((z = d.v.ct) == null ? void 0 : z.t) !== "d") {
|
|
1471
|
+
const j = st((pe = d.v.ct) == null ? void 0 : pe.s), q = d.v.v;
|
|
1463
1472
|
if (!(q == null || String(q).trim() === ""))
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
1473
|
+
if (j != null)
|
|
1474
|
+
d.v.m = j;
|
|
1466
1475
|
else if (typeof q == "boolean")
|
|
1467
|
-
|
|
1476
|
+
d.v.m = ut(q);
|
|
1468
1477
|
else if (typeof q == "number" && isFinite(q)) {
|
|
1469
|
-
const Oe = (
|
|
1478
|
+
const Oe = (We = d.v.ct) == null ? void 0 : We.fa;
|
|
1470
1479
|
if (typeof Oe == "string" && Oe && le.get(Oe) === !1)
|
|
1471
1480
|
try {
|
|
1472
|
-
|
|
1481
|
+
d.v.m = Pe.format(Oe, q);
|
|
1473
1482
|
} catch {
|
|
1474
|
-
|
|
1483
|
+
d.v.m = String(q);
|
|
1475
1484
|
}
|
|
1476
1485
|
else
|
|
1477
|
-
|
|
1478
|
-
} else typeof q == "object" || (
|
|
1486
|
+
d.v.m = String(q);
|
|
1487
|
+
} else typeof q == "object" || (d.v.m = String(q));
|
|
1479
1488
|
}
|
|
1480
1489
|
}
|
|
1481
1490
|
}
|
|
1482
1491
|
if (Array.isArray(e.data)) {
|
|
1483
|
-
const
|
|
1484
|
-
for (let P = 0; P <
|
|
1485
|
-
const
|
|
1486
|
-
if (Array.isArray(
|
|
1487
|
-
for (let Y = 0; Y <
|
|
1488
|
-
const
|
|
1489
|
-
if (!
|
|
1490
|
-
const he = String(
|
|
1491
|
-
he.startsWith("=") || (
|
|
1492
|
+
const d = e.data;
|
|
1493
|
+
for (let P = 0; P < d.length; P++) {
|
|
1494
|
+
const F = d[P];
|
|
1495
|
+
if (Array.isArray(F))
|
|
1496
|
+
for (let Y = 0; Y < F.length; Y++) {
|
|
1497
|
+
const K = F[Y];
|
|
1498
|
+
if (!K || typeof K != "object" || !K.f) continue;
|
|
1499
|
+
const he = String(K.f);
|
|
1500
|
+
he.startsWith("=") || (K.f = `=${he}`), ((Ie = K.ct) == null ? void 0 : Ie.t) !== "d" && (K.ct = { ...K.ct ?? {}, t: "str" }, U(P, Y));
|
|
1492
1501
|
}
|
|
1493
1502
|
}
|
|
1494
1503
|
}
|
|
1495
|
-
if (e.calcChain =
|
|
1496
|
-
for (const
|
|
1497
|
-
const { r: P, c:
|
|
1504
|
+
if (e.calcChain = H, S && ((Ue = e.config) != null && Ue.merge) && e.celldata)
|
|
1505
|
+
for (const d of Object.values(e.config.merge)) {
|
|
1506
|
+
const { r: P, c: F, rs: Y, cs: K } = d;
|
|
1498
1507
|
for (let he = 0; he < Y; he++)
|
|
1499
|
-
for (let
|
|
1500
|
-
const q = `${P + he}_${
|
|
1501
|
-
|
|
1502
|
-
|
|
1508
|
+
for (let j = 0; j < K; j++) {
|
|
1509
|
+
const q = `${P + he}_${F + j}`;
|
|
1510
|
+
if (he !== 0 || j !== 0) continue;
|
|
1511
|
+
let ee = S.get(q);
|
|
1512
|
+
ee ? (ee.v || (ee.v = {}), ee.v.mc = { r: P, c: F, rs: Y, cs: K }) : (ee = {
|
|
1513
|
+
r: P + he,
|
|
1514
|
+
c: F + j,
|
|
1515
|
+
v: { mc: { r: P, c: F, rs: Y, cs: K } }
|
|
1516
|
+
}, e.celldata.push(ee), S.set(q, ee));
|
|
1503
1517
|
}
|
|
1504
1518
|
}
|
|
1505
1519
|
return e;
|
|
@@ -1509,23 +1523,23 @@ async function _t({
|
|
|
1509
1523
|
sheets: ae
|
|
1510
1524
|
});
|
|
1511
1525
|
let t;
|
|
1512
|
-
if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e,
|
|
1513
|
-
J !== "merge-current-dsheet" &&
|
|
1514
|
-
if (e instanceof
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1526
|
+
if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e, b) => (e.order = b, e)), s.current.transact(() => {
|
|
1527
|
+
J !== "merge-current-dsheet" && te.delete(0, te.length), t.forEach((e) => {
|
|
1528
|
+
if (e instanceof Ke.Map) return;
|
|
1529
|
+
const b = et(e);
|
|
1530
|
+
te.push([b()]);
|
|
1517
1531
|
});
|
|
1518
|
-
}),
|
|
1519
|
-
const e =
|
|
1520
|
-
p.current =
|
|
1532
|
+
}), s != null && s.current) {
|
|
1533
|
+
const e = s.current.getArray(w), b = tt(e);
|
|
1534
|
+
p.current = b, g((a) => a + 1);
|
|
1521
1535
|
}
|
|
1522
|
-
|
|
1523
|
-
const n =
|
|
1536
|
+
V != null && V.headless || ht(k);
|
|
1537
|
+
const n = rt((m = X == null ? void 0 : X.info) == null ? void 0 : m.name);
|
|
1524
1538
|
v == null || v(n), Q();
|
|
1525
1539
|
}
|
|
1526
1540
|
);
|
|
1527
1541
|
} catch (ke) {
|
|
1528
|
-
console.error("Error loading the workbook", ke), !(
|
|
1542
|
+
console.error("Error loading the workbook", ke), !(V != null && V.suppressUiWarnings) && typeof alert < "u" && alert(
|
|
1529
1543
|
"Error loading the workbook. Please ensure it is a valid .xlsx file."
|
|
1530
1544
|
), M(ke);
|
|
1531
1545
|
}
|
|
@@ -1533,5 +1547,5 @@ async function _t({
|
|
|
1533
1547
|
});
|
|
1534
1548
|
}
|
|
1535
1549
|
export {
|
|
1536
|
-
|
|
1550
|
+
xt as runXlsxFileUpload
|
|
1537
1551
|
};
|