@gridsheet/react-dev 3.4.1 → 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.
package/dist/index.js CHANGED
@@ -2058,9 +2058,10 @@ class ee {
2058
2058
  }
2059
2059
  /** @internal */
2060
2060
  processFormula(e, { idMap: t, ...s }) {
2061
+ var i, r;
2061
2062
  if ((typeof e == "string" || e instanceof String) && e.charAt(0) === "=") {
2062
- const i = new Ue(e.substring(1));
2063
- return i.tokenize(t), i.identify({ ...s, sheet: this }), i.dependencyIds.forEach((r) => this.addDependency(r, s.dependency)), s.dependency != null && (this._formulaHasAsync(i) ? this.registry.asyncFormulaCells.add(s.dependency) : this.registry.asyncFormulaCells.delete(s.dependency)), "=" + i.identifiedFormula;
2063
+ const n = new Ue(e.substring(1));
2064
+ return n.tokenize(t), n.identify({ ...s, sheet: this }), n.dependencyIds.forEach((a) => this.addDependency(a, s.dependency)), s.dependency != null && (this._formulaHasAsync(n) ? this.registry.asyncFormulaCells.add(s.dependency) : this.registry.asyncFormulaCells.delete(s.dependency), (r = (i = this.registry).onFormula) == null || r.call(i)), "=" + n.identifiedFormula;
2064
2065
  }
2065
2066
  return s.dependency != null && this.registry.asyncFormulaCells.delete(s.dependency), e;
2066
2067
  }
@@ -4794,18 +4795,19 @@ class Dr {
4794
4795
  onInsertCols: h,
4795
4796
  onSelect: c,
4796
4797
  onKeyUp: u,
4797
- onInit: f
4798
+ onInit: f,
4799
+ onFormula: d
4798
4800
  } = {}) {
4799
- 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 = _s, this.cutting = !1, this.histories = [], this.historyIndex = -1, this.historyLimit = bs, this._componentSheetIds = /* @__PURE__ */ new Map(), this.ready = !1, this.functions = {}, this.policies = {}, this.transmit = (d) => {
4800
- }, this.updateSheet = (d) => ({ type: 0, value: d }), e != null && (this.historyLimit = e), this.functions = {
4801
+ 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 = _s, this.cutting = !1, this.histories = [], this.historyIndex = -1, this.historyLimit = bs, this._componentSheetIds = /* @__PURE__ */ new Map(), this.ready = !1, this.functions = {}, this.policies = {}, this.transmit = (m) => {
4802
+ }, this.updateSheet = (m) => ({ type: 0, value: m }), e != null && (this.historyLimit = e), this.functions = {
4801
4803
  ...$r,
4802
4804
  ...t
4803
4805
  };
4804
- for (const d in this.functions) {
4805
- const m = this.functions[d];
4806
- m.__name = d;
4806
+ for (const m in this.functions) {
4807
+ const p = this.functions[m];
4808
+ p.__name = m;
4807
4809
  }
4808
- this.policies = s, this.onSave = i, this.onChange = r, this.onRemoveRows = n, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = h, this.onSelect = c, this.onKeyUp = u, this.onInit = f;
4810
+ this.policies = s, this.onSave = i, this.onChange = r, this.onRemoveRows = n, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = h, this.onSelect = c, this.onKeyUp = u, this.onInit = f, this.onFormula = d;
4809
4811
  }
4810
4812
  boot() {
4811
4813
  if (this.ready || Object.keys(this.contextsBySheetId).length === 0)