@fileverse-dev/fortune-react 1.2.86 → 1.2.87

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.
@@ -140,6 +140,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
140
140
  handleRedo: () => void;
141
141
  calculateFormula: () => void;
142
142
  calculateSubSheetFormula: (id: string) => void;
143
+ calculateCellReferencedSubSheetFormula: (id: string, refCell?: string[]) => void;
143
144
  dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
144
145
  celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number, colCount?: number) => CellMatrix | null;
145
146
  insertFunction: (selectedFuncIndex: number, filteredFunctionList: any[], callback?: () => void) => void;
@@ -389,6 +389,12 @@ export function generateAPIs(context, setContext, handleUndo, handleRedo, settin
389
389
  api.calculateSheetFromula(draftCtx, id);
390
390
  });
391
391
  },
392
+ calculateCellReferencedSubSheetFormula: function calculateCellReferencedSubSheetFormula(id, refCell) {
393
+ console.log("calculateCellReferencedSubSheetFormula", id, refCell);
394
+ setContext(function (draftCtx) {
395
+ api.calculateReferencedCellSheetFromula(draftCtx, id, refCell);
396
+ });
397
+ },
392
398
  dataToCelldata: function dataToCelldata(data) {
393
399
  return api.dataToCelldata(data);
394
400
  },
@@ -147,6 +147,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
147
147
  handleRedo: () => void;
148
148
  calculateFormula: () => void;
149
149
  calculateSubSheetFormula: (id: string) => void;
150
+ calculateCellReferencedSubSheetFormula: (id: string, refCell?: string[] | undefined) => void;
150
151
  dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
151
152
  celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number | undefined, colCount?: number | undefined) => CellMatrix | null;
152
153
  insertFunction: (selectedFuncIndex: number, filteredFunctionList: any[], callback?: (() => void) | undefined) => void;
@@ -288,7 +288,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
288
288
  return newContext;
289
289
  });
290
290
  }
291
- }, [emitOp]);
291
+ }, [emitOp, globalCache]);
292
292
  var handleRedo = useCallback(function () {
293
293
  var history = globalCache.current.redoList.pop();
294
294
  if (history) {
@@ -140,6 +140,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
140
140
  handleRedo: () => void;
141
141
  calculateFormula: () => void;
142
142
  calculateSubSheetFormula: (id: string) => void;
143
+ calculateCellReferencedSubSheetFormula: (id: string, refCell?: string[]) => void;
143
144
  dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
144
145
  celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number, colCount?: number) => CellMatrix | null;
145
146
  insertFunction: (selectedFuncIndex: number, filteredFunctionList: any[], callback?: () => void) => void;
@@ -396,6 +396,12 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
396
396
  _fortuneCore.api.calculateSheetFromula(draftCtx, id);
397
397
  });
398
398
  },
399
+ calculateCellReferencedSubSheetFormula: function calculateCellReferencedSubSheetFormula(id, refCell) {
400
+ console.log("calculateCellReferencedSubSheetFormula", id, refCell);
401
+ setContext(function (draftCtx) {
402
+ _fortuneCore.api.calculateReferencedCellSheetFromula(draftCtx, id, refCell);
403
+ });
404
+ },
399
405
  dataToCelldata: function dataToCelldata(data) {
400
406
  return _fortuneCore.api.dataToCelldata(data);
401
407
  },
@@ -147,6 +147,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
147
147
  handleRedo: () => void;
148
148
  calculateFormula: () => void;
149
149
  calculateSubSheetFormula: (id: string) => void;
150
+ calculateCellReferencedSubSheetFormula: (id: string, refCell?: string[] | undefined) => void;
150
151
  dataToCelldata: (data: CellMatrix | undefined) => CellWithRowAndCol[];
151
152
  celldataToData: (celldata: CellWithRowAndCol[], rowCount?: number | undefined, colCount?: number | undefined) => CellMatrix | null;
152
153
  insertFunction: (selectedFuncIndex: number, filteredFunctionList: any[], callback?: (() => void) | undefined) => void;
@@ -297,7 +297,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
297
297
  return newContext;
298
298
  });
299
299
  }
300
- }, [emitOp]);
300
+ }, [emitOp, globalCache]);
301
301
  var handleRedo = (0, _react.useCallback)(function () {
302
302
  var history = globalCache.current.redoList.pop();
303
303
  if (history) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.86",
3
+ "version": "1.2.87",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.2.86",
19
+ "@fileverse-dev/fortune-core": "1.2.87",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",