@rowsncolumns/spreadsheet 10.2.73 → 10.2.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/evaluate-formula.d.ts +17 -0
- package/dist/cjs/api/evaluate-formula.d.ts.map +1 -0
- package/dist/cjs/api/evaluate-formula.js +141 -0
- package/dist/cjs/api/go-to.d.ts +19 -0
- package/dist/cjs/api/go-to.d.ts.map +1 -0
- package/dist/cjs/api/go-to.js +49 -0
- package/dist/cjs/atoms/evaluate-formula-dialog.atom.d.ts +36 -0
- package/dist/cjs/atoms/evaluate-formula-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/evaluate-formula-dialog.atom.js +36 -0
- package/dist/cjs/atoms/go-to-dialog.atom.d.ts +36 -0
- package/dist/cjs/atoms/go-to-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/go-to-dialog.atom.js +34 -0
- package/dist/cjs/atoms/index.d.ts +4 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -1
- package/dist/cjs/atoms/index.js +4 -0
- package/dist/cjs/atoms/paste-special-dialog.atom.d.ts +29 -0
- package/dist/cjs/atoms/paste-special-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/paste-special-dialog.atom.js +34 -0
- package/dist/cjs/atoms/remove-duplicates-dialog.atom.d.ts +45 -0
- package/dist/cjs/atoms/remove-duplicates-dialog.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/remove-duplicates-dialog.atom.js +37 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +109 -3
- package/dist/cjs/components/canvas-grid/typings.d.ts +54 -8
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/context-menu/index.d.ts +16 -3
- package/dist/cjs/components/context-menu/index.d.ts.map +1 -1
- package/dist/cjs/components/context-menu/index.js +112 -5
- package/dist/cjs/components/context-menu/total-row-functions.d.ts +32 -0
- package/dist/cjs/components/context-menu/total-row-functions.d.ts.map +1 -0
- package/dist/cjs/components/context-menu/total-row-functions.js +62 -0
- package/dist/cjs/components/evaluate-formula-dialog/index.d.ts +34 -0
- package/dist/cjs/components/evaluate-formula-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/evaluate-formula-dialog/index.js +106 -0
- package/dist/cjs/components/go-to-dialog/index.d.ts +35 -0
- package/dist/cjs/components/go-to-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/go-to-dialog/index.js +93 -0
- package/dist/cjs/components/paste-special-dialog/index.d.ts +29 -0
- package/dist/cjs/components/paste-special-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/paste-special-dialog/index.js +99 -0
- package/dist/cjs/components/remove-duplicates-dialog/index.d.ts +37 -0
- package/dist/cjs/components/remove-duplicates-dialog/index.d.ts.map +1 -0
- package/dist/cjs/components/remove-duplicates-dialog/index.js +91 -0
- package/dist/cjs/components/toolbar/index.d.ts +1 -0
- package/dist/cjs/components/toolbar/index.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/index.js +1 -0
- package/dist/cjs/components/toolbar/text-rotation-selector.d.ts +29 -0
- package/dist/cjs/components/toolbar/text-rotation-selector.d.ts.map +1 -0
- package/dist/cjs/components/toolbar/text-rotation-selector.js +78 -0
- package/dist/cjs/components/toolbar/text-wrap-selector.d.ts +7 -1
- package/dist/cjs/components/toolbar/text-wrap-selector.d.ts.map +1 -1
- package/dist/cjs/components/toolbar/text-wrap-selector.js +10 -3
- package/dist/cjs/hooks/use-copy-paste-cut.d.ts +20 -1
- package/dist/cjs/hooks/use-copy-paste-cut.d.ts.map +1 -1
- package/dist/cjs/hooks/use-copy-paste-cut.js +25 -20
- package/dist/cjs/hooks/use-keyboard-handler.d.ts +17 -2
- package/dist/cjs/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/cjs/hooks/use-keyboard-handler.js +182 -19
- package/dist/cjs/index.d.ts +6 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +173 -1
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/api/evaluate-formula.d.ts +17 -0
- package/dist/esm/api/evaluate-formula.d.ts.map +1 -0
- package/dist/esm/api/evaluate-formula.js +109 -0
- package/dist/esm/api/go-to.d.ts +19 -0
- package/dist/esm/api/go-to.d.ts.map +1 -0
- package/dist/esm/api/go-to.js +41 -0
- package/dist/esm/atoms/evaluate-formula-dialog.atom.d.ts +36 -0
- package/dist/esm/atoms/evaluate-formula-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/evaluate-formula-dialog.atom.js +25 -0
- package/dist/esm/atoms/go-to-dialog.atom.d.ts +36 -0
- package/dist/esm/atoms/go-to-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/go-to-dialog.atom.js +25 -0
- package/dist/esm/atoms/index.d.ts +4 -0
- package/dist/esm/atoms/index.d.ts.map +1 -1
- package/dist/esm/atoms/index.js +4 -0
- package/dist/esm/atoms/paste-special-dialog.atom.d.ts +29 -0
- package/dist/esm/atoms/paste-special-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/paste-special-dialog.atom.js +25 -0
- package/dist/esm/atoms/remove-duplicates-dialog.atom.d.ts +45 -0
- package/dist/esm/atoms/remove-duplicates-dialog.atom.d.ts.map +1 -0
- package/dist/esm/atoms/remove-duplicates-dialog.atom.js +26 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +107 -3
- package/dist/esm/components/canvas-grid/typings.d.ts +54 -8
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/context-menu/index.d.ts +16 -3
- package/dist/esm/components/context-menu/index.d.ts.map +1 -1
- package/dist/esm/components/context-menu/index.js +114 -7
- package/dist/esm/components/context-menu/total-row-functions.d.ts +32 -0
- package/dist/esm/components/context-menu/total-row-functions.d.ts.map +1 -0
- package/dist/esm/components/context-menu/total-row-functions.js +50 -0
- package/dist/esm/components/evaluate-formula-dialog/index.d.ts +34 -0
- package/dist/esm/components/evaluate-formula-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/evaluate-formula-dialog/index.js +86 -0
- package/dist/esm/components/go-to-dialog/index.d.ts +35 -0
- package/dist/esm/components/go-to-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/go-to-dialog/index.js +84 -0
- package/dist/esm/components/paste-special-dialog/index.d.ts +29 -0
- package/dist/esm/components/paste-special-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/paste-special-dialog/index.js +90 -0
- package/dist/esm/components/remove-duplicates-dialog/index.d.ts +37 -0
- package/dist/esm/components/remove-duplicates-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/remove-duplicates-dialog/index.js +82 -0
- package/dist/esm/components/toolbar/index.d.ts +1 -0
- package/dist/esm/components/toolbar/index.d.ts.map +1 -1
- package/dist/esm/components/toolbar/index.js +1 -0
- package/dist/esm/components/toolbar/text-rotation-selector.d.ts +29 -0
- package/dist/esm/components/toolbar/text-rotation-selector.d.ts.map +1 -0
- package/dist/esm/components/toolbar/text-rotation-selector.js +71 -0
- package/dist/esm/components/toolbar/text-wrap-selector.d.ts +7 -1
- package/dist/esm/components/toolbar/text-wrap-selector.d.ts.map +1 -1
- package/dist/esm/components/toolbar/text-wrap-selector.js +10 -3
- package/dist/esm/hooks/use-copy-paste-cut.d.ts +20 -1
- package/dist/esm/hooks/use-copy-paste-cut.d.ts.map +1 -1
- package/dist/esm/hooks/use-copy-paste-cut.js +8 -3
- package/dist/esm/hooks/use-keyboard-handler.d.ts +17 -2
- package/dist/esm/hooks/use-keyboard-handler.d.ts.map +1 -1
- package/dist/esm/hooks/use-keyboard-handler.js +169 -19
- package/dist/esm/index.d.ts +6 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +173 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/context-menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/context-menu/index.tsx"],"names":[],"mappings":"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"}
|
|
@@ -9,11 +9,13 @@ var utils_1 = require("@rowsncolumns/utils");
|
|
|
9
9
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
10
10
|
var validation_1 = require("../../api/validation");
|
|
11
11
|
var atoms_1 = require("../../atoms");
|
|
12
|
+
var remove_duplicates_dialog_atom_1 = require("../../atoms/remove-duplicates-dialog.atom");
|
|
12
13
|
var config_1 = require("../../config");
|
|
13
14
|
var helpers_1 = require("../../helpers");
|
|
15
|
+
var total_row_functions_1 = require("./total-row-functions");
|
|
14
16
|
var ContextMenu = function (_a) {
|
|
15
17
|
var _b;
|
|
16
|
-
var isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, activeCell = _a.activeCell, selections = _a.selections, basicFilter = _a.basicFilter, isTableHeader = _a.isTableHeader, onClearContents = _a.onClearContents, onHideColumn = _a.onHideColumn, onHideRow = _a.onHideRow, onGroupRows = _a.onGroupRows, onUngroupRows = _a.onUngroupRows, onGroupColumns = _a.onGroupColumns, onUngroupColumns = _a.onUngroupColumns, onDeleteRow = _a.onDeleteRow, onDeleteColumn = _a.onDeleteColumn, onInsertColumn = _a.onInsertColumn, onInsertRow = _a.onInsertRow, onInsertCellsShiftDown = _a.onInsertCellsShiftDown, onInsertCellsShiftRight = _a.onInsertCellsShiftRight, onDeleteCellsShiftLeft = _a.onDeleteCellsShiftLeft, onDeleteCellsShiftUp = _a.onDeleteCellsShiftUp, onFreezeRow = _a.onFreezeRow, onFreezeColumn = _a.onFreezeColumn, onCopy = _a.onCopy, onCut = _a.onCut, onPaste = _a.onPaste, onInsertNote = _a.onInsertNote, onProtectRange = _a.onProtectRange, onUnProtectRange = _a.onUnProtectRange, onSortRange = _a.onSortRange, onSortColumn = _a.onSortColumn, onRequestDefineNamedRange = _a.onRequestDefineNamedRange, onRequestResize = _a.onRequestResize, onRequestEditTable = _a.onRequestEditTable, onRequestEditPivotTable = _a.onRequestEditPivotTable, onRequestDeletePivotTable = _a.onRequestDeletePivotTable, onPivotDrillDown = _a.onPivotDrillDown, onRequestFormatCells = _a.onRequestFormatCells, onRequestConditionalFormat = _a.onRequestConditionalFormat, onRequestDataValidation = _a.onRequestDataValidation, onRemoveTable = _a.onRemoveTable, onClearFormatting = _a.onClearFormatting, onCreateTable = _a.onCreateTable, onCreateBasicFilter = _a.onCreateBasicFilter, onFilterTable = _a.onFilterTable, onSortTable = _a.onSortTable, getFormattedValuesFromRange = _a.getFormattedValuesFromRange, focusSheet = _a.focusSheet, isSheetFocused = _a.isSheetFocused, getFormattedValue = _a.getFormattedValue, onInsertTableColumn = _a.onInsertTableColumn, onDeleteTableColumn = _a.onDeleteTableColumn, onInsertTableRow = _a.onInsertTableRow, onDeleteTableRow = _a.onDeleteTableRow, onSplitTextToColumns = _a.onSplitTextToColumns, onRemoveDuplicates = _a.onRemoveDuplicates, isHiddenColumn = _a.isHiddenColumn, isHiddenRow = _a.isHiddenRow, onShowColumn = _a.onShowColumn, onShowRow = _a.onShowRow, tables = _a.tables, pivotTables = _a.pivotTables, protectedRanges = _a.protectedRanges, sheetId = _a.sheetId, frozenRows = _a.frozenRows, frozenColumns = _a.frozenColumns, selectedRowHeadersIds = _a.selectedRowHeadersIds, selectedColumnHeadersIds = _a.selectedColumnHeadersIds, _c = _a.readonly, readonly = _c === void 0 ? false : _c, onAddQuickEdit = _a.onAddQuickEdit, enableMagicFill = _a.enableMagicFill;
|
|
18
|
+
var isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, activeCell = _a.activeCell, selections = _a.selections, basicFilter = _a.basicFilter, isTableHeader = _a.isTableHeader, onClearContents = _a.onClearContents, onHideColumn = _a.onHideColumn, onHideRow = _a.onHideRow, onGroupRows = _a.onGroupRows, onUngroupRows = _a.onUngroupRows, onGroupColumns = _a.onGroupColumns, onUngroupColumns = _a.onUngroupColumns, onDeleteRow = _a.onDeleteRow, onDeleteColumn = _a.onDeleteColumn, onInsertColumn = _a.onInsertColumn, onInsertRow = _a.onInsertRow, onInsertCellsShiftDown = _a.onInsertCellsShiftDown, onInsertCellsShiftRight = _a.onInsertCellsShiftRight, onDeleteCellsShiftLeft = _a.onDeleteCellsShiftLeft, onDeleteCellsShiftUp = _a.onDeleteCellsShiftUp, onFreezeRow = _a.onFreezeRow, onFreezeColumn = _a.onFreezeColumn, onCopy = _a.onCopy, onCut = _a.onCut, onPaste = _a.onPaste, onRequestPasteSpecial = _a.onRequestPasteSpecial, onRequestEvaluateFormula = _a.onRequestEvaluateFormula, isActiveCellFormula = _a.isActiveCellFormula, onInsertNote = _a.onInsertNote, onProtectRange = _a.onProtectRange, onUnProtectRange = _a.onUnProtectRange, onSortRange = _a.onSortRange, onSortColumn = _a.onSortColumn, onRequestDefineNamedRange = _a.onRequestDefineNamedRange, onRequestResize = _a.onRequestResize, onRequestEditTable = _a.onRequestEditTable, onRequestEditPivotTable = _a.onRequestEditPivotTable, onRequestDeletePivotTable = _a.onRequestDeletePivotTable, onPivotDrillDown = _a.onPivotDrillDown, onRequestFormatCells = _a.onRequestFormatCells, onRequestConditionalFormat = _a.onRequestConditionalFormat, onRequestDataValidation = _a.onRequestDataValidation, onRemoveTable = _a.onRemoveTable, onClearFormatting = _a.onClearFormatting, onCreateTable = _a.onCreateTable, onCreateBasicFilter = _a.onCreateBasicFilter, onFilterTable = _a.onFilterTable, onSortTable = _a.onSortTable, getFormattedValuesFromRange = _a.getFormattedValuesFromRange, focusSheet = _a.focusSheet, isSheetFocused = _a.isSheetFocused, getFormattedValue = _a.getFormattedValue, onInsertTableColumn = _a.onInsertTableColumn, onDeleteTableColumn = _a.onDeleteTableColumn, onInsertTableRow = _a.onInsertTableRow, onDeleteTableRow = _a.onDeleteTableRow, onSplitTextToColumns = _a.onSplitTextToColumns, onRemoveDuplicates = _a.onRemoveDuplicates, onChange = _a.onChange, getCellData = _a.getCellData, isHiddenColumn = _a.isHiddenColumn, isHiddenRow = _a.isHiddenRow, onShowColumn = _a.onShowColumn, onShowRow = _a.onShowRow, tables = _a.tables, pivotTables = _a.pivotTables, protectedRanges = _a.protectedRanges, sheetId = _a.sheetId, frozenRows = _a.frozenRows, frozenColumns = _a.frozenColumns, selectedRowHeadersIds = _a.selectedRowHeadersIds, selectedColumnHeadersIds = _a.selectedColumnHeadersIds, _c = _a.readonly, readonly = _c === void 0 ? false : _c, onAddQuickEdit = _a.onAddQuickEdit, enableMagicFill = _a.enableMagicFill;
|
|
17
19
|
var isHeader = isColumnHeader || isRowHeader;
|
|
18
20
|
var shouldFocusSheetRef = (0, react_1.useRef)(true);
|
|
19
21
|
var multiColumnTitle = (0, helpers_1.generateMultiDimTitle)(selectedColumnHeadersIds, "y");
|
|
@@ -53,6 +55,76 @@ var ContextMenu = function (_a) {
|
|
|
53
55
|
var lastSelectedRowIndex = selectedRowHeadersIds.reduce(function (m, v) { return (v > m ? v : m); }, -Infinity);
|
|
54
56
|
// Get contentful range
|
|
55
57
|
var getContentfulRangeAroundCell = (0, atoms_1.useGetContentfulRangeAroundCell)();
|
|
58
|
+
// Remove duplicates — Excel's dialog (column checklist + "my data has
|
|
59
|
+
// headers") when a host mounts `RemoveDuplicatesDialogHost`, otherwise the
|
|
60
|
+
// one-click de-dupe over the selection.
|
|
61
|
+
var isRemoveDuplicatesDialogMounted = (0, remove_duplicates_dialog_atom_1.useIsRemoveDuplicatesDialogMounted)();
|
|
62
|
+
var openRemoveDuplicatesDialog = (0, remove_duplicates_dialog_atom_1.useOpenRemoveDuplicatesDialog)();
|
|
63
|
+
var handleRemoveDuplicates = (0, react_1.useCallback)(function () {
|
|
64
|
+
var _a, _b, _c, _d, _e;
|
|
65
|
+
if (!isRemoveDuplicatesDialogMounted) {
|
|
66
|
+
onRemoveDuplicates === null || onRemoveDuplicates === void 0 ? void 0 : onRemoveDuplicates(sheetId, activeCell, selections);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// A table de-dupes its own rows; a lone cell expands to the data region
|
|
70
|
+
// around it, like Excel.
|
|
71
|
+
var range;
|
|
72
|
+
if (activeTable) {
|
|
73
|
+
range = tslib_1.__assign(tslib_1.__assign({}, activeTable.range), { endRowIndex: activeTable.range.endRowIndex - (activeTable.totalRow ? 1 : 0) });
|
|
74
|
+
}
|
|
75
|
+
else if (selections.length) {
|
|
76
|
+
range = selection.range;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
range = (_a = getContentfulRangeAroundCell === null || getContentfulRangeAroundCell === void 0 ? void 0 : getContentfulRangeAroundCell(sheetId, activeCell)) !== null && _a !== void 0 ? _a : selection.range;
|
|
80
|
+
}
|
|
81
|
+
var columns = [];
|
|
82
|
+
for (var columnIndex = range.startColumnIndex; columnIndex <= range.endColumnIndex; columnIndex++) {
|
|
83
|
+
var header = (_d = (_c = (_b = activeTable === null || activeTable === void 0 ? void 0 : activeTable.columns) === null || _b === void 0 ? void 0 : _b[columnIndex - activeTable.range.startColumnIndex]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : getFormattedValue(sheetId, range.startRowIndex, columnIndex);
|
|
84
|
+
columns.push({
|
|
85
|
+
columnIndex: columnIndex,
|
|
86
|
+
label: "Column ".concat((0, utils_1.number2Alpha)(columnIndex - 1)),
|
|
87
|
+
header: header || undefined,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Excel pre-ticks "my data has headers" when the first row reads as
|
|
91
|
+
// labels: every cell filled and none of them a number.
|
|
92
|
+
var hasHeader = activeTable
|
|
93
|
+
? ((_e = activeTable.headerRow) !== null && _e !== void 0 ? _e : true)
|
|
94
|
+
: range.endRowIndex > range.startRowIndex &&
|
|
95
|
+
columns.every(function (column) { return !!column.header && Number.isNaN(Number(column.header)); });
|
|
96
|
+
var target = range;
|
|
97
|
+
openRemoveDuplicatesDialog({
|
|
98
|
+
columns: columns,
|
|
99
|
+
hasHeader: hasHeader,
|
|
100
|
+
onApply: function (options) {
|
|
101
|
+
return onRemoveDuplicates === null || onRemoveDuplicates === void 0 ? void 0 : onRemoveDuplicates(sheetId, activeCell, [{ range: target }], options);
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
}, [
|
|
105
|
+
isRemoveDuplicatesDialogMounted,
|
|
106
|
+
openRemoveDuplicatesDialog,
|
|
107
|
+
onRemoveDuplicates,
|
|
108
|
+
sheetId,
|
|
109
|
+
activeCell,
|
|
110
|
+
selections,
|
|
111
|
+
selection,
|
|
112
|
+
activeTable,
|
|
113
|
+
getContentfulRangeAroundCell,
|
|
114
|
+
getFormattedValue,
|
|
115
|
+
]);
|
|
116
|
+
// Totals-row function picker: the active cell sits on a table's totals row.
|
|
117
|
+
var isActiveCellTableTotal = !!(activeTable === null || activeTable === void 0 ? void 0 : activeTable.totalRow) &&
|
|
118
|
+
activeCell.rowIndex === activeTable.range.endRowIndex;
|
|
119
|
+
var activeTotalRowFunction = (0, react_1.useMemo)(function () {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
if (!isActiveCellTableTotal) {
|
|
122
|
+
return "none";
|
|
123
|
+
}
|
|
124
|
+
var cellData = getCellData === null || getCellData === void 0 ? void 0 : getCellData(sheetId, activeCell.rowIndex, activeCell.columnIndex);
|
|
125
|
+
var ue = (_a = cellData === null || cellData === void 0 ? void 0 : cellData.ue) !== null && _a !== void 0 ? _a : cellData === null || cellData === void 0 ? void 0 : cellData.userEnteredValue;
|
|
126
|
+
return (0, total_row_functions_1.getTotalRowFunctionFromFormula)((_b = ue === null || ue === void 0 ? void 0 : ue.fv) !== null && _b !== void 0 ? _b : ue === null || ue === void 0 ? void 0 : ue.formulaValue);
|
|
127
|
+
}, [isActiveCellTableTotal, getCellData, sheetId, activeCell]);
|
|
56
128
|
// Sort table or filter
|
|
57
129
|
var onSortTableOrFilterView = (0, react_1.useCallback)(function (direction) {
|
|
58
130
|
// Found a table
|
|
@@ -169,7 +241,16 @@ var ContextMenu = function (_a) {
|
|
|
169
241
|
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onPaste === null || onPaste === void 0 ? void 0 : onPaste("Formatting"); } }, "Formatting only"),
|
|
170
242
|
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onPaste === null || onPaste === void 0 ? void 0 : onPaste("Formula"); } }, "Formula"),
|
|
171
243
|
react_1.default.createElement(ui_1.DropdownMenuSeparator, null),
|
|
172
|
-
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onPaste === null || onPaste === void 0 ? void 0 : onPaste("Transposed"); } }, "Transposed")
|
|
244
|
+
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onPaste === null || onPaste === void 0 ? void 0 : onPaste("Transposed"); } }, "Transposed"),
|
|
245
|
+
onRequestPasteSpecial ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
246
|
+
react_1.default.createElement(ui_1.DropdownMenuSeparator, null),
|
|
247
|
+
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () {
|
|
248
|
+
// Focus moves to the dialog, not back to the sheet
|
|
249
|
+
shouldFocusSheetRef.current = false;
|
|
250
|
+
onRequestPasteSpecial();
|
|
251
|
+
} },
|
|
252
|
+
"Paste special\u2026",
|
|
253
|
+
react_1.default.createElement(ui_1.DropdownRightSlot, null, "\u2318\u2325V")))) : null)),
|
|
173
254
|
enableMagicFill ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
174
255
|
react_1.default.createElement(ui_1.DropdownMenuSeparator, null),
|
|
175
256
|
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () {
|
|
@@ -499,7 +580,26 @@ var ContextMenu = function (_a) {
|
|
|
499
580
|
react_1.default.createElement(icons_1.ChevronRightIcon, null))),
|
|
500
581
|
react_1.default.createElement(ui_1.DropdownMenuSubContent, { sideOffset: 2, alignOffset: -5 },
|
|
501
582
|
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onRemoveTable === null || onRemoveTable === void 0 ? void 0 : onRemoveTable(activeTable); }, disabled: readonly }, "Convert to range"),
|
|
502
|
-
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onRequestEditTable === null || onRequestEditTable === void 0 ? void 0 : onRequestEditTable(activeTable); }, disabled: readonly }, "Edit table")
|
|
583
|
+
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () { return onRequestEditTable === null || onRequestEditTable === void 0 ? void 0 : onRequestEditTable(activeTable); }, disabled: readonly }, "Edit table"),
|
|
584
|
+
isActiveCellTableTotal ? (react_1.default.createElement(ui_1.DropdownMenuSub, null,
|
|
585
|
+
react_1.default.createElement(ui_1.DropdownMenuSubTrigger, { disabled: readonly },
|
|
586
|
+
"Total row function",
|
|
587
|
+
react_1.default.createElement(ui_1.DropdownRightSlot, null,
|
|
588
|
+
react_1.default.createElement(icons_1.ChevronRightIcon, null))),
|
|
589
|
+
react_1.default.createElement(ui_1.DropdownMenuSubContent, { sideOffset: 2, alignOffset: -5 }, total_row_functions_1.TOTAL_ROW_FUNCTIONS.map(function (option) { return (react_1.default.createElement(ui_1.DropdownMenuCheckboxItem, { key: option.id, checked: activeTotalRowFunction === option.id, disabled: readonly, onSelect: function () {
|
|
590
|
+
var formula = (0, total_row_functions_1.getTotalRowFunctionFormula)(option.id, activeTable, activeCell.columnIndex);
|
|
591
|
+
if (formula === undefined) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (formula === "") {
|
|
595
|
+
onClearContents === null || onClearContents === void 0 ? void 0 : onClearContents(sheetId, activeCell, (0, grid_1.selectionFromActiveCell)(activeCell));
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(sheetId, activeCell, formula, null);
|
|
599
|
+
} },
|
|
600
|
+
react_1.default.createElement(ui_1.DropdownMenuItemIndicator, null,
|
|
601
|
+
react_1.default.createElement(icons_1.CheckIcon, null)),
|
|
602
|
+
option.label)); })))) : null))) : null,
|
|
503
603
|
activePivotTable ? (react_1.default.createElement(ui_1.DropdownMenuSub, null,
|
|
504
604
|
react_1.default.createElement(ui_1.DropdownMenuSubTrigger, { disabled: readonly },
|
|
505
605
|
react_1.default.createElement(ui_1.DropdownLeftSlot, null,
|
|
@@ -607,9 +707,16 @@ var ContextMenu = function (_a) {
|
|
|
607
707
|
}, disabled: readonly },
|
|
608
708
|
react_1.default.createElement(ui_1.DropdownLeftSlot, null,
|
|
609
709
|
react_1.default.createElement(icons_1.PlusIcon, null)),
|
|
610
|
-
"Define named range")
|
|
710
|
+
"Define named range"),
|
|
711
|
+
onRequestEvaluateFormula && isActiveCellFormula ? (react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: function () {
|
|
712
|
+
shouldFocusSheetRef.current = false;
|
|
713
|
+
onRequestEvaluateFormula(sheetId, activeCell);
|
|
714
|
+
} },
|
|
715
|
+
react_1.default.createElement(ui_1.DropdownLeftSlot, null,
|
|
716
|
+
react_1.default.createElement(icons_1.CodeIcon, null)),
|
|
717
|
+
"Evaluate formula")) : null)),
|
|
611
718
|
react_1.default.createElement(ui_1.DropdownMenuSeparator, null),
|
|
612
|
-
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick:
|
|
719
|
+
react_1.default.createElement(ui_1.DropdownMenuItem, { onClick: handleRemoveDuplicates, disabled: readonly },
|
|
613
720
|
react_1.default.createElement(ui_1.DropdownLeftSlot, null,
|
|
614
721
|
react_1.default.createElement(icons_1.RemoveDuplicatesIcon, null)),
|
|
615
722
|
"Remove duplicates"),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TableView } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* The aggregations Excel offers in a table's totals-row dropdown, each backed
|
|
4
|
+
* by the `SUBTOTAL` function number that ignores hidden (filtered) rows.
|
|
5
|
+
*/
|
|
6
|
+
export type TotalRowFunction = "none" | "average" | "count" | "countNumbers" | "max" | "min" | "sum" | "stdDev" | "var";
|
|
7
|
+
export type TotalRowFunctionOption = {
|
|
8
|
+
id: TotalRowFunction;
|
|
9
|
+
label: string;
|
|
10
|
+
/** `SUBTOTAL` function number (101–111 = ignore hidden rows). */
|
|
11
|
+
subtotal?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const TOTAL_ROW_FUNCTIONS: TotalRowFunctionOption[];
|
|
14
|
+
/**
|
|
15
|
+
* Escape a column name for use inside a structured reference: `[`, `]`, `#`
|
|
16
|
+
* and `'` are prefixed with `'`, as Excel does.
|
|
17
|
+
*/
|
|
18
|
+
export declare const escapeStructuredColumnName: (name: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Formula for a totals-row cell, e.g. `=SUBTOTAL(109,Table1[Amount])`.
|
|
21
|
+
* Qualified with the table name so it evaluates from any engine and matches
|
|
22
|
+
* what Excel writes for a totals row. Returns `""` for "none" (clear the
|
|
23
|
+
* cell) and `undefined` when the column has no name to reference.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getTotalRowFunctionFormula: (fn: TotalRowFunction, table: Pick<TableView, "title" | "columns" | "range">, columnIndex: number) => string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Recognise the aggregation a totals-row formula uses, so the picker can show
|
|
28
|
+
* the active choice. Both the hidden-row-aware (1xx) and plain (1–11)
|
|
29
|
+
* `SUBTOTAL` numbers map to the same option; anything else is "none".
|
|
30
|
+
*/
|
|
31
|
+
export declare const getTotalRowFunctionFromFormula: (formula: string | null | undefined) => TotalRowFunction;
|
|
32
|
+
//# sourceMappingURL=total-row-functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"total-row-functions.d.ts","sourceRoot":"","sources":["../../../../components/context-menu/total-row-functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,GACT,OAAO,GACP,cAAc,GACd,KAAK,GACL,KAAK,GACL,KAAK,GACL,QAAQ,GACR,KAAK,CAAC;AAEV,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,gBAAgB,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,sBAAsB,EAUvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,WACnB,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,IAAI,gBAAgB,EACpB,OAAO,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,EACrD,aAAa,MAAM,KAClB,MAAM,GAAG,SAaX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,KACjC,gBAgBF,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTotalRowFunctionFromFormula = exports.getTotalRowFunctionFormula = exports.escapeStructuredColumnName = exports.TOTAL_ROW_FUNCTIONS = void 0;
|
|
4
|
+
exports.TOTAL_ROW_FUNCTIONS = [
|
|
5
|
+
{ id: "none", label: "None" },
|
|
6
|
+
{ id: "average", label: "Average", subtotal: 101 },
|
|
7
|
+
{ id: "count", label: "Count", subtotal: 103 },
|
|
8
|
+
{ id: "countNumbers", label: "Count Numbers", subtotal: 102 },
|
|
9
|
+
{ id: "max", label: "Max", subtotal: 104 },
|
|
10
|
+
{ id: "min", label: "Min", subtotal: 105 },
|
|
11
|
+
{ id: "sum", label: "Sum", subtotal: 109 },
|
|
12
|
+
{ id: "stdDev", label: "StdDev", subtotal: 107 },
|
|
13
|
+
{ id: "var", label: "Var", subtotal: 110 },
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Escape a column name for use inside a structured reference: `[`, `]`, `#`
|
|
17
|
+
* and `'` are prefixed with `'`, as Excel does.
|
|
18
|
+
*/
|
|
19
|
+
var escapeStructuredColumnName = function (name) {
|
|
20
|
+
return name.replace(/(['\[\]#])/g, "'$1");
|
|
21
|
+
};
|
|
22
|
+
exports.escapeStructuredColumnName = escapeStructuredColumnName;
|
|
23
|
+
/**
|
|
24
|
+
* Formula for a totals-row cell, e.g. `=SUBTOTAL(109,Table1[Amount])`.
|
|
25
|
+
* Qualified with the table name so it evaluates from any engine and matches
|
|
26
|
+
* what Excel writes for a totals row. Returns `""` for "none" (clear the
|
|
27
|
+
* cell) and `undefined` when the column has no name to reference.
|
|
28
|
+
*/
|
|
29
|
+
var getTotalRowFunctionFormula = function (fn, table, columnIndex) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
if (fn === "none") {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
var option = exports.TOTAL_ROW_FUNCTIONS.find(function (item) { return item.id === fn; });
|
|
35
|
+
var columnName = (_b = (_a = table.columns) === null || _a === void 0 ? void 0 : _a[columnIndex - table.range.startColumnIndex]) === null || _b === void 0 ? void 0 : _b.name;
|
|
36
|
+
if (!(option === null || option === void 0 ? void 0 : option.subtotal) || !columnName || !table.title) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return "=SUBTOTAL(".concat(option.subtotal, ",").concat(table.title, "[").concat((0, exports.escapeStructuredColumnName)(columnName), "])");
|
|
40
|
+
};
|
|
41
|
+
exports.getTotalRowFunctionFormula = getTotalRowFunctionFormula;
|
|
42
|
+
/**
|
|
43
|
+
* Recognise the aggregation a totals-row formula uses, so the picker can show
|
|
44
|
+
* the active choice. Both the hidden-row-aware (1xx) and plain (1–11)
|
|
45
|
+
* `SUBTOTAL` numbers map to the same option; anything else is "none".
|
|
46
|
+
*/
|
|
47
|
+
var getTotalRowFunctionFromFormula = function (formula) {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
if (!formula) {
|
|
50
|
+
return "none";
|
|
51
|
+
}
|
|
52
|
+
var match = /^\s*=\s*SUBTOTAL\s*\(\s*(\d{1,3})\s*,/i.exec(formula);
|
|
53
|
+
if (!match) {
|
|
54
|
+
return "none";
|
|
55
|
+
}
|
|
56
|
+
var number = Number(match[1]);
|
|
57
|
+
var normalized = number > 100 ? number - 100 : number;
|
|
58
|
+
return ((_b = (_a = exports.TOTAL_ROW_FUNCTIONS.find(function (item) {
|
|
59
|
+
return item.subtotal !== undefined && item.subtotal - 100 === normalized;
|
|
60
|
+
})) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : "none");
|
|
61
|
+
};
|
|
62
|
+
exports.getTotalRowFunctionFromFormula = getTotalRowFunctionFromFormula;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type EvaluationValue } from "@rowsncolumns/calculator";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export type EvaluateFormulaDialogProps = {
|
|
4
|
+
/** Controls visibility. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange(open: boolean): void;
|
|
7
|
+
/** Display label of the evaluated cell, e.g. `Sheet1!$A$1`. */
|
|
8
|
+
reference: string;
|
|
9
|
+
/** The cell's formula, including the leading `=`. */
|
|
10
|
+
formula: string;
|
|
11
|
+
/**
|
|
12
|
+
* Scratch-evaluates one sub-expression (no leading `=`) in the cell's
|
|
13
|
+
* context. Errors come back as `{ error: "#DIV/0!" }`, blanks as `null`.
|
|
14
|
+
*/
|
|
15
|
+
evaluate(expression: string): Promise<EvaluationValue>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Excel's Evaluate Formula dialog: a read-only stepper that underlines the
|
|
19
|
+
* next sub-expression the calculator would resolve and, on Evaluate,
|
|
20
|
+
* replaces it with its value until only the result remains. Nothing is
|
|
21
|
+
* written to the sheet.
|
|
22
|
+
*/
|
|
23
|
+
export declare const EvaluateFormulaDialog: React.MemoExoticComponent<({ open, onOpenChange, reference, formula, evaluate, }: EvaluateFormulaDialogProps) => React.JSX.Element>;
|
|
24
|
+
/**
|
|
25
|
+
* Host-mounted, atom-driven wrapper around {@link EvaluateFormulaDialog}.
|
|
26
|
+
* Mount it once in the host alongside the other editor dialogs; the grid
|
|
27
|
+
* opens it from the context menu ("Evaluate formula…") for a formula cell.
|
|
28
|
+
* Keyed per request so each opening restarts from the cell's formula.
|
|
29
|
+
*/
|
|
30
|
+
export declare const EvaluateFormulaDialogHost: {
|
|
31
|
+
(): React.JSX.Element | null;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/evaluate-formula-dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,MAAM,MAAM,0BAA0B,GAAG;IACvC,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACxD,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,oFAO7B,0BAA0B,uBAiG9B,CAAC;AAUF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;CAiBrC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvaluateFormulaDialogHost = exports.EvaluateFormulaDialog = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var calculator_1 = require("@rowsncolumns/calculator");
|
|
6
|
+
var ui_1 = require("@rowsncolumns/ui");
|
|
7
|
+
var utils_1 = require("@rowsncolumns/utils");
|
|
8
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
9
|
+
var evaluate_formula_dialog_atom_1 = require("../../atoms/evaluate-formula-dialog.atom");
|
|
10
|
+
var CANNOT_EVALUATE = "This formula cannot be stepped through. Check it for syntax errors.";
|
|
11
|
+
/**
|
|
12
|
+
* Excel's Evaluate Formula dialog: a read-only stepper that underlines the
|
|
13
|
+
* next sub-expression the calculator would resolve and, on Evaluate,
|
|
14
|
+
* replaces it with its value until only the result remains. Nothing is
|
|
15
|
+
* written to the sheet.
|
|
16
|
+
*/
|
|
17
|
+
exports.EvaluateFormulaDialog = (0, react_1.memo)(function (_a) {
|
|
18
|
+
var open = _a.open, onOpenChange = _a.onOpenChange, reference = _a.reference, formula = _a.formula, evaluate = _a.evaluate;
|
|
19
|
+
var _b = tslib_1.__read((0, react_1.useState)(function () { return (0, calculator_1.createFormulaEvaluation)(formula); }), 2), state = _b[0], setState = _b[1];
|
|
20
|
+
var _c = tslib_1.__read((0, react_1.useState)(false), 2), busy = _c[0], setBusy = _c[1];
|
|
21
|
+
var _d = tslib_1.__read((0, react_1.useState)(undefined), 2), failure = _d[0], setFailure = _d[1];
|
|
22
|
+
var step = (0, react_1.useCallback)(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
23
|
+
var _a, err_1;
|
|
24
|
+
return tslib_1.__generator(this, function (_b) {
|
|
25
|
+
switch (_b.label) {
|
|
26
|
+
case 0:
|
|
27
|
+
if (!state || state.done || busy)
|
|
28
|
+
return [2 /*return*/];
|
|
29
|
+
setBusy(true);
|
|
30
|
+
_b.label = 1;
|
|
31
|
+
case 1:
|
|
32
|
+
_b.trys.push([1, 3, 4, 5]);
|
|
33
|
+
_a = setState;
|
|
34
|
+
return [4 /*yield*/, (0, calculator_1.advanceFormulaEvaluation)(state, evaluate)];
|
|
35
|
+
case 2:
|
|
36
|
+
_a.apply(void 0, [_b.sent()]);
|
|
37
|
+
setFailure(undefined);
|
|
38
|
+
return [3 /*break*/, 5];
|
|
39
|
+
case 3:
|
|
40
|
+
err_1 = _b.sent();
|
|
41
|
+
setFailure(err_1 instanceof Error ? err_1.message : "The expression could not be evaluated.");
|
|
42
|
+
return [3 /*break*/, 5];
|
|
43
|
+
case 4:
|
|
44
|
+
setBusy(false);
|
|
45
|
+
return [7 /*endfinally*/];
|
|
46
|
+
case 5: return [2 /*return*/];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}); }, [state, busy, evaluate]);
|
|
50
|
+
var restart = (0, react_1.useCallback)(function () {
|
|
51
|
+
setState((0, calculator_1.createFormulaEvaluation)(formula));
|
|
52
|
+
setFailure(undefined);
|
|
53
|
+
}, [formula]);
|
|
54
|
+
var target = state === null || state === void 0 ? void 0 : state.target;
|
|
55
|
+
var before = state && target ? state.text.slice(0, target.start) : "";
|
|
56
|
+
var underlined = state && target ? state.text.slice(target.start, target.end + 1) : "";
|
|
57
|
+
var after = state && target ? state.text.slice(target.end + 1) : "";
|
|
58
|
+
return (react_1.default.createElement(ui_1.Dialog, { open: open, onOpenChange: onOpenChange, modal: true },
|
|
59
|
+
react_1.default.createElement(ui_1.DialogContent, { className: "w-[520px] max-w-[92vw] pointer-events-auto" },
|
|
60
|
+
react_1.default.createElement(ui_1.DialogTitle, null, "Evaluate Formula"),
|
|
61
|
+
react_1.default.createElement(ui_1.DialogCloseButton, null),
|
|
62
|
+
react_1.default.createElement(ui_1.DialogBody, { className: "flex flex-col gap-3" },
|
|
63
|
+
react_1.default.createElement("div", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-xs" },
|
|
64
|
+
react_1.default.createElement("span", { className: "font-medium" }, "Reference:"),
|
|
65
|
+
react_1.default.createElement("span", { className: "font-mono" }, reference),
|
|
66
|
+
react_1.default.createElement("span", { className: "font-medium" }, "Evaluation:"),
|
|
67
|
+
react_1.default.createElement("div", { "data-testid": "evaluate-formula-expression", className: "font-mono whitespace-pre-wrap break-all rounded border border-rnc-border px-2 py-1.5 min-h-[64px]" }, state ? (state.done ? (react_1.default.createElement("span", { className: "italic" },
|
|
68
|
+
"= ",
|
|
69
|
+
state.text)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
70
|
+
"= ",
|
|
71
|
+
before,
|
|
72
|
+
react_1.default.createElement("u", { "data-testid": "evaluate-formula-target" }, underlined),
|
|
73
|
+
after))) : (react_1.default.createElement("span", { className: "text-rnc-destructive" }, CANNOT_EVALUATE)))),
|
|
74
|
+
failure ? (react_1.default.createElement("div", { role: "alert", className: "text-xs text-rnc-destructive" }, failure)) : null,
|
|
75
|
+
react_1.default.createElement("p", { className: "text-xs text-rnc-foreground/70" }, "To show the result of the underlined expression, click Evaluate. The final result appears italicized."),
|
|
76
|
+
react_1.default.createElement(ui_1.Separator, null),
|
|
77
|
+
react_1.default.createElement("div", { className: "flex justify-end gap-2" },
|
|
78
|
+
react_1.default.createElement(ui_1.Button, { variant: "outline", size: "sm", onClick: function () { return onOpenChange(false); } }, "Close"),
|
|
79
|
+
(state === null || state === void 0 ? void 0 : state.done) ? (react_1.default.createElement(ui_1.Button, { size: "sm", onClick: restart }, "Restart")) : (react_1.default.createElement(ui_1.Button, { size: "sm", onClick: step, disabled: !state || busy }, "Evaluate")))))));
|
|
80
|
+
});
|
|
81
|
+
exports.EvaluateFormulaDialog.displayName = "EvaluateFormulaDialog";
|
|
82
|
+
var referenceOf = function (request) {
|
|
83
|
+
var _a;
|
|
84
|
+
var address = (_a = (0, utils_1.cellToAddress)(request.cell, true, true)) !== null && _a !== void 0 ? _a : "";
|
|
85
|
+
var sheetName = (0, utils_1.sanitizeSheetName)(request.sheetName);
|
|
86
|
+
return sheetName ? "".concat(sheetName, "!").concat(address) : address;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Host-mounted, atom-driven wrapper around {@link EvaluateFormulaDialog}.
|
|
90
|
+
* Mount it once in the host alongside the other editor dialogs; the grid
|
|
91
|
+
* opens it from the context menu ("Evaluate formula…") for a formula cell.
|
|
92
|
+
* Keyed per request so each opening restarts from the cell's formula.
|
|
93
|
+
*/
|
|
94
|
+
var EvaluateFormulaDialogHost = function () {
|
|
95
|
+
(0, evaluate_formula_dialog_atom_1.useRegisterEvaluateFormulaDialogHost)();
|
|
96
|
+
var _a = tslib_1.__read((0, evaluate_formula_dialog_atom_1.useEvaluateFormulaDialogState)(), 2), request = _a[0], setRequest = _a[1];
|
|
97
|
+
var close = (0, react_1.useCallback)(function () { return setRequest(null); }, [setRequest]);
|
|
98
|
+
if (!request)
|
|
99
|
+
return null;
|
|
100
|
+
return (react_1.default.createElement(exports.EvaluateFormulaDialog, { key: "".concat(request.sheetId, ":").concat(request.cell.rowIndex, ":").concat(request.cell.columnIndex, ":").concat(request.formula), open: true, onOpenChange: function (open) {
|
|
101
|
+
if (!open)
|
|
102
|
+
close();
|
|
103
|
+
}, reference: referenceOf(request), formula: request.formula, evaluate: request.evaluate }));
|
|
104
|
+
};
|
|
105
|
+
exports.EvaluateFormulaDialogHost = EvaluateFormulaDialogHost;
|
|
106
|
+
exports.EvaluateFormulaDialogHost.displayName = "EvaluateFormulaDialogHost";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { NamedRange, SheetRange } from "../../types";
|
|
3
|
+
export type GoToDialogProps = {
|
|
4
|
+
/** Controls visibility. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange(open: boolean): void;
|
|
7
|
+
/** Defined names listed in the "Go to" box; picking one fills the reference. */
|
|
8
|
+
namedRanges?: NamedRange[] | null;
|
|
9
|
+
/** Shown as the placeholder of the reference box (the current location). */
|
|
10
|
+
currentAddress?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the typed text to a range, or `undefined` when it is not a
|
|
13
|
+
* valid reference / name (the dialog then shows Excel's error).
|
|
14
|
+
*/
|
|
15
|
+
resolve(reference: string): SheetRange | undefined;
|
|
16
|
+
/** Receives the resolved range; the host selects and scrolls to it. */
|
|
17
|
+
onNavigate(range: SheetRange): void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Excel's Go To dialog (`Ctrl+G` / `F5`): type a cell or range reference,
|
|
21
|
+
* optionally sheet-qualified, or pick a defined name, and the selection
|
|
22
|
+
* jumps there. Resolution is delegated to `resolve` so the dialog stays
|
|
23
|
+
* UI-only.
|
|
24
|
+
*/
|
|
25
|
+
export declare const GoToDialog: React.MemoExoticComponent<({ open, onOpenChange, namedRanges, currentAddress, resolve, onNavigate, }: GoToDialogProps) => React.JSX.Element>;
|
|
26
|
+
/**
|
|
27
|
+
* Host-mounted, atom-driven wrapper around {@link GoToDialog}. Mount it once
|
|
28
|
+
* in the host alongside the other editor dialogs; the grid opens it on
|
|
29
|
+
* `Ctrl+G` / `F5` (unless the host handles `onRequestGoTo` itself).
|
|
30
|
+
*/
|
|
31
|
+
export declare const GoToDialogHost: {
|
|
32
|
+
(): React.JSX.Element | null;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/go-to-dialog/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACnD,uEAAuE;IACvE,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACrC,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,wGAQlB,eAAe,uBA4GnB,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;CA8B1B,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoToDialogHost = exports.GoToDialog = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var ui_1 = require("@rowsncolumns/ui");
|
|
6
|
+
var utils_1 = require("@rowsncolumns/utils");
|
|
7
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
8
|
+
var go_to_1 = require("../../api/go-to");
|
|
9
|
+
var go_to_dialog_atom_1 = require("../../atoms/go-to-dialog.atom");
|
|
10
|
+
var INVALID_REFERENCE = "Reference is not valid.";
|
|
11
|
+
/**
|
|
12
|
+
* Excel's Go To dialog (`Ctrl+G` / `F5`): type a cell or range reference,
|
|
13
|
+
* optionally sheet-qualified, or pick a defined name, and the selection
|
|
14
|
+
* jumps there. Resolution is delegated to `resolve` so the dialog stays
|
|
15
|
+
* UI-only.
|
|
16
|
+
*/
|
|
17
|
+
exports.GoToDialog = (0, react_1.memo)(function (_a) {
|
|
18
|
+
var open = _a.open, onOpenChange = _a.onOpenChange, namedRanges = _a.namedRanges, currentAddress = _a.currentAddress, resolve = _a.resolve, onNavigate = _a.onNavigate;
|
|
19
|
+
var _b = tslib_1.__read((0, react_1.useState)(""), 2), reference = _b[0], setReference = _b[1];
|
|
20
|
+
var _c = tslib_1.__read((0, react_1.useState)(undefined), 2), error = _c[0], setError = _c[1];
|
|
21
|
+
var navigate = (0, react_1.useCallback)(function (text) {
|
|
22
|
+
var range = resolve(text);
|
|
23
|
+
if (!range) {
|
|
24
|
+
setError(INVALID_REFERENCE);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
onNavigate(range);
|
|
28
|
+
onOpenChange(false);
|
|
29
|
+
}, [resolve, onNavigate, onOpenChange]);
|
|
30
|
+
var names = (namedRanges !== null && namedRanges !== void 0 ? namedRanges : []).filter(function (range) { return range.range && !range.hidden; });
|
|
31
|
+
return (react_1.default.createElement(ui_1.Dialog, { open: open, onOpenChange: onOpenChange, modal: true },
|
|
32
|
+
react_1.default.createElement(ui_1.DialogContent, { className: "w-[360px] max-w-[92vw] pointer-events-auto" },
|
|
33
|
+
react_1.default.createElement(ui_1.DialogTitle, null, "Go To"),
|
|
34
|
+
react_1.default.createElement(ui_1.DialogCloseButton, null),
|
|
35
|
+
react_1.default.createElement(ui_1.DialogBody, { className: "flex flex-col gap-3" },
|
|
36
|
+
react_1.default.createElement("form", { className: "flex flex-col gap-3", onSubmit: function (e) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
navigate(reference);
|
|
39
|
+
} },
|
|
40
|
+
react_1.default.createElement("div", { className: "flex flex-col gap-1" },
|
|
41
|
+
react_1.default.createElement("span", { className: "text-xs font-medium" }, "Go to:"),
|
|
42
|
+
react_1.default.createElement("div", { role: "listbox", "aria-label": "Defined names", className: "h-[140px] overflow-auto rounded border border-rnc-border text-xs" }, names.length === 0 ? (react_1.default.createElement("div", { className: "px-2 py-1.5 text-rnc-foreground/60" }, "No defined names")) : (names.map(function (range) { return (react_1.default.createElement("div", { key: String(range.namedRangeId), role: "option", "aria-selected": reference === range.name, className: (0, ui_1.cn)("px-2 py-1 cursor-default select-none hover:bg-rnc-accent", reference === range.name && "bg-rnc-accent"), onClick: function () {
|
|
43
|
+
setReference(range.name);
|
|
44
|
+
setError(undefined);
|
|
45
|
+
}, onDoubleClick: function () { return navigate(range.name); } }, range.name)); })))),
|
|
46
|
+
react_1.default.createElement("label", { className: "flex flex-col gap-1 text-xs font-medium" },
|
|
47
|
+
"Reference:",
|
|
48
|
+
react_1.default.createElement(ui_1.Input, { autoFocus: true, value: reference, placeholder: currentAddress, "aria-invalid": error ? true : undefined, onChange: function (e) {
|
|
49
|
+
setReference(e.target.value);
|
|
50
|
+
setError(undefined);
|
|
51
|
+
} })),
|
|
52
|
+
error ? (react_1.default.createElement("div", { role: "alert", className: "text-xs text-rnc-destructive" }, error)) : null,
|
|
53
|
+
react_1.default.createElement(ui_1.Separator, null),
|
|
54
|
+
react_1.default.createElement("div", { className: "flex justify-end gap-2" },
|
|
55
|
+
react_1.default.createElement(ui_1.Button, { type: "button", variant: "outline", size: "sm", onClick: function () { return onOpenChange(false); } }, "Cancel"),
|
|
56
|
+
react_1.default.createElement(ui_1.Button, { type: "submit", size: "sm", disabled: !reference.trim() }, "OK")))))));
|
|
57
|
+
});
|
|
58
|
+
exports.GoToDialog.displayName = "GoToDialog";
|
|
59
|
+
var currentAddressOf = function (request) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
var address = (_a = (0, utils_1.cellToAddress)(request.activeCell)) !== null && _a !== void 0 ? _a : "";
|
|
62
|
+
var sheetName = (_b = request.getSheetName) === null || _b === void 0 ? void 0 : _b.call(request, request.sheetId);
|
|
63
|
+
return sheetName ? "".concat(sheetName, "!").concat(address) : address;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Host-mounted, atom-driven wrapper around {@link GoToDialog}. Mount it once
|
|
67
|
+
* in the host alongside the other editor dialogs; the grid opens it on
|
|
68
|
+
* `Ctrl+G` / `F5` (unless the host handles `onRequestGoTo` itself).
|
|
69
|
+
*/
|
|
70
|
+
var GoToDialogHost = function () {
|
|
71
|
+
(0, go_to_dialog_atom_1.useRegisterGoToDialogHost)();
|
|
72
|
+
var _a = tslib_1.__read((0, go_to_dialog_atom_1.useGoToDialogState)(), 2), request = _a[0], setRequest = _a[1];
|
|
73
|
+
var close = (0, react_1.useCallback)(function () { return setRequest(null); }, [setRequest]);
|
|
74
|
+
var resolve = (0, react_1.useCallback)(function (reference) {
|
|
75
|
+
return request
|
|
76
|
+
? (0, go_to_1.resolveGoToReference)(reference, {
|
|
77
|
+
sheetId: request.sheetId,
|
|
78
|
+
namedRanges: request.namedRanges,
|
|
79
|
+
getSheetId: request.getSheetId,
|
|
80
|
+
rowCount: request.rowCount,
|
|
81
|
+
columnCount: request.columnCount,
|
|
82
|
+
})
|
|
83
|
+
: undefined;
|
|
84
|
+
}, [request]);
|
|
85
|
+
if (!request)
|
|
86
|
+
return null;
|
|
87
|
+
return (react_1.default.createElement(exports.GoToDialog, { open: true, onOpenChange: function (open) {
|
|
88
|
+
if (!open)
|
|
89
|
+
close();
|
|
90
|
+
}, namedRanges: request.namedRanges, currentAddress: currentAddressOf(request), resolve: resolve, onNavigate: request.onNavigate }));
|
|
91
|
+
};
|
|
92
|
+
exports.GoToDialogHost = GoToDialogHost;
|
|
93
|
+
exports.GoToDialogHost.displayName = "GoToDialogHost";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PasteSpecialOptions } from "../../hooks/use-copy-paste-cut";
|
|
3
|
+
export type PasteSpecialDialogProps = {
|
|
4
|
+
/** Controls visibility. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange(open: boolean): void;
|
|
7
|
+
/**
|
|
8
|
+
* Emits the assembled request. The host routes it to the grid's
|
|
9
|
+
* `paste(options)`; the dialog never touches the clipboard itself.
|
|
10
|
+
*/
|
|
11
|
+
onApply(options: PasteSpecialOptions): void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Excel's Paste Special dialog: what to paste (all / formulas / values /
|
|
15
|
+
* formats), an arithmetic operation against the destination, skip blanks and
|
|
16
|
+
* transpose. Every choice composes into one `PasteSpecialOptions` request.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PasteSpecialDialog: React.MemoExoticComponent<({ open, onOpenChange, onApply }: PasteSpecialDialogProps) => React.JSX.Element>;
|
|
19
|
+
/**
|
|
20
|
+
* Host-mounted, atom-driven wrapper around {@link PasteSpecialDialog}. Mount
|
|
21
|
+
* it once in the host alongside the other editor dialogs; the grid opens it
|
|
22
|
+
* from the context menu ("Paste special…") and `Ctrl+Alt+V`. Remounted per
|
|
23
|
+
* request so each opening starts from Excel's defaults.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PasteSpecialDialogHost: {
|
|
26
|
+
(): React.JSX.Element | null;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/paste-special-dialog/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAoBxC,MAAM,MAAM,uBAAuB,GAAG;IACpC,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC7C,CAAC;AAyCF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,8DACK,uBAAuB,uBA2F1D,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;CAclC,CAAC"}
|