@fileverse-dev/dsheet 1.2.20 → 1.2.21
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/index.es.js
CHANGED
|
@@ -176448,99 +176448,100 @@ const n6 = `$#,##0.${"0".repeat(2)}`, Cm = ({
|
|
|
176448
176448
|
column: t,
|
|
176449
176449
|
newValue: r,
|
|
176450
176450
|
apiData: a,
|
|
176451
|
-
sheetEditorRef: n
|
|
176451
|
+
sheetEditorRef: n,
|
|
176452
|
+
shouldIgnoreUsdValue: i
|
|
176452
176453
|
}) => {
|
|
176453
|
-
var
|
|
176454
|
-
const
|
|
176455
|
-
|
|
176454
|
+
var p, d, h, b, g, y, w;
|
|
176455
|
+
const l = Array.isArray(a[0]) ? a[0] : Object.keys(a[0]), c = (p = n.current) == null ? void 0 : p.getSheet(), f = ((d = c == null ? void 0 : c.data) == null ? void 0 : d.length) || 0, s = ((b = (h = c == null ? void 0 : c.data) == null ? void 0 : h[0]) == null ? void 0 : b.length) || 0, o = a.length - (f - e) + 1, u = l.length - (s - t) + 1;
|
|
176456
|
+
o > 0 && ((g = n.current) == null || g.insertRowOrColumn(
|
|
176456
176457
|
"row",
|
|
176457
|
-
c - 1,
|
|
176458
|
-
s
|
|
176459
|
-
)), o > 0 && ((g = n.current) == null || g.insertRowOrColumn(
|
|
176460
|
-
"column",
|
|
176461
176458
|
f - 1,
|
|
176462
176459
|
o
|
|
176460
|
+
)), u > 0 && ((y = n.current) == null || y.insertRowOrColumn(
|
|
176461
|
+
"column",
|
|
176462
|
+
s - 1,
|
|
176463
|
+
u
|
|
176463
176464
|
));
|
|
176464
|
-
let
|
|
176465
|
-
const
|
|
176465
|
+
let v;
|
|
176466
|
+
const m = [];
|
|
176466
176467
|
if (Array.isArray(a[0])) {
|
|
176467
176468
|
if (Array.isArray(a[0])) {
|
|
176468
|
-
|
|
176469
|
+
v = {
|
|
176469
176470
|
row: [e, e + a.length - 1],
|
|
176470
176471
|
column: [t, t + (a[0].length - 1)]
|
|
176471
176472
|
};
|
|
176472
|
-
const
|
|
176473
|
-
if (
|
|
176473
|
+
const _ = a[0].map(String).map((T, M) => {
|
|
176474
|
+
if (M === 0)
|
|
176474
176475
|
return {
|
|
176475
176476
|
...r && typeof r == "object" ? UR({ ...r }) : r,
|
|
176476
|
-
m:
|
|
176477
|
-
v:
|
|
176477
|
+
m: T,
|
|
176478
|
+
v: T,
|
|
176478
176479
|
isDataBlockFormula: !0
|
|
176479
176480
|
};
|
|
176480
|
-
const
|
|
176481
|
+
const N = P5(e, t + M, n), { m: L, ct: B, ...R } = N || {}, D = z5(T, N == null ? void 0 : N.ct);
|
|
176481
176482
|
return {
|
|
176482
|
-
...
|
|
176483
|
-
v:
|
|
176484
|
-
m: String(
|
|
176485
|
-
...
|
|
176483
|
+
...R,
|
|
176484
|
+
v: T,
|
|
176485
|
+
m: String(T),
|
|
176486
|
+
...D ? { ct: D } : {}
|
|
176486
176487
|
};
|
|
176487
176488
|
});
|
|
176488
|
-
|
|
176489
|
-
for (let
|
|
176490
|
-
const
|
|
176491
|
-
a[
|
|
176492
|
-
const
|
|
176493
|
-
|
|
176494
|
-
...
|
|
176495
|
-
...HR(
|
|
176489
|
+
m.push(_);
|
|
176490
|
+
for (let T = 1; T < a.length; T++) {
|
|
176491
|
+
const M = [];
|
|
176492
|
+
a[T].forEach((N, L) => {
|
|
176493
|
+
const B = P5(e + T, t + L, n), { m: R, ct: D, ...j } = B || {}, E = Lx(N);
|
|
176494
|
+
M.push({
|
|
176495
|
+
...j,
|
|
176496
|
+
...HR(B, E),
|
|
176496
176497
|
// move color from styles to cell-level 'fc' when becoming numeric
|
|
176497
|
-
v:
|
|
176498
|
-
ct: z5(
|
|
176498
|
+
v: N,
|
|
176499
|
+
ct: z5(N, B.ct),
|
|
176499
176500
|
// if the value is numeric, skip "m" (FortuneSheet will render display text using v + ct/fa).
|
|
176500
176501
|
// if it's text, explicitly set "m" to match the value so it displays correctly.
|
|
176501
|
-
...
|
|
176502
|
+
...E ? {} : { m: N ? String(N) : "" }
|
|
176502
176503
|
});
|
|
176503
|
-
}),
|
|
176504
|
+
}), m.push(M);
|
|
176504
176505
|
}
|
|
176505
176506
|
}
|
|
176506
176507
|
} else {
|
|
176507
|
-
|
|
176508
|
+
v = {
|
|
176508
176509
|
row: [e, e + a.length],
|
|
176509
|
-
column: [t, t + (
|
|
176510
|
+
column: [t, t + (l.length - 1)]
|
|
176510
176511
|
};
|
|
176511
|
-
const
|
|
176512
|
-
if (
|
|
176512
|
+
const x = l.map((_, T) => {
|
|
176513
|
+
if (T === 0)
|
|
176513
176514
|
return {
|
|
176514
176515
|
...r && typeof r == "object" ? UR({ ...r }) : r,
|
|
176515
|
-
m:
|
|
176516
|
-
v:
|
|
176516
|
+
m: _,
|
|
176517
|
+
v: _,
|
|
176517
176518
|
isDataBlockFormula: !0
|
|
176518
176519
|
};
|
|
176519
|
-
const
|
|
176520
|
+
const M = P5(e, t + T, n), { m: N, ct: L, ...B } = M || {}, R = z5(_, M == null ? void 0 : M.ct);
|
|
176520
176521
|
return {
|
|
176521
|
-
...
|
|
176522
|
-
v:
|
|
176523
|
-
m: String(
|
|
176524
|
-
...
|
|
176522
|
+
...B,
|
|
176523
|
+
v: _,
|
|
176524
|
+
m: String(_),
|
|
176525
|
+
...R ? { ct: R } : {}
|
|
176525
176526
|
};
|
|
176526
176527
|
});
|
|
176527
|
-
|
|
176528
|
-
for (let
|
|
176529
|
-
const
|
|
176530
|
-
|
|
176531
|
-
const
|
|
176532
|
-
|
|
176533
|
-
...
|
|
176534
|
-
...HR(
|
|
176528
|
+
m.push(x);
|
|
176529
|
+
for (let _ = 0; _ < a.length; _++) {
|
|
176530
|
+
const T = [];
|
|
176531
|
+
l.forEach((M, N) => {
|
|
176532
|
+
const L = a[_][M], B = P5(e + 1 + _, t + N, n), { m: R, ct: D, ...j } = B || {}, E = Lx(L), k = {};
|
|
176533
|
+
E && iY(M) && !i ? (k.m = qn(n6, L), k.ht = 2) : L && (k.m = String(L)), T.push({
|
|
176534
|
+
...j,
|
|
176535
|
+
...HR(B, E),
|
|
176535
176536
|
// move color from styles to cell-level 'fc' when becoming numeric
|
|
176536
|
-
v:
|
|
176537
|
-
ct: z5(
|
|
176538
|
-
...
|
|
176537
|
+
v: L,
|
|
176538
|
+
ct: z5(L, B.ct, M),
|
|
176539
|
+
...k
|
|
176539
176540
|
});
|
|
176540
|
-
}),
|
|
176541
|
+
}), m.push(T);
|
|
176541
176542
|
}
|
|
176542
176543
|
}
|
|
176543
|
-
|
|
176544
|
+
v && ((w = n.current) == null || w.setCellValuesByRange(m, v));
|
|
176544
176545
|
}, P5 = (e, t, r) => {
|
|
176545
176546
|
var i, l, c;
|
|
176546
176547
|
const a = (l = (i = r.current) == null ? void 0 : i.getSheet()) == null ? void 0 : l.data, n = (c = a == null ? void 0 : a[e]) == null ? void 0 : c[t];
|
|
@@ -176639,13 +176640,14 @@ const jkt = (e) => {
|
|
|
176639
176640
|
m: e,
|
|
176640
176641
|
isDataBlockFormula: !0
|
|
176641
176642
|
});
|
|
176642
|
-
}, oY = (e, t) => {
|
|
176643
|
+
}, oY = (e, t, r) => {
|
|
176643
176644
|
Cm({
|
|
176644
176645
|
row: t.row,
|
|
176645
176646
|
column: t.column,
|
|
176646
176647
|
newValue: t.newValue,
|
|
176647
176648
|
apiData: e,
|
|
176648
|
-
sheetEditorRef: t.sheetEditorRef
|
|
176649
|
+
sheetEditorRef: t.sheetEditorRef,
|
|
176650
|
+
shouldIgnoreUsdValue: r === "COINGECKO"
|
|
176649
176651
|
});
|
|
176650
176652
|
}, Hkt = (e, t, r) => {
|
|
176651
176653
|
var n;
|
|
@@ -176736,7 +176738,7 @@ const jkt = (e) => {
|
|
|
176736
176738
|
...t.newValue,
|
|
176737
176739
|
m: "No Data",
|
|
176738
176740
|
isDataBlockFormula: !0
|
|
176739
|
-
}) : oY(g, t);
|
|
176741
|
+
}) : oY(g, t, y);
|
|
176740
176742
|
} else !g && typeof g != "boolean" ? (s = t.sheetEditorRef.current) == null || s.setCellValue(t.row, t.column, {
|
|
176741
176743
|
...t.newValue,
|
|
176742
176744
|
m: "No Data",
|
|
@@ -176916,7 +176918,8 @@ const jkt = (e) => {
|
|
|
176916
176918
|
column: M,
|
|
176917
176919
|
newValue: x,
|
|
176918
176920
|
apiData: j,
|
|
176919
|
-
sheetEditorRef: e
|
|
176921
|
+
sheetEditorRef: e,
|
|
176922
|
+
shouldIgnoreUsdValue: !0
|
|
176920
176923
|
}), B != null && B.toString()) {
|
|
176921
176924
|
const F = {
|
|
176922
176925
|
...v,
|
|
@@ -6,10 +6,11 @@ export type FormulaSyncType = {
|
|
|
6
6
|
newValue: Record<string, string>;
|
|
7
7
|
apiData: Array<Record<string, object>> | Array<Array<string>>;
|
|
8
8
|
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
9
|
+
shouldIgnoreUsdValue?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare function isUsdValue(str: string): boolean;
|
|
11
12
|
export declare const USD_FA: string;
|
|
12
|
-
export declare const formulaResponseUiSync: ({ row, column, newValue, apiData, sheetEditorRef, }: FormulaSyncType) => void;
|
|
13
|
+
export declare const formulaResponseUiSync: ({ row, column, newValue, apiData, sheetEditorRef, shouldIgnoreUsdValue, }: FormulaSyncType) => void;
|
|
13
14
|
export declare const getCellClone: (r: number, c: number, sheetEditorRef: React.RefObject<WorkbookInstance | null>) => {
|
|
14
15
|
v?: string | number | boolean;
|
|
15
16
|
m?: string | number;
|