@fileverse-dev/fortune-react 1.0.2-mod-25 → 1.0.2-mod-25-patch-1
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 +51 -205
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -2368,72 +2368,6 @@ input[type="number"].condition-rules-project-input {
|
|
|
2368
2368
|
cursor: pointer;
|
|
2369
2369
|
}
|
|
2370
2370
|
|
|
2371
|
-
/*函数公式查找样式*/
|
|
2372
|
-
#luckysheet-search-formula {
|
|
2373
|
-
font-size: 12px;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
#luckysheet-search-formula .inpbox {
|
|
2377
|
-
margin-bottom: 5px;
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
#luckysheet-search-formula .inpbox div {
|
|
2381
|
-
display: block;
|
|
2382
|
-
margin-bottom: 5px;
|
|
2383
|
-
}
|
|
2384
|
-
|
|
2385
|
-
#luckysheet-search-formula .inpbox input {
|
|
2386
|
-
width: 100%;
|
|
2387
|
-
height: 24px;
|
|
2388
|
-
line-height: 24px;
|
|
2389
|
-
border: 1px solid #d4d4d4;
|
|
2390
|
-
padding: 0 10px;
|
|
2391
|
-
box-sizing: border-box;
|
|
2392
|
-
font-size: 12px;
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
#luckysheet-search-formula .selbox {
|
|
2396
|
-
margin-bottom: 5px;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
#luckysheet-search-formula .selbox select {
|
|
2400
|
-
width: 50%;
|
|
2401
|
-
height: 24px;
|
|
2402
|
-
line-height: 24px;
|
|
2403
|
-
border: 1px solid #d4d4d4;
|
|
2404
|
-
box-sizing: border-box;
|
|
2405
|
-
font-size: 12px;
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
#luckysheet-search-formula .listbox label {
|
|
2409
|
-
display: block;
|
|
2410
|
-
margin-bottom: 5px;
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
#formulaTypeList {
|
|
2414
|
-
width: 300px;
|
|
2415
|
-
height: 170px;
|
|
2416
|
-
border: 1px solid #d4d4d4;
|
|
2417
|
-
overflow-y: scroll;
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
.formulaList {
|
|
2421
|
-
width: 300px;
|
|
2422
|
-
height: 170px;
|
|
2423
|
-
border: 1px solid #d4d4d4;
|
|
2424
|
-
overflow-y: scroll;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
.listBox {
|
|
2428
|
-
padding: 5px;
|
|
2429
|
-
border-bottom: 1px solid #d4d4d4;
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
.listBox.on {
|
|
2433
|
-
background-color: #8c89fe;
|
|
2434
|
-
color: #fff;
|
|
2435
|
-
}
|
|
2436
|
-
|
|
2437
2371
|
#fortune-split-column {
|
|
2438
2372
|
/* position: absolute;
|
|
2439
2373
|
padding: 30px 42px;
|
package/dist/index.esm.css
CHANGED
|
@@ -2368,72 +2368,6 @@ input[type="number"].condition-rules-project-input {
|
|
|
2368
2368
|
cursor: pointer;
|
|
2369
2369
|
}
|
|
2370
2370
|
|
|
2371
|
-
/*函数公式查找样式*/
|
|
2372
|
-
#luckysheet-search-formula {
|
|
2373
|
-
font-size: 12px;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
#luckysheet-search-formula .inpbox {
|
|
2377
|
-
margin-bottom: 5px;
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
#luckysheet-search-formula .inpbox div {
|
|
2381
|
-
display: block;
|
|
2382
|
-
margin-bottom: 5px;
|
|
2383
|
-
}
|
|
2384
|
-
|
|
2385
|
-
#luckysheet-search-formula .inpbox input {
|
|
2386
|
-
width: 100%;
|
|
2387
|
-
height: 24px;
|
|
2388
|
-
line-height: 24px;
|
|
2389
|
-
border: 1px solid #d4d4d4;
|
|
2390
|
-
padding: 0 10px;
|
|
2391
|
-
box-sizing: border-box;
|
|
2392
|
-
font-size: 12px;
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
#luckysheet-search-formula .selbox {
|
|
2396
|
-
margin-bottom: 5px;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
#luckysheet-search-formula .selbox select {
|
|
2400
|
-
width: 50%;
|
|
2401
|
-
height: 24px;
|
|
2402
|
-
line-height: 24px;
|
|
2403
|
-
border: 1px solid #d4d4d4;
|
|
2404
|
-
box-sizing: border-box;
|
|
2405
|
-
font-size: 12px;
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
#luckysheet-search-formula .listbox label {
|
|
2409
|
-
display: block;
|
|
2410
|
-
margin-bottom: 5px;
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
#formulaTypeList {
|
|
2414
|
-
width: 300px;
|
|
2415
|
-
height: 170px;
|
|
2416
|
-
border: 1px solid #d4d4d4;
|
|
2417
|
-
overflow-y: scroll;
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
.formulaList {
|
|
2421
|
-
width: 300px;
|
|
2422
|
-
height: 170px;
|
|
2423
|
-
border: 1px solid #d4d4d4;
|
|
2424
|
-
overflow-y: scroll;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
.listBox {
|
|
2428
|
-
padding: 5px;
|
|
2429
|
-
border-bottom: 1px solid #d4d4d4;
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
.listBox.on {
|
|
2433
|
-
background-color: #8c89fe;
|
|
2434
|
-
color: #fff;
|
|
2435
|
-
}
|
|
2436
|
-
|
|
2437
2371
|
#fortune-split-column {
|
|
2438
2372
|
/* position: absolute;
|
|
2439
2373
|
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';
|
|
@@ -4304,205 +4304,6 @@ var Option = function Option(_ref2) {
|
|
|
4304
4304
|
}, children));
|
|
4305
4305
|
};
|
|
4306
4306
|
|
|
4307
|
-
var FormulaSearch$1 = function FormulaSearch(_ref) {
|
|
4308
|
-
var _onCancel = _ref.onCancel;
|
|
4309
|
-
var _useContext = useContext(WorkbookContext),
|
|
4310
|
-
context = _useContext.context,
|
|
4311
|
-
setContext = _useContext.setContext,
|
|
4312
|
-
_useContext$refs = _useContext.refs,
|
|
4313
|
-
cellInput = _useContext$refs.cellInput,
|
|
4314
|
-
globalCache = _useContext$refs.globalCache;
|
|
4315
|
-
var _useState = useState(20),
|
|
4316
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
4317
|
-
selectedType = _useState2[0],
|
|
4318
|
-
setSelectedType = _useState2[1];
|
|
4319
|
-
var _useState3 = useState(0),
|
|
4320
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
4321
|
-
selectedFuncIndex = _useState4[0],
|
|
4322
|
-
setSelectedFuncIndex = _useState4[1];
|
|
4323
|
-
var _useState5 = useState(""),
|
|
4324
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
4325
|
-
searchText = _useState6[0],
|
|
4326
|
-
setSearchText = _useState6[1];
|
|
4327
|
-
var _locale = locale(context),
|
|
4328
|
-
formulaMore = _locale.formulaMore,
|
|
4329
|
-
functionlist = _locale.functionlist,
|
|
4330
|
-
button = _locale.button;
|
|
4331
|
-
var typeList = useMemo(function () {
|
|
4332
|
-
return [{
|
|
4333
|
-
t: 20,
|
|
4334
|
-
n: formulaMore.Crypto
|
|
4335
|
-
}, {
|
|
4336
|
-
t: 0,
|
|
4337
|
-
n: formulaMore.Math
|
|
4338
|
-
}, {
|
|
4339
|
-
t: 1,
|
|
4340
|
-
n: formulaMore.Statistical
|
|
4341
|
-
}, {
|
|
4342
|
-
t: 2,
|
|
4343
|
-
n: formulaMore.Lookup
|
|
4344
|
-
}, {
|
|
4345
|
-
t: 3,
|
|
4346
|
-
n: formulaMore.luckysheet
|
|
4347
|
-
}, {
|
|
4348
|
-
t: 4,
|
|
4349
|
-
n: formulaMore.dataMining
|
|
4350
|
-
}, {
|
|
4351
|
-
t: 5,
|
|
4352
|
-
n: formulaMore.Database
|
|
4353
|
-
}, {
|
|
4354
|
-
t: 6,
|
|
4355
|
-
n: formulaMore.Date
|
|
4356
|
-
}, {
|
|
4357
|
-
t: 7,
|
|
4358
|
-
n: formulaMore.Filter
|
|
4359
|
-
}, {
|
|
4360
|
-
t: 8,
|
|
4361
|
-
n: formulaMore.Financial
|
|
4362
|
-
}, {
|
|
4363
|
-
t: 9,
|
|
4364
|
-
n: formulaMore.Engineering
|
|
4365
|
-
}, {
|
|
4366
|
-
t: 10,
|
|
4367
|
-
n: formulaMore.Logical
|
|
4368
|
-
}, {
|
|
4369
|
-
t: 11,
|
|
4370
|
-
n: formulaMore.Operator
|
|
4371
|
-
}, {
|
|
4372
|
-
t: 12,
|
|
4373
|
-
n: formulaMore.Text
|
|
4374
|
-
}, {
|
|
4375
|
-
t: 13,
|
|
4376
|
-
n: formulaMore.Parser
|
|
4377
|
-
}, {
|
|
4378
|
-
t: 14,
|
|
4379
|
-
n: formulaMore.Array
|
|
4380
|
-
}, {
|
|
4381
|
-
t: -1,
|
|
4382
|
-
n: formulaMore.other
|
|
4383
|
-
}];
|
|
4384
|
-
}, [formulaMore]);
|
|
4385
|
-
var filteredFunctionList = useMemo(function () {
|
|
4386
|
-
if (searchText) {
|
|
4387
|
-
var list = [];
|
|
4388
|
-
var text = _.cloneDeep(searchText.toUpperCase());
|
|
4389
|
-
for (var i = 0; i < functionlist.length; i += 1) {
|
|
4390
|
-
if (/^[a-zA-Z]+$/.test(text)) {
|
|
4391
|
-
if (functionlist[i].n.indexOf(text) !== -1) {
|
|
4392
|
-
list.push(functionlist[i]);
|
|
4393
|
-
}
|
|
4394
|
-
} else if (functionlist[i].a.indexOf(text) !== -1) {
|
|
4395
|
-
list.push(functionlist[i]);
|
|
4396
|
-
}
|
|
4397
|
-
}
|
|
4398
|
-
return list;
|
|
4399
|
-
}
|
|
4400
|
-
return _.filter(functionlist, function (v) {
|
|
4401
|
-
return v.t === selectedType;
|
|
4402
|
-
});
|
|
4403
|
-
}, [functionlist, selectedType, searchText]);
|
|
4404
|
-
var onConfirm = useCallback(function () {
|
|
4405
|
-
var _context$luckysheet_s;
|
|
4406
|
-
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];
|
|
4407
|
-
var row_index = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
4408
|
-
var col_index = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
4409
|
-
if (!last) {
|
|
4410
|
-
row_index = 0;
|
|
4411
|
-
col_index = 0;
|
|
4412
|
-
} else {
|
|
4413
|
-
if (row_index == null) {
|
|
4414
|
-
var _last$row = _slicedToArray(last.row, 1);
|
|
4415
|
-
row_index = _last$row[0];
|
|
4416
|
-
}
|
|
4417
|
-
if (col_index == null) {
|
|
4418
|
-
var _last$column = _slicedToArray(last.column, 1);
|
|
4419
|
-
col_index = _last$column[0];
|
|
4420
|
-
}
|
|
4421
|
-
}
|
|
4422
|
-
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>");
|
|
4423
|
-
setContext(function (ctx) {
|
|
4424
|
-
if (cellInput.current != null) {
|
|
4425
|
-
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
4426
|
-
globalCache.doNotUpdateCell = true;
|
|
4427
|
-
cellInput.current.innerHTML = formulaTxt;
|
|
4428
|
-
var spans = cellInput.current.childNodes;
|
|
4429
|
-
if (!_.isEmpty(spans)) {
|
|
4430
|
-
setCaretPosition(ctx, spans[spans.length - 1], 0, 1);
|
|
4431
|
-
}
|
|
4432
|
-
ctx.functionHint = filteredFunctionList[selectedFuncIndex].n.toUpperCase();
|
|
4433
|
-
ctx.functionCandidates = [];
|
|
4434
|
-
if (_.isEmpty(ctx.formulaCache.functionlistMap)) {
|
|
4435
|
-
for (var i = 0; i < functionlist.length; i += 1) {
|
|
4436
|
-
ctx.formulaCache.functionlistMap[functionlist[i].n] = functionlist[i];
|
|
4437
|
-
}
|
|
4438
|
-
}
|
|
4439
|
-
_onCancel();
|
|
4440
|
-
}
|
|
4441
|
-
});
|
|
4442
|
-
}, [cellInput, context.luckysheet_select_save, filteredFunctionList, globalCache, selectedFuncIndex, setContext, _onCancel, functionlist]);
|
|
4443
|
-
var onCancel = useCallback(function () {
|
|
4444
|
-
setContext(function (ctx) {
|
|
4445
|
-
cancelNormalSelected(ctx);
|
|
4446
|
-
if (cellInput.current) {
|
|
4447
|
-
cellInput.current.innerHTML = "";
|
|
4448
|
-
}
|
|
4449
|
-
});
|
|
4450
|
-
_onCancel();
|
|
4451
|
-
}, [_onCancel, cellInput, setContext]);
|
|
4452
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
4453
|
-
id: "luckysheet-search-formula"
|
|
4454
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4455
|
-
className: "inpbox"
|
|
4456
|
-
}, /*#__PURE__*/React.createElement("div", null, formulaMore.findFunctionTitle, "\uFF1A"), /*#__PURE__*/React.createElement("input", {
|
|
4457
|
-
className: "formulaInputFocus",
|
|
4458
|
-
id: "searchFormulaListInput",
|
|
4459
|
-
placeholder: formulaMore.tipInputFunctionName,
|
|
4460
|
-
spellCheck: "false",
|
|
4461
|
-
onChange: function onChange(e) {
|
|
4462
|
-
return setSearchText(e.target.value);
|
|
4463
|
-
}
|
|
4464
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
4465
|
-
className: "selbox"
|
|
4466
|
-
}, /*#__PURE__*/React.createElement("span", null, formulaMore.selectCategory, "\uFF1A"), /*#__PURE__*/React.createElement("select", {
|
|
4467
|
-
id: "formulaTypeSelect",
|
|
4468
|
-
onChange: function onChange(e) {
|
|
4469
|
-
setSelectedType(parseInt(e.target.value, 10));
|
|
4470
|
-
setSelectedFuncIndex(0);
|
|
4471
|
-
}
|
|
4472
|
-
}, typeList.map(function (v) {
|
|
4473
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
4474
|
-
key: v.t,
|
|
4475
|
-
value: v.t
|
|
4476
|
-
}, v.n);
|
|
4477
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
4478
|
-
className: "listbox",
|
|
4479
|
-
style: {
|
|
4480
|
-
height: 200
|
|
4481
|
-
}
|
|
4482
|
-
}, /*#__PURE__*/React.createElement("div", null, formulaMore.selectFunctionTitle, "\uFF1A"), /*#__PURE__*/React.createElement("div", {
|
|
4483
|
-
className: "formulaList"
|
|
4484
|
-
}, filteredFunctionList.map(function (v, index) {
|
|
4485
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
4486
|
-
className: "listBox".concat(index === selectedFuncIndex ? " on" : ""),
|
|
4487
|
-
key: v.n,
|
|
4488
|
-
onClick: function onClick() {
|
|
4489
|
-
return setSelectedFuncIndex(index);
|
|
4490
|
-
},
|
|
4491
|
-
tabIndex: 0
|
|
4492
|
-
}, /*#__PURE__*/React.createElement("div", null, v.n), /*#__PURE__*/React.createElement("div", null, v.a));
|
|
4493
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
4494
|
-
className: "fortune-dialog-box-button-container"
|
|
4495
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4496
|
-
className: "fortune-message-box-button button-primary",
|
|
4497
|
-
onClick: onConfirm,
|
|
4498
|
-
tabIndex: 0
|
|
4499
|
-
}, button.confirm), /*#__PURE__*/React.createElement("div", {
|
|
4500
|
-
className: "fortune-message-box-button button-default",
|
|
4501
|
-
onClick: onCancel,
|
|
4502
|
-
tabIndex: 0
|
|
4503
|
-
}, button.cancel)));
|
|
4504
|
-
};
|
|
4505
|
-
|
|
4506
4307
|
var SplitColumn = function SplitColumn() {
|
|
4507
4308
|
var _useContext = useContext(WorkbookContext),
|
|
4508
4309
|
context = _useContext.context,
|
|
@@ -6306,9 +6107,10 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6306
6107
|
}), /*#__PURE__*/React.createElement(MenuDivider, null), /*#__PURE__*/React.createElement(Option, {
|
|
6307
6108
|
key: "formula",
|
|
6308
6109
|
onClick: function onClick() {
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6110
|
+
var button = document.getElementById("function-button");
|
|
6111
|
+
if (button) {
|
|
6112
|
+
button.click();
|
|
6113
|
+
}
|
|
6312
6114
|
setOpen(false);
|
|
6313
6115
|
}
|
|
6314
6116
|
}, "".concat(formula.find, "...")));
|
|
@@ -10137,7 +9939,7 @@ var MoreItemsContaier = function MoreItemsContaier(_ref) {
|
|
|
10137
9939
|
}, children);
|
|
10138
9940
|
};
|
|
10139
9941
|
|
|
10140
|
-
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY) {
|
|
9942
|
+
function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cellInput, scrollbarX, scrollbarY, globalCache) {
|
|
10141
9943
|
return {
|
|
10142
9944
|
applyOp: function applyOp(ops) {
|
|
10143
9945
|
setContext(function (ctx_) {
|
|
@@ -10438,6 +10240,50 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10438
10240
|
},
|
|
10439
10241
|
celldataToData: function celldataToData(celldata, rowCount, colCount) {
|
|
10440
10242
|
return api.celldataToData(celldata, rowCount, colCount);
|
|
10243
|
+
},
|
|
10244
|
+
insertFunction: function insertFunction(selectedFuncIndex, filteredFunctionList, callback) {
|
|
10245
|
+
var _context$luckysheet_s2;
|
|
10246
|
+
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];
|
|
10247
|
+
var row_index = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
10248
|
+
var col_index = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
10249
|
+
if (!last) {
|
|
10250
|
+
row_index = 0;
|
|
10251
|
+
col_index = 0;
|
|
10252
|
+
} else {
|
|
10253
|
+
if (row_index == null) {
|
|
10254
|
+
var _last$row2 = _slicedToArray(last.row, 1);
|
|
10255
|
+
row_index = _last$row2[0];
|
|
10256
|
+
}
|
|
10257
|
+
if (col_index == null) {
|
|
10258
|
+
var _last$column2 = _slicedToArray(last.column, 1);
|
|
10259
|
+
col_index = _last$column2[0];
|
|
10260
|
+
}
|
|
10261
|
+
}
|
|
10262
|
+
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>");
|
|
10263
|
+
var _locale2 = locale(context),
|
|
10264
|
+
functionlist = _locale2.functionlist;
|
|
10265
|
+
setContext(function (ctx) {
|
|
10266
|
+
if (cellInput != null && globalCache != null) {
|
|
10267
|
+
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
10268
|
+
globalCache.doNotUpdateCell = true;
|
|
10269
|
+
cellInput.innerHTML = formulaTxt;
|
|
10270
|
+
var spans = cellInput.childNodes;
|
|
10271
|
+
if (!_.isEmpty(spans)) {
|
|
10272
|
+
setCaretPosition(ctx, spans[spans.length - 1], 0, 1);
|
|
10273
|
+
}
|
|
10274
|
+
ctx.functionHint = filteredFunctionList[selectedFuncIndex].n.toUpperCase();
|
|
10275
|
+
ctx.functionCandidates = [];
|
|
10276
|
+
if (_.isEmpty(ctx.formulaCache.functionlistMap)) {
|
|
10277
|
+
for (var i = 0; i < functionlist.length; i += 1) {
|
|
10278
|
+
ctx.formulaCache.functionlistMap[functionlist[i].n] = functionlist[i];
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
10282
|
+
}
|
|
10283
|
+
});
|
|
10284
|
+
},
|
|
10285
|
+
getLocaleContext: function getLocaleContext() {
|
|
10286
|
+
return locale(context);
|
|
10441
10287
|
}
|
|
10442
10288
|
};
|
|
10443
10289
|
}
|
|
@@ -11645,8 +11491,8 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11645
11491
|
};
|
|
11646
11492
|
}, [onPaste]);
|
|
11647
11493
|
useImperativeHandle(ref, function () {
|
|
11648
|
-
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current);
|
|
11649
|
-
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings]);
|
|
11494
|
+
return generateAPIs(context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, cellInput.current, scrollbarX.current, scrollbarY.current, globalCache.current);
|
|
11495
|
+
}, [context, setContextWithProduce, handleUndo, handleRedo, mergedSettings, globalCache]);
|
|
11650
11496
|
var i = getSheetIndex(context, context.currentSheetId);
|
|
11651
11497
|
if (i == null) {
|
|
11652
11498
|
return null;
|