@fileverse-dev/dsheet 3.0.1-yjs-2 → 3.0.2-patch.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-Cdz6oSCq.js → constants-Q8nzbvQO.js} +5 -3
- package/dist/constants.js +1 -1
- package/dist/editor/components/editor-workbook-sync.d.ts +1 -1
- package/dist/editor/constants/shared-constants.d.ts +2 -0
- package/dist/{executeStringFunction-COcGVlOE.js → executeStringFunction-C5hEkx9z.js} +9318 -13673
- package/dist/formula.js +1 -1
- package/dist/{index-BBy6z-oo.js → index-Dql-IRPC.js} +24662 -21401
- package/dist/index.es.js +42 -42
- package/dist/sheet-engine/core/api/cell.d.ts +20 -0
- package/dist/sheet-engine/core/api/common.d.ts +1 -2
- package/dist/sheet-engine/core/api/index.d.ts +0 -1
- package/dist/sheet-engine/core/api/sheet.d.ts +0 -5
- package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +0 -1
- package/dist/sheet-engine/core/settings.d.ts +1 -1
- package/dist/sheet-engine/core/types.d.ts +0 -3
- package/dist/sheet-engine/react/components/Workbook/api.d.ts +1 -8
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -5
- package/dist/{use-xlsx-import-impl-DWEFU2LX.js → use-xlsx-import-impl-BsL90Hs0.js} +477 -491
- package/dist/{xlsx-export-impl-BNythnz2.js → xlsx-export-impl-DfQuhamE.js} +1106 -1106
- package/package.json +7 -4
- package/dist/editor/utils/config-ydoc-update.d.ts +0 -20
- package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +0 -17
- package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +0 -23
- package/dist/sheet-engine/core/utils/border-config-utils.d.ts +0 -10
- package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +0 -8
- package/dist/sheet-engine/core/utils/range-format.d.ts +0 -43
- package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +0 -40
|
@@ -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 Ze } from "./executeStringFunction-C5hEkx9z.js";
|
|
2
|
+
import * as Je from "yjs";
|
|
3
|
+
import { m as Qe, y as Ke, r as et } from "./index-Dql-IRPC.js";
|
|
4
|
+
import { n as tt } from "./xlsx-hyperlink-inline-DzewAypN.js";
|
|
5
|
+
import { toast as Ie } from "@fileverse/ui";
|
|
6
|
+
var ze = { exports: {} };
|
|
7
|
+
(function(y) {
|
|
8
|
+
var u = {}, 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 Xe = { exports: {} };
|
|
|
15
15
|
for (var n = ""; n.length < r; ) n += t;
|
|
16
16
|
return n;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function N(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 R(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 Xe = { 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 F(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 Xe = { 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 F(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 Xe = { 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, d = 0, a = 1, f = 0, C = 1, l = 0, _ = 0, A = Math.floor(e); l < r && (A = Math.floor(e), f = A * a + d, _ = A * l + C, !(e - A < 5e-8)); )
|
|
89
|
+
e = 1 / (e - A), d = a, a = f, C = l, l = _;
|
|
90
|
+
if (_ > r && (l > r ? (_ = C, f = d) : (_ = l, f = a)), !n) return [0, m * f, _];
|
|
91
|
+
var D = Math.floor(m * f / _);
|
|
92
|
+
return [D, m * f - D * _, _];
|
|
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)), d = 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], d = 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], d = 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()], d = C.getDay(), m < 60 && (d = (d + 6) % 7), n && (d = 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 = d, 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 Xe = { 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(l) {
|
|
121
|
+
return l.indexOf(".") == -1 ? l : l.replace(r, "$1");
|
|
122
122
|
}
|
|
123
123
|
var m = /(?:\.0*|(\.\d*[1-9])0+)[Ee]/, e = /(E[+-])(\d)$/;
|
|
124
|
-
function
|
|
125
|
-
return
|
|
124
|
+
function d(l) {
|
|
125
|
+
return l.indexOf("E") == -1 ? l : l.replace(m, "$1E").replace(e, "$10$2");
|
|
126
126
|
}
|
|
127
|
-
function a(
|
|
128
|
-
var
|
|
129
|
-
return
|
|
127
|
+
function a(l) {
|
|
128
|
+
var _ = l < 0 ? 12 : 11, A = n(l.toFixed(12));
|
|
129
|
+
return A.length <= _ || (A = l.toPrecision(10), A.length <= _) ? A : l.toExponential(5);
|
|
130
130
|
}
|
|
131
|
-
function f(
|
|
132
|
-
var
|
|
133
|
-
return
|
|
131
|
+
function f(l) {
|
|
132
|
+
var _ = n(l.toFixed(11));
|
|
133
|
+
return _.length > (l < 0 ? 12 : 11) || _ === "0" || _ === "-0" ? l.toPrecision(6) : _;
|
|
134
134
|
}
|
|
135
|
-
function C(
|
|
136
|
-
var
|
|
137
|
-
return
|
|
135
|
+
function C(l) {
|
|
136
|
+
var _ = Math.floor(Math.log(Math.abs(l)) * Math.LOG10E), A;
|
|
137
|
+
return _ >= -4 && _ <= -1 ? A = l.toPrecision(10 + _) : Math.abs(_) <= 9 ? A = a(l) : _ === 10 ? A = l.toFixed(10).substr(0, 12) : A = f(l), n(d(A.toUpperCase()));
|
|
138
138
|
}
|
|
139
139
|
return C;
|
|
140
140
|
}();
|
|
@@ -162,7 +162,7 @@ var Xe = { 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 = "", d = 0, a = 0, f = n.y, C, l = 0;
|
|
166
166
|
switch (t) {
|
|
167
167
|
case 98:
|
|
168
168
|
f = n.y + 543;
|
|
@@ -170,10 +170,10 @@ var Xe = { exports: {} };
|
|
|
170
170
|
switch (r.length) {
|
|
171
171
|
case 1:
|
|
172
172
|
case 2:
|
|
173
|
-
C = f % 100,
|
|
173
|
+
C = f % 100, l = 2;
|
|
174
174
|
break;
|
|
175
175
|
default:
|
|
176
|
-
C = f % 1e4,
|
|
176
|
+
C = f % 1e4, l = 4;
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
break;
|
|
@@ -181,7 +181,7 @@ var Xe = { exports: {} };
|
|
|
181
181
|
switch (r.length) {
|
|
182
182
|
case 1:
|
|
183
183
|
case 2:
|
|
184
|
-
C = n.m,
|
|
184
|
+
C = n.m, l = r.length;
|
|
185
185
|
break;
|
|
186
186
|
case 3:
|
|
187
187
|
return Ae[n.m - 1][1];
|
|
@@ -195,7 +195,7 @@ var Xe = { exports: {} };
|
|
|
195
195
|
switch (r.length) {
|
|
196
196
|
case 1:
|
|
197
197
|
case 2:
|
|
198
|
-
C = n.d,
|
|
198
|
+
C = n.d, l = r.length;
|
|
199
199
|
break;
|
|
200
200
|
case 3:
|
|
201
201
|
return Ce[n.q][0];
|
|
@@ -207,7 +207,7 @@ var Xe = { 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, l = r.length;
|
|
211
211
|
break;
|
|
212
212
|
default:
|
|
213
213
|
throw "bad hour format: " + r;
|
|
@@ -217,7 +217,7 @@ var Xe = { exports: {} };
|
|
|
217
217
|
switch (r.length) {
|
|
218
218
|
case 1:
|
|
219
219
|
case 2:
|
|
220
|
-
C = n.H,
|
|
220
|
+
C = n.H, l = r.length;
|
|
221
221
|
break;
|
|
222
222
|
default:
|
|
223
223
|
throw "bad hour format: " + r;
|
|
@@ -227,7 +227,7 @@ var Xe = { exports: {} };
|
|
|
227
227
|
switch (r.length) {
|
|
228
228
|
case 1:
|
|
229
229
|
case 2:
|
|
230
|
-
C = n.M,
|
|
230
|
+
C = n.M, l = r.length;
|
|
231
231
|
break;
|
|
232
232
|
default:
|
|
233
233
|
throw "bad minute format: " + r;
|
|
@@ -235,7 +235,7 @@ var Xe = { 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") ? N(n.S, r.length) : (m >= 2 ? a = m === 3 ? 1e3 : 100 : a = m === 1 ? 10 : 1, d = Math.round(a * (n.S + n.u)), d >= 60 * a && (d = 0), r === "s" ? d === 0 ? "0" : "" + d / a : (e = N(d, 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 Xe = { exports: {} };
|
|
|
253
253
|
default:
|
|
254
254
|
throw "bad abstime format: " + r;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
l = r.length === 3 ? 1 : 2;
|
|
257
257
|
break;
|
|
258
258
|
case 101:
|
|
259
|
-
C = f,
|
|
259
|
+
C = f, l = 1;
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
return
|
|
262
|
+
var _ = l > 0 ? N(C, l) : "";
|
|
263
|
+
return _;
|
|
264
264
|
}
|
|
265
265
|
function oe(t) {
|
|
266
266
|
var r = 3;
|
|
@@ -271,44 +271,44 @@ var Xe = { 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 k = i.replace(r, ""), o = i.length - k.length;
|
|
275
|
+
return ne(h, k, 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 k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
|
|
279
|
+
return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
|
|
280
280
|
}
|
|
281
281
|
function e(h, i) {
|
|
282
|
-
var c,
|
|
282
|
+
var c, k = 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 s = Math.floor(Math.log(i) * Math.LOG10E) % o;
|
|
289
|
+
if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % 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 + s) : c += "E+" + (E - s); 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(H, j, W, S) {
|
|
296
|
+
return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
|
|
297
297
|
});
|
|
298
|
-
} else c = i.toExponential(
|
|
298
|
+
} else c = i.toExponential(k);
|
|
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 d = /# (\?+)( ?)\/( ?)(\d+)/;
|
|
302
302
|
function a(h, i, c) {
|
|
303
|
-
var
|
|
304
|
-
return c + (
|
|
303
|
+
var k = parseInt(h[4], 10), o = Math.round(i * k), s = Math.floor(o / k), E = o - s * k, H = k;
|
|
304
|
+
return c + (s === 0 ? "" : "" + s) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : R(E, h[1].length) + h[2] + "/" + h[3] + N(H, 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#]+)/, l = /\).*[0#]/, _ = /\(###\) ###\\?-####/;
|
|
310
|
+
function A(h) {
|
|
311
|
+
for (var i = "", c, k = 0; k != h.length; ++k) switch (c = h.charCodeAt(k)) {
|
|
312
312
|
case 35:
|
|
313
313
|
break;
|
|
314
314
|
case 63:
|
|
@@ -322,74 +322,74 @@ var Xe = { exports: {} };
|
|
|
322
322
|
}
|
|
323
323
|
return i;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function D(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), k = Math.pow(10, i);
|
|
331
|
+
return i < ("" + Math.round(c * k)).length ? 0 : Math.round(c * k);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function T(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 L(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(l)) {
|
|
341
|
+
var k = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
|
|
342
|
+
return c >= 0 ? O("n", k, c) : "(" + O("n", k, -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, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
|
|
349
|
+
if (i.match(/^00+$/)) return W + re(j, 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 : A(i.substr(0, i.length - o.length)) + o;
|
|
352
|
+
if (s = i.match(d)) return a(s, j, W);
|
|
353
|
+
if (i.match(/^#+0+$/)) return W + re(j, i.length - i.indexOf("0"));
|
|
354
|
+
if (s = i.match(C))
|
|
355
|
+
return o = D(c, s[1].length).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])).replace(/\.(\d*)$/, function(z, pe) {
|
|
356
|
+
return "." + pe + $("0", A(s[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"), s = i.match(/^(0*)\.(#*)$/))
|
|
359
|
+
return W + D(j, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
|
|
360
|
+
if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(re(j, 0));
|
|
361
|
+
if (s = i.match(/^#,##0\.([#0]*0)$/))
|
|
362
|
+
return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + T(c, s[1].length))) + "." + N(U(c, s[1].length), s[1].length);
|
|
363
|
+
if (s = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
|
|
364
|
+
if (s = 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(_))
|
|
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 S = "";
|
|
371
|
+
if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
372
|
+
return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
|
|
373
|
+
if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
374
|
+
return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
|
|
375
|
+
if (s = i.match(/^[#0?]+$/))
|
|
376
|
+
return o = re(c, 0), i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
|
|
377
|
+
if (s = i.match(/^([#0?]+)\.([#0]+)$/)) {
|
|
378
|
+
o = "" + c.toFixed(Math.min(s[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 A(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 (s = i.match(/^00,000\.([#0]*0)$/))
|
|
383
|
+
return E = U(c, s[1].length), c < 0 ? "-" + O(h, i, -c) : oe(L(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
|
|
384
|
+
return "00," + (z.length < 3 ? N(0, 3 - z.length) : "") + z;
|
|
385
|
+
}) + "." + N(E, s[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(j, 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 Xe = { 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 k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
|
|
403
|
+
return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
|
|
404
404
|
}
|
|
405
405
|
function ue(h, i, c) {
|
|
406
|
-
var
|
|
407
|
-
return ne(h,
|
|
406
|
+
var k = i.replace(r, ""), o = i.length - k.length;
|
|
407
|
+
return ne(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
|
|
408
408
|
}
|
|
409
409
|
function Z(h, i) {
|
|
410
|
-
var c,
|
|
410
|
+
var c, k = 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 s = Math.floor(Math.log(i) * Math.LOG10E) % o;
|
|
417
|
+
if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % 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 + s) : c += "E+" + (E - s), c = c.replace(/\+-/, "-");
|
|
420
420
|
}
|
|
421
|
-
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(
|
|
422
|
-
return
|
|
421
|
+
c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(H, j, W, S) {
|
|
422
|
+
return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
|
|
423
423
|
});
|
|
424
|
-
} else c = i.toExponential(
|
|
424
|
+
} else c = i.toExponential(k);
|
|
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(l)) {
|
|
429
|
+
var k = i.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
|
|
430
|
+
return c >= 0 ? x("n", k, c) : "(" + x("n", k, -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, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
|
|
437
|
+
if (i.match(/^00+$/)) return W + N(j, 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 : A(i.substr(0, i.length - o.length)) + o;
|
|
440
|
+
if (s = i.match(d)) return f(s, j, W);
|
|
441
|
+
if (i.match(/^#+0+$/)) return W + N(j, i.length - i.indexOf("0"));
|
|
442
|
+
if (s = i.match(C))
|
|
443
|
+
return o = ("" + c).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
|
|
444
|
+
return "." + pe + $("0", A(s[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"), s = i.match(/^(0*)\.(#*)$/))
|
|
447
|
+
return W + ("" + j).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
|
|
448
|
+
if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + j);
|
|
449
|
+
if (s = i.match(/^#,##0\.([#0]*0)$/))
|
|
450
|
+
return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", s[1].length);
|
|
451
|
+
if (s = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
|
|
452
|
+
if (s = 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(_))
|
|
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 S = "";
|
|
459
|
+
if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
460
|
+
return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
|
|
461
|
+
if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
|
|
462
|
+
return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
|
|
463
|
+
if (s = i.match(/^[#0?]+$/))
|
|
464
|
+
return o = "" + c, i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
|
|
465
|
+
if (s = i.match(/^([#0]+)\.([#0]+)$/)) {
|
|
466
|
+
o = "" + c.toFixed(Math.min(s[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 A(i.substr(0, be) + o + i.substr(i.length - ve));
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
470
|
+
if (s = 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 ? N(0, 3 - z.length) : "") + z;
|
|
473
|
+
}) + "." + N(0, s[1].length);
|
|
474
474
|
switch (i) {
|
|
475
475
|
case "###,###":
|
|
476
476
|
case "##,###":
|
|
477
477
|
case "#,###":
|
|
478
|
-
var me = oe("" +
|
|
478
|
+
var me = oe("" + j);
|
|
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) + A(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, k) {
|
|
486
|
+
return (k | 0) === k ? x(i, c, k) : O(i, c, k);
|
|
487
487
|
};
|
|
488
488
|
}();
|
|
489
489
|
function ke(t) {
|
|
@@ -598,19 +598,19 @@ var Xe = { 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 = [], d = "", a = 0, f = "", C = "t", l, _, A, D = "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 (d = ""; (A = t.charCodeAt(++a)) !== 34 && a < t.length; ) d += String.fromCharCode(A);
|
|
609
|
+
e[e.length] = { t: "t", v: d }, ++a;
|
|
610
610
|
break;
|
|
611
611
|
case "\\":
|
|
612
|
-
var U = t.charAt(++a),
|
|
613
|
-
e[e.length] = { t:
|
|
612
|
+
var U = t.charAt(++a), T = U === "(" || U === ")" ? U : "t";
|
|
613
|
+
e[e.length] = { t: T, v: U }, ++a;
|
|
614
614
|
break;
|
|
615
615
|
case "_":
|
|
616
616
|
e[e.length] = { t: "t", v: " " }, a += 2;
|
|
@@ -621,7 +621,7 @@ var Xe = { 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 (l == null && (l = ye(r, n, t.charAt(a + 1) === "2"), l == 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 Xe = { exports: {} };
|
|
|
640
640
|
case "s":
|
|
641
641
|
case "e":
|
|
642
642
|
case "g":
|
|
643
|
-
if (r < 0 ||
|
|
643
|
+
if (r < 0 || l == null && (l = ye(r, n), l == null))
|
|
644
644
|
return "";
|
|
645
|
-
for (
|
|
646
|
-
f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f =
|
|
645
|
+
for (d = f; ++a < t.length && t.charAt(a).toLowerCase() === f; ) d += f;
|
|
646
|
+
f === "m" && C.toLowerCase() === "h" && (f = "M"), f === "h" && (f = D), e[e.length] = { t: f, v: d }, 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 L = { t: f, v: f };
|
|
652
|
+
if (l == null && (l = ye(r, n)), t.substr(a, 3).toUpperCase() === "A/P" ? (l != null && (L.v = l.H >= 12 ? "P" : "A"), L.t = "T", D = "h", a += 3) : t.substr(a, 5).toUpperCase() === "AM/PM" ? (l != null && (L.v = l.H >= 12 ? "PM" : "AM"), L.t = "T", a += 5, D = "h") : t.substr(a, 5).toUpperCase() === "上午/下午" ? (l != null && (L.v = l.H >= 12 ? "下午" : "上午"), L.t = "T", a += 5, D = "h") : (L.t = "t", ++a), l == null && L.t === "T") return "";
|
|
653
|
+
e[e.length] = L, C = f;
|
|
654
654
|
break;
|
|
655
655
|
case "[":
|
|
656
|
-
for (
|
|
657
|
-
if (
|
|
658
|
-
if (
|
|
659
|
-
if (
|
|
656
|
+
for (d = f; t.charAt(a++) !== "]" && a < t.length; ) d += t.charAt(a);
|
|
657
|
+
if (d.slice(-1) !== "]") throw 'unterminated "[" block: |' + d + "|";
|
|
658
|
+
if (d.match(_e)) {
|
|
659
|
+
if (l == null && (l = ye(r, n), l == null))
|
|
660
660
|
return "";
|
|
661
|
-
e[e.length] = { t: "Z", v:
|
|
662
|
-
} else
|
|
661
|
+
e[e.length] = { t: "Z", v: d.toLowerCase() }, C = d.charAt(1);
|
|
662
|
+
} else d.indexOf("$") > -1 && (d = (d.match(/\$([^-\[\]]*)/) || [])[1] || "$", xe(t) || (e[e.length] = { t: "t", v: d }));
|
|
663
663
|
break;
|
|
664
664
|
case ".":
|
|
665
|
-
if (
|
|
666
|
-
for (
|
|
667
|
-
e[e.length] = { t: "s", v:
|
|
665
|
+
if (l != null) {
|
|
666
|
+
for (d = f; ++a < t.length && (f = t.charAt(a)) === "0"; ) d += f;
|
|
667
|
+
e[e.length] = { t: "s", v: d };
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
670
670
|
case "0":
|
|
671
671
|
case "#":
|
|
672
|
-
for (
|
|
673
|
-
e[e.length] = { t: "n", v:
|
|
672
|
+
for (d = f; ++a < t.length && "0#?.,E+-%".indexOf(f = t.charAt(a)) > -1; ) d += f;
|
|
673
|
+
e[e.length] = { t: "n", v: d };
|
|
674
674
|
break;
|
|
675
675
|
case "?":
|
|
676
|
-
for (
|
|
677
|
-
e[e.length] = { t: f, v:
|
|
676
|
+
for (d = f; t.charAt(++a) === f; ) d += f;
|
|
677
|
+
e[e.length] = { t: f, v: d }, C = f;
|
|
678
678
|
break;
|
|
679
679
|
case "*":
|
|
680
680
|
++a, (t.charAt(a) == " " || t.charAt(a) == "*") && ++a;
|
|
@@ -692,8 +692,8 @@ var Xe = { exports: {} };
|
|
|
692
692
|
case "7":
|
|
693
693
|
case "8":
|
|
694
694
|
case "9":
|
|
695
|
-
for (
|
|
696
|
-
e[e.length] = { t: "D", v:
|
|
695
|
+
for (d = f; a < t.length && "0123456789".indexOf(t.charAt(++a)) > -1; ) d += t.charAt(a);
|
|
696
|
+
e[e.length] = { t: "D", v: d };
|
|
697
697
|
break;
|
|
698
698
|
case " ":
|
|
699
699
|
e[e.length] = { t: f, v: f }, ++a;
|
|
@@ -711,7 +711,7 @@ var Xe = { exports: {} };
|
|
|
711
711
|
switch (e[a].t) {
|
|
712
712
|
case "h":
|
|
713
713
|
case "H":
|
|
714
|
-
e[a].t =
|
|
714
|
+
e[a].t = D, 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 Xe = { exports: {} };
|
|
|
733
733
|
case 0:
|
|
734
734
|
break;
|
|
735
735
|
case 1:
|
|
736
|
-
|
|
736
|
+
l.u >= 0.5 && (l.u = 0, ++l.S), l.S >= 60 && (l.S = 0, ++l.M), l.M >= 60 && (l.M = 0, ++l.H);
|
|
737
737
|
break;
|
|
738
738
|
case 2:
|
|
739
|
-
|
|
739
|
+
l.u >= 0.5 && (l.u = 0, ++l.S), l.S >= 60 && (l.S = 0, ++l.M);
|
|
740
740
|
break;
|
|
741
741
|
}
|
|
742
742
|
var Z = "", x;
|
|
@@ -760,7 +760,7 @@ var Xe = { 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, l, se), e[a].t = "t";
|
|
764
764
|
break;
|
|
765
765
|
case "n":
|
|
766
766
|
case "?":
|
|
@@ -775,35 +775,35 @@ var Xe = { 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 k = 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
|
+
k = a;
|
|
781
781
|
break;
|
|
782
782
|
}
|
|
783
783
|
var o = e.length;
|
|
784
|
-
if (
|
|
784
|
+
if (k === 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 (k !== e.length && c.indexOf("E") === -1) {
|
|
789
|
+
for (x = c.indexOf(".") - 1, a = k; 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 (_ = e[a].v.indexOf(".") > -1 && a === k ? e[a].v.indexOf(".") - 1 : e[a].v.length - 1, h = e[a].v.substr(_ + 1); _ >= 0; --_)
|
|
792
|
+
x >= 0 && (e[a].v.charAt(_) === "0" || e[a].v.charAt(_) === "#") && (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 = k; a < e.length; ++a)
|
|
796
|
+
if (!(e[a] == null || "n?(".indexOf(e[a].t) === -1 && a !== k)) {
|
|
797
|
+
for (_ = e[a].v.indexOf(".") > -1 && a === k ? e[a].v.indexOf(".") + 1 : 0, h = e[a].v.substr(0, _); _ < e[a].v.length; ++_)
|
|
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 s = "";
|
|
805
|
+
for (a = 0; a !== e.length; ++a) e[a] != null && (s += e[a].v);
|
|
806
|
+
return s;
|
|
807
807
|
}
|
|
808
808
|
p._eval = $e;
|
|
809
809
|
var Me = /\[[=<>]/, X = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
|
|
@@ -832,7 +832,7 @@ var Xe = { exports: {} };
|
|
|
832
832
|
}
|
|
833
833
|
return !1;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function ee(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 Xe = { 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 d = r > 0 ? n[0] : r < 0 ? n[1] : n[2];
|
|
851
|
+
if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, d];
|
|
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, d];
|
|
857
857
|
}
|
|
858
858
|
function de(t, r, n) {
|
|
859
859
|
n == null && (n = {});
|
|
@@ -868,7 +868,7 @@ var Xe = { 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 = ee(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 Xe = { 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(u), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = u);
|
|
903
|
+
})(ze);
|
|
904
|
+
var rt = ze.exports;
|
|
905
|
+
const Pe = /* @__PURE__ */ Ze(rt), Be = [
|
|
906
906
|
"228, 232, 237",
|
|
907
907
|
// Light Gray
|
|
908
908
|
"219, 233, 236",
|
|
@@ -927,99 +927,99 @@ const Pe = /* @__PURE__ */ Qe(at), je = [
|
|
|
927
927
|
// Cyan
|
|
928
928
|
"244, 239, 234"
|
|
929
929
|
// Cream
|
|
930
|
-
],
|
|
930
|
+
], Ue = Be[0], nt = [
|
|
931
931
|
["true", "false"],
|
|
932
932
|
["yes", "no"],
|
|
933
933
|
["1", "0"]
|
|
934
934
|
];
|
|
935
|
-
function
|
|
936
|
-
const g =
|
|
937
|
-
return
|
|
935
|
+
function at(y, u) {
|
|
936
|
+
const g = y.toLowerCase(), w = u.toLowerCase();
|
|
937
|
+
return nt.some(([p, v]) => g === p && w === v);
|
|
938
938
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
939
|
+
const it = 200;
|
|
940
|
+
function ct() {
|
|
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 ot(y) {
|
|
944
|
+
if (!Array.isArray(y) || y.length === 0) return null;
|
|
945
|
+
const u = y.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
|
|
946
|
+
return u.trim() ? u : null;
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
948
|
+
function lt(y) {
|
|
949
|
+
return y ? "TRUE" : "FALSE";
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
let
|
|
951
|
+
function st(y) {
|
|
952
|
+
let u = !1, g = 0;
|
|
953
953
|
const w = () => {
|
|
954
|
-
if (
|
|
955
|
-
const v =
|
|
954
|
+
if (u) return !0;
|
|
955
|
+
const v = y.current;
|
|
956
956
|
if (!(v != null && v.getWorkbookContext) || !v.recalculateAllFormulas) return !1;
|
|
957
|
-
const $ = v.getWorkbookContext(),
|
|
958
|
-
return !(
|
|
957
|
+
const $ = v.getWorkbookContext(), N = $ == null ? void 0 : $.luckysheetfile;
|
|
958
|
+
return !(N != null && N.length) || !N.some(
|
|
959
959
|
(I) => Array.isArray(I.data) && I.data.length > 0
|
|
960
|
-
) ? !1 : (v.recalculateAllFormulas(),
|
|
960
|
+
) ? !1 : (v.recalculateAllFormulas(), u = !0, !0);
|
|
961
961
|
}, p = () => {
|
|
962
962
|
var v, $;
|
|
963
|
-
w() || (g += 1, g <
|
|
963
|
+
w() || (g += 1, g < it ? requestAnimationFrame(p) : (($ = (v = y.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), u = !0));
|
|
964
964
|
};
|
|
965
965
|
requestAnimationFrame(() => requestAnimationFrame(p));
|
|
966
966
|
for (const v of [120, 400, 1200])
|
|
967
967
|
window.setTimeout(() => {
|
|
968
|
-
|
|
968
|
+
u || w();
|
|
969
969
|
}, v);
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
return
|
|
971
|
+
function ut(y) {
|
|
972
|
+
return y <= 0 ? Ue : y > Be.length ? Array(y).fill(Ue).join(", ") : Be.slice(0, y).join(", ");
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const
|
|
976
|
-
if (!
|
|
977
|
-
const g =
|
|
974
|
+
function je(y) {
|
|
975
|
+
const u = y.match(/^([A-Z]+)(\d+)$/i);
|
|
976
|
+
if (!u) return null;
|
|
977
|
+
const g = u[1].toUpperCase(), w = u[2];
|
|
978
978
|
let p = 0;
|
|
979
|
-
for (let
|
|
980
|
-
p = p * 26 + (g.charCodeAt(
|
|
979
|
+
for (let N = 0; N < g.length; N++)
|
|
980
|
+
p = p * 26 + (g.charCodeAt(N) - 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 ht(y, u) {
|
|
985
|
+
const g = je(y);
|
|
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(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", N = $.split(",").map((fe) => fe.trim()).filter(Boolean);
|
|
988
|
+
let R = u.type === "list" ? "dropdown" : u.type || "dropdown", I = $, J = "";
|
|
989
|
+
u.type === "list" && N.length === 2 && at(N[0], N[1]) && (R = "checkbox", I = N[0], J = N[1]);
|
|
990
|
+
const F = R === "checkbox" ? 1 : I ? I.split(",").length : 0, ie = ut(F || 1), re = {
|
|
991
|
+
type: R,
|
|
992
992
|
type2: "",
|
|
993
|
-
rangeTxt:
|
|
993
|
+
rangeTxt: y,
|
|
994
994
|
value1: I,
|
|
995
995
|
value2: J,
|
|
996
996
|
validity: "",
|
|
997
997
|
remote: !1,
|
|
998
|
-
prohibitInput:
|
|
999
|
-
hintShow: !!
|
|
1000
|
-
hintValue:
|
|
998
|
+
prohibitInput: u.type === "list",
|
|
999
|
+
hintShow: !!u.showInputMessage,
|
|
1000
|
+
hintValue: u.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 ft(y) {
|
|
1007
|
+
const u = y.split(":"), g = je(u[0].trim());
|
|
1008
1008
|
if (!g) return null;
|
|
1009
|
-
const w =
|
|
1009
|
+
const w = u.length > 1 ? je(u[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 gt(y) {
|
|
1016
|
+
return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => ft(u)).filter(
|
|
1017
|
+
(u) => !!u
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
return
|
|
1020
|
+
function Ye(y) {
|
|
1021
|
+
const u = gt(y);
|
|
1022
|
+
return u.length ? u.map((g) => {
|
|
1023
1023
|
const [w, p] = g.row, [v, $] = g.column;
|
|
1024
1024
|
return {
|
|
1025
1025
|
left: 0,
|
|
@@ -1038,9 +1038,9 @@ function ze(k) {
|
|
|
1038
1038
|
};
|
|
1039
1039
|
}) : null;
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1042
|
-
var $,
|
|
1043
|
-
const
|
|
1041
|
+
function Ge(y) {
|
|
1042
|
+
var $, N;
|
|
1043
|
+
const u = {
|
|
1044
1044
|
textColor: "#000000",
|
|
1045
1045
|
cellColor: "#ffffff",
|
|
1046
1046
|
bold: !1,
|
|
@@ -1048,16 +1048,16 @@ function qe(k) {
|
|
|
1048
1048
|
underline: !1,
|
|
1049
1049
|
strikethrough: !1
|
|
1050
1050
|
};
|
|
1051
|
-
if (!
|
|
1052
|
-
const g =
|
|
1053
|
-
let p =
|
|
1051
|
+
if (!y) return u;
|
|
1052
|
+
const g = y.font, w = y.fill;
|
|
1053
|
+
let p = u.textColor, v = u.cellColor;
|
|
1054
1054
|
if (($ = g == null ? void 0 : g.color) != null && $.argb) {
|
|
1055
|
-
const
|
|
1056
|
-
p = "#" + (
|
|
1055
|
+
const R = g.color.argb;
|
|
1056
|
+
p = "#" + (R.length >= 6 ? R.slice(-6) : R);
|
|
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" && ((N = w.fgColor) != null && N.argb)) {
|
|
1059
|
+
const R = w.fgColor.argb;
|
|
1060
|
+
v = "#" + (R.length >= 6 ? R.slice(-6) : R);
|
|
1061
1061
|
}
|
|
1062
1062
|
return {
|
|
1063
1063
|
textColor: p,
|
|
@@ -1068,33 +1068,33 @@ function qe(k) {
|
|
|
1068
1068
|
strikethrough: !1
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1072
|
-
if (!
|
|
1073
|
-
const
|
|
1071
|
+
function qe(y) {
|
|
1072
|
+
if (!y || typeof y != "string") return "";
|
|
1073
|
+
const u = y.trim().replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").replace(/^=/, ""), g = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
|
|
1074
1074
|
if (g) return (g[1] ?? "").replace(/""/g, '"');
|
|
1075
|
-
const w =
|
|
1075
|
+
const w = u.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(y) {
|
|
1079
|
+
if (!y || typeof y != "string") return "";
|
|
1080
|
+
const u = y.trim().replace(/"/g, '"').replace(/'/g, "'").replace(/^=/, ""), g = u.match(/"((?:[^"]|"")*)"/);
|
|
1081
1081
|
if (g) return (g[1] ?? "").replace(/""/g, '"');
|
|
1082
|
-
const w =
|
|
1082
|
+
const w = u.match(/'([^']*)'/);
|
|
1083
1083
|
return w ? w[1] ?? "" : "";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
if (!
|
|
1087
|
-
const
|
|
1088
|
-
return g ?
|
|
1085
|
+
function dt(y) {
|
|
1086
|
+
if (!y || typeof y != "string") return null;
|
|
1087
|
+
const u = y.trim().toUpperCase(), g = qe(y) || De(y);
|
|
1088
|
+
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;
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const w = (
|
|
1090
|
+
function bt(y, u, g) {
|
|
1091
|
+
const w = (y || "").toLowerCase();
|
|
1092
1092
|
if (w === "cellis") {
|
|
1093
|
-
const p = (
|
|
1093
|
+
const p = (u || "").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 = (u ?? "").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 pt(k, s, g) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
return null;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
if (!
|
|
1149
|
-
let g = (
|
|
1150
|
-
const w = Array.isArray(
|
|
1147
|
+
function mt(y, u) {
|
|
1148
|
+
if (!u.type) return null;
|
|
1149
|
+
let g = (u.text ?? "").trim();
|
|
1150
|
+
const w = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, p = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && dt(w);
|
|
1151
1151
|
if (p) {
|
|
1152
|
-
const I =
|
|
1152
|
+
const I = Ye(y);
|
|
1153
1153
|
if (!I) return null;
|
|
1154
|
-
const J =
|
|
1154
|
+
const J = Ge(u.style);
|
|
1155
1155
|
return {
|
|
1156
1156
|
type: "default",
|
|
1157
1157
|
cellrange: I,
|
|
@@ -1168,51 +1168,51 @@ function wt(k, s) {
|
|
|
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
|
+
(u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = qe(w), g || (g = De(w)));
|
|
1172
|
+
const v = bt(u.type, u.operator, {
|
|
1173
|
+
percent: u.percent,
|
|
1174
|
+
bottom: u.bottom,
|
|
1175
|
+
rank: u.rank,
|
|
1176
|
+
aboveAverage: u.aboveAverage,
|
|
1177
|
+
text: g || u.text,
|
|
1178
|
+
timePeriod: u.timePeriod
|
|
1179
1179
|
});
|
|
1180
1180
|
if (!v) return null;
|
|
1181
1181
|
let $;
|
|
1182
|
-
|
|
1182
|
+
u.type === "cellIs" && Array.isArray(u.formulae) && u.formulae.length > 0 ? $ = u.formulae.map((I) => String(I ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.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 N = Ye(y);
|
|
1186
|
+
if (!N) return null;
|
|
1187
|
+
const R = Ge(u.style);
|
|
1188
1188
|
return {
|
|
1189
1189
|
type: "default",
|
|
1190
|
-
cellrange:
|
|
1190
|
+
cellrange: N,
|
|
1191
1191
|
format: {
|
|
1192
|
-
textColor:
|
|
1193
|
-
cellColor:
|
|
1194
|
-
bold:
|
|
1195
|
-
italic:
|
|
1196
|
-
underline:
|
|
1197
|
-
strikethrough:
|
|
1192
|
+
textColor: R.textColor,
|
|
1193
|
+
cellColor: R.cellColor,
|
|
1194
|
+
bold: R.bold,
|
|
1195
|
+
italic: R.italic,
|
|
1196
|
+
underline: R.underline,
|
|
1197
|
+
strikethrough: R.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 _t({
|
|
1205
|
+
sheetEditorRef: y,
|
|
1206
|
+
ydocRef: u,
|
|
1207
1207
|
setForceSheetRender: g,
|
|
1208
1208
|
dsheetId: w,
|
|
1209
1209
|
currentDataRef: p,
|
|
1210
1210
|
updateDocumentTitle: v,
|
|
1211
1211
|
filterToastShown: $,
|
|
1212
|
-
setFilterToastShown:
|
|
1213
|
-
},
|
|
1212
|
+
setFilterToastShown: N
|
|
1213
|
+
}, R, I, J, F) {
|
|
1214
1214
|
var Ee, ce;
|
|
1215
|
-
const ie =
|
|
1215
|
+
const ie = R == null ? void 0 : R.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 xt({
|
|
|
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 ee = 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 l = le[0];
|
|
1242
|
+
if (l.state === "frozen") {
|
|
1243
|
+
const _ = l.xSplit || 0, A = l.ySplit || 0;
|
|
1244
|
+
let D = null;
|
|
1245
|
+
_ > 0 && A > 0 ? D = "rangeBoth" : A > 0 ? D = "rangeRow" : _ > 0 && (D = "rangeColumn"), D && (xe[ee] = {
|
|
1246
|
+
type: D,
|
|
1247
1247
|
range: {
|
|
1248
|
-
row_focus:
|
|
1249
|
-
column_focus:
|
|
1248
|
+
row_focus: A - 1,
|
|
1249
|
+
column_focus: _ - 1
|
|
1250
1250
|
}
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
const t = {};
|
|
1255
|
-
X.eachRow({ includeEmpty: !1 }, (
|
|
1256
|
-
|
|
1255
|
+
X.eachRow({ includeEmpty: !1 }, (l, _) => {
|
|
1256
|
+
l.eachCell({ includeEmpty: !1 }, (A, D) => {
|
|
1257
1257
|
var se, ue, Z;
|
|
1258
|
-
const U = `${
|
|
1259
|
-
|
|
1258
|
+
const U = `${_ - 1}_${D - 1}`;
|
|
1259
|
+
A.hyperlink && (de[U] = [
|
|
1260
1260
|
{
|
|
1261
1261
|
linkType: "webpage",
|
|
1262
|
-
linkAddress:
|
|
1262
|
+
linkAddress: A.hyperlink
|
|
1263
1263
|
}
|
|
1264
1264
|
]);
|
|
1265
|
-
const
|
|
1266
|
-
if (
|
|
1267
|
-
|
|
1268
|
-
const x =
|
|
1269
|
-
if (x && (O.fs = x),
|
|
1270
|
-
const h =
|
|
1265
|
+
const T = (se = A.style) == null ? void 0 : se.font, L = (ue = A.style) == null ? void 0 : ue.fill, O = {};
|
|
1266
|
+
if (T) {
|
|
1267
|
+
T.bold && (O.bl = 1), T.italic && (O.it = 1), T.underline && (O.un = 1);
|
|
1268
|
+
const x = T.size ?? ke;
|
|
1269
|
+
if (x && (O.fs = x), T.name && (O.ff = T.name), (Z = T.color) != null && Z.argb) {
|
|
1270
|
+
const h = T.color.argb, i = "#" + h.substring(h.length - 6);
|
|
1271
1271
|
O.fc = i;
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
if ((
|
|
1275
|
-
const x =
|
|
1274
|
+
if ((L == null ? void 0 : L.type) === "pattern" && L.pattern === "solid" && L.fgColor && L.fgColor.argb) {
|
|
1275
|
+
const x = L.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[ee] = de), Object.keys(t).length > 0 && ($e[ee] = t);
|
|
1281
1281
|
const r = He(X, ge);
|
|
1282
|
-
r.length > 0 && (Me[
|
|
1282
|
+
r.length > 0 && (Me[ee] = r);
|
|
1283
1283
|
const n = X.tables;
|
|
1284
|
-
n && Object.keys(n).length > 0 && ((a =
|
|
1285
|
-
|
|
1284
|
+
n && Object.keys(n).length > 0 && ((a = F == null ? void 0 : F.onWarning) == null || a.call(
|
|
1285
|
+
F,
|
|
1286
1286
|
"Tables are not fully supported. Table styles will not be applied."
|
|
1287
|
-
),
|
|
1287
|
+
), F != null && F.suppressUiWarnings || Ie({
|
|
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 xt({
|
|
|
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 l = {};
|
|
1297
|
+
for (const [_, A] of Object.entries(m)) {
|
|
1298
|
+
const U = ht(_, A);
|
|
1299
|
+
U && (l[U.rowColKey] = U.entry);
|
|
1300
1300
|
}
|
|
1301
|
-
Object.keys(
|
|
1301
|
+
Object.keys(l).length > 0 && (fe[ee] = l);
|
|
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 l = [];
|
|
1306
|
+
for (const _ of e) {
|
|
1307
|
+
const A = _.ref, D = _.rules || [];
|
|
1308
|
+
for (const U of D) {
|
|
1309
|
+
const T = 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: A,
|
|
1312
|
+
type: T.type,
|
|
1313
|
+
operator: T.operator,
|
|
1314
|
+
formulae: T.formulae,
|
|
1315
|
+
text: T.text,
|
|
1316
|
+
timePeriod: T.timePeriod,
|
|
1317
|
+
percent: T.percent,
|
|
1318
|
+
bottom: T.bottom,
|
|
1319
|
+
rank: T.rank,
|
|
1320
|
+
aboveAverage: T.aboveAverage
|
|
1321
1321
|
});
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
ref:
|
|
1325
|
-
type:
|
|
1326
|
-
operator:
|
|
1327
|
-
formulae:
|
|
1328
|
-
text:
|
|
1329
|
-
}),
|
|
1322
|
+
const L = T.type ? mt(A, T) : null;
|
|
1323
|
+
L ? console.log("[XLSX CF MAPPED] accepted", L) : console.log("[XLSX CF MAPPED] skipped", {
|
|
1324
|
+
ref: A,
|
|
1325
|
+
type: T.type,
|
|
1326
|
+
operator: T.operator,
|
|
1327
|
+
formulae: T.formulae,
|
|
1328
|
+
text: T.text
|
|
1329
|
+
}), L && l.push(L);
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
|
-
|
|
1332
|
+
l.length > 0 && (Ce[ee] = l);
|
|
1333
1333
|
}
|
|
1334
|
-
X.autoFilter && (Ae || (Ae = !0, (C =
|
|
1335
|
-
|
|
1334
|
+
X.autoFilter && (Ae || (Ae = !0, (C = F == null ? void 0 : F.onWarning) == null || C.call(
|
|
1335
|
+
F,
|
|
1336
1336
|
"Filters are not supported in imported files."
|
|
1337
|
-
)), $ || (
|
|
1337
|
+
)), $ || (N(!0), F != null && F.suppressUiWarnings || Ie({
|
|
1338
1338
|
title: "Filters are not supported in imported files",
|
|
1339
1339
|
variant: "warning",
|
|
1340
1340
|
showCloseButton: !0,
|
|
@@ -1345,175 +1345,161 @@ async function xt({
|
|
|
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, d) => {
|
|
1349
|
+
const a = fe[d];
|
|
1350
1350
|
a && Object.keys(a).length > 0 && (e.dataVerification = a);
|
|
1351
|
-
const f = Ce[
|
|
1351
|
+
const f = Ce[d];
|
|
1352
1352
|
e.luckysheet_conditionformat_save = Array.isArray(f) && f.length > 0 ? f : [];
|
|
1353
|
-
}), !
|
|
1353
|
+
}), !u.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 ee = u.current.getArray(w), de = Array.from(ee), le = /* @__PURE__ */ new Map();
|
|
1358
|
+
ae = ae.map((e, d) => {
|
|
1359
|
+
var T, L, O, se, ue, Z, x, h, i, c, k, o, s, E, H, j, W, S, be, ve, me, z, pe, We;
|
|
1360
|
+
const a = (T = e == null ? void 0 : e.celldata) == null ? void 0 : T[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 = ((L = F == null ? void 0 : F.generateSheetId) == null ? void 0 : L.call(F)) ?? ((O = y.current) == null ? void 0 : O.getSettings().generateSheetId()) ?? ct()), xe[d] && (e.frozen = xe[d]), _e[d] && (e.hyperlink = {
|
|
1362
1362
|
...e.hyperlink || {},
|
|
1363
|
-
..._e[
|
|
1364
|
-
}), (
|
|
1365
|
-
const
|
|
1363
|
+
..._e[d]
|
|
1364
|
+
}), (se = e.config) != null && se.columnlen) {
|
|
1365
|
+
const b = {};
|
|
1366
1366
|
Object.entries(e.config.columnlen).forEach(
|
|
1367
|
-
([P,
|
|
1368
|
-
const Y = (Number(
|
|
1369
|
-
|
|
1367
|
+
([P, V]) => {
|
|
1368
|
+
const Y = (Number(V) - 5) / 8 + 0.83;
|
|
1369
|
+
b[P] = Math.round(Y * 7 + 5);
|
|
1370
1370
|
}
|
|
1371
|
-
), e.config.columnlen =
|
|
1371
|
+
), e.config.columnlen = b;
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
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(
|
|
1373
|
+
if ((ue = e.config) != null && ue.rowlen) {
|
|
1374
|
+
const b = Math.round(
|
|
1384
1375
|
Number(e.defaultRowHeight) || 21
|
|
1385
1376
|
), P = {};
|
|
1386
|
-
Object.entries(e.config.rowlen).forEach(([
|
|
1387
|
-
Math.abs(Math.round(Number(Y)) -
|
|
1377
|
+
Object.entries(e.config.rowlen).forEach(([V, Y]) => {
|
|
1378
|
+
Math.abs(Math.round(Number(Y)) - b) > 1 && (P[V] = Number(Y));
|
|
1388
1379
|
}), e.config.rowlen = P;
|
|
1389
1380
|
}
|
|
1390
|
-
if ((
|
|
1391
|
-
const
|
|
1381
|
+
if ((Z = e.config) != null && Z.customHeight) {
|
|
1382
|
+
const b = new Set(
|
|
1392
1383
|
Object.keys(e.config.rowlen || {})
|
|
1393
1384
|
), P = {};
|
|
1394
1385
|
Object.entries(e.config.customHeight).forEach(
|
|
1395
|
-
([
|
|
1396
|
-
|
|
1386
|
+
([V, Y]) => {
|
|
1387
|
+
b.has(V) && Number(Y) === 1 && (P[V] = 1);
|
|
1397
1388
|
}
|
|
1398
1389
|
), e.config.customHeight = P;
|
|
1399
1390
|
}
|
|
1400
|
-
if (Me[
|
|
1401
|
-
const
|
|
1402
|
-
(
|
|
1391
|
+
if (Me[d]) {
|
|
1392
|
+
const b = Number(e.defaultColWidth) || Number(
|
|
1393
|
+
(i = (h = (x = y.current) == null ? void 0 : x.getSettings) == null ? void 0 : h.call(x)) == null ? void 0 : i.defaultColWidth
|
|
1403
1394
|
) || 99, P = Number(e.defaultRowHeight) || Number(
|
|
1404
|
-
(
|
|
1395
|
+
(o = (k = (c = y.current) == null ? void 0 : c.getSettings) == null ? void 0 : k.call(c)) == null ? void 0 : o.defaultRowHeight
|
|
1405
1396
|
) || 21;
|
|
1406
1397
|
e.images = Te(
|
|
1407
|
-
Me[
|
|
1398
|
+
Me[d],
|
|
1408
1399
|
e,
|
|
1409
|
-
|
|
1400
|
+
b,
|
|
1410
1401
|
P
|
|
1411
1402
|
);
|
|
1412
1403
|
}
|
|
1413
|
-
const
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
const Y =
|
|
1417
|
-
Y.has(
|
|
1418
|
-
},
|
|
1404
|
+
const l = _e[d], _ = $e[d], A = [], D = (b, P) => {
|
|
1405
|
+
const V = `${b}_${P}`;
|
|
1406
|
+
D._seen == null && (D._seen = /* @__PURE__ */ new Set());
|
|
1407
|
+
const Y = D._seen;
|
|
1408
|
+
Y.has(V) || (Y.add(V), A.push({ r: b, c: P, id: e.id }));
|
|
1409
|
+
}, U = (s = e.config) != null && s.merge ? /* @__PURE__ */ new Map() : null;
|
|
1419
1410
|
if (e.celldata)
|
|
1420
|
-
for (const
|
|
1421
|
-
const P = `${
|
|
1422
|
-
if (
|
|
1411
|
+
for (const b of e.celldata) {
|
|
1412
|
+
const P = `${b.r}_${b.c}`;
|
|
1413
|
+
if (U == null || U.set(
|
|
1423
1414
|
P,
|
|
1424
|
-
|
|
1425
|
-
),
|
|
1426
|
-
if (
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1415
|
+
b
|
|
1416
|
+
), b.v) {
|
|
1417
|
+
if (b.v.f) {
|
|
1418
|
+
const B = String(b.v.f);
|
|
1419
|
+
B.startsWith("=") || (b.v.f = `=${B}`);
|
|
1429
1420
|
}
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
if (!!(
|
|
1433
|
-
const { fc:
|
|
1434
|
-
Object.assign(
|
|
1421
|
+
if (b.v.f && ((E = b.v.ct) == null ? void 0 : E.t) !== "d" && (b.v.ct = { ...b.v.ct ?? {}, t: "str" }, D(b.r, b.c)), _ != null && _[P]) {
|
|
1422
|
+
const B = _[P];
|
|
1423
|
+
if (!!(l != null && l[P])) {
|
|
1424
|
+
const { fc: K, un: Oe, ...Xe } = B;
|
|
1425
|
+
Object.assign(b.v, Xe);
|
|
1435
1426
|
} else
|
|
1436
|
-
Object.assign(
|
|
1427
|
+
Object.assign(b.v, B);
|
|
1437
1428
|
}
|
|
1438
|
-
if (
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1429
|
+
if (l != null && l[P] && !b.v.f) {
|
|
1430
|
+
const B = l[P][0];
|
|
1431
|
+
B && tt(
|
|
1432
|
+
b.v,
|
|
1433
|
+
B
|
|
1443
1434
|
);
|
|
1444
1435
|
}
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1447
|
-
const
|
|
1448
|
-
if (typeof
|
|
1436
|
+
const V = (H = b.v.ct) == null ? void 0 : H.fa, Y = typeof V == "string" ? V.trim().toLowerCase() : "", te = Y === "general" || ((j = b.v.ct) == null ? void 0 : j.t) === "g", he = Y === "@" || ((W = b.v.ct) == null ? void 0 : W.t) === "s";
|
|
1437
|
+
if (V && !le.has(V) && le.set(V, Pe.is_date(V)), !b.v.f && V && le.get(V)) {
|
|
1438
|
+
const B = typeof b.v.v == "string" ? parseFloat(b.v.v) : b.v.v;
|
|
1439
|
+
if (typeof B == "number" && !isNaN(B))
|
|
1449
1440
|
try {
|
|
1450
|
-
|
|
1441
|
+
b.v.v = B, b.v.m = Pe.format(V, B), b.v.ct = { ...b.v.ct, t: "d" };
|
|
1451
1442
|
} catch {
|
|
1452
1443
|
}
|
|
1453
|
-
} else if (!
|
|
1454
|
-
const
|
|
1444
|
+
} else if (!b.v.f && typeof b.v.v == "string" && !he && !te) {
|
|
1445
|
+
const B = b.v.v.trim();
|
|
1455
1446
|
if (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/.test(
|
|
1456
|
-
|
|
1447
|
+
B
|
|
1457
1448
|
)) {
|
|
1458
|
-
const
|
|
1459
|
-
if (!isFinite(
|
|
1449
|
+
const K = Number(B);
|
|
1450
|
+
if (!isFinite(K))
|
|
1460
1451
|
continue;
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1452
|
+
if (b.v.v = K, b.v.ht == null && (b.v.ht = 2), !V)
|
|
1453
|
+
b.v.m = String(K);
|
|
1463
1454
|
else
|
|
1464
1455
|
try {
|
|
1465
|
-
|
|
1456
|
+
b.v.m = Pe.format(V, K);
|
|
1466
1457
|
} catch {
|
|
1467
1458
|
}
|
|
1468
1459
|
}
|
|
1469
|
-
} else !
|
|
1470
|
-
if (!
|
|
1471
|
-
const
|
|
1460
|
+
} else !b.v.f && typeof b.v.v == "number" && isFinite(b.v.v) && ((S = b.v.ct) == null ? void 0 : S.t) !== "s" && ((be = b.v.ct) == null ? void 0 : be.t) !== "d" && b.v.ht == null && (b.v.ht = 2);
|
|
1461
|
+
if (!b.v.f && (b.v.m === void 0 || b.v.m === null) && ((ve = b.v.ct) == null ? void 0 : ve.t) !== "d") {
|
|
1462
|
+
const B = ot((me = b.v.ct) == null ? void 0 : me.s), q = b.v.v;
|
|
1472
1463
|
if (!(q == null || String(q).trim() === ""))
|
|
1473
|
-
if (
|
|
1474
|
-
|
|
1464
|
+
if (B != null)
|
|
1465
|
+
b.v.m = B;
|
|
1475
1466
|
else if (typeof q == "boolean")
|
|
1476
|
-
|
|
1467
|
+
b.v.m = lt(q);
|
|
1477
1468
|
else if (typeof q == "number" && isFinite(q)) {
|
|
1478
|
-
const Oe = (
|
|
1469
|
+
const Oe = (z = b.v.ct) == null ? void 0 : z.fa;
|
|
1479
1470
|
if (typeof Oe == "string" && Oe && le.get(Oe) === !1)
|
|
1480
1471
|
try {
|
|
1481
|
-
|
|
1472
|
+
b.v.m = Pe.format(Oe, q);
|
|
1482
1473
|
} catch {
|
|
1483
|
-
|
|
1474
|
+
b.v.m = String(q);
|
|
1484
1475
|
}
|
|
1485
1476
|
else
|
|
1486
|
-
|
|
1487
|
-
} else typeof q == "object" || (
|
|
1477
|
+
b.v.m = String(q);
|
|
1478
|
+
} else typeof q == "object" || (b.v.m = String(q));
|
|
1488
1479
|
}
|
|
1489
1480
|
}
|
|
1490
1481
|
}
|
|
1491
1482
|
if (Array.isArray(e.data)) {
|
|
1492
|
-
const
|
|
1493
|
-
for (let P = 0; P <
|
|
1494
|
-
const
|
|
1495
|
-
if (Array.isArray(
|
|
1496
|
-
for (let Y = 0; Y <
|
|
1497
|
-
const
|
|
1498
|
-
if (!
|
|
1499
|
-
const he = String(
|
|
1500
|
-
he.startsWith("=") || (
|
|
1483
|
+
const b = e.data;
|
|
1484
|
+
for (let P = 0; P < b.length; P++) {
|
|
1485
|
+
const V = b[P];
|
|
1486
|
+
if (Array.isArray(V))
|
|
1487
|
+
for (let Y = 0; Y < V.length; Y++) {
|
|
1488
|
+
const te = V[Y];
|
|
1489
|
+
if (!te || typeof te != "object" || !te.f) continue;
|
|
1490
|
+
const he = String(te.f);
|
|
1491
|
+
he.startsWith("=") || (te.f = `=${he}`), ((pe = te.ct) == null ? void 0 : pe.t) !== "d" && (te.ct = { ...te.ct ?? {}, t: "str" }, D(P, Y));
|
|
1501
1492
|
}
|
|
1502
1493
|
}
|
|
1503
1494
|
}
|
|
1504
|
-
if (e.calcChain =
|
|
1505
|
-
for (const
|
|
1506
|
-
const { r: P, c:
|
|
1495
|
+
if (e.calcChain = A, U && ((We = e.config) != null && We.merge) && e.celldata)
|
|
1496
|
+
for (const b of Object.values(e.config.merge)) {
|
|
1497
|
+
const { r: P, c: V, rs: Y, cs: te } = b;
|
|
1507
1498
|
for (let he = 0; he < Y; he++)
|
|
1508
|
-
for (let
|
|
1509
|
-
const q = `${P + he}_${
|
|
1510
|
-
|
|
1511
|
-
|
|
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));
|
|
1499
|
+
for (let B = 0; B < te; B++) {
|
|
1500
|
+
const q = `${P + he}_${V + B}`;
|
|
1501
|
+
let K = U.get(q);
|
|
1502
|
+
K || (K = { r: P + he, c: V + B, v: {} }, e.celldata.push(K), U.set(q, K)), K.v || (K.v = {}), K.v.mc = he === 0 && B === 0 ? { r: P, c: V, rs: Y, cs: te } : { r: P, c: V };
|
|
1517
1503
|
}
|
|
1518
1504
|
}
|
|
1519
1505
|
return e;
|
|
@@ -1523,23 +1509,23 @@ async function xt({
|
|
|
1523
1509
|
sheets: ae
|
|
1524
1510
|
});
|
|
1525
1511
|
let t;
|
|
1526
|
-
if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e,
|
|
1527
|
-
J !== "merge-current-dsheet" &&
|
|
1528
|
-
if (e instanceof
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1512
|
+
if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e, d) => (e.order = d, e)), u.current.transact(() => {
|
|
1513
|
+
J !== "merge-current-dsheet" && ee.delete(0, ee.length), t.forEach((e) => {
|
|
1514
|
+
if (e instanceof Je.Map) return;
|
|
1515
|
+
const d = Qe(e);
|
|
1516
|
+
ee.push([d()]);
|
|
1531
1517
|
});
|
|
1532
|
-
}),
|
|
1533
|
-
const e =
|
|
1534
|
-
p.current =
|
|
1518
|
+
}), u != null && u.current) {
|
|
1519
|
+
const e = u.current.getArray(w), d = Ke(e);
|
|
1520
|
+
p.current = d, g((a) => a + 1);
|
|
1535
1521
|
}
|
|
1536
|
-
|
|
1537
|
-
const n =
|
|
1522
|
+
F != null && F.headless || st(y);
|
|
1523
|
+
const n = et((m = X == null ? void 0 : X.info) == null ? void 0 : m.name);
|
|
1538
1524
|
v == null || v(n), Q();
|
|
1539
1525
|
}
|
|
1540
1526
|
);
|
|
1541
1527
|
} catch (ke) {
|
|
1542
|
-
console.error("Error loading the workbook", ke), !(
|
|
1528
|
+
console.error("Error loading the workbook", ke), !(F != null && F.suppressUiWarnings) && typeof alert < "u" && alert(
|
|
1543
1529
|
"Error loading the workbook. Please ensure it is a valid .xlsx file."
|
|
1544
1530
|
), M(ke);
|
|
1545
1531
|
}
|
|
@@ -1547,5 +1533,5 @@ async function xt({
|
|
|
1547
1533
|
});
|
|
1548
1534
|
}
|
|
1549
1535
|
export {
|
|
1550
|
-
|
|
1536
|
+
_t as runXlsxFileUpload
|
|
1551
1537
|
};
|