@fileverse-dev/fortune-react 1.0.2-mod-27 → 1.0.2-mod-28
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/Workbook/api.d.ts +1050 -2
- package/dist/components/Workbook/index.d.ts +1048 -0
- package/dist/index.css +0 -66
- package/dist/index.esm.css +0 -66
- package/dist/index.esm.js +52 -206
- package/dist/index.js +51 -205
- package/dist/index.umd.css +0 -66
- package/dist/index.umd.js +4314 -2780
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -2463,72 +2463,6 @@ input[type="number"].condition-rules-project-input {
|
|
|
2463
2463
|
cursor: pointer;
|
|
2464
2464
|
}
|
|
2465
2465
|
|
|
2466
|
-
/*函数公式查找样式*/
|
|
2467
|
-
#luckysheet-search-formula {
|
|
2468
|
-
font-size: 12px;
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
#luckysheet-search-formula .inpbox {
|
|
2472
|
-
margin-bottom: 5px;
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
|
-
#luckysheet-search-formula .inpbox div {
|
|
2476
|
-
display: block;
|
|
2477
|
-
margin-bottom: 5px;
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
#luckysheet-search-formula .inpbox input {
|
|
2481
|
-
width: 100%;
|
|
2482
|
-
height: 24px;
|
|
2483
|
-
line-height: 24px;
|
|
2484
|
-
border: 1px solid #d4d4d4;
|
|
2485
|
-
padding: 0 10px;
|
|
2486
|
-
box-sizing: border-box;
|
|
2487
|
-
font-size: 12px;
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
#luckysheet-search-formula .selbox {
|
|
2491
|
-
margin-bottom: 5px;
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
#luckysheet-search-formula .selbox select {
|
|
2495
|
-
width: 50%;
|
|
2496
|
-
height: 24px;
|
|
2497
|
-
line-height: 24px;
|
|
2498
|
-
border: 1px solid #d4d4d4;
|
|
2499
|
-
box-sizing: border-box;
|
|
2500
|
-
font-size: 12px;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
#luckysheet-search-formula .listbox label {
|
|
2504
|
-
display: block;
|
|
2505
|
-
margin-bottom: 5px;
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
|
-
#formulaTypeList {
|
|
2509
|
-
width: 300px;
|
|
2510
|
-
height: 170px;
|
|
2511
|
-
border: 1px solid #d4d4d4;
|
|
2512
|
-
overflow-y: scroll;
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
.formulaList {
|
|
2516
|
-
width: 300px;
|
|
2517
|
-
height: 170px;
|
|
2518
|
-
border: 1px solid #d4d4d4;
|
|
2519
|
-
overflow-y: scroll;
|
|
2520
|
-
}
|
|
2521
|
-
|
|
2522
|
-
.listBox {
|
|
2523
|
-
padding: 5px;
|
|
2524
|
-
border-bottom: 1px solid #d4d4d4;
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
.listBox.on {
|
|
2528
|
-
background-color: #8c89fe;
|
|
2529
|
-
color: #fff;
|
|
2530
|
-
}
|
|
2531
|
-
|
|
2532
2466
|
#fortune-split-column {
|
|
2533
2467
|
/* position: absolute;
|
|
2534
2468
|
padding: 30px 42px;
|
package/dist/index.esm.css
CHANGED
|
@@ -2463,72 +2463,6 @@ input[type="number"].condition-rules-project-input {
|
|
|
2463
2463
|
cursor: pointer;
|
|
2464
2464
|
}
|
|
2465
2465
|
|
|
2466
|
-
/*函数公式查找样式*/
|
|
2467
|
-
#luckysheet-search-formula {
|
|
2468
|
-
font-size: 12px;
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
#luckysheet-search-formula .inpbox {
|
|
2472
|
-
margin-bottom: 5px;
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
|
-
#luckysheet-search-formula .inpbox div {
|
|
2476
|
-
display: block;
|
|
2477
|
-
margin-bottom: 5px;
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
#luckysheet-search-formula .inpbox input {
|
|
2481
|
-
width: 100%;
|
|
2482
|
-
height: 24px;
|
|
2483
|
-
line-height: 24px;
|
|
2484
|
-
border: 1px solid #d4d4d4;
|
|
2485
|
-
padding: 0 10px;
|
|
2486
|
-
box-sizing: border-box;
|
|
2487
|
-
font-size: 12px;
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
#luckysheet-search-formula .selbox {
|
|
2491
|
-
margin-bottom: 5px;
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
#luckysheet-search-formula .selbox select {
|
|
2495
|
-
width: 50%;
|
|
2496
|
-
height: 24px;
|
|
2497
|
-
line-height: 24px;
|
|
2498
|
-
border: 1px solid #d4d4d4;
|
|
2499
|
-
box-sizing: border-box;
|
|
2500
|
-
font-size: 12px;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
#luckysheet-search-formula .listbox label {
|
|
2504
|
-
display: block;
|
|
2505
|
-
margin-bottom: 5px;
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
|
-
#formulaTypeList {
|
|
2509
|
-
width: 300px;
|
|
2510
|
-
height: 170px;
|
|
2511
|
-
border: 1px solid #d4d4d4;
|
|
2512
|
-
overflow-y: scroll;
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
.formulaList {
|
|
2516
|
-
width: 300px;
|
|
2517
|
-
height: 170px;
|
|
2518
|
-
border: 1px solid #d4d4d4;
|
|
2519
|
-
overflow-y: scroll;
|
|
2520
|
-
}
|
|
2521
|
-
|
|
2522
|
-
.listBox {
|
|
2523
|
-
padding: 5px;
|
|
2524
|
-
border-bottom: 1px solid #d4d4d4;
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
.listBox.on {
|
|
2528
|
-
background-color: #8c89fe;
|
|
2529
|
-
color: #fff;
|
|
2530
|
-
}
|
|
2531
|
-
|
|
2532
2466
|
#fortune-split-column {
|
|
2533
2467
|
/* position: absolute;
|
|
2534
2468
|
padding: 30px 42px;
|
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, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel,
|
|
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, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, 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, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-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';
|
|
@@ -4453,205 +4453,6 @@ var Option = function Option(_ref2) {
|
|
|
4453
4453
|
}, children));
|
|
4454
4454
|
};
|
|
4455
4455
|
|
|
4456
|
-
var FormulaSearch$1 = function FormulaSearch(_ref) {
|
|
4457
|
-
var _onCancel = _ref.onCancel;
|
|
4458
|
-
var _useContext = useContext(WorkbookContext),
|
|
4459
|
-
context = _useContext.context,
|
|
4460
|
-
setContext = _useContext.setContext,
|
|
4461
|
-
_useContext$refs = _useContext.refs,
|
|
4462
|
-
cellInput = _useContext$refs.cellInput,
|
|
4463
|
-
globalCache = _useContext$refs.globalCache;
|
|
4464
|
-
var _useState = useState(20),
|
|
4465
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
4466
|
-
selectedType = _useState2[0],
|
|
4467
|
-
setSelectedType = _useState2[1];
|
|
4468
|
-
var _useState3 = useState(0),
|
|
4469
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
4470
|
-
selectedFuncIndex = _useState4[0],
|
|
4471
|
-
setSelectedFuncIndex = _useState4[1];
|
|
4472
|
-
var _useState5 = useState(""),
|
|
4473
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
4474
|
-
searchText = _useState6[0],
|
|
4475
|
-
setSearchText = _useState6[1];
|
|
4476
|
-
var _locale = locale(context),
|
|
4477
|
-
formulaMore = _locale.formulaMore,
|
|
4478
|
-
functionlist = _locale.functionlist,
|
|
4479
|
-
button = _locale.button;
|
|
4480
|
-
var typeList = useMemo(function () {
|
|
4481
|
-
return [{
|
|
4482
|
-
t: 20,
|
|
4483
|
-
n: formulaMore.Crypto
|
|
4484
|
-
}, {
|
|
4485
|
-
t: 0,
|
|
4486
|
-
n: formulaMore.Math
|
|
4487
|
-
}, {
|
|
4488
|
-
t: 1,
|
|
4489
|
-
n: formulaMore.Statistical
|
|
4490
|
-
}, {
|
|
4491
|
-
t: 2,
|
|
4492
|
-
n: formulaMore.Lookup
|
|
4493
|
-
}, {
|
|
4494
|
-
t: 3,
|
|
4495
|
-
n: formulaMore.luckysheet
|
|
4496
|
-
}, {
|
|
4497
|
-
t: 4,
|
|
4498
|
-
n: formulaMore.dataMining
|
|
4499
|
-
}, {
|
|
4500
|
-
t: 5,
|
|
4501
|
-
n: formulaMore.Database
|
|
4502
|
-
}, {
|
|
4503
|
-
t: 6,
|
|
4504
|
-
n: formulaMore.Date
|
|
4505
|
-
}, {
|
|
4506
|
-
t: 7,
|
|
4507
|
-
n: formulaMore.Filter
|
|
4508
|
-
}, {
|
|
4509
|
-
t: 8,
|
|
4510
|
-
n: formulaMore.Financial
|
|
4511
|
-
}, {
|
|
4512
|
-
t: 9,
|
|
4513
|
-
n: formulaMore.Engineering
|
|
4514
|
-
}, {
|
|
4515
|
-
t: 10,
|
|
4516
|
-
n: formulaMore.Logical
|
|
4517
|
-
}, {
|
|
4518
|
-
t: 11,
|
|
4519
|
-
n: formulaMore.Operator
|
|
4520
|
-
}, {
|
|
4521
|
-
t: 12,
|
|
4522
|
-
n: formulaMore.Text
|
|
4523
|
-
}, {
|
|
4524
|
-
t: 13,
|
|
4525
|
-
n: formulaMore.Parser
|
|
4526
|
-
}, {
|
|
4527
|
-
t: 14,
|
|
4528
|
-
n: formulaMore.Array
|
|
4529
|
-
}, {
|
|
4530
|
-
t: -1,
|
|
4531
|
-
n: formulaMore.other
|
|
4532
|
-
}];
|
|
4533
|
-
}, [formulaMore]);
|
|
4534
|
-
var filteredFunctionList = useMemo(function () {
|
|
4535
|
-
if (searchText) {
|
|
4536
|
-
var list = [];
|
|
4537
|
-
var text = _.cloneDeep(searchText.toUpperCase());
|
|
4538
|
-
for (var i = 0; i < functionlist.length; i += 1) {
|
|
4539
|
-
if (/^[a-zA-Z]+$/.test(text)) {
|
|
4540
|
-
if (functionlist[i].n.indexOf(text) !== -1) {
|
|
4541
|
-
list.push(functionlist[i]);
|
|
4542
|
-
}
|
|
4543
|
-
} else if (functionlist[i].a.indexOf(text) !== -1) {
|
|
4544
|
-
list.push(functionlist[i]);
|
|
4545
|
-
}
|
|
4546
|
-
}
|
|
4547
|
-
return list;
|
|
4548
|
-
}
|
|
4549
|
-
return _.filter(functionlist, function (v) {
|
|
4550
|
-
return v.t === selectedType;
|
|
4551
|
-
});
|
|
4552
|
-
}, [functionlist, selectedType, searchText]);
|
|
4553
|
-
var onConfirm = useCallback(function () {
|
|
4554
|
-
var _context$luckysheet_s;
|
|
4555
|
-
var last = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[context.luckysheet_select_save.length - 1];
|
|
4556
|
-
var row_index = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
4557
|
-
var col_index = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
4558
|
-
if (!last) {
|
|
4559
|
-
row_index = 0;
|
|
4560
|
-
col_index = 0;
|
|
4561
|
-
} else {
|
|
4562
|
-
if (row_index == null) {
|
|
4563
|
-
var _last$row = _slicedToArray(last.row, 1);
|
|
4564
|
-
row_index = _last$row[0];
|
|
4565
|
-
}
|
|
4566
|
-
if (col_index == null) {
|
|
4567
|
-
var _last$column = _slicedToArray(last.column, 1);
|
|
4568
|
-
col_index = _last$column[0];
|
|
4569
|
-
}
|
|
4570
|
-
}
|
|
4571
|
-
var formulaTxt = "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">=</span><span dir=\"auto\" class=\"luckysheet-formula-text-color\">".concat(filteredFunctionList[selectedFuncIndex].n.toUpperCase(), "</span><span dir=\"auto\" class=\"luckysheet-formula-text-color\">(</span>");
|
|
4572
|
-
setContext(function (ctx) {
|
|
4573
|
-
if (cellInput.current != null) {
|
|
4574
|
-
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
4575
|
-
globalCache.doNotUpdateCell = true;
|
|
4576
|
-
cellInput.current.innerHTML = formulaTxt;
|
|
4577
|
-
var spans = cellInput.current.childNodes;
|
|
4578
|
-
if (!_.isEmpty(spans)) {
|
|
4579
|
-
setCaretPosition(ctx, spans[spans.length - 1], 0, 1);
|
|
4580
|
-
}
|
|
4581
|
-
ctx.functionHint = filteredFunctionList[selectedFuncIndex].n.toUpperCase();
|
|
4582
|
-
ctx.functionCandidates = [];
|
|
4583
|
-
if (_.isEmpty(ctx.formulaCache.functionlistMap)) {
|
|
4584
|
-
for (var i = 0; i < functionlist.length; i += 1) {
|
|
4585
|
-
ctx.formulaCache.functionlistMap[functionlist[i].n] = functionlist[i];
|
|
4586
|
-
}
|
|
4587
|
-
}
|
|
4588
|
-
_onCancel();
|
|
4589
|
-
}
|
|
4590
|
-
});
|
|
4591
|
-
}, [cellInput, context.luckysheet_select_save, filteredFunctionList, globalCache, selectedFuncIndex, setContext, _onCancel, functionlist]);
|
|
4592
|
-
var onCancel = useCallback(function () {
|
|
4593
|
-
setContext(function (ctx) {
|
|
4594
|
-
cancelNormalSelected(ctx);
|
|
4595
|
-
if (cellInput.current) {
|
|
4596
|
-
cellInput.current.innerHTML = "";
|
|
4597
|
-
}
|
|
4598
|
-
});
|
|
4599
|
-
_onCancel();
|
|
4600
|
-
}, [_onCancel, cellInput, setContext]);
|
|
4601
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
4602
|
-
id: "luckysheet-search-formula"
|
|
4603
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4604
|
-
className: "inpbox"
|
|
4605
|
-
}, /*#__PURE__*/React.createElement("div", null, formulaMore.findFunctionTitle, "\uFF1A"), /*#__PURE__*/React.createElement("input", {
|
|
4606
|
-
className: "formulaInputFocus",
|
|
4607
|
-
id: "searchFormulaListInput",
|
|
4608
|
-
placeholder: formulaMore.tipInputFunctionName,
|
|
4609
|
-
spellCheck: "false",
|
|
4610
|
-
onChange: function onChange(e) {
|
|
4611
|
-
return setSearchText(e.target.value);
|
|
4612
|
-
}
|
|
4613
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
4614
|
-
className: "selbox"
|
|
4615
|
-
}, /*#__PURE__*/React.createElement("span", null, formulaMore.selectCategory, "\uFF1A"), /*#__PURE__*/React.createElement("select", {
|
|
4616
|
-
id: "formulaTypeSelect",
|
|
4617
|
-
onChange: function onChange(e) {
|
|
4618
|
-
setSelectedType(parseInt(e.target.value, 10));
|
|
4619
|
-
setSelectedFuncIndex(0);
|
|
4620
|
-
}
|
|
4621
|
-
}, typeList.map(function (v) {
|
|
4622
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
4623
|
-
key: v.t,
|
|
4624
|
-
value: v.t
|
|
4625
|
-
}, v.n);
|
|
4626
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
4627
|
-
className: "listbox",
|
|
4628
|
-
style: {
|
|
4629
|
-
height: 200
|
|
4630
|
-
}
|
|
4631
|
-
}, /*#__PURE__*/React.createElement("div", null, formulaMore.selectFunctionTitle, "\uFF1A"), /*#__PURE__*/React.createElement("div", {
|
|
4632
|
-
className: "formulaList"
|
|
4633
|
-
}, filteredFunctionList.map(function (v, index) {
|
|
4634
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
4635
|
-
className: "listBox".concat(index === selectedFuncIndex ? " on" : ""),
|
|
4636
|
-
key: v.n,
|
|
4637
|
-
onClick: function onClick() {
|
|
4638
|
-
return setSelectedFuncIndex(index);
|
|
4639
|
-
},
|
|
4640
|
-
tabIndex: 0
|
|
4641
|
-
}, /*#__PURE__*/React.createElement("div", null, v.n), /*#__PURE__*/React.createElement("div", null, v.a));
|
|
4642
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
4643
|
-
className: "fortune-dialog-box-button-container"
|
|
4644
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4645
|
-
className: "fortune-message-box-button button-primary",
|
|
4646
|
-
onClick: onConfirm,
|
|
4647
|
-
tabIndex: 0
|
|
4648
|
-
}, button.confirm), /*#__PURE__*/React.createElement("div", {
|
|
4649
|
-
className: "fortune-message-box-button button-default",
|
|
4650
|
-
onClick: onCancel,
|
|
4651
|
-
tabIndex: 0
|
|
4652
|
-
}, button.cancel)));
|
|
4653
|
-
};
|
|
4654
|
-
|
|
4655
4456
|
var SplitColumn = function SplitColumn() {
|
|
4656
4457
|
var _useContext = useContext(WorkbookContext),
|
|
4657
4458
|
context = _useContext.context,
|
|
@@ -6455,9 +6256,10 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6455
6256
|
}), /*#__PURE__*/React.createElement(MenuDivider, null), /*#__PURE__*/React.createElement(Option, {
|
|
6456
6257
|
key: "formula",
|
|
6457
6258
|
onClick: function onClick() {
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6259
|
+
var button = document.getElementById("function-button");
|
|
6260
|
+
if (button) {
|
|
6261
|
+
button.click();
|
|
6262
|
+
}
|
|
6461
6263
|
setOpen(false);
|
|
6462
6264
|
}
|
|
6463
6265
|
}, "".concat(formula.find, "...")));
|
|
@@ -10286,7 +10088,7 @@ var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
|
10286
10088
|
}, children);
|
|
10287
10089
|
};
|
|
10288
10090
|
|
|
10289
|
-
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY) {
|
|
10091
|
+
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY, globalCache) {
|
|
10290
10092
|
return {
|
|
10291
10093
|
applyOp: function applyOp(ops) {
|
|
10292
10094
|
setContext(function (ctx_) {
|
|
@@ -10587,6 +10389,50 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10587
10389
|
},
|
|
10588
10390
|
celldataToData: function celldataToData(celldata, rowCount, colCount) {
|
|
10589
10391
|
return api.celldataToData(celldata, rowCount, colCount);
|
|
10392
|
+
},
|
|
10393
|
+
insertFunction: function insertFunction(selectedFuncIndex, filteredFunctionList, callback) {
|
|
10394
|
+
var _context$luckysheet_s2;
|
|
10395
|
+
var last = (_context$luckysheet_s2 = context.luckysheet_select_save) === null || _context$luckysheet_s2 === void 0 ? void 0 : _context$luckysheet_s2[context.luckysheet_select_save.length - 1];
|
|
10396
|
+
var row_index = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
10397
|
+
var col_index = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
10398
|
+
if (!last) {
|
|
10399
|
+
row_index = 0;
|
|
10400
|
+
col_index = 0;
|
|
10401
|
+
} else {
|
|
10402
|
+
if (row_index == null) {
|
|
10403
|
+
var _last$row2 = _slicedToArray(last.row, 1);
|
|
10404
|
+
row_index = _last$row2[0];
|
|
10405
|
+
}
|
|
10406
|
+
if (col_index == null) {
|
|
10407
|
+
var _last$column2 = _slicedToArray(last.column, 1);
|
|
10408
|
+
col_index = _last$column2[0];
|
|
10409
|
+
}
|
|
10410
|
+
}
|
|
10411
|
+
var formulaTxt = "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">=</span><span dir=\"auto\" class=\"luckysheet-formula-text-color\">".concat(filteredFunctionList[selectedFuncIndex].n.toUpperCase(), "</span><span dir=\"auto\" class=\"luckysheet-formula-text-color\">(</span>");
|
|
10412
|
+
var _locale2 = locale(context),
|
|
10413
|
+
functionlist = _locale2.functionlist;
|
|
10414
|
+
setContext(function (ctx) {
|
|
10415
|
+
if (cellInput != null && globalCache != null) {
|
|
10416
|
+
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
10417
|
+
globalCache.doNotUpdateCell = true;
|
|
10418
|
+
cellInput.innerHTML = formulaTxt;
|
|
10419
|
+
var spans = cellInput.childNodes;
|
|
10420
|
+
if (!_.isEmpty(spans)) {
|
|
10421
|
+
setCaretPosition(ctx, spans[spans.length - 1], 0, 1);
|
|
10422
|
+
}
|
|
10423
|
+
ctx.functionHint = filteredFunctionList[selectedFuncIndex].n.toUpperCase();
|
|
10424
|
+
ctx.functionCandidates = [];
|
|
10425
|
+
if (_.isEmpty(ctx.formulaCache.functionlistMap)) {
|
|
10426
|
+
for (var i = 0; i < functionlist.length; i += 1) {
|
|
10427
|
+
ctx.formulaCache.functionlistMap[functionlist[i].n] = functionlist[i];
|
|
10428
|
+
}
|
|
10429
|
+
}
|
|
10430
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
10431
|
+
}
|
|
10432
|
+
});
|
|
10433
|
+
},
|
|
10434
|
+
getLocaleContext: function getLocaleContext() {
|
|
10435
|
+
return locale(context);
|
|
10590
10436
|
}
|
|
10591
10437
|
};
|
|
10592
10438
|
}
|
|
@@ -11794,8 +11640,8 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11794
11640
|
};
|
|
11795
11641
|
}, [onPaste]);
|
|
11796
11642
|
useImperativeHandle(ref, function () {
|
|
11797
|
-
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current);
|
|
11798
|
-
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings]);
|
|
11643
|
+
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current, globalCache.current);
|
|
11644
|
+
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, globalCache]);
|
|
11799
11645
|
var i = getSheetIndex(context, context.currentSheetId);
|
|
11800
11646
|
if (i == null) {
|
|
11801
11647
|
return null;
|