@leankylin-sheet/react 2.0.10 → 2.0.11
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/components/FxEditor/CalcInfo.d.ts +3 -0
- package/dist/index.esm.js +88 -2
- package/dist/index.js +87 -1
- package/dist/index.umd.js +111 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/core';
|
|
1
|
+
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getDataBySelectionNoCopy, getInlineStringNoStyle, rangeHightlightselected, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/core';
|
|
2
2
|
import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
|
|
3
3
|
import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
|
|
4
4
|
import _ from 'lodash';
|
|
@@ -6324,6 +6324,92 @@ var LocationBox = function LocationBox() {
|
|
|
6324
6324
|
}, rangeText));
|
|
6325
6325
|
};
|
|
6326
6326
|
|
|
6327
|
+
var intThousands = function intThousands(number) {
|
|
6328
|
+
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ",";
|
|
6329
|
+
return String(number).replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
6330
|
+
};
|
|
6331
|
+
var numberThousands = function numberThousands(num, groupSeparator, precision) {
|
|
6332
|
+
var number = Number(num).toFixed(precision);
|
|
6333
|
+
var _String$split = String(number).split("."),
|
|
6334
|
+
_String$split2 = _slicedToArray(_String$split, 2),
|
|
6335
|
+
init = _String$split2[0],
|
|
6336
|
+
decimal = _String$split2[1];
|
|
6337
|
+
if (precision) {
|
|
6338
|
+
return "".concat(intThousands(init, groupSeparator), ".").concat(decimal);
|
|
6339
|
+
}
|
|
6340
|
+
return intThousands(init, groupSeparator);
|
|
6341
|
+
};
|
|
6342
|
+
var CalcInfo = function CalcInfo() {
|
|
6343
|
+
var _useContext = useContext(WorkbookContext),
|
|
6344
|
+
context = _useContext.context;
|
|
6345
|
+
var data = useMemo(function () {
|
|
6346
|
+
var _context$luckysheet_s;
|
|
6347
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
6348
|
+
if (!firstSelection) {
|
|
6349
|
+
return null;
|
|
6350
|
+
}
|
|
6351
|
+
var columns = firstSelection.column;
|
|
6352
|
+
var rows = firstSelection.row;
|
|
6353
|
+
if ((columns === null || columns === void 0 ? void 0 : columns.length) !== 2 || (rows === null || rows === void 0 ? void 0 : rows.length) !== 2) {
|
|
6354
|
+
return null;
|
|
6355
|
+
}
|
|
6356
|
+
if (columns[0] === columns[1] && rows[0] === rows[1]) {
|
|
6357
|
+
return null;
|
|
6358
|
+
}
|
|
6359
|
+
var selectData = getDataBySelectionNoCopy(context, firstSelection);
|
|
6360
|
+
var flatData = selectData.flat();
|
|
6361
|
+
var count = 0;
|
|
6362
|
+
var sum = 0;
|
|
6363
|
+
var max = null;
|
|
6364
|
+
var min = null;
|
|
6365
|
+
for (var index = 0; index < flatData.length; index += 1) {
|
|
6366
|
+
var cell = flatData[index];
|
|
6367
|
+
var value = Number(cell === null || cell === void 0 ? void 0 : cell.v);
|
|
6368
|
+
count += 1;
|
|
6369
|
+
if (Number.isNaN(value)) {
|
|
6370
|
+
continue;
|
|
6371
|
+
}
|
|
6372
|
+
if (max === null) {
|
|
6373
|
+
max = value;
|
|
6374
|
+
}
|
|
6375
|
+
if (min === null) {
|
|
6376
|
+
min = value;
|
|
6377
|
+
}
|
|
6378
|
+
max = Math.max(max, value);
|
|
6379
|
+
min = Math.min(min, value);
|
|
6380
|
+
sum += value;
|
|
6381
|
+
}
|
|
6382
|
+
return {
|
|
6383
|
+
sum: sum,
|
|
6384
|
+
count: count,
|
|
6385
|
+
average: count ? sum / count : null,
|
|
6386
|
+
max: max,
|
|
6387
|
+
min: min
|
|
6388
|
+
};
|
|
6389
|
+
}, [context.luckysheet_select_save]);
|
|
6390
|
+
var labelMap = {
|
|
6391
|
+
sum: "总和",
|
|
6392
|
+
count: "计数",
|
|
6393
|
+
average: "平均值",
|
|
6394
|
+
max: "最大值",
|
|
6395
|
+
min: "最小值"
|
|
6396
|
+
};
|
|
6397
|
+
if (!data) {
|
|
6398
|
+
return null;
|
|
6399
|
+
}
|
|
6400
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6401
|
+
style: {
|
|
6402
|
+
fontSize: 12
|
|
6403
|
+
}
|
|
6404
|
+
}, Object.keys(labelMap).map(function (key) {
|
|
6405
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
6406
|
+
style: {
|
|
6407
|
+
marginRight: 10
|
|
6408
|
+
}
|
|
6409
|
+
}, labelMap[key], ": ", numberThousands(data[key], ",", 2));
|
|
6410
|
+
}));
|
|
6411
|
+
};
|
|
6412
|
+
|
|
6327
6413
|
var FxEditor = function FxEditor() {
|
|
6328
6414
|
var _context$luckysheet_s;
|
|
6329
6415
|
var _useContext = useContext(WorkbookContext),
|
|
@@ -6487,7 +6573,7 @@ var FxEditor = function FxEditor() {
|
|
|
6487
6573
|
},
|
|
6488
6574
|
tabIndex: 0,
|
|
6489
6575
|
allowEdit: allowEdit
|
|
6490
|
-
}), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormulaSearch, {
|
|
6576
|
+
}), /*#__PURE__*/React.createElement(CalcInfo, null), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormulaSearch, {
|
|
6491
6577
|
style: {
|
|
6492
6578
|
top: inputContainerRef.current.clientHeight
|
|
6493
6579
|
}
|
package/dist/index.js
CHANGED
|
@@ -6334,6 +6334,92 @@ var LocationBox = function LocationBox() {
|
|
|
6334
6334
|
}, rangeText));
|
|
6335
6335
|
};
|
|
6336
6336
|
|
|
6337
|
+
var intThousands = function intThousands(number) {
|
|
6338
|
+
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ",";
|
|
6339
|
+
return String(number).replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
6340
|
+
};
|
|
6341
|
+
var numberThousands = function numberThousands(num, groupSeparator, precision) {
|
|
6342
|
+
var number = Number(num).toFixed(precision);
|
|
6343
|
+
var _String$split = String(number).split("."),
|
|
6344
|
+
_String$split2 = _slicedToArray(_String$split, 2),
|
|
6345
|
+
init = _String$split2[0],
|
|
6346
|
+
decimal = _String$split2[1];
|
|
6347
|
+
if (precision) {
|
|
6348
|
+
return "".concat(intThousands(init, groupSeparator), ".").concat(decimal);
|
|
6349
|
+
}
|
|
6350
|
+
return intThousands(init, groupSeparator);
|
|
6351
|
+
};
|
|
6352
|
+
var CalcInfo = function CalcInfo() {
|
|
6353
|
+
var _useContext = React.useContext(WorkbookContext),
|
|
6354
|
+
context = _useContext.context;
|
|
6355
|
+
var data = React.useMemo(function () {
|
|
6356
|
+
var _context$luckysheet_s;
|
|
6357
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
6358
|
+
if (!firstSelection) {
|
|
6359
|
+
return null;
|
|
6360
|
+
}
|
|
6361
|
+
var columns = firstSelection.column;
|
|
6362
|
+
var rows = firstSelection.row;
|
|
6363
|
+
if ((columns === null || columns === void 0 ? void 0 : columns.length) !== 2 || (rows === null || rows === void 0 ? void 0 : rows.length) !== 2) {
|
|
6364
|
+
return null;
|
|
6365
|
+
}
|
|
6366
|
+
if (columns[0] === columns[1] && rows[0] === rows[1]) {
|
|
6367
|
+
return null;
|
|
6368
|
+
}
|
|
6369
|
+
var selectData = core.getDataBySelectionNoCopy(context, firstSelection);
|
|
6370
|
+
var flatData = selectData.flat();
|
|
6371
|
+
var count = 0;
|
|
6372
|
+
var sum = 0;
|
|
6373
|
+
var max = null;
|
|
6374
|
+
var min = null;
|
|
6375
|
+
for (var index = 0; index < flatData.length; index += 1) {
|
|
6376
|
+
var cell = flatData[index];
|
|
6377
|
+
var value = Number(cell === null || cell === void 0 ? void 0 : cell.v);
|
|
6378
|
+
count += 1;
|
|
6379
|
+
if (Number.isNaN(value)) {
|
|
6380
|
+
continue;
|
|
6381
|
+
}
|
|
6382
|
+
if (max === null) {
|
|
6383
|
+
max = value;
|
|
6384
|
+
}
|
|
6385
|
+
if (min === null) {
|
|
6386
|
+
min = value;
|
|
6387
|
+
}
|
|
6388
|
+
max = Math.max(max, value);
|
|
6389
|
+
min = Math.min(min, value);
|
|
6390
|
+
sum += value;
|
|
6391
|
+
}
|
|
6392
|
+
return {
|
|
6393
|
+
sum: sum,
|
|
6394
|
+
count: count,
|
|
6395
|
+
average: count ? sum / count : null,
|
|
6396
|
+
max: max,
|
|
6397
|
+
min: min
|
|
6398
|
+
};
|
|
6399
|
+
}, [context.luckysheet_select_save]);
|
|
6400
|
+
var labelMap = {
|
|
6401
|
+
sum: "总和",
|
|
6402
|
+
count: "计数",
|
|
6403
|
+
average: "平均值",
|
|
6404
|
+
max: "最大值",
|
|
6405
|
+
min: "最小值"
|
|
6406
|
+
};
|
|
6407
|
+
if (!data) {
|
|
6408
|
+
return null;
|
|
6409
|
+
}
|
|
6410
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6411
|
+
style: {
|
|
6412
|
+
fontSize: 12
|
|
6413
|
+
}
|
|
6414
|
+
}, Object.keys(labelMap).map(function (key) {
|
|
6415
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
6416
|
+
style: {
|
|
6417
|
+
marginRight: 10
|
|
6418
|
+
}
|
|
6419
|
+
}, labelMap[key], ": ", numberThousands(data[key], ",", 2));
|
|
6420
|
+
}));
|
|
6421
|
+
};
|
|
6422
|
+
|
|
6337
6423
|
var FxEditor = function FxEditor() {
|
|
6338
6424
|
var _context$luckysheet_s;
|
|
6339
6425
|
var _useContext = React.useContext(WorkbookContext),
|
|
@@ -6497,7 +6583,7 @@ var FxEditor = function FxEditor() {
|
|
|
6497
6583
|
},
|
|
6498
6584
|
tabIndex: 0,
|
|
6499
6585
|
allowEdit: allowEdit
|
|
6500
|
-
}), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
6586
|
+
}), /*#__PURE__*/React__default['default'].createElement(CalcInfo, null), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
6501
6587
|
style: {
|
|
6502
6588
|
top: inputContainerRef.current.clientHeight
|
|
6503
6589
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -85137,6 +85137,30 @@
|
|
|
85137
85137
|
function luckysheetUpdateCell(ctx, row_index, col_index) {
|
|
85138
85138
|
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
85139
85139
|
}
|
|
85140
|
+
function getDataBySelectionNoCopy(ctx, range) {
|
|
85141
|
+
if (!range || !range.row || range.row.length === 0) return [];
|
|
85142
|
+
var data = [];
|
|
85143
|
+
var flowData = getFlowdata(ctx);
|
|
85144
|
+
if (!flowData) return [];
|
|
85145
|
+
for (var r = range.row[0]; r <= range.row[1]; r += 1) {
|
|
85146
|
+
var row = [];
|
|
85147
|
+
if (ctx.config.rowhidden != null && ctx.config.rowhidden[r] != null) {
|
|
85148
|
+
continue;
|
|
85149
|
+
}
|
|
85150
|
+
for (var c = range.column[0]; c <= range.column[1]; c += 1) {
|
|
85151
|
+
var value = null;
|
|
85152
|
+
if (ctx.config.colhidden != null && ctx.config.colhidden[c] != null) {
|
|
85153
|
+
continue;
|
|
85154
|
+
}
|
|
85155
|
+
if (flowData[r] != null && flowData[r][c] != null) {
|
|
85156
|
+
value = flowData[r][c];
|
|
85157
|
+
}
|
|
85158
|
+
row.push(value);
|
|
85159
|
+
}
|
|
85160
|
+
data.push(row);
|
|
85161
|
+
}
|
|
85162
|
+
return data;
|
|
85163
|
+
}
|
|
85140
85164
|
|
|
85141
85165
|
var clipboard = /*#__PURE__*/function () {
|
|
85142
85166
|
function clipboard() {
|
|
@@ -108542,6 +108566,92 @@
|
|
|
108542
108566
|
}, rangeText));
|
|
108543
108567
|
};
|
|
108544
108568
|
|
|
108569
|
+
var intThousands$1 = function intThousands(number) {
|
|
108570
|
+
var groupSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ",";
|
|
108571
|
+
return String(number).replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
108572
|
+
};
|
|
108573
|
+
var numberThousands$1 = function numberThousands(num, groupSeparator, precision) {
|
|
108574
|
+
var number = Number(num).toFixed(precision);
|
|
108575
|
+
var _String$split = String(number).split("."),
|
|
108576
|
+
_String$split2 = _slicedToArray(_String$split, 2),
|
|
108577
|
+
init = _String$split2[0],
|
|
108578
|
+
decimal = _String$split2[1];
|
|
108579
|
+
if (precision) {
|
|
108580
|
+
return "".concat(intThousands$1(init, groupSeparator), ".").concat(decimal);
|
|
108581
|
+
}
|
|
108582
|
+
return intThousands$1(init, groupSeparator);
|
|
108583
|
+
};
|
|
108584
|
+
var CalcInfo = function CalcInfo() {
|
|
108585
|
+
var _useContext = React.useContext(WorkbookContext),
|
|
108586
|
+
context = _useContext.context;
|
|
108587
|
+
var data = React.useMemo(function () {
|
|
108588
|
+
var _context$luckysheet_s;
|
|
108589
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
108590
|
+
if (!firstSelection) {
|
|
108591
|
+
return null;
|
|
108592
|
+
}
|
|
108593
|
+
var columns = firstSelection.column;
|
|
108594
|
+
var rows = firstSelection.row;
|
|
108595
|
+
if ((columns === null || columns === void 0 ? void 0 : columns.length) !== 2 || (rows === null || rows === void 0 ? void 0 : rows.length) !== 2) {
|
|
108596
|
+
return null;
|
|
108597
|
+
}
|
|
108598
|
+
if (columns[0] === columns[1] && rows[0] === rows[1]) {
|
|
108599
|
+
return null;
|
|
108600
|
+
}
|
|
108601
|
+
var selectData = getDataBySelectionNoCopy(context, firstSelection);
|
|
108602
|
+
var flatData = selectData.flat();
|
|
108603
|
+
var count = 0;
|
|
108604
|
+
var sum = 0;
|
|
108605
|
+
var max = null;
|
|
108606
|
+
var min = null;
|
|
108607
|
+
for (var index = 0; index < flatData.length; index += 1) {
|
|
108608
|
+
var cell = flatData[index];
|
|
108609
|
+
var value = Number(cell === null || cell === void 0 ? void 0 : cell.v);
|
|
108610
|
+
count += 1;
|
|
108611
|
+
if (Number.isNaN(value)) {
|
|
108612
|
+
continue;
|
|
108613
|
+
}
|
|
108614
|
+
if (max === null) {
|
|
108615
|
+
max = value;
|
|
108616
|
+
}
|
|
108617
|
+
if (min === null) {
|
|
108618
|
+
min = value;
|
|
108619
|
+
}
|
|
108620
|
+
max = Math.max(max, value);
|
|
108621
|
+
min = Math.min(min, value);
|
|
108622
|
+
sum += value;
|
|
108623
|
+
}
|
|
108624
|
+
return {
|
|
108625
|
+
sum: sum,
|
|
108626
|
+
count: count,
|
|
108627
|
+
average: count ? sum / count : null,
|
|
108628
|
+
max: max,
|
|
108629
|
+
min: min
|
|
108630
|
+
};
|
|
108631
|
+
}, [context.luckysheet_select_save]);
|
|
108632
|
+
var labelMap = {
|
|
108633
|
+
sum: "总和",
|
|
108634
|
+
count: "计数",
|
|
108635
|
+
average: "平均值",
|
|
108636
|
+
max: "最大值",
|
|
108637
|
+
min: "最小值"
|
|
108638
|
+
};
|
|
108639
|
+
if (!data) {
|
|
108640
|
+
return null;
|
|
108641
|
+
}
|
|
108642
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
108643
|
+
style: {
|
|
108644
|
+
fontSize: 12
|
|
108645
|
+
}
|
|
108646
|
+
}, Object.keys(labelMap).map(function (key) {
|
|
108647
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
108648
|
+
style: {
|
|
108649
|
+
marginRight: 10
|
|
108650
|
+
}
|
|
108651
|
+
}, labelMap[key], ": ", numberThousands$1(data[key], ",", 2));
|
|
108652
|
+
}));
|
|
108653
|
+
};
|
|
108654
|
+
|
|
108545
108655
|
var FxEditor = function FxEditor() {
|
|
108546
108656
|
var _context$luckysheet_s;
|
|
108547
108657
|
var _useContext = React.useContext(WorkbookContext),
|
|
@@ -108705,7 +108815,7 @@
|
|
|
108705
108815
|
},
|
|
108706
108816
|
tabIndex: 0,
|
|
108707
108817
|
allowEdit: allowEdit
|
|
108708
|
-
}), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
108818
|
+
}), /*#__PURE__*/React__default['default'].createElement(CalcInfo, null), settings === null || settings === void 0 ? void 0 : settings.fxContainer, focused && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
108709
108819
|
style: {
|
|
108710
108820
|
top: inputContainerRef.current.clientHeight
|
|
108711
108821
|
}
|