@gridsheet/react-core 3.4.0 → 3.4.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"GridSheet.d.ts","sourceRoot":"","sources":["../../src/components/GridSheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmC,WAAW,EAAE,WAAW,EAAe,KAAK,EAAa,MAAM,UAAU,CAAC;AAiCzH,eAAO,MAAM,cAAc,qDAAwC,CAAC;AACpE,eAAO,MAAM,WAAW,4DAAyC,CAAC;AAClE,eAAO,MAAM,cAAc,qDAAwC,CAAC;AACpE,eAAO,MAAM,WAAW,4DAAyC,CAAC;AAElE,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAc,EACd,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe,EACzB,OAAY,EACZ,SAAS,EACT,KAAK,EACL,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,WAAW,GACrB,EAAE,KAAK,eAgXP"}
1
+ {"version":3,"file":"GridSheet.d.ts","sourceRoot":"","sources":["../../src/components/GridSheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmC,WAAW,EAAE,WAAW,EAAe,KAAK,EAAa,MAAM,UAAU,CAAC;AAiCzH,eAAO,MAAM,cAAc,qDAAwC,CAAC;AACpE,eAAO,MAAM,WAAW,4DAAyC,CAAC;AAClE,eAAO,MAAM,cAAc,qDAAwC,CAAC;AACpE,eAAO,MAAM,WAAW,4DAAyC,CAAC;AAElE,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,SAAc,EACd,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe,EACzB,OAAY,EACZ,SAAS,EACT,KAAK,EACL,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,WAAW,GACrB,EAAE,KAAK,eA4XP"}
@@ -1958,9 +1958,10 @@ let ge = class xe {
1958
1958
  }
1959
1959
  /** @internal */
1960
1960
  processFormula(e, { idMap: t, ...s }) {
1961
+ var r, n;
1961
1962
  if ((typeof e == "string" || e instanceof String) && e.charAt(0) === "=") {
1962
- const r = new tt(e.substring(1));
1963
- return r.tokenize(t), r.identify({ ...s, sheet: this }), r.dependencyIds.forEach((n) => this.addDependency(n, s.dependency)), s.dependency != null && (this._formulaHasAsync(r) ? this.registry.asyncFormulaCells.add(s.dependency) : this.registry.asyncFormulaCells.delete(s.dependency)), "=" + r.identifiedFormula;
1963
+ const o = new tt(e.substring(1));
1964
+ return o.tokenize(t), o.identify({ ...s, sheet: this }), o.dependencyIds.forEach((a) => this.addDependency(a, s.dependency)), s.dependency != null && (this._formulaHasAsync(o) ? this.registry.asyncFormulaCells.add(s.dependency) : this.registry.asyncFormulaCells.delete(s.dependency), (n = (r = this.registry).onFormula) == null || n.call(r)), "=" + o.identifiedFormula;
1964
1965
  }
1965
1966
  return s.dependency != null && this.registry.asyncFormulaCells.delete(s.dependency), e;
1966
1967
  }
@@ -3280,7 +3281,7 @@ let ge = class xe {
3280
3281
  if (!je.is(this._stripped))
3281
3282
  return this._stripped;
3282
3283
  let r = this;
3283
- for (; r instanceof xe; )
3284
+ for (; xe.is(r); )
3284
3285
  r = (s = bs({ sheet: r, raise: e, at: t })[0]) == null ? void 0 : s[0];
3285
3286
  return this._stripped = r, this._stripped;
3286
3287
  }
@@ -3669,7 +3670,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3669
3670
  throw e.finishSolvedCache(t, u), u;
3670
3671
  return u;
3671
3672
  }
3672
- return ee.is(c) ? c = e.spill(t, c.matrix) : e.finishSolvedCache(t, c), r === "RESOLVED" && c instanceof ge && (c = ke({ value: c, raise: s, at: n })), L.is(c) && e.finishSolvedCache(t, c), c;
3673
+ return ee.is(c) ? c = e.spill(t, c.matrix) : e.finishSolvedCache(t, c), r === "RESOLVED" && ge.is(c) && (c = ke({ value: c, raise: s, at: n })), L.is(c) && e.finishSolvedCache(t, c), c;
3673
3674
  }, bs = ({ sheet: i, raise: e = !0, at: t }) => {
3674
3675
  const s = i.area;
3675
3676
  return i._toValueMatrix({ area: s, at: t, resolution: "SYSTEM" }).map((r, n) => {
@@ -3695,7 +3696,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3695
3696
  }
3696
3697
  });
3697
3698
  });
3698
- }, ke = ({ value: i, at: e, raise: t = !0 }) => i instanceof ge ? i.strip({ raise: t, at: e }) : i, $t = new Oe("asyncCacheMiss"), ui = (i) => i.some((e) => L.is(e)), Vs = (i) => (i == null ? void 0 : i.__gsType) === "Sheet", Je = (i, e) => {
3699
+ }, ke = ({ value: i, at: e, raise: t = !0 }) => ge.is(i) ? i.strip({ raise: t, at: e }) : i, $t = new Oe("asyncCacheMiss"), ui = (i) => i.some((e) => L.is(e)), Vs = (i) => (i == null ? void 0 : i.__gsType) === "Sheet", Je = (i, e) => {
3699
3700
  for (const t of i)
3700
3701
  if (L.is(t) || Array.isArray(t) && Je(t, e) || ee.is(t) && Je(t.matrix, e) || Vs(t) && Je(t._toValueMatrix({ at: e }), e))
3701
3702
  return !0;
@@ -3774,7 +3775,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3774
3775
  return t;
3775
3776
  if (!i)
3776
3777
  return 0;
3777
- if (i instanceof ge) {
3778
+ if (ge.is(i)) {
3778
3779
  const n = ke({ value: i });
3779
3780
  return P(n, { alternative: t });
3780
3781
  }
@@ -3798,7 +3799,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3798
3799
  return "0";
3799
3800
  if (!i)
3800
3801
  return "";
3801
- if (i instanceof ge) {
3802
+ if (ge.is(i)) {
3802
3803
  const e = ke({ value: i });
3803
3804
  return re(e);
3804
3805
  }
@@ -3816,7 +3817,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3816
3817
  return t;
3817
3818
  if (i === null)
3818
3819
  return !1;
3819
- if (i instanceof ge) {
3820
+ if (ge.is(i)) {
3820
3821
  const r = ke({ value: i });
3821
3822
  return ot(r, e);
3822
3823
  }
@@ -3834,7 +3835,7 @@ const Yt = ({ value: i, sheet: e, point: t, raise: s = !0, resolution: r = "RESO
3834
3835
  function yi(i) {
3835
3836
  if (L.is(i) || i instanceof Date)
3836
3837
  return i;
3837
- if (i instanceof ge) {
3838
+ if (ge.is(i)) {
3838
3839
  const e = ke({ value: i });
3839
3840
  return yi(e);
3840
3841
  }
@@ -3870,7 +3871,7 @@ const bi = /^(<=|>=|<>|>|<|=)?(.*)$/, xi = (i, e) => {
3870
3871
  }
3871
3872
  return es(i, n) === o;
3872
3873
  }, Ce = (i, e, t) => {
3873
- if (i instanceof ge) {
3874
+ if (ge.is(i)) {
3874
3875
  const s = i.solve({ at: t });
3875
3876
  for (let r = 0; r < s.length; r++)
3876
3877
  for (let n = 0; n < s[r].length; n++)
@@ -4701,7 +4702,7 @@ class Sn extends M {
4701
4702
  ], this.category = "logical", this.broadcastDisabled = !0;
4702
4703
  }
4703
4704
  main(e) {
4704
- return ee.is(e) ? e : e instanceof ge ? e._toValueMatrix() : Array.isArray(e) ? e : [[e]];
4705
+ return ee.is(e) ? e : ge.is(e) ? e._toValueMatrix() : Array.isArray(e) ? e : [[e]];
4705
4706
  }
4706
4707
  }
4707
4708
  const Gs = {
@@ -4766,18 +4767,19 @@ class kn {
4766
4767
  onInsertCols: c,
4767
4768
  onSelect: u,
4768
4769
  onKeyUp: d,
4769
- onInit: g
4770
+ onInit: g,
4771
+ onFormula: h
4770
4772
  } = {}) {
4771
- this.sheetHead = 0, this.cellHead = 0, this.data = {}, this.systems = {}, this.sheetIdsByName = {}, this.contextsBySheetId = {}, this.choosingSheetId = 0, this.choosingAddress = "", this.editingSheetId = 0, this.editingAddress = "", this.paletteBySheetName = {}, this.lastFocused = null, this.solvedCaches = /* @__PURE__ */ new Map(), this.lastSpilledTargetIds = /* @__PURE__ */ new Set(), this.asyncFormulaCells = /* @__PURE__ */ new Set(), this.asyncPending = /* @__PURE__ */ new Map(), this.copyingSheetId = 0, this.copyingZone = pr, this.cutting = !1, this.histories = [], this.historyIndex = -1, this.historyLimit = gr, this._componentSheetIds = /* @__PURE__ */ new Map(), this.ready = !1, this.functions = {}, this.policies = {}, this.transmit = (h) => {
4772
- }, this.updateSheet = (h) => ({ type: 0, value: h }), e != null && (this.historyLimit = e), this.functions = {
4773
+ this.sheetHead = 0, this.cellHead = 0, this.data = {}, this.systems = {}, this.sheetIdsByName = {}, this.contextsBySheetId = {}, this.choosingSheetId = 0, this.choosingAddress = "", this.editingSheetId = 0, this.editingAddress = "", this.paletteBySheetName = {}, this.lastFocused = null, this.solvedCaches = /* @__PURE__ */ new Map(), this.lastSpilledTargetIds = /* @__PURE__ */ new Set(), this.asyncFormulaCells = /* @__PURE__ */ new Set(), this.asyncPending = /* @__PURE__ */ new Map(), this.copyingSheetId = 0, this.copyingZone = pr, this.cutting = !1, this.histories = [], this.historyIndex = -1, this.historyLimit = gr, this._componentSheetIds = /* @__PURE__ */ new Map(), this.ready = !1, this.functions = {}, this.policies = {}, this.transmit = (f) => {
4774
+ }, this.updateSheet = (f) => ({ type: 0, value: f }), e != null && (this.historyLimit = e), this.functions = {
4773
4775
  ...Gs,
4774
4776
  ...t
4775
4777
  };
4776
- for (const h in this.functions) {
4777
- const f = this.functions[h];
4778
- f.__name = h;
4778
+ for (const f in this.functions) {
4779
+ const p = this.functions[f];
4780
+ p.__name = f;
4779
4781
  }
4780
- this.policies = s, this.onSave = r, this.onChange = n, this.onRemoveRows = o, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = c, this.onSelect = u, this.onKeyUp = d, this.onInit = g;
4782
+ this.policies = s, this.onSave = r, this.onChange = n, this.onRemoveRows = o, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = c, this.onSelect = u, this.onKeyUp = d, this.onInit = g, this.onFormula = h;
4781
4783
  }
4782
4784
  boot() {
4783
4785
  if (this.ready || Object.keys(this.contextsBySheetId).length === 0)
@@ -6781,4 +6783,4 @@ export {
6781
6783
  Eo as y,
6782
6784
  no as z
6783
6785
  };
6784
- //# sourceMappingURL=hooks-Bt6-NgDa.mjs.map
6786
+ //# sourceMappingURL=hooks-BhxFU0X7.mjs.map