@rowsncolumns/spreadsheet-state 28.0.72 → 28.0.74
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/cjs/api/advanced-filter.d.ts +72 -0
- package/dist/cjs/api/advanced-filter.d.ts.map +1 -0
- package/dist/cjs/api/advanced-filter.js +0 -0
- package/dist/cjs/api/goal-seek.d.ts +29 -0
- package/dist/cjs/api/goal-seek.d.ts.map +1 -0
- package/dist/cjs/api/goal-seek.js +131 -0
- package/dist/cjs/api/immer-utils.d.ts.map +1 -1
- package/dist/cjs/api/immer-utils.js +2 -0
- package/dist/cjs/api/paint-format.d.ts +41 -0
- package/dist/cjs/api/paint-format.d.ts.map +1 -0
- package/dist/cjs/api/paint-format.js +115 -0
- package/dist/cjs/api/paste-special.d.ts +48 -0
- package/dist/cjs/api/paste-special.d.ts.map +1 -0
- package/dist/cjs/api/paste-special.js +229 -0
- package/dist/cjs/api/split-text.d.ts +12 -0
- package/dist/cjs/api/split-text.d.ts.map +1 -1
- package/dist/cjs/api/split-text.js +41 -0
- package/dist/cjs/api/subtotal.d.ts +85 -0
- package/dist/cjs/api/subtotal.d.ts.map +1 -0
- package/dist/cjs/api/subtotal.js +250 -0
- package/dist/cjs/commands.d.ts +13 -0
- package/dist/cjs/commands.d.ts.map +1 -1
- package/dist/cjs/components/editors/data-validation-rule-editor.d.ts.map +1 -1
- package/dist/cjs/components/editors/data-validation-rule-editor.js +83 -16
- package/dist/cjs/components/editors/table-editor.js +7 -2
- package/dist/cjs/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation-worker.js +39 -8
- package/dist/cjs/hooks/use-calculation.d.ts +12 -2
- package/dist/cjs/hooks/use-calculation.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation.js +71 -35
- package/dist/cjs/hooks/use-on-advanced-filter.d.ts +21 -0
- package/dist/cjs/hooks/use-on-advanced-filter.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-advanced-filter.js +42 -0
- package/dist/cjs/hooks/use-on-goal-seek.d.ts +30 -0
- package/dist/cjs/hooks/use-on-goal-seek.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-goal-seek.js +140 -0
- package/dist/cjs/hooks/use-on-import-excel.d.ts +10 -1
- package/dist/cjs/hooks/use-on-import-excel.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-import-excel.js +8 -4
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.js +53 -34
- package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-paste.js +82 -52
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts +2 -1
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-remove-duplicates.js +5 -3
- package/dist/cjs/hooks/use-on-show-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-show-column.js +2 -0
- package/dist/cjs/hooks/use-on-show-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-show-row.js +2 -0
- package/dist/cjs/hooks/use-on-subtotal.d.ts +26 -0
- package/dist/cjs/hooks/use-on-subtotal.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-subtotal.js +53 -0
- package/dist/cjs/hooks/use-paint-format.d.ts +19 -3
- package/dist/cjs/hooks/use-paint-format.d.ts.map +1 -1
- package/dist/cjs/hooks/use-paint-format.js +85 -31
- package/dist/cjs/hooks/use-sheet-properties.d.ts +3 -0
- package/dist/cjs/hooks/use-sheet-properties.d.ts.map +1 -1
- package/dist/cjs/hooks/use-sheet-properties.js +8 -0
- package/dist/cjs/hooks/use-split-text-to-columns.d.ts +2 -1
- package/dist/cjs/hooks/use-split-text-to-columns.d.ts.map +1 -1
- package/dist/cjs/hooks/use-split-text-to-columns.js +3 -2
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts +50 -36
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/cjs/hooks/use-spreadsheet-state.js +98 -18
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/interface/calculation-interface.d.ts.map +1 -1
- package/dist/cjs/interface/calculation-interface.js +5 -0
- package/dist/cjs/interface/change-batch-stream.d.ts.map +1 -1
- package/dist/cjs/interface/change-batch-stream.js +12 -6
- package/dist/cjs/interface/change-batch.d.ts.map +1 -1
- package/dist/cjs/interface/change-batch.js +17 -9
- package/dist/cjs/interface/change-formatting.d.ts.map +1 -1
- package/dist/cjs/interface/change-formatting.js +30 -11
- package/dist/cjs/interface/hide-column.d.ts.map +1 -1
- package/dist/cjs/interface/hide-column.js +4 -0
- package/dist/cjs/interface/hide-row.d.ts.map +1 -1
- package/dist/cjs/interface/hide-row.js +4 -0
- package/dist/cjs/interface/remove-duplicates.d.ts +3 -2
- package/dist/cjs/interface/remove-duplicates.d.ts.map +1 -1
- package/dist/cjs/interface/remove-duplicates.js +41 -7
- package/dist/cjs/interface/split-text.d.ts +2 -1
- package/dist/cjs/interface/split-text.d.ts.map +1 -1
- package/dist/cjs/interface/split-text.js +7 -3
- package/dist/cjs/interface/spreadsheet-interface.d.ts +2 -1
- package/dist/cjs/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/cjs/interface/spreadsheet-interface.js +5 -5
- package/dist/cjs/sheet-cell.d.ts.map +1 -1
- package/dist/cjs/sheet-cell.js +7 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/api/advanced-filter.d.ts +72 -0
- package/dist/esm/api/advanced-filter.d.ts.map +1 -0
- package/dist/esm/api/advanced-filter.js +0 -0
- package/dist/esm/api/goal-seek.d.ts +29 -0
- package/dist/esm/api/goal-seek.d.ts.map +1 -0
- package/dist/esm/api/goal-seek.js +108 -0
- package/dist/esm/api/immer-utils.d.ts.map +1 -1
- package/dist/esm/api/immer-utils.js +2 -0
- package/dist/esm/api/paint-format.d.ts +41 -0
- package/dist/esm/api/paint-format.d.ts.map +1 -0
- package/dist/esm/api/paint-format.js +77 -0
- package/dist/esm/api/paste-special.d.ts +48 -0
- package/dist/esm/api/paste-special.d.ts.map +1 -0
- package/dist/esm/api/paste-special.js +220 -0
- package/dist/esm/api/split-text.d.ts +12 -0
- package/dist/esm/api/split-text.d.ts.map +1 -1
- package/dist/esm/api/split-text.js +28 -0
- package/dist/esm/api/subtotal.d.ts +85 -0
- package/dist/esm/api/subtotal.d.ts.map +1 -0
- package/dist/esm/api/subtotal.js +181 -0
- package/dist/esm/commands.d.ts +13 -0
- package/dist/esm/commands.d.ts.map +1 -1
- package/dist/esm/components/editors/data-validation-rule-editor.d.ts.map +1 -1
- package/dist/esm/components/editors/data-validation-rule-editor.js +52 -4
- package/dist/esm/components/editors/table-editor.js +7 -4
- package/dist/esm/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation-worker.js +20 -2
- package/dist/esm/hooks/use-calculation.d.ts +12 -2
- package/dist/esm/hooks/use-calculation.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation.js +38 -7
- package/dist/esm/hooks/use-on-advanced-filter.d.ts +21 -0
- package/dist/esm/hooks/use-on-advanced-filter.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-advanced-filter.js +41 -0
- package/dist/esm/hooks/use-on-goal-seek.d.ts +30 -0
- package/dist/esm/hooks/use-on-goal-seek.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-goal-seek.js +82 -0
- package/dist/esm/hooks/use-on-import-excel.d.ts +10 -1
- package/dist/esm/hooks/use-on-import-excel.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-import-excel.js +8 -4
- package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-merge-unmerge-cells.js +13 -13
- package/dist/esm/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-paste.js +49 -14
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts +2 -1
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-remove-duplicates.js +5 -3
- package/dist/esm/hooks/use-on-show-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-show-column.js +2 -0
- package/dist/esm/hooks/use-on-show-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-show-row.js +2 -0
- package/dist/esm/hooks/use-on-subtotal.d.ts +26 -0
- package/dist/esm/hooks/use-on-subtotal.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-subtotal.js +48 -0
- package/dist/esm/hooks/use-paint-format.d.ts +19 -3
- package/dist/esm/hooks/use-paint-format.d.ts.map +1 -1
- package/dist/esm/hooks/use-paint-format.js +71 -29
- package/dist/esm/hooks/use-sheet-properties.d.ts +3 -0
- package/dist/esm/hooks/use-sheet-properties.d.ts.map +1 -1
- package/dist/esm/hooks/use-sheet-properties.js +8 -0
- package/dist/esm/hooks/use-split-text-to-columns.d.ts +2 -1
- package/dist/esm/hooks/use-split-text-to-columns.d.ts.map +1 -1
- package/dist/esm/hooks/use-split-text-to-columns.js +3 -2
- package/dist/esm/hooks/use-spreadsheet-state.d.ts +50 -36
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/esm/hooks/use-spreadsheet-state.js +89 -16
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +9 -0
- package/dist/esm/interface/calculation-interface.d.ts.map +1 -1
- package/dist/esm/interface/calculation-interface.js +3 -0
- package/dist/esm/interface/change-batch-stream.d.ts.map +1 -1
- package/dist/esm/interface/change-batch-stream.js +12 -6
- package/dist/esm/interface/change-batch.d.ts.map +1 -1
- package/dist/esm/interface/change-batch.js +15 -9
- package/dist/esm/interface/change-formatting.d.ts.map +1 -1
- package/dist/esm/interface/change-formatting.js +28 -11
- package/dist/esm/interface/hide-column.d.ts.map +1 -1
- package/dist/esm/interface/hide-column.js +4 -0
- package/dist/esm/interface/hide-row.d.ts.map +1 -1
- package/dist/esm/interface/hide-row.js +4 -0
- package/dist/esm/interface/remove-duplicates.d.ts +3 -2
- package/dist/esm/interface/remove-duplicates.d.ts.map +1 -1
- package/dist/esm/interface/remove-duplicates.js +37 -6
- package/dist/esm/interface/split-text.d.ts +2 -1
- package/dist/esm/interface/split-text.d.ts.map +1 -1
- package/dist/esm/interface/split-text.js +6 -3
- package/dist/esm/interface/spreadsheet-interface.d.ts +2 -1
- package/dist/esm/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/esm/interface/spreadsheet-interface.js +5 -5
- package/dist/esm/sheet-cell.d.ts.map +1 -1
- package/dist/esm/sheet-cell.js +7 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +18 -18
|
@@ -366,7 +366,7 @@ var isHeavyArrayFormula = function (formula) {
|
|
|
366
366
|
};
|
|
367
367
|
var cellPromises = new Map();
|
|
368
368
|
export var useCalculation = function (_a) {
|
|
369
|
-
var locale = _a.locale, functions = _a.functions, iterativeCalculation = _a.iterativeCalculation, onDemandFormulaPattern = _a.onDemandFormulaPattern, activeSheetId = _a.activeSheetId, onSuccess = _a.onSuccess, onChangeDependencyGraph = _a.onChangeDependencyGraph, getSheetId = _a.getSheetId, getSheetName = _a.getSheetName, getSheetIndex = _a.getSheetIndex, getSheetCount = _a.getSheetCount, getActiveSheetId = _a.getActiveSheetId, getEffectiveValue = _a.getEffectiveValue, getUserEnteredValue = _a.getUserEnteredValue, getConditionalFormatFormula = _a.getConditionalFormatFormula, getDataValidationFormula = _a.getDataValidationFormula, getSheetProperties = _a.getSheetProperties, getCellData = _a.getCellData, onStructuredReference = _a.onStructuredReference, onNamedRange = _a.onNamedRange, namedRanges = _a.namedRanges, onChangeStaticReference = _a.onChangeStaticReference, onBeginCalculation = _a.onBeginCalculation, getEffectiveStructuredValue = _a.getEffectiveStructuredValue, isRowHidden = _a.isRowHidden, isRowHiddenByFilter = _a.isRowHiddenByFilter, _b = _a.enableLazyCalculation, enableLazyCalculation = _b === void 0 ? true : _b, _c = _a.enabled, enabled = _c === void 0 ? true : _c;
|
|
369
|
+
var locale = _a.locale, functions = _a.functions, iterativeCalculation = _a.iterativeCalculation, onDemandFormulaPattern = _a.onDemandFormulaPattern, activeSheetId = _a.activeSheetId, onSuccess = _a.onSuccess, onChangeDependencyGraph = _a.onChangeDependencyGraph, getSheetId = _a.getSheetId, getSheetName = _a.getSheetName, getSheetIndex = _a.getSheetIndex, getSheetNames = _a.getSheetNames, getSheetCount = _a.getSheetCount, getActiveSheetId = _a.getActiveSheetId, getEffectiveValue = _a.getEffectiveValue, getUserEnteredValue = _a.getUserEnteredValue, getConditionalFormatFormula = _a.getConditionalFormatFormula, getDataValidationFormula = _a.getDataValidationFormula, getSheetProperties = _a.getSheetProperties, getCellData = _a.getCellData, onStructuredReference = _a.onStructuredReference, onNamedRange = _a.onNamedRange, namedRanges = _a.namedRanges, onChangeStaticReference = _a.onChangeStaticReference, onBeginCalculation = _a.onBeginCalculation, getEffectiveStructuredValue = _a.getEffectiveStructuredValue, isRowHidden = _a.isRowHidden, isRowHiddenByFilter = _a.isRowHiddenByFilter, _b = _a.enableLazyCalculation, enableLazyCalculation = _b === void 0 ? true : _b, _c = _a.enabled, enabled = _c === void 0 ? true : _c;
|
|
370
370
|
// Convert string pattern to RegExp if provided
|
|
371
371
|
var onDemandPattern = useMemo(function () {
|
|
372
372
|
if (!onDemandFormulaPattern)
|
|
@@ -381,6 +381,9 @@ export var useCalculation = function (_a) {
|
|
|
381
381
|
var graphOperationQueue = useRef([]);
|
|
382
382
|
// Results queue
|
|
383
383
|
var resultsQueueRef = useRef(new Map());
|
|
384
|
+
// Circular-reference members awaiting the next `onSuccess` flush (see
|
|
385
|
+
// `CalculationSuccessContext.circularReferences`).
|
|
386
|
+
var circularReferencesQueueRef = useRef(new Map());
|
|
384
387
|
var resultsFlushPendingRef = useRef(false);
|
|
385
388
|
var isFullRecalcRef = useRef(false);
|
|
386
389
|
var staticNodeArrayRef = useRef([]);
|
|
@@ -388,6 +391,7 @@ export var useCalculation = function (_a) {
|
|
|
388
391
|
var getSheetNameStable = useCallbackRef(getSheetName);
|
|
389
392
|
var getSheetIdStable = useCallbackRef(getSheetId);
|
|
390
393
|
var getSheetIndexStable = useCallbackRef(getSheetIndex);
|
|
394
|
+
var getSheetNamesStable = useCallbackRef(getSheetNames);
|
|
391
395
|
var getSheetCountStable = useCallbackRef(getSheetCount);
|
|
392
396
|
var getCellDataStable = useCallbackRef(getCellData);
|
|
393
397
|
var onStructuredReferenceStable = useCallbackRef(onStructuredReference);
|
|
@@ -770,6 +774,7 @@ export var useCalculation = function (_a) {
|
|
|
770
774
|
locale: locale,
|
|
771
775
|
getSheetId: getSheetIdStable,
|
|
772
776
|
getSheetIndex: getSheetIndexStable,
|
|
777
|
+
getSheetNames: getSheetNames ? getSheetNamesStable : undefined,
|
|
773
778
|
getSheetCount: getSheetCountStable,
|
|
774
779
|
getSheetProperties: function (sheetId) {
|
|
775
780
|
if (sheetId === void 0) { sheetId = getActiveSheetId(); }
|
|
@@ -780,6 +785,17 @@ export var useCalculation = function (_a) {
|
|
|
780
785
|
isRowHiddenByFilter: isRowHiddenByFilter
|
|
781
786
|
? isRowHiddenByFilterStable
|
|
782
787
|
: undefined,
|
|
788
|
+
getCellFormula: function (sheetId, rowIndex, columnIndex) {
|
|
789
|
+
var userEnteredValue = getFinalUserEnteredValue({
|
|
790
|
+
sheetId: sheetId,
|
|
791
|
+
rowIndex: rowIndex,
|
|
792
|
+
columnIndex: columnIndex,
|
|
793
|
+
});
|
|
794
|
+
return typeof userEnteredValue === "string" &&
|
|
795
|
+
isAFormula(userEnteredValue)
|
|
796
|
+
? userEnteredValue
|
|
797
|
+
: undefined;
|
|
798
|
+
},
|
|
783
799
|
getCellValue: function (sheetId, rowIndex, columnIndex, property) {
|
|
784
800
|
var _a;
|
|
785
801
|
var key = makeKey({
|
|
@@ -1079,7 +1095,7 @@ export var useCalculation = function (_a) {
|
|
|
1079
1095
|
publishResults(initialResults.values());
|
|
1080
1096
|
}
|
|
1081
1097
|
runCellBatch_1 = function (input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1082
|
-
var cellNodes, rootSheetId, _a, included, deferred, circularKeys_1, results, cellNodes_1, cellNodes_1_1, node
|
|
1098
|
+
var cellNodes, rootSheetId, _a, included, deferred, circularKeys_1, results, circularPositions, cellNodes_1, cellNodes_1_1, node;
|
|
1083
1099
|
var e_20, _b;
|
|
1084
1100
|
var _c;
|
|
1085
1101
|
return __generator(this, function (_d) {
|
|
@@ -1102,15 +1118,16 @@ export var useCalculation = function (_a) {
|
|
|
1102
1118
|
circularKeys_1 = findCircularKeys(cellNodes);
|
|
1103
1119
|
if (circularKeys_1.size) {
|
|
1104
1120
|
results = new Map();
|
|
1121
|
+
circularPositions = [];
|
|
1105
1122
|
try {
|
|
1106
1123
|
for (cellNodes_1 = __values(cellNodes), cellNodes_1_1 = cellNodes_1.next(); !cellNodes_1_1.done; cellNodes_1_1 = cellNodes_1.next()) {
|
|
1107
1124
|
node = cellNodes_1_1.value;
|
|
1108
1125
|
if (!circularKeys_1.has(node.key)) {
|
|
1109
1126
|
continue;
|
|
1110
1127
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1128
|
+
getComputationCache().set(node.key, 0);
|
|
1129
|
+
results.set(node.key, [node.position, 0]);
|
|
1130
|
+
circularPositions.push(node.position);
|
|
1114
1131
|
}
|
|
1115
1132
|
}
|
|
1116
1133
|
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
@@ -1120,7 +1137,7 @@ export var useCalculation = function (_a) {
|
|
|
1120
1137
|
}
|
|
1121
1138
|
finally { if (e_20) throw e_20.error; }
|
|
1122
1139
|
}
|
|
1123
|
-
publishResults(results.values());
|
|
1140
|
+
publishResults(results.values(), circularPositions);
|
|
1124
1141
|
cellNodes = cellNodes.filter(function (node) { return !circularKeys_1.has(node.key); });
|
|
1125
1142
|
}
|
|
1126
1143
|
}
|
|
@@ -1257,7 +1274,7 @@ export var useCalculation = function (_a) {
|
|
|
1257
1274
|
// Process async
|
|
1258
1275
|
function processCells(cells, recalculatedPosition) {
|
|
1259
1276
|
return __awaiter(this, void 0, void 0, function () {
|
|
1260
|
-
var cellMap, cells_5, cells_5_1, cell, adjacency, getDependencies, hasSelfReference, indices, lowlinks, stack, onStack, iterativeGroups, index, strongConnect, cells_6, cells_6_1, cell, key, cells_7, cells_7_1, cell, key, iterativeKeys, iterativeGroups_1, iterativeGroups_1_1, group, group_1, group_1_1, cell, nonIterativeCells, maxIterations, maxChange, iterativeGroups_2, iterativeGroups_2_1, group, group_2, group_2_1, cell, effectiveValue, previousValues, converged, iteration, currentValues, group_3, group_3_1, cell, userEnteredValue, result, key, err_2,
|
|
1277
|
+
var cellMap, cells_5, cells_5_1, cell, adjacency, getDependencies, hasSelfReference, indices, lowlinks, stack, onStack, iterativeGroups, index, strongConnect, cells_6, cells_6_1, cell, key, cells_7, cells_7_1, cell, key, iterativeKeys, iterativeGroups_1, iterativeGroups_1_1, group, group_1, group_1_1, cell, nonIterativeCells, maxIterations, maxChange, iterativeGroups_2, iterativeGroups_2_1, group, group_2, group_2_1, cell, effectiveValue, previousValues, converged, iteration, currentValues, group_3, group_3_1, cell, userEnteredValue, result, key, err_2, error_1, e_22_1, maxDelta, currentValues_1, currentValues_1_1, _a, key, value, delta, finalValues, results, group_4, group_4_1, cell, key, value, _b, arrayErrors, recomputeOperations, arrayErrors_1, arrayErrors_1_1, _c, errorKey, errorValue, _d, collides, recomputeOperations, e_23_1, followUpCells, iterativeGroups_3, iterativeGroups_3_1, group, group_5, group_5_1, cell, dependents, dependents_1, dependents_1_1, dependent, cellDep, depKey;
|
|
1261
1278
|
var e_24, _e, e_25, _f, e_26, _g, e_27, _h, e_28, _j, e_23, _k, e_29, _l, e_22, _m, e_30, _o, e_31, _p, e_32, _q, e_33, _r, e_34, _s, e_35, _t;
|
|
1262
1279
|
var _u, _v, _w, _x, _y, _z, _0;
|
|
1263
1280
|
return __generator(this, function (_1) {
|
|
@@ -1546,11 +1563,11 @@ export var useCalculation = function (_a) {
|
|
|
1546
1563
|
return [3 /*break*/, 13];
|
|
1547
1564
|
case 12:
|
|
1548
1565
|
err_2 = _1.sent();
|
|
1549
|
-
|
|
1566
|
+
error_1 = err_2 instanceof FormulaError
|
|
1550
1567
|
? err_2
|
|
1551
1568
|
: new FormulaError((_z = err_2 === null || err_2 === void 0 ? void 0 : err_2.name) !== null && _z !== void 0 ? _z : "#ERROR!", (_0 = err_2 === null || err_2 === void 0 ? void 0 : err_2.message) !== null && _0 !== void 0 ? _0 : String(err_2), err_2 === null || err_2 === void 0 ? void 0 : err_2.stack);
|
|
1552
|
-
currentValues.set(makeKey(cell.position),
|
|
1553
|
-
getComputationCache().set(makeKey(cell.position),
|
|
1569
|
+
currentValues.set(makeKey(cell.position), error_1);
|
|
1570
|
+
getComputationCache().set(makeKey(cell.position), error_1);
|
|
1554
1571
|
return [3 /*break*/, 13];
|
|
1555
1572
|
case 13:
|
|
1556
1573
|
group_3_1 = group_3.next();
|
|
@@ -1907,7 +1924,7 @@ export var useCalculation = function (_a) {
|
|
|
1907
1924
|
}
|
|
1908
1925
|
// Process a single dirty cell
|
|
1909
1926
|
var processCell = function (dirtyCell, recalculatedPosition) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1910
|
-
var results, position, key, userEnteredValue, isFormula, onDemandMap, rafTimer, isCellNode_1, result, _a, collides, recomputeOperations, err_3,
|
|
1927
|
+
var results, position, key, userEnteredValue, isFormula, onDemandMap, rafTimer, isCellNode_1, result, _a, collides, recomputeOperations, err_3, error_2, _b, arrayErrors, recomputeOperations, arrayErrors_2, arrayErrors_2_1, _c, key_1, value;
|
|
1911
1928
|
var e_42, _d;
|
|
1912
1929
|
return __generator(this, function (_e) {
|
|
1913
1930
|
switch (_e.label) {
|
|
@@ -2002,23 +2019,23 @@ export var useCalculation = function (_a) {
|
|
|
2002
2019
|
}
|
|
2003
2020
|
// Calculation error
|
|
2004
2021
|
if (err_3 instanceof FormulaError || err_3 instanceof Error) {
|
|
2005
|
-
|
|
2022
|
+
error_2 = err_3 instanceof FormulaError
|
|
2006
2023
|
? err_3
|
|
2007
2024
|
: new FormulaError(err_3.name, err_3.message, err_3.stack);
|
|
2008
2025
|
// We have to check if this error is caused in a cell
|
|
2009
2026
|
// containing array formula
|
|
2010
2027
|
// If so we have to reset all values references by this
|
|
2011
2028
|
// array
|
|
2012
|
-
debug("Computation Error",
|
|
2029
|
+
debug("Computation Error", error_2, position, key, userEnteredValue);
|
|
2013
2030
|
_b = __read(getErrorResultsFromArrayPosition(position), 2), arrayErrors = _b[0], recomputeOperations = _b[1];
|
|
2014
2031
|
// Add it to computation cache
|
|
2015
|
-
getComputationCache().set(key,
|
|
2032
|
+
getComputationCache().set(key, error_2);
|
|
2016
2033
|
// Invalidate any cached ranges containing this cell
|
|
2017
2034
|
getCalculator().invalidateCacheForCell(position.sheetId, position.rowIndex, position.columnIndex);
|
|
2018
2035
|
// New compuete
|
|
2019
2036
|
enqueueCalculations(recomputeOperations);
|
|
2020
2037
|
// Add to results
|
|
2021
|
-
results.set(key, [position,
|
|
2038
|
+
results.set(key, [position, error_2]);
|
|
2022
2039
|
try {
|
|
2023
2040
|
for (arrayErrors_2 = __values(arrayErrors), arrayErrors_2_1 = arrayErrors_2.next(); !arrayErrors_2_1.done; arrayErrors_2_1 = arrayErrors_2.next()) {
|
|
2024
2041
|
_c = __read(arrayErrors_2_1.value, 2), key_1 = _c[0], value = _c[1];
|
|
@@ -2088,12 +2105,12 @@ export var useCalculation = function (_a) {
|
|
|
2088
2105
|
/**
|
|
2089
2106
|
* Publish results back to the
|
|
2090
2107
|
*/
|
|
2091
|
-
var publishResults = useCallback(function (item) {
|
|
2092
|
-
var e_43, _a;
|
|
2108
|
+
var publishResults = useCallback(function (item, circularReferences) {
|
|
2109
|
+
var e_43, _a, e_44, _b;
|
|
2093
2110
|
try {
|
|
2094
2111
|
for (var item_1 = __values(item), item_1_1 = item_1.next(); !item_1_1.done; item_1_1 = item_1.next()) {
|
|
2095
2112
|
var entry = item_1_1.value;
|
|
2096
|
-
var
|
|
2113
|
+
var _c = __read(entry, 1), key = _c[0];
|
|
2097
2114
|
resultsQueueRef.current.set(makeKey(key), entry);
|
|
2098
2115
|
}
|
|
2099
2116
|
}
|
|
@@ -2104,6 +2121,19 @@ export var useCalculation = function (_a) {
|
|
|
2104
2121
|
}
|
|
2105
2122
|
finally { if (e_43) throw e_43.error; }
|
|
2106
2123
|
}
|
|
2124
|
+
try {
|
|
2125
|
+
for (var _d = __values(circularReferences !== null && circularReferences !== void 0 ? circularReferences : []), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2126
|
+
var position = _e.value;
|
|
2127
|
+
circularReferencesQueueRef.current.set(makeKey(position), position);
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
catch (e_44_1) { e_44 = { error: e_44_1 }; }
|
|
2131
|
+
finally {
|
|
2132
|
+
try {
|
|
2133
|
+
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
2134
|
+
}
|
|
2135
|
+
finally { if (e_44) throw e_44.error; }
|
|
2136
|
+
}
|
|
2107
2137
|
if (resultsQueueRef.current.size === 0) {
|
|
2108
2138
|
return;
|
|
2109
2139
|
}
|
|
@@ -2121,14 +2151,20 @@ export var useCalculation = function (_a) {
|
|
|
2121
2151
|
if (!resultsQueueRef.current.size) {
|
|
2122
2152
|
return;
|
|
2123
2153
|
}
|
|
2154
|
+
var context = circularReferencesQueueRef.current.size > 0
|
|
2155
|
+
? {
|
|
2156
|
+
circularReferences: Array.from(circularReferencesQueueRef.current.values()),
|
|
2157
|
+
}
|
|
2158
|
+
: {};
|
|
2124
2159
|
try {
|
|
2125
|
-
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(resultsQueueRef.current.values(), isFullRecalc,
|
|
2160
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(resultsQueueRef.current.values(), isFullRecalc, context);
|
|
2126
2161
|
}
|
|
2127
2162
|
catch (err) {
|
|
2128
2163
|
console.error("[spreadsheet-state] recalculation pass aborted:", err);
|
|
2129
2164
|
}
|
|
2130
2165
|
finally {
|
|
2131
2166
|
resultsQueueRef.current.clear();
|
|
2167
|
+
circularReferencesQueueRef.current.clear();
|
|
2132
2168
|
isFullRecalcRef.current = false;
|
|
2133
2169
|
}
|
|
2134
2170
|
});
|
|
@@ -2346,7 +2382,7 @@ export var useCalculation = function (_a) {
|
|
|
2346
2382
|
// Get precedents from formula string
|
|
2347
2383
|
// Does not check with DAG
|
|
2348
2384
|
var getPrecedentsFromFormulaString = useCallback(function (value, source) {
|
|
2349
|
-
var
|
|
2385
|
+
var e_45, _a;
|
|
2350
2386
|
var dependencies = getCalculator().dependencies(value, source);
|
|
2351
2387
|
var nodes = [];
|
|
2352
2388
|
try {
|
|
@@ -2365,12 +2401,12 @@ export var useCalculation = function (_a) {
|
|
|
2365
2401
|
}
|
|
2366
2402
|
}
|
|
2367
2403
|
}
|
|
2368
|
-
catch (
|
|
2404
|
+
catch (e_45_1) { e_45 = { error: e_45_1 }; }
|
|
2369
2405
|
finally {
|
|
2370
2406
|
try {
|
|
2371
2407
|
if (dependencies_2_1 && !dependencies_2_1.done && (_a = dependencies_2.return)) _a.call(dependencies_2);
|
|
2372
2408
|
}
|
|
2373
|
-
finally { if (
|
|
2409
|
+
finally { if (e_45) throw e_45.error; }
|
|
2374
2410
|
}
|
|
2375
2411
|
return nodes;
|
|
2376
2412
|
}, []);
|
|
@@ -2419,7 +2455,7 @@ export var useCalculation = function (_a) {
|
|
|
2419
2455
|
* via the enqueue logic.
|
|
2420
2456
|
*/
|
|
2421
2457
|
var processOperationQueue = useCallback(function () {
|
|
2422
|
-
var
|
|
2458
|
+
var e_46, _a, e_47, _b, e_48, _c, e_49, _d;
|
|
2423
2459
|
// Swap queue with empty array - O(1) operation
|
|
2424
2460
|
var operations = operationQueue.current;
|
|
2425
2461
|
if (operations.length === 0)
|
|
@@ -2447,7 +2483,7 @@ export var useCalculation = function (_a) {
|
|
|
2447
2483
|
if (operation.type !== "dirty" && isArrayFormula(operation.position)) {
|
|
2448
2484
|
var parentCandidates = new Map();
|
|
2449
2485
|
try {
|
|
2450
|
-
for (var _e = (
|
|
2486
|
+
for (var _e = (e_46 = void 0, __values(createArraySideEffectsAndGetResults({
|
|
2451
2487
|
position: operation.position,
|
|
2452
2488
|
getDependents: getDependents,
|
|
2453
2489
|
}))), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
@@ -2462,29 +2498,29 @@ export var useCalculation = function (_a) {
|
|
|
2462
2498
|
}
|
|
2463
2499
|
}
|
|
2464
2500
|
}
|
|
2465
|
-
catch (
|
|
2501
|
+
catch (e_46_1) { e_46 = { error: e_46_1 }; }
|
|
2466
2502
|
finally {
|
|
2467
2503
|
try {
|
|
2468
2504
|
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
|
|
2469
2505
|
}
|
|
2470
|
-
finally { if (
|
|
2506
|
+
finally { if (e_46) throw e_46.error; }
|
|
2471
2507
|
}
|
|
2472
2508
|
try {
|
|
2473
|
-
for (var _j = (
|
|
2509
|
+
for (var _j = (e_47 = void 0, __values(parentCandidates.values())), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
2474
2510
|
var parent_2 = _k.value;
|
|
2475
2511
|
getCalculator().markAsDirty(parent_2);
|
|
2476
2512
|
}
|
|
2477
2513
|
}
|
|
2478
|
-
catch (
|
|
2514
|
+
catch (e_47_1) { e_47 = { error: e_47_1 }; }
|
|
2479
2515
|
finally {
|
|
2480
2516
|
try {
|
|
2481
2517
|
if (_k && !_k.done && (_b = _j.return)) _b.call(_j);
|
|
2482
2518
|
}
|
|
2483
|
-
finally { if (
|
|
2519
|
+
finally { if (e_47) throw e_47.error; }
|
|
2484
2520
|
}
|
|
2485
2521
|
if (clearedArrayRange) {
|
|
2486
2522
|
try {
|
|
2487
|
-
for (var _l = (
|
|
2523
|
+
for (var _l = (e_48 = void 0, __values(getCalculator().arrayRangeMap)), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
2488
2524
|
var _o = __read(_m.value, 2), key = _o[0], range = _o[1];
|
|
2489
2525
|
if (!rangesOverlap(range, clearedArrayRange)) {
|
|
2490
2526
|
continue;
|
|
@@ -2495,19 +2531,19 @@ export var useCalculation = function (_a) {
|
|
|
2495
2531
|
}
|
|
2496
2532
|
}
|
|
2497
2533
|
}
|
|
2498
|
-
catch (
|
|
2534
|
+
catch (e_48_1) { e_48 = { error: e_48_1 }; }
|
|
2499
2535
|
finally {
|
|
2500
2536
|
try {
|
|
2501
2537
|
if (_m && !_m.done && (_c = _l.return)) _c.call(_l);
|
|
2502
2538
|
}
|
|
2503
|
-
finally { if (
|
|
2539
|
+
finally { if (e_48) throw e_48.error; }
|
|
2504
2540
|
}
|
|
2505
2541
|
}
|
|
2506
2542
|
}
|
|
2507
2543
|
var arrayParent = getCalculator().getClosestArrayParentCell(operation.position);
|
|
2508
2544
|
if (arrayParent && !isEqualPosition(arrayParent, operation.position)) {
|
|
2509
2545
|
try {
|
|
2510
|
-
for (var _p = (
|
|
2546
|
+
for (var _p = (e_49 = void 0, __values(createArraySideEffectsAndGetResults({
|
|
2511
2547
|
position: arrayParent,
|
|
2512
2548
|
shouldRemoveArrayReference: false,
|
|
2513
2549
|
getDependents: getDependents,
|
|
@@ -2516,12 +2552,12 @@ export var useCalculation = function (_a) {
|
|
|
2516
2552
|
initialArrayResults.current.set(key, value);
|
|
2517
2553
|
}
|
|
2518
2554
|
}
|
|
2519
|
-
catch (
|
|
2555
|
+
catch (e_49_1) { e_49 = { error: e_49_1 }; }
|
|
2520
2556
|
finally {
|
|
2521
2557
|
try {
|
|
2522
2558
|
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
2523
2559
|
}
|
|
2524
|
-
finally { if (
|
|
2560
|
+
finally { if (e_49) throw e_49.error; }
|
|
2525
2561
|
}
|
|
2526
2562
|
}
|
|
2527
2563
|
// Backend driven
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GridRange } from "@rowsncolumns/common-types";
|
|
2
|
+
import { type AdvancedFilterOptions, type AdvancedFilterPlan, type AdvancedFilterPlanExecutor } from "../api/advanced-filter";
|
|
3
|
+
import type { useSheetProperties } from "./use-sheet-properties";
|
|
4
|
+
export type { AdvancedFilterOptions, AdvancedFilterPlan };
|
|
5
|
+
export type UseOnAdvancedFilterProps = {
|
|
6
|
+
getEffectiveValue: ReturnType<typeof useSheetProperties>["getEffectiveValue"];
|
|
7
|
+
getFormattedValue: ReturnType<typeof useSheetProperties>["getFormattedValue"];
|
|
8
|
+
onHideRow: AdvancedFilterPlanExecutor["onHideRow"];
|
|
9
|
+
onShowRow: AdvancedFilterPlanExecutor["onShowRow"];
|
|
10
|
+
onChangeBatch: (sheetId: number, ranges: GridRange, values: (string | number | boolean | null)[][]) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Excel's Data → Sort & Filter → Advanced, composed over the existing
|
|
14
|
+
* hide/show-row and batch-write callbacks so both engines execute it through
|
|
15
|
+
* the same streamed commands. Records are compared by their effective value
|
|
16
|
+
* (numbers stay numeric) and fall back to the displayed text. Returns the
|
|
17
|
+
* applied plan, or `undefined` when the list has no records, the copy
|
|
18
|
+
* destination is missing / protected, or the sheet cannot be edited.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useOnAdvancedFilter: ({ getEffectiveValue, getFormattedValue, onHideRow, onShowRow, onChangeBatch, }: UseOnAdvancedFilterProps) => (sheetId: number, options: AdvancedFilterOptions) => AdvancedFilterPlan | undefined;
|
|
21
|
+
//# sourceMappingURL=use-on-advanced-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-on-advanced-filter.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-advanced-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAGhC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;AAE1D,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC9E,iBAAiB,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC9E,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,KAC3C,IAAI,CAAC;CACX,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,gFAMjC,wBAAwB,eAKb,MAAM,WAAW,qBAAqB,KAAG,kBAAkB,GAAG,SA2B3E,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { applyAdvancedFilterPlan, planAdvancedFilter, } from "../api/advanced-filter";
|
|
3
|
+
import { useCanEditCellRange, useCanEditSheet } from "./use-can-edit-cellrange";
|
|
4
|
+
/**
|
|
5
|
+
* Excel's Data → Sort & Filter → Advanced, composed over the existing
|
|
6
|
+
* hide/show-row and batch-write callbacks so both engines execute it through
|
|
7
|
+
* the same streamed commands. Records are compared by their effective value
|
|
8
|
+
* (numbers stay numeric) and fall back to the displayed text. Returns the
|
|
9
|
+
* applied plan, or `undefined` when the list has no records, the copy
|
|
10
|
+
* destination is missing / protected, or the sheet cannot be edited.
|
|
11
|
+
*/
|
|
12
|
+
export var useOnAdvancedFilter = function (_a) {
|
|
13
|
+
var getEffectiveValue = _a.getEffectiveValue, getFormattedValue = _a.getFormattedValue, onHideRow = _a.onHideRow, onShowRow = _a.onShowRow, onChangeBatch = _a.onChangeBatch;
|
|
14
|
+
var canEditCellRange = useCanEditCellRange();
|
|
15
|
+
var canEditSheet = useCanEditSheet();
|
|
16
|
+
return useCallback(function (sheetId, options) {
|
|
17
|
+
if (!canEditSheet(sheetId)) {
|
|
18
|
+
console.debug("This sheet is protected, users cannot filter it.");
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
var plan = planAdvancedFilter(options, function (rowIndex, columnIndex) {
|
|
22
|
+
var value = getEffectiveValue(sheetId, rowIndex, columnIndex);
|
|
23
|
+
return value !== null && value !== void 0 ? value : getFormattedValue(sheetId, rowIndex, columnIndex);
|
|
24
|
+
});
|
|
25
|
+
if (!plan)
|
|
26
|
+
return undefined;
|
|
27
|
+
if (plan.copy && !canEditCellRange(sheetId, plan.copy.range)) {
|
|
28
|
+
console.debug("This range is protected, users cannot edit this cell range.");
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
applyAdvancedFilterPlan(sheetId, plan, { onHideRow: onHideRow, onShowRow: onShowRow, onChangeBatch: onChangeBatch });
|
|
32
|
+
return plan;
|
|
33
|
+
}, [
|
|
34
|
+
canEditSheet,
|
|
35
|
+
canEditCellRange,
|
|
36
|
+
getEffectiveValue,
|
|
37
|
+
getFormattedValue,
|
|
38
|
+
onHideRow,
|
|
39
|
+
onShowRow,
|
|
40
|
+
onChangeBatch,
|
|
41
|
+
]);
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CellInterface } from "@rowsncolumns/common-types";
|
|
2
|
+
import { type GoalSeekResult } from "../api/goal-seek";
|
|
3
|
+
import type { useCalculation } from "./use-calculation";
|
|
4
|
+
import type { useOnChange } from "./use-on-change";
|
|
5
|
+
import type { useSheetProperties } from "./use-sheet-properties";
|
|
6
|
+
export type { GoalSeekResult };
|
|
7
|
+
export type UseOnGoalSeekProps = {
|
|
8
|
+
getFormulaValue: ReturnType<typeof useSheetProperties>["getFormulaValue"];
|
|
9
|
+
getEffectiveValue: ReturnType<typeof useSheetProperties>["getEffectiveValue"];
|
|
10
|
+
/** The calculator's scratch evaluation (UNFORMATTED results). */
|
|
11
|
+
onRequestCalculate: ReturnType<typeof useCalculation>["onRequestCalculate"];
|
|
12
|
+
getDependents: ReturnType<typeof useCalculation>["getDependents"];
|
|
13
|
+
onChange: ReturnType<typeof useOnChange>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Excel's Goal Seek (Data → What-If Analysis): find the value of
|
|
17
|
+
* `changingCell` that makes the formula in `setCell` evaluate to
|
|
18
|
+
* `targetValue`. Every trial is a scratch evaluation — the changing cell is
|
|
19
|
+
* pinned through the calculator's override map and the formula cells between
|
|
20
|
+
* it and the set cell (its transitive dependents, in dependency order) are
|
|
21
|
+
* re-evaluated into the same map, so nothing is written until the search
|
|
22
|
+
* ends. The final value is committed through `onChange` (one undo step,
|
|
23
|
+
* streamed to any engine consumer like a typed edit).
|
|
24
|
+
*
|
|
25
|
+
* Resolves to `undefined` when the set cell holds no formula or the changing
|
|
26
|
+
* cell is protected; otherwise the {@link GoalSeekResult} — Excel reports
|
|
27
|
+
* "found a solution" / "may not have found a solution" from `status`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useOnGoalSeek: ({ getFormulaValue, getEffectiveValue, onRequestCalculate, getDependents, onChange, }: UseOnGoalSeekProps) => (sheetId: number, setCell: CellInterface, targetValue: number, changingCell: CellInterface) => Promise<GoalSeekResult | undefined>;
|
|
30
|
+
//# sourceMappingURL=use-on-goal-seek.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-on-goal-seek.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-goal-seek.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC1E,iBAAiB,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC9E,iEAAiE;IACjE,kBAAkB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAC5E,aAAa,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,eAAe,CAAC,CAAC;IAClE,QAAQ,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;CAC1C,CAAC;AAUF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GAAI,sFAM3B,kBAAkB,eAKN,MAAM,WACN,aAAa,eACT,MAAM,gBACL,aAAa,KAC1B,OAAO,CAAC,cAAc,GAAG,SAAS,CA+DxC,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator, __values } from "tslib";
|
|
2
|
+
import { isCellNode, makeKey } from "@rowsncolumns/dag";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { goalSeek } from "../api/goal-seek";
|
|
5
|
+
import { useCanEditCellRange } from "./use-can-edit-cellrange";
|
|
6
|
+
/** Cap on the formula chain re-evaluated per trial (a runaway dependency fan-out). */
|
|
7
|
+
var MAX_AFFECTED_CELLS = 2000;
|
|
8
|
+
var sameCell = function (a, sheetId, b) {
|
|
9
|
+
var _a;
|
|
10
|
+
return ((_a = a.sheetId) !== null && _a !== void 0 ? _a : sheetId) === sheetId &&
|
|
11
|
+
a.rowIndex === b.rowIndex &&
|
|
12
|
+
a.columnIndex === b.columnIndex;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Excel's Goal Seek (Data → What-If Analysis): find the value of
|
|
16
|
+
* `changingCell` that makes the formula in `setCell` evaluate to
|
|
17
|
+
* `targetValue`. Every trial is a scratch evaluation — the changing cell is
|
|
18
|
+
* pinned through the calculator's override map and the formula cells between
|
|
19
|
+
* it and the set cell (its transitive dependents, in dependency order) are
|
|
20
|
+
* re-evaluated into the same map, so nothing is written until the search
|
|
21
|
+
* ends. The final value is committed through `onChange` (one undo step,
|
|
22
|
+
* streamed to any engine consumer like a typed edit).
|
|
23
|
+
*
|
|
24
|
+
* Resolves to `undefined` when the set cell holds no formula or the changing
|
|
25
|
+
* cell is protected; otherwise the {@link GoalSeekResult} — Excel reports
|
|
26
|
+
* "found a solution" / "may not have found a solution" from `status`.
|
|
27
|
+
*/
|
|
28
|
+
export var useOnGoalSeek = function (_a) {
|
|
29
|
+
var getFormulaValue = _a.getFormulaValue, getEffectiveValue = _a.getEffectiveValue, onRequestCalculate = _a.onRequestCalculate, getDependents = _a.getDependents, onChange = _a.onChange;
|
|
30
|
+
var canEditCellRange = useCanEditCellRange();
|
|
31
|
+
return useCallback(function (sheetId, setCell, targetValue, changingCell) { return __awaiter(void 0, void 0, void 0, function () {
|
|
32
|
+
var formula, changingPosition, affected, _a, _b, node, position, evaluate, current, initialValue, result;
|
|
33
|
+
var e_1, _c;
|
|
34
|
+
return __generator(this, function (_d) {
|
|
35
|
+
switch (_d.label) {
|
|
36
|
+
case 0:
|
|
37
|
+
if (!Number.isFinite(targetValue))
|
|
38
|
+
return [2 /*return*/, undefined];
|
|
39
|
+
if (!canEditCellRange(sheetId, changingCell)) {
|
|
40
|
+
console.debug("This range is protected, users cannot edit this cell range.");
|
|
41
|
+
return [2 /*return*/, undefined];
|
|
42
|
+
}
|
|
43
|
+
formula = getFormulaValue(sheetId, setCell.rowIndex, setCell.columnIndex);
|
|
44
|
+
if (!formula)
|
|
45
|
+
return [2 /*return*/, undefined];
|
|
46
|
+
if (sameCell(setCell, sheetId, changingCell))
|
|
47
|
+
return [2 /*return*/, undefined];
|
|
48
|
+
changingPosition = __assign({ sheetId: sheetId }, changingCell);
|
|
49
|
+
affected = [];
|
|
50
|
+
try {
|
|
51
|
+
for (_a = __values(getDependents(changingPosition)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
52
|
+
node = _b.value;
|
|
53
|
+
if (!isCellNode(node))
|
|
54
|
+
continue;
|
|
55
|
+
position = node.position;
|
|
56
|
+
if (sameCell(position, sheetId, setCell) && position.sheetId === sheetId)
|
|
57
|
+
continue;
|
|
58
|
+
if (position.conditionalFormatId != null || position.dataValidationId != null)
|
|
59
|
+
continue;
|
|
60
|
+
affected.push(position);
|
|
61
|
+
if (affected.length >= MAX_AFFECTED_CELLS)
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
66
|
+
finally {
|
|
67
|
+
try {
|
|
68
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
69
|
+
}
|
|
70
|
+
finally { if (e_1) throw e_1.error; }
|
|
71
|
+
}
|
|
72
|
+
evaluate = function (trial) { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
+
var overrides, scratch, affected_1, affected_1_1, position, cellFormula, value, e_2_1, result;
|
|
74
|
+
var e_2, _a;
|
|
75
|
+
return __generator(this, function (_b) {
|
|
76
|
+
switch (_b.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
overrides = new Map([[makeKey(changingPosition), trial]]);
|
|
79
|
+
scratch = function (text, position) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
return [2 /*return*/, onRequestCalculate(text, position.sheetId, position.rowIndex, position.columnIndex, {
|
|
82
|
+
overrides: overrides,
|
|
83
|
+
disablePreview: true,
|
|
84
|
+
})];
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
87
|
+
_b.label = 1;
|
|
88
|
+
case 1:
|
|
89
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
90
|
+
affected_1 = __values(affected), affected_1_1 = affected_1.next();
|
|
91
|
+
_b.label = 2;
|
|
92
|
+
case 2:
|
|
93
|
+
if (!!affected_1_1.done) return [3 /*break*/, 5];
|
|
94
|
+
position = affected_1_1.value;
|
|
95
|
+
cellFormula = getFormulaValue(position.sheetId, position.rowIndex, position.columnIndex);
|
|
96
|
+
if (!cellFormula)
|
|
97
|
+
return [3 /*break*/, 4];
|
|
98
|
+
return [4 /*yield*/, scratch(cellFormula, position)];
|
|
99
|
+
case 3:
|
|
100
|
+
value = _b.sent();
|
|
101
|
+
// An errored intermediate reads as an error in the set cell too,
|
|
102
|
+
// which the solver treats as an unusable trial.
|
|
103
|
+
overrides.set(makeKey(position), value instanceof Error ? undefined : value);
|
|
104
|
+
_b.label = 4;
|
|
105
|
+
case 4:
|
|
106
|
+
affected_1_1 = affected_1.next();
|
|
107
|
+
return [3 /*break*/, 2];
|
|
108
|
+
case 5: return [3 /*break*/, 8];
|
|
109
|
+
case 6:
|
|
110
|
+
e_2_1 = _b.sent();
|
|
111
|
+
e_2 = { error: e_2_1 };
|
|
112
|
+
return [3 /*break*/, 8];
|
|
113
|
+
case 7:
|
|
114
|
+
try {
|
|
115
|
+
if (affected_1_1 && !affected_1_1.done && (_a = affected_1.return)) _a.call(affected_1);
|
|
116
|
+
}
|
|
117
|
+
finally { if (e_2) throw e_2.error; }
|
|
118
|
+
return [7 /*endfinally*/];
|
|
119
|
+
case 8: return [4 /*yield*/, scratch(formula, __assign({ sheetId: sheetId }, setCell))];
|
|
120
|
+
case 9:
|
|
121
|
+
result = _b.sent();
|
|
122
|
+
return [2 /*return*/, typeof result === "number" && Number.isFinite(result) ? result : undefined];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}); };
|
|
126
|
+
current = getEffectiveValue(sheetId, changingCell.rowIndex, changingCell.columnIndex);
|
|
127
|
+
initialValue = typeof current === "number"
|
|
128
|
+
? current
|
|
129
|
+
: typeof current === "string" && current.trim() !== "" && Number.isFinite(Number(current))
|
|
130
|
+
? Number(current)
|
|
131
|
+
: 0;
|
|
132
|
+
return [4 /*yield*/, goalSeek({ evaluate: evaluate, targetValue: targetValue, initialValue: initialValue })];
|
|
133
|
+
case 1:
|
|
134
|
+
result = _d.sent();
|
|
135
|
+
onChange(sheetId, changingCell, String(result.value), undefined);
|
|
136
|
+
return [2 /*return*/, result];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}); }, [canEditCellRange, getFormulaValue, getEffectiveValue, onRequestCalculate, getDependents, onChange]);
|
|
140
|
+
};
|
|
@@ -19,6 +19,7 @@ export type UseOnImportExcelFileProps<T extends CellData, S extends Sheet> = {
|
|
|
19
19
|
onChangeCellXfs?: UseSpreadsheetProps<T, S>["onChangeCellXfs"];
|
|
20
20
|
onRequestFonts: UseSpreadsheetProps<T, S>["onRequestFonts"];
|
|
21
21
|
onChangeTheme: UseSpreadsheetProps<T, S>["onChangeTheme"];
|
|
22
|
+
onChangeNamedCellStyles?: UseSpreadsheetProps<T, S>["onChangeNamedCellStyles"];
|
|
22
23
|
onChangeSlicers: UseSpreadsheetProps<T, S>["onChangeSlicers"];
|
|
23
24
|
/**
|
|
24
25
|
* Phase D1 — pivot table import. Worker emits
|
|
@@ -39,7 +40,15 @@ export type UseOnImportExcelFileProps<T extends CellData, S extends Sheet> = {
|
|
|
39
40
|
export type ExcelImportResponse = {
|
|
40
41
|
requiresRecalc?: boolean;
|
|
41
42
|
iterativeCalculationOptions?: IterativeCalculationOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Date system of the imported cell data — always the 1900 system: a
|
|
45
|
+
* `date1904` workbook is converted on import (date-formatted serials
|
|
46
|
+
* shifted by 1462 days), so this can be wired straight to
|
|
47
|
+
* `SheetCell.setUse1904` / `createExcelFile({ use1904 })`.
|
|
48
|
+
*/
|
|
42
49
|
use1904?: boolean;
|
|
50
|
+
/** The source workbook declared the 1904 date system (informational). */
|
|
51
|
+
sourceUse1904?: boolean;
|
|
43
52
|
success: boolean;
|
|
44
53
|
isPasswordProtected?: boolean;
|
|
45
54
|
};
|
|
@@ -59,7 +68,7 @@ export type ExcelImportOptions = {
|
|
|
59
68
|
*/
|
|
60
69
|
prompt?: UseSpreadsheetProps["onPrompt"];
|
|
61
70
|
};
|
|
62
|
-
export declare const useOnImportExcelFile: <T extends CellData, S extends Sheet>({ enableExcelImportHistory, onChangeSheetData, onChangeSheets, onChangeTables, onChangeEmbeds, onChangeNamedRanges, onChangeSharedStrings, onChangeConditionalFormats, onChangeDataValidations, onChangeCellXfs, onChangeCharts, onRequestFonts, onChangeTheme, onCreateDataValidationRule, onClearHistory, onChangeHistory, onChangeSlicers, onChangePivotTables, evaluateConditionalFormatting, evaluateDataValidations, clearRangeCache, onConfirm, onPrompt, }: UseOnImportExcelFileProps<T, S>) => {
|
|
71
|
+
export declare const useOnImportExcelFile: <T extends CellData, S extends Sheet>({ enableExcelImportHistory, onChangeSheetData, onChangeSheets, onChangeTables, onChangeEmbeds, onChangeNamedRanges, onChangeSharedStrings, onChangeConditionalFormats, onChangeDataValidations, onChangeCellXfs, onChangeCharts, onRequestFonts, onChangeTheme, onChangeNamedCellStyles, onCreateDataValidationRule, onClearHistory, onChangeHistory, onChangeSlicers, onChangePivotTables, evaluateConditionalFormatting, evaluateDataValidations, clearRangeCache, onConfirm, onPrompt, }: UseOnImportExcelFileProps<T, S>) => {
|
|
63
72
|
importExcelFile: (file: File | ArrayBuffer, options?: ExcelImportOptions) => Promise<ExcelImportResponse>;
|
|
64
73
|
isImportingExcelfile: boolean;
|
|
65
74
|
generateStatePatches: () => Promise<SpreadsheetPatch>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-on-import-excel.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-import-excel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,KAAK,EACV,QAAQ,EAKR,KAAK,EACN,MAAM,2BAA2B,CAAC;AAoBnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,IAAI;IAC3E,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IACxD,iBAAiB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAClE,cAAc,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC5D,qBAAqB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;IAC1E,cAAc,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC5D,cAAc,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC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