@fileverse-dev/dsheet 4.0.2-a → 4.0.2-b

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.
@@ -549,12 +549,12 @@ function Zp(e, t) {
549
549
  l
550
550
  );
551
551
  const o = e.luckysheetfile.length - 1, i = e.luckysheetfile[o], u = i.id;
552
- (c = i.calcChain) != null && c.length && (i.calcChain = i.calcChain.map(
553
- (g) => ({
554
- ...g,
555
- id: u
556
- })
557
- )), (f = i.dynamicArray) != null && f.length && (i.dynamicArray = i.dynamicArray.map(
552
+ (c = i.calcChain) != null && c.length && (i.calcChain = i.calcChain.filter(
553
+ (g) => g != null && typeof g.r == "number" && typeof g.c == "number"
554
+ ).map((g) => ({
555
+ ...g,
556
+ id: u
557
+ }))), (f = i.dynamicArray) != null && f.length && (i.dynamicArray = i.dynamicArray.map(
558
558
  (g) => g && typeof g == "object" && "id" in g ? { ...g, id: u } : g
559
559
  )), (m = i.dynamicArray_compute) != null && m.length && (i.dynamicArray_compute = i.dynamicArray_compute.map(
560
560
  (g) => g && typeof g == "object" && "id" in g ? { ...g, id: u } : g
@@ -18443,7 +18443,7 @@ function pd(e, t, n) {
18443
18443
  const a = Ko(r);
18444
18444
  let l = !1;
18445
18445
  (o = r.calcChain) == null || o.forEach((i) => {
18446
- if (l) return;
18446
+ if (l || i == null) return;
18447
18447
  const u = i.id ?? r.id, s = Or(
18448
18448
  e,
18449
18449
  u,
@@ -18462,6 +18462,7 @@ function gd(e, t, n, r) {
18462
18462
  const a = n.calcChain;
18463
18463
  if (!(a != null && a.length)) return !0;
18464
18464
  for (const l of a) {
18465
+ if (l == null) continue;
18465
18466
  const o = l.id ?? t, i = Or(
18466
18467
  e,
18467
18468
  o,
@@ -18483,6 +18484,7 @@ function yd(e, t) {
18483
18484
  typeof u != "string" || !u.startsWith("=") || Sa(e, u).forEach((s) => n.add(s));
18484
18485
  };
18485
18486
  return gd(e, t, a, l) || (i = a.calcChain) == null || i.forEach((u) => {
18487
+ if (u == null) return;
18486
18488
  const s = u.id ?? t, c = Or(
18487
18489
  e,
18488
18490
  s,
@@ -24133,14 +24135,28 @@ function Qt(e, t) {
24133
24135
  if (!n)
24134
24136
  return hs(e, t), t;
24135
24137
  for (let r = 0; r < t.length; r += 1) {
24136
- const a = t[r].row[0], l = t[r].row[1], o = t[r].column[0], i = t[r].column[1];
24137
- let u, s;
24138
- if (h.isNil(t[r].row_focus) ? u = a : u = t[r].row_focus, h.isNil(t[r].column_focus) ? s = o : s = t[r].column_focus, h.isNil(u) || h.isNil(s))
24138
+ const a = t[r], l = a.row[0], o = a.row[1], i = a.column[0], u = a.column[1];
24139
+ let s, c;
24140
+ if (h.isNil(a.row_focus) ? s = l : s = a.row_focus, h.isNil(a.column_focus) ? c = i : c = a.column_focus, h.isNil(s) || h.isNil(c))
24139
24141
  return console.error("normalizeSelection: rf and cf is nil"), e.primaryCellActive = null, t;
24140
- const c = e.visibledatarow[l], f = a - 1 === -1 ? 0 : e.visibledatarow[a - 1], m = e.visibledatacolumn[i], d = o - 1 === -1 ? 0 : e.visibledatacolumn[o - 1];
24141
- let p = e.visibledatarow[u], g = u - 1 === -1 ? 0 : e.visibledatarow[u - 1], y = e.visibledatacolumn[s], b = s - 1 === -1 ? 0 : e.visibledatacolumn[s - 1];
24142
- const w = _n(e, n, u, s);
24143
- w && ([g, p] = w.row, [b, y] = w.column), t[r].row = [a, l], t[r].column = [o, i], t[r].row_focus = u, t[r].column_focus = s, t[r].left = b, t[r].width = y - b <= 0 ? 0 : y - b - 1, t[r].top = g, t[r].height = p - g <= 0 ? 0 : p - g - 1, t[r].left_move = d, t[r].width_move = m - d <= 0 ? 0 : m - d - 1, t[r].top_move = f, t[r].height_move = c - f <= 0 ? 0 : c - f - 1;
24142
+ const f = e.visibledatarow[o], m = l - 1 === -1 ? 0 : e.visibledatarow[l - 1], d = e.visibledatacolumn[u], p = i - 1 === -1 ? 0 : e.visibledatacolumn[i - 1];
24143
+ let g = e.visibledatarow[s], y = s - 1 === -1 ? 0 : e.visibledatarow[s - 1], b = e.visibledatacolumn[c], w = c - 1 === -1 ? 0 : e.visibledatacolumn[c - 1];
24144
+ const v = _n(e, n, s, c);
24145
+ v && ([y, g] = v.row, [w, b] = v.column), t[r] = {
24146
+ ...a,
24147
+ row: [l, o],
24148
+ column: [i, u],
24149
+ row_focus: s,
24150
+ column_focus: c,
24151
+ left: w,
24152
+ width: b - w <= 0 ? 0 : b - w - 1,
24153
+ top: y,
24154
+ height: g - y <= 0 ? 0 : g - y - 1,
24155
+ left_move: p,
24156
+ width_move: d - p <= 0 ? 0 : d - p - 1,
24157
+ top_move: m,
24158
+ height_move: f - m <= 0 ? 0 : f - m - 1
24159
+ };
24144
24160
  }
24145
24161
  return hs(e, t), t;
24146
24162
  }
package/dist/formula.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FLVURL as r } from "@fileverse-dev/formulajs";
2
- import { e as t, f } from "./executeStringFunction-BQvE7aeV.js";
2
+ import { e as t, f } from "./executeStringFunction-BhJfh6Uc.js";
3
3
  export {
4
4
  r as FLVURL,
5
5
  t as executeStringFunction,