@fileverse-dev/dsheet 1.2.86-price → 1.2.86-price-a

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.
Files changed (2) hide show
  1. package/dist/index.es.js +38 -34
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -186729,68 +186729,72 @@ const EEt = (e) => {
186729
186729
  var h, p;
186730
186730
  (h = n.current[v]) == null || h.delete(m), (p = e.current) == null || p.removeFromLiveQueryList(v, m);
186731
186731
  }, s = async (v) => {
186732
- var h, p, d, b;
186732
+ var h, p, d, b, g, w, x;
186733
186733
  const m = v.data.function.split("=")[1];
186734
186734
  try {
186735
186735
  switch (v.data.name.toLowerCase()) {
186736
186736
  case "coingecko": {
186737
- const { cellData: g, data: w } = v, { row: x, column: k } = w, T = (h = e.current) == null ? void 0 : h.getWorkbookContext(), L = (d = (p = lr(T)) == null ? void 0 : p[x]) == null ? void 0 : d[k], S = Xt(T, w.subSheetId), B = (D) => {
186738
- if (!D) return D;
186739
- D.replace(/\\"/g, '"');
186737
+ const { cellData: k, data: T } = v, { row: L, column: S } = T, B = (h = e.current) == null ? void 0 : h.getWorkbookContext(), R = (d = (p = lr(B)) == null ? void 0 : p[L]) == null ? void 0 : d[S], q = Xt(B, T.subSheetId), j = (I) => {
186738
+ if (!I) return I;
186739
+ I.replace(/\\"/g, '"');
186740
186740
  };
186741
- if (!(L != null && L.f) || B(L == null ? void 0 : L.f) !== B(g.f)) {
186742
- S != null && S.toString && f(S, w.id);
186741
+ if (!(R != null && R.f) || j(R == null ? void 0 : R.f) !== j(k.f)) {
186742
+ q != null && q.toString && f(q, T.id);
186743
186743
  return;
186744
186744
  }
186745
- const R = await VC({
186745
+ const N = await VC({
186746
186746
  functionCallString: m,
186747
186747
  sheetEditorRef: e
186748
186748
  });
186749
- if (yre(R)) {
186750
- R.type = hM, t == null || t({ data: R });
186749
+ if (yre(N)) {
186750
+ N.type = hM, t == null || t({ data: N });
186751
186751
  return;
186752
186752
  }
186753
- const q = R, j = q[0];
186754
- if (!j) return;
186755
- const [N, P] = Object.entries(j)[0], _ = v.data.value[0];
186756
- if (_) {
186757
- const [D, F] = Object.entries(_)[0];
186758
- if (!(N !== D || P !== F))
186753
+ const P = N, A = P[0];
186754
+ if (!A) return;
186755
+ const [_, D] = Object.entries(A)[0], E = v.data.value[0];
186756
+ if (E) {
186757
+ const [I, W] = Object.entries(E)[0];
186758
+ if (!(_ !== I || D !== W))
186759
186759
  return;
186760
186760
  }
186761
186761
  if (H5({
186762
- row: x,
186763
- column: k,
186764
- newValue: g,
186765
- apiData: q,
186762
+ row: L,
186763
+ column: S,
186764
+ newValue: k,
186765
+ apiData: P,
186766
186766
  sheetEditorRef: e,
186767
186767
  shouldIgnoreUsdValue: !0
186768
- }), S != null && S.toString()) {
186769
- const D = {
186768
+ }), q != null && q.toString()) {
186769
+ const I = {
186770
186770
  ...v,
186771
- data: { ...w, value: q }
186771
+ data: { ...T, value: P }
186772
186772
  };
186773
- n.current[S].set(
186774
- D.data.id,
186775
- D
186773
+ n.current[q].set(
186774
+ I.data.id,
186775
+ I
186776
186776
  ), (b = e.current) == null || b.updateSheetLiveQueryList(
186777
- S,
186778
- D
186777
+ q,
186778
+ I
186779
186779
  );
186780
186780
  }
186781
- gW(T.currentSheetId, x, k), console.log("subSheetIndex ========", S);
186781
+ gW(B.currentSheetId, L, S), (x = e.current) == null || x.calculateSubSheetFormula(
186782
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
186783
+ // @ts-expect-error
186784
+ (w = (g = e.current) == null ? void 0 : g.getSheet()) == null ? void 0 : w.id
186785
+ );
186782
186786
  return;
186783
186787
  }
186784
186788
  }
186785
- } catch (g) {
186786
- const w = {
186789
+ } catch (k) {
186790
+ const T = {
186787
186791
  data: {
186788
- message: (g == null ? void 0 : g.message) || "Live query failed",
186792
+ message: (k == null ? void 0 : k.message) || "Live query failed",
186789
186793
  functionName: "COINGECKO",
186790
186794
  type: hM
186791
186795
  }
186792
186796
  };
186793
- t == null || t(w);
186797
+ t == null || t(T);
186794
186798
  }
186795
186799
  }, o = mr(!1), u = async () => {
186796
186800
  var v;
@@ -234754,7 +234758,7 @@ const RMt = ({
234754
234758
  if (c[q], !j.v.baseValue) continue;
234755
234759
  j.v = typeof j.v == "string" ? j.v : { ...c[q].v };
234756
234760
  const N = (m = (v = j.v) == null ? void 0 : v.m) == null ? void 0 : m.toString(), P = (p = (h = j.v) == null ? void 0 : h.m) != null && p.includes(".") ? (w = (g = (b = (d = j.v) == null ? void 0 : d.m) == null ? void 0 : b.split(" ")[0]) == null ? void 0 : g.split(".")[1]) == null ? void 0 : w.length : 0, A = (k = (x = j.v) == null ? void 0 : x.m) == null ? void 0 : k.split(" ")[1], _ = LMt[A], D = (L = t.current[_]) == null ? void 0 : L[(T = j.v) == null ? void 0 : T.baseCurrency];
234757
- if (console.log(D, "price ============"), !D) return;
234761
+ if (!D) return;
234758
234762
  j.v.m = N.replace(
234759
234763
  /\d+(\.\d+)?/,
234760
234764
  (Number((S = j.v) == null ? void 0 : S.v) / D).toFixed(P).toString()
@@ -234762,7 +234766,7 @@ const RMt = ({
234762
234766
  const F = FMt(j.c + 1);
234763
234767
  f.push(`${F}${j.r + 1}`);
234764
234768
  }
234765
- console.log(f, "hahahahaahgggg"), f.length > 0 && ((R = e.current) == null || R.calculateCellReferencedSubSheetFormula(a, f));
234769
+ f.length > 0 && ((R = e.current) == null || R.calculateCellReferencedSubSheetFormula(a, f));
234766
234770
  };
234767
234771
  return br(() => (i(), r.current = setInterval(
234768
234772
  () => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "1.2.86-price",
5
+ "version": "1.2.86-price-a",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {